From d4ef6cf4b970ff74a47b0fc08287b59542f28735 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:43:56 -0400 Subject: [PATCH 01/10] python3Packages.pyscard: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- .../python-modules/pyscard/default.nix | 31 +++++-------------- pkgs/top-level/python-packages.nix | 4 +-- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/pyscard/default.nix b/pkgs/development/python-modules/pyscard/default.nix index 8186c89b7b27..859bd2d17b18 100644 --- a/pkgs/development/python-modules/pyscard/default.nix +++ b/pkgs/development/python-modules/pyscard/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitHub, - PCSC, pcsclite, pkg-config, pytestCheckHook, @@ -11,11 +10,6 @@ swig, }: -let - # Package does not support configuring the pcsc library. - withApplePCSC = stdenv.hostPlatform.isDarwin; -in - buildPythonPackage rec { pname = "pyscard"; version = "2.2.1"; @@ -30,9 +24,9 @@ buildPythonPackage rec { build-system = [ setuptools ]; - nativeBuildInputs = [ swig ] ++ lib.optionals (!withApplePCSC) [ pkg-config ]; + nativeBuildInputs = [ swig ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ]; - buildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ]; + buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ pcsclite ]; nativeCheckInputs = [ pytestCheckHook ]; @@ -41,21 +35,12 @@ buildPythonPackage rec { substituteInPlace pyproject.toml \ --replace-fail 'requires = ["setuptools","swig"]' 'requires = ["setuptools"]' '' - + ( - if withApplePCSC then - '' - substituteInPlace src/smartcard/scard/winscarddll.c \ - --replace-fail "/System/Library/Frameworks/PCSC.framework/PCSC" \ - "${PCSC}/Library/Frameworks/PCSC.framework/PCSC" - '' - else - '' - substituteInPlace setup.py --replace-fail "pkg-config" "$PKG_CONFIG" - substituteInPlace src/smartcard/scard/winscarddll.c \ - --replace-fail "libpcsclite.so.1" \ - "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" - '' - ); + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + substituteInPlace setup.py --replace-fail "pkg-config" "$PKG_CONFIG" + substituteInPlace src/smartcard/scard/winscarddll.c \ + --replace-fail "libpcsclite.so.1" \ + "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" + ''; meta = { description = "Smartcard library for python"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dfb5f4b148d4..8249eb40d1f5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13200,9 +13200,7 @@ self: super: with self; { pyscaffoldext-travis = callPackage ../development/python-modules/pyscaffoldext-travis { }; - pyscard = callPackage ../development/python-modules/pyscard { - inherit (pkgs.darwin.apple_sdk.frameworks) PCSC; - }; + pyscard = callPackage ../development/python-modules/pyscard { }; pyscf = callPackage ../development/python-modules/pyscf { }; From 9f0c288cabec407eb1e7920072e33c3561ffe40a Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:45:52 -0400 Subject: [PATCH 02/10] netcdffortran: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- .../libraries/netcdf-fortran/default.nix | 26 +++++-------------- pkgs/top-level/all-packages.nix | 4 +-- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/pkgs/development/libraries/netcdf-fortran/default.nix b/pkgs/development/libraries/netcdf-fortran/default.nix index aacafb1e674f..363a85402eae 100644 --- a/pkgs/development/libraries/netcdf-fortran/default.nix +++ b/pkgs/development/libraries/netcdf-fortran/default.nix @@ -6,9 +6,6 @@ hdf5, curl, gfortran, - CoreFoundation, - CoreServices, - SystemConfiguration, }: stdenv.mkDerivation rec { pname = "netcdf-fortran"; @@ -22,23 +19,12 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ gfortran ]; - buildInputs = - [ - netcdf - hdf5 - curl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - CoreFoundation - CoreServices - SystemConfiguration - ]; - env.NIX_LDFLAGS = toString ( - lib.optionals stdenv.hostPlatform.isDarwin [ - "-F${CoreServices}/Library/Frameworks" - "-F${SystemConfiguration}/Library/Frameworks" - ] - ); + buildInputs = [ + netcdf + hdf5 + curl + ]; + doCheck = true; FFLAGS = [ "-std=legacy" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b03ffcc2e61f..f2f1afe764e7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4462,9 +4462,7 @@ with pkgs; hdf5 = hdf5-mpi.override { usev110Api = true; }; }; - netcdffortran = callPackage ../development/libraries/netcdf-fortran { - inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices SystemConfiguration; - }; + netcdffortran = callPackage ../development/libraries/netcdf-fortran { }; inherit (callPackage ../servers/web-apps/netbox { }) netbox_3_7; From 8c64351dabd0ed0b2732ed89d758e2347a542b62 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:46:40 -0400 Subject: [PATCH 03/10] libsamplerate: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- .../libraries/libsamplerate/default.nix | 20 +------------------ pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/pkgs/development/libraries/libsamplerate/default.nix b/pkgs/development/libraries/libsamplerate/default.nix index f50d40bf8e2f..776bd977cbb0 100644 --- a/pkgs/development/libraries/libsamplerate/default.nix +++ b/pkgs/development/libraries/libsamplerate/default.nix @@ -4,15 +4,8 @@ fetchurl, pkg-config, libsndfile, - ApplicationServices, - Carbon, - CoreServices, }: -let - inherit (lib) optionals optionalString; - -in stdenv.mkDerivation rec { pname = "libsamplerate"; version = "0.2.2"; @@ -23,12 +16,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ libsndfile ] - ++ optionals stdenv.hostPlatform.isDarwin [ - ApplicationServices - CoreServices - ]; + buildInputs = [ libsndfile ]; configureFlags = [ "--disable-fftw" ]; @@ -37,12 +25,6 @@ stdenv.mkDerivation rec { "out" ]; - postConfigure = optionalString stdenv.hostPlatform.isDarwin '' - # need headers from the Carbon.framework in /System/Library/Frameworks to - # compile this on darwin -- not sure how to handle - NIX_CFLAGS_COMPILE+=" -I${Carbon}/Library/Frameworks/Carbon.framework/Headers" - ''; - meta = with lib; { description = "Sample Rate Converter for audio"; homepage = "https://libsndfile.github.io/libsamplerate/"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f2f1afe764e7..8fce02f53007 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10203,9 +10203,7 @@ with pkgs; memHierarchy = "L3:16/64/8192K,L2:16/64/2048K,L1:8/64/16K"; }; - libsamplerate = callPackage ../development/libraries/libsamplerate { - inherit (darwin.apple_sdk.frameworks) ApplicationServices Carbon CoreServices; - }; + libsamplerate = callPackage ../development/libraries/libsamplerate { }; # GNU libc provides libiconv so systems with glibc don't need to # build libiconv separately. Additionally, Apple forked/repackaged From cc1d31dab2731c04090b8b34534b69b423e32288 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:47:19 -0400 Subject: [PATCH 04/10] xorg.xorgserver: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- pkgs/servers/x11/xorg/overrides.nix | 23 ++++++----------------- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 8c72f10418ed..cb0bde1e38cb 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -48,10 +48,6 @@ libxslt, libxcrypt, hwdata, - ApplicationServices, - Carbon, - Cocoa, - Xplugin, xorg, windows, libgbm, @@ -1220,9 +1216,6 @@ self: super: bootstrap_cmds automake autoconf - Xplugin - Carbon - Cocoa mesa ]; propagatedBuildInputs = commonPropagatedBuildInputs ++ [ @@ -1281,7 +1274,6 @@ self: super: preConfigure = '' mkdir -p $out/Applications export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error" - substituteInPlace hw/xquartz/pbproxy/Makefile.in --replace -F/System -F${ApplicationServices} ''; postInstall = '' rm -fr $out/share/X11/xkb/compiled @@ -1322,15 +1314,12 @@ self: super: "--without-dtrace" ]; - buildInputs = - old.buildInputs - ++ [ - xorg.pixman - xorg.libXfont2 - xorg.xtrans - xorg.libxcvt - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ Xplugin ]; + buildInputs = old.buildInputs ++ [ + xorg.pixman + xorg.libXfont2 + xorg.xtrans + xorg.libxcvt + ]; }); lndir = super.lndir.overrideAttrs (attrs: { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fce02f53007..c53dce2692c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12667,8 +12667,6 @@ with pkgs; # so as not to have the newly bound xorg items already in scope, which would # have created a cycle. overrides = lib.callPackageWith __splicedPackages ../servers/x11/xorg/overrides.nix { - inherit (darwin.apple_sdk.frameworks) ApplicationServices Carbon Cocoa; - inherit (darwin.apple_sdk.libs) Xplugin; inherit (buildPackages.darwin) bootstrap_cmds; udev = if stdenv.hostPlatform.isLinux then udev else null; libdrm = if stdenv.hostPlatform.isLinux then libdrm else null; From 84b5f48c2b66d2a0f8219d5286917e56d360ff26 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:47:47 -0400 Subject: [PATCH 05/10] odin: clean up apple_sdk stubs Also, patched out all impure paths in the linker.cpp file for darwin. Signed-off-by: Ihar Hrachyshka --- .../od/odin/darwin-remove-impure-links.patch | 23 +++++++++++++++++++ pkgs/by-name/od/odin/package.nix | 21 +++-------------- pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 pkgs/by-name/od/odin/darwin-remove-impure-links.patch 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; }; From a5cd73e594e634cb09819048cf826852c2df02ef Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:48:29 -0400 Subject: [PATCH 06/10] bullet{,roboschool}: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- pkgs/development/libraries/bullet/default.nix | 35 +++++-------------- .../libraries/bullet/roboschool-fork.nix | 27 +++----------- pkgs/top-level/all-packages.nix | 8 ++--- 3 files changed, 16 insertions(+), 54 deletions(-) diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix index 63be83763eb2..59a03c86bba0 100644 --- a/pkgs/development/libraries/bullet/default.nix +++ b/pkgs/development/libraries/bullet/default.nix @@ -6,8 +6,6 @@ libGLU, libGL, libglut, - Cocoa, - OpenGL, }: stdenv.mkDerivation rec { @@ -22,26 +20,16 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake ]; - buildInputs = - lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - libGL - libglut - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Cocoa - OpenGL - ]; + buildInputs = [ + libGLU + libGL + libglut + ]; - postPatch = - '' - substituteInPlace examples/ThirdPartyLibs/Gwen/CMakeLists.txt \ - --replace "-DGLEW_STATIC" "-DGLEW_STATIC -Wno-narrowing" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt - sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt - ''; + postPatch = '' + substituteInPlace examples/ThirdPartyLibs/Gwen/CMakeLists.txt \ + --replace "-DGLEW_STATIC" "-DGLEW_STATIC -Wno-narrowing" + ''; cmakeFlags = [ @@ -50,11 +38,6 @@ stdenv.mkDerivation rec { "-DINSTALL_EXTRA_LIBS=ON" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DOPENGL_FOUND=true" - "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework" - "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework" - "-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework" - "-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework" "-DBUILD_BULLET2_DEMOS=OFF" "-DBUILD_UNIT_TESTS=OFF" "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF" diff --git a/pkgs/development/libraries/bullet/roboschool-fork.nix b/pkgs/development/libraries/bullet/roboschool-fork.nix index 94ce4a3f865d..53b296aa82f0 100644 --- a/pkgs/development/libraries/bullet/roboschool-fork.nix +++ b/pkgs/development/libraries/bullet/roboschool-fork.nix @@ -6,8 +6,6 @@ libGLU, libGL, libglut, - Cocoa, - OpenGL, }: stdenv.mkDerivation { @@ -26,24 +24,14 @@ stdenv.mkDerivation { }; nativeBuildInputs = [ cmake ]; - buildInputs = - lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - libGL - libglut - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Cocoa - OpenGL - ]; + buildInputs = [ + libGLU + libGL + libglut + ]; patches = [ ./gwen-narrowing.patch ]; - postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' - sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt - sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt - ''; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" @@ -51,11 +39,6 @@ stdenv.mkDerivation { "-DINSTALL_EXTRA_LIBS=ON" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DOPENGL_FOUND=true" - "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework" - "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework" - "-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework" - "-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework" "-DBUILD_BULLET2_DEMOS=OFF" "-DBUILD_UNIT_TESTS=OFF" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e26433b4fc85..fc8a6395f059 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19295,13 +19295,9 @@ with pkgs; zncModules = recurseIntoAttrs (callPackage ../applications/networking/znc/modules.nix { }); - bullet = callPackage ../development/libraries/bullet { - inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL; - }; + bullet = callPackage ../development/libraries/bullet { }; - bullet-roboschool = callPackage ../development/libraries/bullet/roboschool-fork.nix { - inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL; - }; + bullet-roboschool = callPackage ../development/libraries/bullet/roboschool-fork.nix { }; dart = callPackage ../development/compilers/dart { }; From a8fc944dd02cb337ab5ab218f42d58619e68187e Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:48:53 -0400 Subject: [PATCH 07/10] gildas: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- pkgs/by-name/gi/gildas/package.nix | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/gi/gildas/package.nix b/pkgs/by-name/gi/gildas/package.nix index 6370487384b4..e714c2fc7aa6 100644 --- a/pkgs/by-name/gi/gildas/package.nix +++ b/pkgs/by-name/gi/gildas/package.nix @@ -12,7 +12,6 @@ perl, groff, which, - darwin, ncurses, }: @@ -49,17 +48,13 @@ stdenv.mkDerivation rec { which ]; - buildInputs = - [ - gtk2-x11 - lesstif - cfitsio - python3Env - ncurses - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin ( - with darwin.apple_sdk.frameworks; [ CoreFoundation ] - ); + buildInputs = [ + gtk2-x11 + lesstif + cfitsio + python3Env + ncurses + ]; patches = [ ./wrapper.patch ] @@ -73,10 +68,6 @@ stdenv.mkDerivation rec { # Workaround for https://github.com/NixOS/nixpkgs/issues/304528 env.GAG_CPP = lib.optionalString stdenv.hostPlatform.isDarwin "${gfortran.outPath}/bin/cpp"; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin ( - with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks" - ); - configurePhase = '' substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out substituteInPlace admin/wrapper.sh --replace '%%PYTHONHOME%%' ${python3Env} From 7ad1b2838bd3f20bba1017b5c2e3b332d74811a3 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:49:07 -0400 Subject: [PATCH 08/10] opensc: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- pkgs/by-name/op/opensc/package.nix | 61 +++++++++++------------------- 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/pkgs/by-name/op/opensc/package.nix b/pkgs/by-name/op/opensc/package.nix index 4714e994308a..8c642beb23da 100644 --- a/pkgs/by-name/op/opensc/package.nix +++ b/pkgs/by-name/op/opensc/package.nix @@ -14,9 +14,7 @@ docbook_xsl, libxslt, docbook_xml_dtd_412, - darwin, nix-update-script, - withApplePCSC ? stdenv.hostPlatform.isDarwin, }: stdenv.mkDerivation rec { @@ -35,46 +33,33 @@ stdenv.mkDerivation rec { autoreconfHook libxslt # xsltproc ]; - buildInputs = - [ - zlib - readline - openssl - libassuan - libXt - libiconv - docbook_xml_dtd_412 - ] - ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.Carbon - ++ (if withApplePCSC then [ darwin.apple_sdk.frameworks.PCSC ] else [ pcsclite ]); + buildInputs = [ + zlib + readline + openssl + libassuan + libXt + libiconv + docbook_xml_dtd_412 + ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) pcsclite; env.NIX_CFLAGS_COMPILE = "-Wno-error"; - configureFlags = [ - "--enable-zlib" - "--enable-readline" - "--enable-openssl" - "--enable-pcsc" - "--enable-sm" - "--enable-man" - "--enable-doc" - "--localstatedir=/var" - "--sysconfdir=/etc" - "--with-xsl-stylesheetsdir=${docbook_xsl}/xml/xsl/docbook" - "--with-pcsc-provider=${ - if withApplePCSC then - "${darwin.apple_sdk.frameworks.PCSC}/Library/Frameworks/PCSC.framework/PCSC" - else - "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" - }" - ]; - - PCSC_CFLAGS = lib.concatStringsSep " " ( - lib.optionals withApplePCSC [ - "-I${darwin.apple_sdk.frameworks.PCSC}/Library/Frameworks/PCSC.framework/Headers" - "-I${lib.getDev pcsclite}/include/PCSC" + configureFlags = + [ + "--enable-zlib" + "--enable-readline" + "--enable-openssl" + "--enable-pcsc" + "--enable-sm" + "--enable-man" + "--enable-doc" + "--localstatedir=/var" + "--sysconfdir=/etc" + "--with-xsl-stylesheetsdir=${docbook_xsl}/xml/xsl/docbook" ] - ); + ++ lib.optional (!stdenv.hostPlatform.isDarwin) + "--with-pcsc-provider=${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"; installFlags = [ "sysconfdir=$(out)/etc" From 2ea4434e0b4a32713ccd3ec7eed890dc236d2204 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:49:51 -0400 Subject: [PATCH 09/10] bazel-test-cpp: clean up apple_sdk stubs Signed-off-by: Ihar Hrachyshka --- pkgs/development/tools/build-managers/bazel/cpp-test.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/cpp-test.nix b/pkgs/development/tools/build-managers/bazel/cpp-test.nix index e1748042d137..e5ad6bc2a41c 100644 --- a/pkgs/development/tools/build-managers/bazel/cpp-test.nix +++ b/pkgs/development/tools/build-managers/bazel/cpp-test.nix @@ -10,9 +10,7 @@ runLocal, runtimeShell, writeScript, - writeText, distDir, - Foundation ? null, }: let @@ -58,10 +56,6 @@ let + lib.optionalString (stdenv.hostPlatform.isDarwin) '' --cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \ --linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \ - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && Foundation != null) '' - --linkopt=-Wl,-F${Foundation}/Library/Frameworks \ - --linkopt=-L${darwin.libobjc}/lib \ ''; }; From d1ee8a7901edf8540aac1c8a6142f0356b6f3b69 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Apr 2025 21:50:20 -0400 Subject: [PATCH 10/10] python3Packages.jaxlib: clean up apple_sdk stubs Note: jaxlib currently points to jaxlib-bin so this code is not utilized for regular jaxlib installations. Signed-off-by: Ihar Hrachyshka --- pkgs/development/python-modules/jaxlib/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 137d9b39e510..c2c06e7385bc 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -15,7 +15,6 @@ cython, fetchFromGitHub, git, - darwin, jsoncpp, nsync, openssl, @@ -409,10 +408,8 @@ let ); # Note: we cannot do most of this patching at `patch` phase as the deps - # are not available yet. Framework search paths aren't added by bintools - # hook. See https://github.com/NixOS/nixpkgs/pull/41914. + # are not available yet. preBuild = lib.optionalString effectiveStdenv.hostPlatform.isDarwin '' - export NIX_LDFLAGS+=" -F${darwin.apple_sdk.frameworks.IOKit}/Library/Frameworks" substituteInPlace ../output/external/rules_cc/cc/private/toolchain/osx_cc_wrapper.sh.tpl \ --replace "/usr/bin/install_name_tool" "${cctools}/bin/install_name_tool" substituteInPlace ../output/external/rules_cc/cc/private/toolchain/unix_cc_configure.bzl \