diff --git a/pkgs/by-name/od/odin/darwin-remove-impure-links.patch b/pkgs/by-name/od/odin/darwin-remove-impure-links.patch new file mode 100644 index 000000000000..eb7fa04c415a --- /dev/null +++ b/pkgs/by-name/od/odin/darwin-remove-impure-links.patch @@ -0,0 +1,23 @@ +diff --git a/src/linker.cpp b/src/linker.cpp +index ec165ef7d..91a28b8fc 100644 +--- a/src/linker.cpp ++++ b/src/linker.cpp +@@ -769,18 +769,6 @@ try_cross_linking:; + gbString platform_lib_str = gb_string_make(heap_allocator(), ""); + defer (gb_string_free(platform_lib_str)); + if (build_context.metrics.os == TargetOs_darwin) { +- platform_lib_str = gb_string_appendc(platform_lib_str, "-Wl,-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/usr/local/lib "); +- +- // Homebrew's default library path, checking if it exists to avoid linking warnings. +- if (gb_file_exists("/opt/homebrew/lib")) { +- platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/homebrew/lib "); +- } +- +- // MacPort's default library path, checking if it exists to avoid linking warnings. +- if (gb_file_exists("/opt/local/lib")) { +- platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/local/lib "); +- } +- + // Only specify this flag if the user has given a minimum version to target. + // This will cause warnings to show up for mismatched libraries. + if (build_context.minimum_os_version_string_given) { diff --git a/pkgs/by-name/od/odin/package.nix b/pkgs/by-name/od/odin/package.nix index 8b8ce9205098..c30f50c52bda 100644 --- a/pkgs/by-name/od/odin/package.nix +++ b/pkgs/by-name/od/odin/package.nix @@ -1,12 +1,9 @@ { fetchFromGitHub, lib, - libiconv, llvmPackages, - MacOSX-SDK, makeBinaryWrapper, nix-update-script, - Security, which, }: @@ -24,16 +21,9 @@ stdenv.mkDerivation { hash = "sha256-GXea4+OIFyAhTqmDh2q+ewTUqI92ikOsa2s83UH2r58="; }; - postPatch = - lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/linker.cpp \ - --replace-fail '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' ${MacOSX-SDK} - '' - + '' - substituteInPlace build_odin.sh \ - --replace-fail '-framework System' '-lSystem' - patchShebangs build_odin.sh - ''; + patches = [ + ./darwin-remove-impure-links.patch + ]; LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config"; @@ -46,11 +36,6 @@ stdenv.mkDerivation { which ]; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - Security - ]; - installPhase = '' runHook preInstall diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c53dce2692c3..e26433b4fc85 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13109,8 +13109,6 @@ with pkgs; }; odin = callPackage ../by-name/od/odin/package.nix { - inherit (pkgs.darwin.apple_sdk_11_0) MacOSX-SDK; - inherit (pkgs.darwin.apple_sdk_11_0.frameworks) Security; llvmPackages = llvmPackages_18; };