diff --git a/pkgs/by-name/gi/gildas/package.nix b/pkgs/by-name/gi/gildas/package.nix index 6370487384b4c..e714c2fc7aa6b 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} 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 0000000000000..eb7fa04c415a2 --- /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 8b8ce92050981..c30f50c52bda1 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/by-name/op/opensc/package.nix b/pkgs/by-name/op/opensc/package.nix index 4714e994308a4..8c642beb23da0 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" diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix index 63be83763eb29..59a03c86bba01 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 94ce4a3f865d0..53b296aa82f0f 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/development/libraries/libsamplerate/default.nix b/pkgs/development/libraries/libsamplerate/default.nix index f50d40bf8e2f6..776bd977cbb06 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/development/libraries/netcdf-fortran/default.nix b/pkgs/development/libraries/netcdf-fortran/default.nix index aacafb1e674f2..363a85402eae0 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/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 137d9b39e510f..c2c06e7385bc9 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 \ diff --git a/pkgs/development/python-modules/pyscard/default.nix b/pkgs/development/python-modules/pyscard/default.nix index 8186c89b7b275..859bd2d17b189 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/development/tools/build-managers/bazel/cpp-test.nix b/pkgs/development/tools/build-managers/bazel/cpp-test.nix index e1748042d1371..e5ad6bc2a41c7 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 \ ''; }; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 8c72f10418edb..cb0bde1e38cbd 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 b03ffcc2e61fa..fc8a6395f0599 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; @@ -10205,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 @@ -12671,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; @@ -13115,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; }; @@ -19303,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 { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dfb5f4b148d44..8249eb40d1f59 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 { };