From e2457ce8bb8a4661768982dcf0313132771067a0 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 10 May 2022 23:38:30 +0300 Subject: [PATCH 1/4] stdenv: warn about use of stdenv.glibc TODO was added in https://github.com/NixOS/nixpkgs/pull/34645/commits/119920faa6717f8075e0ea44553203171a71f9ea (cherry picked from commit a05b5817834f553f8eae560c58fed02a59af42b9) --- pkgs/stdenv/linux/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 5c5ca64b1e95..8f8c902e4db5 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -398,8 +398,11 @@ in inherit (prevStage.stdenv) fetchurlBoot; extraAttrs = { - # TODO: remove this! - inherit (prevStage) glibc; + # remove before 22.11 + glibc = lib.warn + ( "`stdenv.glibc` is deprecated and will be removed in release 22.11." + + " Please use `pkgs.glibc` instead.") + prevStage.glibc; inherit bootstrapTools; shellPackage = prevStage.bash; From 75e79f63d4e68b9afbab41225bc8f7965896026f Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 23 May 2022 21:28:14 +0300 Subject: [PATCH 2/4] treewide: stdenv.glibc -> glibc (cherry picked from commit 0c4d65b21efd3ae2fcdec54492cbaa6542352eb9) --- doc/stdenv/multiple-output.chapter.md | 2 +- maintainers/scripts/patchelf-hints.sh | 2 +- pkgs/applications/audio/baudline/default.nix | 4 ++-- pkgs/applications/audio/yoshimi/default.nix | 5 ++--- .../editors/eclipse/build-eclipse.nix | 4 ++-- pkgs/applications/editors/eclipse/default.nix | 2 -- pkgs/applications/editors/jetbrains/linux.nix | 4 ++-- .../extensions/cpptools/missing_elf_deps.sh | 3 +-- .../sane/backends/brscan4/default.nix | 4 ++-- .../sane/backends/brscan5/default.nix | 4 ++-- .../networking/spideroak/default.nix | 4 ++-- .../science/math/cplex/default.nix | 4 ++-- .../science/math/hmetis/default.nix | 6 ++--- .../virtualization/virtualbox/default.nix | 6 ++--- pkgs/build-support/vm/default.nix | 8 +++---- .../compilers/nvidia-cg-toolkit/default.nix | 6 ++--- .../development/libraries/live555/default.nix | 3 ++- pkgs/development/mobile/androidenv/cmake.nix | 2 +- .../python-modules/monotonic/default.nix | 3 ++- .../python-modules/twisted/default.nix | 2 +- .../development/tools/eclipse-mat/default.nix | 3 ++- pkgs/development/tools/iaca/2.1.nix | 4 ++-- pkgs/development/tools/iaca/3.0.nix | 4 ++-- pkgs/development/tools/misc/ninka/default.nix | 2 -- pkgs/games/planetaryannihilation/default.nix | 8 +++---- pkgs/games/ue4demos/default.nix | 4 ++-- .../misc/cups/drivers/brgenml1lpr/default.nix | 2 +- pkgs/misc/cups/drivers/canon/default.nix | 22 +++++++++---------- pkgs/misc/cups/drivers/hl1110/default.nix | 8 +++---- pkgs/misc/cups/drivers/hl3140cw/default.nix | 6 ++--- .../cups/drivers/mfcj470dwlpr/default.nix | 4 ++-- .../linux/mwprocapture/default.nix | 4 ++-- pkgs/os-specific/linux/sgx/ssl/default.nix | 3 ++- pkgs/stdenv/adapters.nix | 4 ++-- pkgs/tools/compression/kzipmix/default.nix | 6 ++--- pkgs/tools/graphics/pngout/default.nix | 3 ++- pkgs/tools/inputmethods/m17n-db/default.nix | 5 ++--- pkgs/tools/misc/nbench/default.nix | 4 ++-- pkgs/tools/networking/nbd/default.nix | 5 ++--- pkgs/tools/networking/tgt/default.nix | 6 ++--- .../checkinstall/default.nix | 6 ++--- pkgs/tools/system/hardinfo/default.nix | 4 ++-- 42 files changed, 94 insertions(+), 101 deletions(-) diff --git a/doc/stdenv/multiple-output.chapter.md b/doc/stdenv/multiple-output.chapter.md index 62bf543e51e5..a8c96a25b7be 100644 --- a/doc/stdenv/multiple-output.chapter.md +++ b/doc/stdenv/multiple-output.chapter.md @@ -77,7 +77,7 @@ There is a special handling of the `debug` output, described at [](#stdenv-separ A commonly adopted convention in `nixpkgs` is that executables provided by the package are contained within its first output. This convention allows the dependent packages to reference the executables provided by packages in a uniform manner. For instance, provided with the knowledge that the `perl` package contains a `perl` executable it can be referenced as `${pkgs.perl}/bin/perl` within a Nix derivation that needs to execute a Perl script. -The `glibc` package is a deliberate single exception to the “binaries first” convention. The `glibc` has `libs` as its first output allowing the libraries provided by `glibc` to be referenced directly (e.g. `${stdenv.glibc}/lib/ld-linux-x86-64.so.2`). The executables provided by `glibc` can be accessed via its `bin` attribute (e.g. `${stdenv.glibc.bin}/bin/ldd`). +The `glibc` package is a deliberate single exception to the “binaries first” convention. The `glibc` has `libs` as its first output allowing the libraries provided by `glibc` to be referenced directly (e.g. `${glibc}/lib/ld-linux-x86-64.so.2`). The executables provided by `glibc` can be accessed via its `bin` attribute (e.g. `${glibc.bin}/bin/ldd`). The reason for why `glibc` deviates from the convention is because referencing a library provided by `glibc` is a very common operation among Nix packages. For instance, third-party executables packaged by Nix are typically patched and relinked with the relevant version of `glibc` libraries from Nix packages (please see the documentation on [patchelf](https://github.com/NixOS/patchelf) for more details). diff --git a/maintainers/scripts/patchelf-hints.sh b/maintainers/scripts/patchelf-hints.sh index 5fdfc15dc232..802ecab0f0a1 100755 --- a/maintainers/scripts/patchelf-hints.sh +++ b/maintainers/scripts/patchelf-hints.sh @@ -61,7 +61,7 @@ for bin in $(find $binaryDist -executable -type f) :; do uniq; ) - if test "$names" = "glibc"; then names="stdenv.glibc"; fi + if test "$names" = "glibc"; then names="glibc"; fi if echo $names | grep -c "gcc" &> /dev/null; then names="stdenv.cc.cc"; fi if test $lib != $libPath; then diff --git a/pkgs/applications/audio/baudline/default.nix b/pkgs/applications/audio/baudline/default.nix index 7d6d51011cc2..ab88642e6bc2 100644 --- a/pkgs/applications/audio/baudline/default.nix +++ b/pkgs/applications/audio/baudline/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, libXmu, libXt, libX11, libXext, libXxf86vm, libjack2 -, makeWrapper +, makeWrapper, glibc }: let @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { cp -r . "$out/libexec/baudline/" - interpreter="$(echo ${stdenv.glibc.out}/lib/ld-linux*)" + interpreter="$(echo ${glibc.out}/lib/ld-linux*)" for prog in "$out"/libexec/baudline/baudline*; do patchelf --interpreter "$interpreter" "$prog" ln -sr "$prog" "$out/bin/" diff --git a/pkgs/applications/audio/yoshimi/default.nix b/pkgs/applications/audio/yoshimi/default.nix index fe9da33e5cae..e6fbada15d28 100644 --- a/pkgs/applications/audio/yoshimi/default.nix +++ b/pkgs/applications/audio/yoshimi/default.nix @@ -1,4 +1,5 @@ { lib +, glibc , stdenv , fetchFromGitHub , alsa-lib @@ -20,8 +21,6 @@ , zlib }: -assert stdenv ? glibc; - stdenv.mkDerivation rec { pname = "yoshimi"; version = "2.1.2.2"; @@ -60,7 +59,7 @@ stdenv.mkDerivation rec { zlib ]; - cmakeFlags = [ "-DFLTK_MATH_LIBRARY=${stdenv.glibc.out}/lib/libm.so" ]; + cmakeFlags = [ "-DFLTK_MATH_LIBRARY=${glibc.out}/lib/libm.so" ]; meta = with lib; { description = "High quality software synthesizer based on ZynAddSubFX"; diff --git a/pkgs/applications/editors/eclipse/build-eclipse.nix b/pkgs/applications/editors/eclipse/build-eclipse.nix index 3b497f34a439..c9bb8168995f 100644 --- a/pkgs/applications/editors/eclipse/build-eclipse.nix +++ b/pkgs/applications/editors/eclipse/build-eclipse.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender +{ lib, stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender, glibc , zlib, jdk, glib, glib-networking, gtk, libXtst, libsecret, gsettings-desktop-schemas, webkitgtk , makeWrapper, perl, ... }: @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { tar xfvz $src -C $out # Patch binaries. - interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) libCairo=$out/eclipse/libcairo-swt.so patchelf --set-interpreter $interpreter $out/eclipse/eclipse [ -f $libCairo ] && patchelf --set-rpath ${lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]} $libCairo diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index ea763ecb39ad..b91d12401917 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -6,8 +6,6 @@ , callPackage }: -assert stdenv ? glibc; - # https://download.eclipse.org/eclipse/downloads/ is the main place to # find the downloads needed for new versions # diff --git a/pkgs/applications/editors/jetbrains/linux.nix b/pkgs/applications/editors/jetbrains/linux.nix index 55ed0e6829e5..9cc94a6484c9 100644 --- a/pkgs/applications/editors/jetbrains/linux.nix +++ b/pkgs/applications/editors/jetbrains/linux.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, makeDesktopItem, makeWrapper, patchelf, writeText +{ stdenv, lib, makeDesktopItem, makeWrapper, patchelf, writeText, glibc , coreutils, gnugrep, which, git, unzip, libsecret, libnotify, e2fsprogs , vmopts ? null }: @@ -46,7 +46,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec { truncate --size=$size $fname } - interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) if [[ "${stdenv.hostPlatform.system}" == "x86_64-linux" && -e bin/fsnotifier64 ]]; then target_size=$(get_file_size bin/fsnotifier64) patchelf --set-interpreter "$interpreter" bin/fsnotifier64 diff --git a/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh b/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh index f5eb08d78a5d..7f1f08ca0f3b 100755 --- a/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh +++ b/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh @@ -11,7 +11,7 @@ function get_pkg_out() { echo "$(nix-build -E "$nixExp" --no-out-link)${suffix}" } -interpreter="$(get_pkg_out "stdenv.glibc" "/lib/ld-linux-x86-64.so.2")" +interpreter="$(get_pkg_out "glibc" "/lib/ld-linux-x86-64.so.2")" echo "interpreter='$interpreter'" # For clangformat dep on 'libtinfo.so.5'. @@ -49,4 +49,3 @@ function print_nix_version_mono() { echo "nixMonoBin='$nixMonoBin'" $nixMonoBin/mono --version } - diff --git a/pkgs/applications/graphics/sane/backends/brscan4/default.nix b/pkgs/applications/graphics/sane/backends/brscan4/default.nix index 93d40374607e..b203f0c3dbc6 100644 --- a/pkgs/applications/graphics/sane/backends/brscan4/default.nix +++ b/pkgs/applications/graphics/sane/backends/brscan4/default.nix @@ -1,8 +1,8 @@ -{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb-compat-0_1 }: +{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb-compat-0_1, glibc }: let myPatchElf = file: with lib; '' patchelf --set-interpreter \ - ${stdenv.glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; diff --git a/pkgs/applications/graphics/sane/backends/brscan5/default.nix b/pkgs/applications/graphics/sane/backends/brscan5/default.nix index 219d435a81a0..4afc5ac40a26 100644 --- a/pkgs/applications/graphics/sane/backends/brscan5/default.nix +++ b/pkgs/applications/graphics/sane/backends/brscan5/default.nix @@ -1,8 +1,8 @@ -{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb1, avahi-compat, glib, libredirect, nixosTests }: +{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb1, avahi-compat, glib, libredirect, nixosTests, glibc }: let myPatchElf = file: with lib; '' patchelf --set-interpreter \ - ${stdenv.glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; system = stdenv.hostPlatform.system; diff --git a/pkgs/applications/networking/spideroak/default.nix b/pkgs/applications/networking/spideroak/default.nix index edff4c78126e..3543a979fb34 100644 --- a/pkgs/applications/networking/spideroak/default.nix +++ b/pkgs/applications/networking/spideroak/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, makeWrapper, patchelf +{ lib, stdenv, fetchurl, makeWrapper, patchelf, glibc , fontconfig, freetype, glib, libICE, libSM , libX11, libXext, libXrender, zlib }: @@ -37,7 +37,7 @@ in stdenv.mkDerivation { rm -f $out/opt/SpiderOakONE/lib/libz* - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2 \ + patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 \ "$out/opt/SpiderOakONE/lib/SpiderOakONE" RPATH=$out/opt/SpiderOakONE/lib:${ldpath} diff --git a/pkgs/applications/science/math/cplex/default.nix b/pkgs/applications/science/math/cplex/default.nix index 068f9f0ea3c1..f3caa037b35e 100644 --- a/pkgs/applications/science/math/cplex/default.nix +++ b/pkgs/applications/science/math/cplex/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, makeWrapper, openjdk, gtk2, xorg, glibcLocales, releasePath ? null }: +{ lib, stdenv, makeWrapper, openjdk, gtk2, xorg, glibc, glibcLocales, releasePath ? null }: # To use this package, you need to download your own cplex installer from IBM # and override the releasePath attribute to point to the location of the file. @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { let libraryPath = lib.makeLibraryPath [ stdenv.cc.cc gtk2 xorg.libXtst ]; in '' - interpreter=${stdenv.glibc}/lib/ld-linux-x86-64.so.2 + interpreter=${glibc}/lib/ld-linux-x86-64.so.2 for pgm in $out/opl/bin/x86-64_linux/oplrun $out/opl/bin/x86-64_linux/oplrunjava $out/opl/oplide/oplide; do diff --git a/pkgs/applications/science/math/hmetis/default.nix b/pkgs/applications/science/math/hmetis/default.nix index f25a0f13c7fb..e97b81daedda 100644 --- a/pkgs/applications/science/math/hmetis/default.nix +++ b/pkgs/applications/science/math/hmetis/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, ghostscript }: +{ lib, stdenv, fetchurl, ghostscript, glibc }: stdenv.mkDerivation rec { pname = "hmetis"; @@ -16,8 +16,8 @@ stdenv.mkDerivation rec { patchPhase = '' for binaryfile in $binaryFiles; do patchelf \ - --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 \ - --set-rpath ${stdenv.glibc}/lib \ + --set-interpreter ${glibc}/lib/ld-linux.so.2 \ + --set-rpath ${glibc}/lib \ $binaryfile done ''; diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 9424628d2877..2cc0e30f2b98 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -1,5 +1,5 @@ { config, stdenv, fetchurl, lib, acpica-tools, dev86, pam, libxslt, libxml2, wrapQtAppsHook -, libX11, xorgproto, libXext, libXcursor, libXmu, libIDL, SDL, libcap, libGL +, libX11, xorgproto, libXext, libXcursor, libXmu, libIDL, SDL, libcap, libGL, glibc , libpng, glib, lvm2, libXrandr, libXinerama, libopus, qtbase, qtx11extras , qttools, qtsvg, qtwayland, pkg-config, which, docbook_xsl, docbook_xml_dtd_43 , alsa-lib, curl, libvpx, nettools, dbus, substituteAll, gsoap, zlib @@ -62,8 +62,8 @@ in stdenv.mkDerivation { ${optionalString (!headless) '' -e 's@TOOLQT5BIN=.*@TOOLQT5BIN="${getDev qtbase}/bin"@' \ ''} -i configure - ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 - ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2 + ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 + ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 grep 'libpulse\.so\.0' src include -rI --files-with-match | xargs sed -i -e ' ${optionalString pulseSupport diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index e466ff7ecce8..56091dee8f68 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -35,10 +35,10 @@ rec { mkdir -p $out/lib # Copy what we need from Glibc. - cp -p ${pkgs.stdenv.glibc.out}/lib/ld-linux*.so.? $out/lib - cp -p ${pkgs.stdenv.glibc.out}/lib/libc.so.* $out/lib - cp -p ${pkgs.stdenv.glibc.out}/lib/libm.so.* $out/lib - cp -p ${pkgs.stdenv.glibc.out}/lib/libresolv.so.* $out/lib + cp -p ${pkgs.glibc.out}/lib/ld-linux*.so.? $out/lib + cp -p ${pkgs.glibc.out}/lib/libc.so.* $out/lib + cp -p ${pkgs.glibc.out}/lib/libm.so.* $out/lib + cp -p ${pkgs.glibc.out}/lib/libresolv.so.* $out/lib # Copy BusyBox. cp -pd ${pkgs.busybox}/bin/* $out/bin diff --git a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix index 2f7a1c7a9643..0dbecf6ffa42 100644 --- a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix +++ b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix @@ -1,6 +1,4 @@ -{ lib, stdenv, fetchurl }: - -assert stdenv ? glibc; +{ lib, stdenv, fetchurl, glibc }: stdenv.mkDerivation rec { version = "3.1"; @@ -25,7 +23,7 @@ stdenv.mkDerivation rec { installPhase = '' for b in cgc cgfxcat cginfo do - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux*.so.? "bin/$b" + patchelf --set-interpreter ${glibc.out}/lib/ld-linux*.so.? "bin/$b" done # FIXME: cgfxcat and cginfo need more patchelf mkdir -p "$out/bin/" diff --git a/pkgs/development/libraries/live555/default.nix b/pkgs/development/libraries/live555/default.nix index 217ea7408d22..851f52fe4ab2 100644 --- a/pkgs/development/libraries/live555/default.nix +++ b/pkgs/development/libraries/live555/default.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { sed -i \ -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ config.linux - '' + lib.optionalString (stdenv ? glibc) '' + '' # condition from icu/base.nix + + lib.optionalString (stdenv.hostPlatform.libc == "glibc" || stdenv.hostPlatform.libc == "musl") '' substituteInPlace liveMedia/include/Locale.hh \ --replace '' '' ''; diff --git a/pkgs/development/mobile/androidenv/cmake.nix b/pkgs/development/mobile/androidenv/cmake.nix index ade111cf3f9e..234862ce8212 100644 --- a/pkgs/development/mobile/androidenv/cmake.nix +++ b/pkgs/development/mobile/androidenv/cmake.nix @@ -3,7 +3,7 @@ deployAndroidPackage { inherit package os; nativeBuildInputs = [ autoPatchelfHook ]; - buildInputs = lib.optional (os == "linux") [ pkgs.stdenv.glibc pkgs.stdenv.cc.cc pkgs.ncurses5 ]; + buildInputs = lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.ncurses5 ]; patchInstructions = lib.optionalString (os == "linux") '' autoPatchelf $packageBaseDir/bin ''; diff --git a/pkgs/development/python-modules/monotonic/default.nix b/pkgs/development/python-modules/monotonic/default.nix index d775d5157191..a2271a595815 100644 --- a/pkgs/development/python-modules/monotonic/default.nix +++ b/pkgs/development/python-modules/monotonic/default.nix @@ -1,6 +1,7 @@ { lib, stdenv , buildPythonPackage , fetchPypi +, glibc }: buildPythonPackage rec { @@ -16,7 +17,7 @@ buildPythonPackage rec { patchPhase = lib.optionalString stdenv.isLinux '' substituteInPlace monotonic.py --replace \ - "ctypes.util.find_library('c')" "'${stdenv.glibc.out}/lib/libc.so.6'" + "ctypes.util.find_library('c')" "'${glibc.out}/lib/libc.so.6'" ''; meta = with lib; { diff --git a/pkgs/development/python-modules/twisted/default.nix b/pkgs/development/python-modules/twisted/default.nix index ab950e6a96bd..82f91561f3c6 100644 --- a/pkgs/development/python-modules/twisted/default.nix +++ b/pkgs/development/python-modules/twisted/default.nix @@ -54,7 +54,7 @@ buildPythonPackage rec { # twisted.python.runtime.platform.supportsINotify() == False postPatch = lib.optionalString stdenv.isLinux '' substituteInPlace src/twisted/python/_inotify.py --replace \ - "ctypes.util.find_library(\"c\")" "'${stdenv.glibc.out}/lib/libc.so.6'" + "ctypes.util.find_library(\"c\")" "'${stdenv.cc.libc}/lib/libc.so.6'" ''; # Generate Twisted's plug-in cache. Twisted users must do it as well. See diff --git a/pkgs/development/tools/eclipse-mat/default.nix b/pkgs/development/tools/eclipse-mat/default.nix index 7408b35fe5ad..5ba2a2fccb99 100644 --- a/pkgs/development/tools/eclipse-mat/default.nix +++ b/pkgs/development/tools/eclipse-mat/default.nix @@ -1,4 +1,5 @@ { fetchurl +, glibc , fontconfig , freetype , glib @@ -57,7 +58,7 @@ stdenv.mkDerivation rec { mv mat $out # Patch binaries. - interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) libCairo=$out/eclipse/libcairo-swt.so patchelf --set-interpreter $interpreter $out/mat/MemoryAnalyzer [ -f $libCairo ] && patchelf --set-rpath ${ diff --git a/pkgs/development/tools/iaca/2.1.nix b/pkgs/development/tools/iaca/2.1.nix index a1b9729ccb4a..3d59ab33381f 100644 --- a/pkgs/development/tools/iaca/2.1.nix +++ b/pkgs/development/tools/iaca/2.1.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, makeWrapper, requireFile, gcc, unzip }: +{ lib, stdenv, makeWrapper, requireFile, gcc, unzip, glibc }: with lib; # v2.1: last version with NHM/WSM arch support @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { ''; preFixup = let libPath = makeLibraryPath [ stdenv.cc.cc.lib gcc ]; in '' patchelf \ - --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 \ + --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 \ --set-rpath $out/lib:"${libPath}" \ $out/bin/iaca ''; diff --git a/pkgs/development/tools/iaca/3.0.nix b/pkgs/development/tools/iaca/3.0.nix index 4da6851af5af..ab3a2f57db3f 100644 --- a/pkgs/development/tools/iaca/3.0.nix +++ b/pkgs/development/tools/iaca/3.0.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, requireFile, unzip }: +{ lib, stdenv, requireFile, unzip, glibc }: with lib; stdenv.mkDerivation rec { @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin cp iaca $out/bin - patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $out/bin/iaca + patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 $out/bin/iaca ''; meta = { description = "Intel Architecture Code Analyzer"; diff --git a/pkgs/development/tools/misc/ninka/default.nix b/pkgs/development/tools/misc/ninka/default.nix index 8e8fb6bb5972..2b45af77e7a9 100644 --- a/pkgs/development/tools/misc/ninka/default.nix +++ b/pkgs/development/tools/misc/ninka/default.nix @@ -1,7 +1,5 @@ { lib, stdenv, fetchFromGitHub, perl, perlPackages }: -assert stdenv ? glibc; - perlPackages.buildPerlPackage { pname = "ninka"; version = "2.0-pre"; diff --git a/pkgs/games/planetaryannihilation/default.nix b/pkgs/games/planetaryannihilation/default.nix index 2debd15f814e..6c337328669d 100644 --- a/pkgs/games/planetaryannihilation/default.nix +++ b/pkgs/games/planetaryannihilation/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, config, fetchurl, patchelf, makeWrapper, gtk2, glib, udev, alsa-lib, atk +{ lib, stdenv, glibc, config, fetchurl, patchelf, makeWrapper, gtk2, glib, udev, alsa-lib, atk , nspr, fontconfig, cairo, pango, nss, freetype, gnome2, gdk-pixbuf, curl, systemd, xorg, requireFile }: stdenv.mkDerivation rec { @@ -23,12 +23,12 @@ stdenv.mkDerivation rec { ln -s ${systemd}/lib/libudev.so.1 $out/lib/libudev.so.0 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/PA" - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib xorg.libXdamage xorg.libXfixes gtk2 glib stdenv.glibc.out "$out" xorg.libXext pango udev xorg.libX11 xorg.libXcomposite alsa-lib atk nspr fontconfig cairo pango nss freetype gnome2.GConf gdk-pixbuf xorg.libXrender ]}:{stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" "$out/host/CoherentUI_Host" + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib xorg.libXdamage xorg.libXfixes gtk2 glib glibc.out "$out" xorg.libXext pango udev xorg.libX11 xorg.libXcomposite alsa-lib atk nspr fontconfig cairo pango nss freetype gnome2.GConf gdk-pixbuf xorg.libXrender ]}:{stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" "$out/host/CoherentUI_Host" - wrapProgram $out/PA --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib stdenv.glibc.out xorg.libX11 xorg.libXcursor gtk2 glib curl "$out" ]}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" + wrapProgram $out/PA --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib glibc.out xorg.libX11 xorg.libXcursor gtk2 glib curl "$out" ]}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" for f in $out/lib/*; do - patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib curl xorg.libX11 stdenv.glibc.out xorg.libXcursor "$out" ]}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" $f + patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib curl xorg.libX11 glibc.out xorg.libXcursor "$out" ]}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" $f done ''; diff --git a/pkgs/games/ue4demos/default.nix b/pkgs/games/ue4demos/default.nix index 51148e42e8e1..34ea4726ce2f 100644 --- a/pkgs/games/ue4demos/default.nix +++ b/pkgs/games/ue4demos/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, unzip, patchelf, xorg, openal }: +{ lib, stdenv, fetchurl, unzip, patchelf, xorg, openal, glibc }: let urls = file: @@ -24,7 +24,7 @@ let cd $out unzip $src - interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) binary=$(find . -executable -type f) patchelf \ --set-interpreter $interpreter \ diff --git a/pkgs/misc/cups/drivers/brgenml1lpr/default.nix b/pkgs/misc/cups/drivers/brgenml1lpr/default.nix index fd439e9cd73d..385c1df92f37 100644 --- a/pkgs/misc/cups/drivers/brgenml1lpr/default.nix +++ b/pkgs/misc/cups/drivers/brgenml1lpr/default.nix @@ -30,7 +30,7 @@ let myPatchElf = file: with lib; '' patchelf --set-interpreter \ - ${stdenv.glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; in diff --git a/pkgs/misc/cups/drivers/canon/default.nix b/pkgs/misc/cups/drivers/canon/default.nix index 5a01a0295a8a..d9981cee95f4 100644 --- a/pkgs/misc/cups/drivers/canon/default.nix +++ b/pkgs/misc/cups/drivers/canon/default.nix @@ -1,6 +1,5 @@ { lib , stdenv -, stdenv_32bit , fetchurl , unzip , autoconf @@ -24,6 +23,7 @@ , ghostscript , pkgs , pkgsi686Linux +, glibc , zlib }: @@ -151,9 +151,9 @@ stdenv.mkDerivation rec { ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so.1 - patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${stdenv_32bit.glibc.out}/lib:${pkgsi686Linux.libxml2.out}/lib:$out/lib32" libcanonufr2r.so.1.0.0 - patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${stdenv_32bit.glibc.out}/lib" libcaepcmufr2.so.1.0 - patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${stdenv_32bit.glibc.out}/lib" libColorGearCufr2.so.2.0.0 + patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.glibc.out}/lib:${pkgsi686Linux.libxml2.out}/lib:$out/lib32" libcanonufr2r.so.1.0.0 + patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.glibc.out}/lib" libcaepcmufr2.so.1.0 + patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.glibc.out}/lib" libColorGearCufr2.so.2.0.0 ) ( @@ -167,17 +167,17 @@ stdenv.mkDerivation rec { ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so.1 - patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64:$out/lib" libcanonufr2r.so.1.0.0 - patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" libcaepcmufr2.so.1.0 - patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" libColorGearCufr2.so.2.0.0 + patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64:$out/lib" libcanonufr2r.so.1.0.0 + patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" libcaepcmufr2.so.1.0 + patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" libColorGearCufr2.so.2.0.0 ) ( cd $out/bin - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" cnsetuputil2 - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" cnpdfdrv - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64:$out/lib" cnpkbidir - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64:$out/lib" cnrsdrvufr2 + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" cnsetuputil2 + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" cnpdfdrv + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64:$out/lib" cnpkbidir + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64:$out/lib" cnrsdrvufr2 mv cnsetuputil2 cnsetuputil2.wrapped echo "#!${runtimeShell} -e" > cnsetuputil2 diff --git a/pkgs/misc/cups/drivers/hl1110/default.nix b/pkgs/misc/cups/drivers/hl1110/default.nix index 768256e816a4..8ab137a818ed 100644 --- a/pkgs/misc/cups/drivers/hl1110/default.nix +++ b/pkgs/misc/cups/drivers/hl1110/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk}: +{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk, glibc }: let version = "3.0.1-1"; @@ -38,9 +38,9 @@ stdenv.mkDerivation { sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/HL1110/lpd/psconvert2 - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/brprintconflsr3 - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/rawtobr3 - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/inf/braddprinter + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/brprintconflsr3 + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/rawtobr3 + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/inf/braddprinter wrapProgram $out/opt/brother/Printers/HL1110/lpd/psconvert2 \ --prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] } diff --git a/pkgs/misc/cups/drivers/hl3140cw/default.nix b/pkgs/misc/cups/drivers/hl3140cw/default.nix index fc6a06535ebe..c977558c956d 100644 --- a/pkgs/misc/cups/drivers/hl3140cw/default.nix +++ b/pkgs/misc/cups/drivers/hl3140cw/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk}: +{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk, glibc}: let version = "1.1.4-0"; @@ -41,8 +41,8 @@ stdenv.mkDerivation { sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/hl3140cw/lpd/psconvertij2 - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/hl3140cw/lpd/brhl3140cwfilter - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_hl3140cw + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/hl3140cw/lpd/brhl3140cwfilter + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_hl3140cw wrapProgram $out/opt/brother/Printers/hl3140cw/lpd/psconvertij2 \ --prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] } diff --git a/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix index b2dbd0ca77ab..47efdfe6f181 100644 --- a/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cups, dpkg, ghostscript, a2ps, coreutils, gnused, gawk, file, makeWrapper }: +{ lib, stdenv, fetchurl, cups, dpkg, ghostscript, a2ps, coreutils, gnused, gawk, file, makeWrapper, glibc }: stdenv.mkDerivation rec { pname = "mfcj470dw-cupswrapper"; @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter mkdir -p $out/lib/cups/filter/ ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw diff --git a/pkgs/os-specific/linux/mwprocapture/default.nix b/pkgs/os-specific/linux/mwprocapture/default.nix index 0de982c3d5ee..149207aff448 100644 --- a/pkgs/os-specific/linux/mwprocapture/default.nix +++ b/pkgs/os-specific/linux/mwprocapture/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, kernel, alsa-lib }: +{ lib, stdenv, fetchurl, kernel, alsa-lib, glibc }: with lib; @@ -7,7 +7,7 @@ let if stdenv.is64bit then "64" else "32"; - libpath = makeLibraryPath [ stdenv.cc.cc stdenv.glibc alsa-lib ]; + libpath = makeLibraryPath [ stdenv.cc.cc glibc alsa-lib ]; in stdenv.mkDerivation rec { diff --git a/pkgs/os-specific/linux/sgx/ssl/default.nix b/pkgs/os-specific/linux/sgx/ssl/default.nix index 6b83515ff13c..f14355be1c8f 100644 --- a/pkgs/os-specific/linux/sgx/ssl/default.nix +++ b/pkgs/os-specific/linux/sgx/ssl/default.nix @@ -1,4 +1,5 @@ { stdenv +, glibc , fetchFromGitHub , fetchpatch , fetchurl @@ -53,7 +54,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl sgx-sdk - stdenv.glibc + glibc which ]; diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index e11b6efb59c4..93184c4fc07c 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -69,7 +69,7 @@ rec { })); } // lib.optionalAttrs (stdenv0.hostPlatform.libc == "libc") { extraBuildInputs = (old.extraBuildInputs or []) ++ [ - stdenv0.glibc.static + pkgs.glibc.static ]; }); @@ -119,7 +119,7 @@ rec { ++ lib.optional (!stdenv.hostPlatform.isDarwin) makeStaticBinaries # Glibc doesn’t come with static runtimes by default. - # ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ((lib.flip overrideInStdenv) [ self.stdenv.glibc.static ]) + # ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ((lib.flip overrideInStdenv) [ self.glibc.static ]) ); diff --git a/pkgs/tools/compression/kzipmix/default.nix b/pkgs/tools/compression/kzipmix/default.nix index 9072a24b7fb5..d0ab75f00618 100644 --- a/pkgs/tools/compression/kzipmix/default.nix +++ b/pkgs/tools/compression/kzipmix/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, glibc }: stdenv.mkDerivation rec { pname = "kzipmix"; @@ -13,8 +13,8 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp amd64/{kzip,zipmix} $out/bin - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/bin/kzip - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/bin/zipmix + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/bin/kzip + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/bin/zipmix ''; meta = with lib; { diff --git a/pkgs/tools/graphics/pngout/default.nix b/pkgs/tools/graphics/pngout/default.nix index b6f19d2390e1..0149ce896149 100644 --- a/pkgs/tools/graphics/pngout/default.nix +++ b/pkgs/tools/graphics/pngout/default.nix @@ -2,6 +2,7 @@ , stdenv , fetchurl , unzip +, glibc }: let @@ -36,7 +37,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp ${platform.folder}/pngout $out/bin '' + lib.optionalString stdenv.isLinux '' - patchelf --set-interpreter ${stdenv.glibc.out}/lib/${platform.ld-linux} $out/bin/pngout + patchelf --set-interpreter ${glibc.out}/lib/${platform.ld-linux} $out/bin/pngout ''; meta = { diff --git a/pkgs/tools/inputmethods/m17n-db/default.nix b/pkgs/tools/inputmethods/m17n-db/default.nix index d24d1b44d862..a7a7df7ee0c3 100644 --- a/pkgs/tools/inputmethods/m17n-db/default.nix +++ b/pkgs/tools/inputmethods/m17n-db/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, gettext, gawk, bash }: +{ lib, stdenv, fetchurl, gettext, gawk, bash, glibc }: stdenv.mkDerivation rec { pname = "m17n-db"; @@ -14,8 +14,7 @@ stdenv.mkDerivation rec { strictDeps = true; - configureFlags = lib.optional (stdenv ? glibc) - "--with-charmaps=${stdenv.glibc.out}/share/i18n/charmaps" + configureFlags = [ "--with-charmaps=${glibc.out}/share/i18n/charmaps" ] ; meta = { diff --git a/pkgs/tools/misc/nbench/default.nix b/pkgs/tools/misc/nbench/default.nix index 744ce314ec4e..34ffcfe2d8a7 100644 --- a/pkgs/tools/misc/nbench/default.nix +++ b/pkgs/tools/misc/nbench/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, glibc }: stdenv.mkDerivation rec { pname = "nbench-byte"; @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { ''; buildInputs = lib.optionals stdenv.hostPlatform.isGnu [ - stdenv.glibc.static + glibc.static ]; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; diff --git a/pkgs/tools/networking/nbd/default.nix b/pkgs/tools/networking/nbd/default.nix index d302e6250950..e0679c089bcd 100644 --- a/pkgs/tools/networking/nbd/default.nix +++ b/pkgs/tools/networking/nbd/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkg-config, glib, which, bison, nixosTests }: +{ lib, stdenv, fetchurl, pkg-config, glib, which, bison, nixosTests, linuxHeaders }: stdenv.mkDerivation rec { pname = "nbd"; @@ -9,8 +9,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-aHcVbSOnsz917uidL1wskcVCr8PNy2Nt6lqIU5pY0Qw="; }; - buildInputs = [ glib ] - ++ lib.optional (stdenv ? glibc) stdenv.glibc.linuxHeaders; + buildInputs = [ glib linuxHeaders ]; nativeBuildInputs = [ pkg-config which bison ]; diff --git a/pkgs/tools/networking/tgt/default.nix b/pkgs/tools/networking/tgt/default.nix index 34f093687605..7e57c8f49011 100644 --- a/pkgs/tools/networking/tgt/default.nix +++ b/pkgs/tools/networking/tgt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl +{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl, glibc , docbook_xsl, coreutils, lsof, rdma-core, makeWrapper, sg3_utils, util-linux }: @@ -29,8 +29,8 @@ stdenv.mkDerivation rec { preConfigure = '' sed -i 's|/usr/bin/||' doc/Makefile sed -i 's|/usr/include/libaio.h|${libaio}/include/libaio.h|' usr/Makefile - sed -i 's|/usr/include/sys/|${stdenv.glibc.dev}/include/sys/|' usr/Makefile - sed -i 's|/usr/include/linux/|${stdenv.glibc.dev}/include/linux/|' usr/Makefile + sed -i 's|/usr/include/sys/|${glibc.dev}/include/sys/|' usr/Makefile + sed -i 's|/usr/include/linux/|${glibc.dev}/include/linux/|' usr/Makefile ''; postInstall = '' diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix index 4987c05f8762..9a6147875da8 100644 --- a/pkgs/tools/package-management/checkinstall/default.nix +++ b/pkgs/tools/package-management/checkinstall/default.nix @@ -1,6 +1,4 @@ -{lib, stdenv, fetchurl, gettext}: - -assert stdenv.isLinux && stdenv ? glibc; +{lib, stdenv, fetchurl, gettext, glibc }: stdenv.mkDerivation rec { pname = "checkinstall"; @@ -54,7 +52,7 @@ stdenv.mkDerivation rec { substituteInPlace checkinstallrc-dist --replace /usr/local $out substituteInPlace installwatch/create-localdecls \ - --replace /usr/include/unistd.h ${stdenv.glibc.dev}/include/unistd.h + --replace /usr/include/unistd.h ${glibc.dev}/include/unistd.h ''; postInstall = diff --git a/pkgs/tools/system/hardinfo/default.nix b/pkgs/tools/system/hardinfo/default.nix index 15c8cbd12f06..828b295813d3 100644 --- a/pkgs/tools/system/hardinfo/default.nix +++ b/pkgs/tools/system/hardinfo/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, which, pkg-config, gtk2, pcre, glib, libxml2 +{ lib, stdenv, fetchurl, which, pkg-config, gtk2, pcre, glib, libxml2, glibc , libsoup ? null }: @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { sed -i -e "s/^CFLAGS = \(.*\)/CFLAGS = \1 -std=gnu89/" Makefile.in substituteInPlace ./arch/linux/common/modules.h --replace /sbin/modinfo modinfo - substituteInPlace ./arch/linux/common/os.h --replace /lib/libc.so.6 ${stdenv.glibc.out}/lib/libc.so.6 + substituteInPlace ./arch/linux/common/os.h --replace /lib/libc.so.6 ${glibc.out}/lib/libc.so.6 ''; # Makefile supports DESTDIR but not PREFIX (it hardcodes $DESTDIR/usr/). From 09250ba91ff60c11fa4f2c553a48c562dbc0ca1a Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 11 May 2022 00:52:26 +0300 Subject: [PATCH 3/4] treewide: change some glibc to stdenv.cc.libc (cherry picked from commit c1fffdfffb43b07ce09b14da0af9a856e1e8566e) --- doc/stdenv/multiple-output.chapter.md | 2 +- pkgs/applications/audio/baudline/default.nix | 4 ++-- pkgs/applications/audio/yoshimi/default.nix | 3 +-- .../editors/eclipse/build-eclipse.nix | 4 ++-- pkgs/applications/editors/jetbrains/linux.nix | 4 ++-- .../extensions/cpptools/missing_elf_deps.sh | 2 +- .../sane/backends/brscan4/default.nix | 4 ++-- .../sane/backends/brscan5/default.nix | 4 ++-- .../networking/spideroak/default.nix | 4 ++-- .../science/math/cplex/default.nix | 4 ++-- .../science/math/hmetis/default.nix | 6 +++--- .../virtualization/virtualbox/default.nix | 6 +++--- pkgs/build-support/vm/default.nix | 8 +++---- .../compilers/nvidia-cg-toolkit/default.nix | 4 ++-- pkgs/development/mobile/androidenv/cmake.nix | 2 +- pkgs/development/node-packages/overrides.nix | 2 +- .../python-modules/monotonic/default.nix | 3 +-- .../development/tools/eclipse-mat/default.nix | 3 +-- pkgs/development/tools/iaca/2.1.nix | 4 ++-- pkgs/development/tools/iaca/3.0.nix | 4 ++-- pkgs/games/planetaryannihilation/default.nix | 8 +++---- pkgs/games/ue4demos/default.nix | 4 ++-- .../misc/cups/drivers/brgenml1lpr/default.nix | 6 +++--- pkgs/misc/cups/drivers/canon/default.nix | 21 +++++++++---------- pkgs/misc/cups/drivers/hl1110/default.nix | 8 +++---- pkgs/misc/cups/drivers/hl3140cw/default.nix | 6 +++--- .../cups/drivers/mfcj470dwlpr/default.nix | 4 ++-- .../linux/mwprocapture/default.nix | 4 ++-- pkgs/os-specific/linux/sgx/ssl/default.nix | 3 +-- pkgs/tools/compression/kzipmix/default.nix | 6 +++--- pkgs/tools/graphics/pngout/default.nix | 3 +-- pkgs/tools/inputmethods/m17n-db/default.nix | 4 ++-- pkgs/tools/misc/nbench/default.nix | 4 ++-- pkgs/tools/networking/tgt/default.nix | 6 +++--- .../checkinstall/default.nix | 4 ++-- pkgs/tools/system/hardinfo/default.nix | 4 ++-- 36 files changed, 83 insertions(+), 89 deletions(-) diff --git a/doc/stdenv/multiple-output.chapter.md b/doc/stdenv/multiple-output.chapter.md index a8c96a25b7be..65156816b991 100644 --- a/doc/stdenv/multiple-output.chapter.md +++ b/doc/stdenv/multiple-output.chapter.md @@ -77,7 +77,7 @@ There is a special handling of the `debug` output, described at [](#stdenv-separ A commonly adopted convention in `nixpkgs` is that executables provided by the package are contained within its first output. This convention allows the dependent packages to reference the executables provided by packages in a uniform manner. For instance, provided with the knowledge that the `perl` package contains a `perl` executable it can be referenced as `${pkgs.perl}/bin/perl` within a Nix derivation that needs to execute a Perl script. -The `glibc` package is a deliberate single exception to the “binaries first” convention. The `glibc` has `libs` as its first output allowing the libraries provided by `glibc` to be referenced directly (e.g. `${glibc}/lib/ld-linux-x86-64.so.2`). The executables provided by `glibc` can be accessed via its `bin` attribute (e.g. `${glibc.bin}/bin/ldd`). +The `glibc` package is a deliberate single exception to the “binaries first” convention. The `glibc` has `libs` as its first output allowing the libraries provided by `glibc` to be referenced directly (e.g. `${glibc}/lib/ld-linux-x86-64.so.2`). The executables provided by `glibc` can be accessed via its `bin` attribute (e.g. `${lib.getBin stdenv.cc.libc}/bin/ldd`). The reason for why `glibc` deviates from the convention is because referencing a library provided by `glibc` is a very common operation among Nix packages. For instance, third-party executables packaged by Nix are typically patched and relinked with the relevant version of `glibc` libraries from Nix packages (please see the documentation on [patchelf](https://github.com/NixOS/patchelf) for more details). diff --git a/pkgs/applications/audio/baudline/default.nix b/pkgs/applications/audio/baudline/default.nix index ab88642e6bc2..b2a74e23dc5e 100644 --- a/pkgs/applications/audio/baudline/default.nix +++ b/pkgs/applications/audio/baudline/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, libXmu, libXt, libX11, libXext, libXxf86vm, libjack2 -, makeWrapper, glibc +, makeWrapper }: let @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { cp -r . "$out/libexec/baudline/" - interpreter="$(echo ${glibc.out}/lib/ld-linux*)" + interpreter="$(echo ${stdenv.cc.libc}/lib/ld-linux*)" for prog in "$out"/libexec/baudline/baudline*; do patchelf --interpreter "$interpreter" "$prog" ln -sr "$prog" "$out/bin/" diff --git a/pkgs/applications/audio/yoshimi/default.nix b/pkgs/applications/audio/yoshimi/default.nix index e6fbada15d28..1f47a456c949 100644 --- a/pkgs/applications/audio/yoshimi/default.nix +++ b/pkgs/applications/audio/yoshimi/default.nix @@ -1,5 +1,4 @@ { lib -, glibc , stdenv , fetchFromGitHub , alsa-lib @@ -59,7 +58,7 @@ stdenv.mkDerivation rec { zlib ]; - cmakeFlags = [ "-DFLTK_MATH_LIBRARY=${glibc.out}/lib/libm.so" ]; + cmakeFlags = [ "-DFLTK_MATH_LIBRARY=${stdenv.cc.libc}/lib/libm.so" ]; meta = with lib; { description = "High quality software synthesizer based on ZynAddSubFX"; diff --git a/pkgs/applications/editors/eclipse/build-eclipse.nix b/pkgs/applications/editors/eclipse/build-eclipse.nix index c9bb8168995f..39b94664f047 100644 --- a/pkgs/applications/editors/eclipse/build-eclipse.nix +++ b/pkgs/applications/editors/eclipse/build-eclipse.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender, glibc +{ lib, stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender , zlib, jdk, glib, glib-networking, gtk, libXtst, libsecret, gsettings-desktop-schemas, webkitgtk , makeWrapper, perl, ... }: @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { tar xfvz $src -C $out # Patch binaries. - interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2) libCairo=$out/eclipse/libcairo-swt.so patchelf --set-interpreter $interpreter $out/eclipse/eclipse [ -f $libCairo ] && patchelf --set-rpath ${lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]} $libCairo diff --git a/pkgs/applications/editors/jetbrains/linux.nix b/pkgs/applications/editors/jetbrains/linux.nix index 9cc94a6484c9..3f77f3fae5b1 100644 --- a/pkgs/applications/editors/jetbrains/linux.nix +++ b/pkgs/applications/editors/jetbrains/linux.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, makeDesktopItem, makeWrapper, patchelf, writeText, glibc +{ stdenv, lib, makeDesktopItem, makeWrapper, patchelf, writeText , coreutils, gnugrep, which, git, unzip, libsecret, libnotify, e2fsprogs , vmopts ? null }: @@ -46,7 +46,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec { truncate --size=$size $fname } - interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2) if [[ "${stdenv.hostPlatform.system}" == "x86_64-linux" && -e bin/fsnotifier64 ]]; then target_size=$(get_file_size bin/fsnotifier64) patchelf --set-interpreter "$interpreter" bin/fsnotifier64 diff --git a/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh b/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh index 7f1f08ca0f3b..e282e126f83b 100755 --- a/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh +++ b/pkgs/applications/editors/vscode/extensions/cpptools/missing_elf_deps.sh @@ -11,7 +11,7 @@ function get_pkg_out() { echo "$(nix-build -E "$nixExp" --no-out-link)${suffix}" } -interpreter="$(get_pkg_out "glibc" "/lib/ld-linux-x86-64.so.2")" +interpreter="$(get_pkg_out "stdenv.cc.libc" "/lib/ld-linux-x86-64.so.2")" echo "interpreter='$interpreter'" # For clangformat dep on 'libtinfo.so.5'. diff --git a/pkgs/applications/graphics/sane/backends/brscan4/default.nix b/pkgs/applications/graphics/sane/backends/brscan4/default.nix index b203f0c3dbc6..ea70224a932a 100644 --- a/pkgs/applications/graphics/sane/backends/brscan4/default.nix +++ b/pkgs/applications/graphics/sane/backends/brscan4/default.nix @@ -1,8 +1,8 @@ -{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb-compat-0_1, glibc }: +{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb-compat-0_1 }: let myPatchElf = file: with lib; '' patchelf --set-interpreter \ - ${glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${stdenv.cc.libc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; diff --git a/pkgs/applications/graphics/sane/backends/brscan5/default.nix b/pkgs/applications/graphics/sane/backends/brscan5/default.nix index 4afc5ac40a26..4d276bd57bc3 100644 --- a/pkgs/applications/graphics/sane/backends/brscan5/default.nix +++ b/pkgs/applications/graphics/sane/backends/brscan5/default.nix @@ -1,8 +1,8 @@ -{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb1, avahi-compat, glib, libredirect, nixosTests, glibc }: +{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb1, avahi-compat, glib, libredirect, nixosTests }: let myPatchElf = file: with lib; '' patchelf --set-interpreter \ - ${glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${stdenv.cc.libc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; system = stdenv.hostPlatform.system; diff --git a/pkgs/applications/networking/spideroak/default.nix b/pkgs/applications/networking/spideroak/default.nix index 3543a979fb34..8c0fdfa3b9a7 100644 --- a/pkgs/applications/networking/spideroak/default.nix +++ b/pkgs/applications/networking/spideroak/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, makeWrapper, patchelf, glibc +{ lib, stdenv, fetchurl, makeWrapper, patchelf , fontconfig, freetype, glib, libICE, libSM , libX11, libXext, libXrender, zlib }: @@ -37,7 +37,7 @@ in stdenv.mkDerivation { rm -f $out/opt/SpiderOakONE/lib/libz* - patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 \ + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 \ "$out/opt/SpiderOakONE/lib/SpiderOakONE" RPATH=$out/opt/SpiderOakONE/lib:${ldpath} diff --git a/pkgs/applications/science/math/cplex/default.nix b/pkgs/applications/science/math/cplex/default.nix index f3caa037b35e..a570e7e9c6d1 100644 --- a/pkgs/applications/science/math/cplex/default.nix +++ b/pkgs/applications/science/math/cplex/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, makeWrapper, openjdk, gtk2, xorg, glibc, glibcLocales, releasePath ? null }: +{ lib, stdenv, makeWrapper, openjdk, gtk2, xorg, glibcLocales, releasePath ? null }: # To use this package, you need to download your own cplex installer from IBM # and override the releasePath attribute to point to the location of the file. @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { let libraryPath = lib.makeLibraryPath [ stdenv.cc.cc gtk2 xorg.libXtst ]; in '' - interpreter=${glibc}/lib/ld-linux-x86-64.so.2 + interpreter=${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 for pgm in $out/opl/bin/x86-64_linux/oplrun $out/opl/bin/x86-64_linux/oplrunjava $out/opl/oplide/oplide; do diff --git a/pkgs/applications/science/math/hmetis/default.nix b/pkgs/applications/science/math/hmetis/default.nix index e97b81daedda..762216a97a44 100644 --- a/pkgs/applications/science/math/hmetis/default.nix +++ b/pkgs/applications/science/math/hmetis/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, ghostscript, glibc }: +{ lib, stdenv, fetchurl, ghostscript }: stdenv.mkDerivation rec { pname = "hmetis"; @@ -16,8 +16,8 @@ stdenv.mkDerivation rec { patchPhase = '' for binaryfile in $binaryFiles; do patchelf \ - --set-interpreter ${glibc}/lib/ld-linux.so.2 \ - --set-rpath ${glibc}/lib \ + --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 \ + --set-rpath ${stdenv.cc.libc}/lib \ $binaryfile done ''; diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 2cc0e30f2b98..a89876aeaabf 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -1,5 +1,5 @@ { config, stdenv, fetchurl, lib, acpica-tools, dev86, pam, libxslt, libxml2, wrapQtAppsHook -, libX11, xorgproto, libXext, libXcursor, libXmu, libIDL, SDL, libcap, libGL, glibc +, libX11, xorgproto, libXext, libXcursor, libXmu, libIDL, SDL, libcap, libGL , libpng, glib, lvm2, libXrandr, libXinerama, libopus, qtbase, qtx11extras , qttools, qtsvg, qtwayland, pkg-config, which, docbook_xsl, docbook_xml_dtd_43 , alsa-lib, curl, libvpx, nettools, dbus, substituteAll, gsoap, zlib @@ -62,8 +62,8 @@ in stdenv.mkDerivation { ${optionalString (!headless) '' -e 's@TOOLQT5BIN=.*@TOOLQT5BIN="${getDev qtbase}/bin"@' \ ''} -i configure - ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 - ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 + ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 + ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 grep 'libpulse\.so\.0' src include -rI --files-with-match | xargs sed -i -e ' ${optionalString pulseSupport diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 56091dee8f68..06e1deb47845 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -35,10 +35,10 @@ rec { mkdir -p $out/lib # Copy what we need from Glibc. - cp -p ${pkgs.glibc.out}/lib/ld-linux*.so.? $out/lib - cp -p ${pkgs.glibc.out}/lib/libc.so.* $out/lib - cp -p ${pkgs.glibc.out}/lib/libm.so.* $out/lib - cp -p ${pkgs.glibc.out}/lib/libresolv.so.* $out/lib + cp -p ${pkgs.stdenv.cc.libc}/lib/ld-linux*.so.? $out/lib + cp -p ${pkgs.stdenv.cc.libc}/lib/libc.so.* $out/lib + cp -p ${pkgs.stdenv.cc.libc}/lib/libm.so.* $out/lib + cp -p ${pkgs.stdenv.cc.libc}/lib/libresolv.so.* $out/lib # Copy BusyBox. cp -pd ${pkgs.busybox}/bin/* $out/bin diff --git a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix index 0dbecf6ffa42..d6d4fdd44810 100644 --- a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix +++ b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, glibc }: +{ lib, stdenv, fetchurl }: stdenv.mkDerivation rec { version = "3.1"; @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { installPhase = '' for b in cgc cgfxcat cginfo do - patchelf --set-interpreter ${glibc.out}/lib/ld-linux*.so.? "bin/$b" + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux*.so.? "bin/$b" done # FIXME: cgfxcat and cginfo need more patchelf mkdir -p "$out/bin/" diff --git a/pkgs/development/mobile/androidenv/cmake.nix b/pkgs/development/mobile/androidenv/cmake.nix index 234862ce8212..a284457a7de6 100644 --- a/pkgs/development/mobile/androidenv/cmake.nix +++ b/pkgs/development/mobile/androidenv/cmake.nix @@ -3,7 +3,7 @@ deployAndroidPackage { inherit package os; nativeBuildInputs = [ autoPatchelfHook ]; - buildInputs = lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.ncurses5 ]; + buildInputs = lib.optional (os == "linux") [ pkgs.stdenv.cc.libc pkgs.stdenv.cc.cc pkgs.ncurses5 ]; patchInstructions = lib.optionalString (os == "linux") '' autoPatchelf $packageBaseDir/bin ''; diff --git a/pkgs/development/node-packages/overrides.nix b/pkgs/development/node-packages/overrides.nix index 7ddb3448601f..f5803b87c803 100644 --- a/pkgs/development/node-packages/overrides.nix +++ b/pkgs/development/node-packages/overrides.nix @@ -202,7 +202,7 @@ final: prev: { wrapProgram "$out/bin/makam" --prefix PATH : ${lib.makeBinPath [ nodejs ]} ${ if stdenv.isLinux - then "patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 \"$out/lib/node_modules/makam/makam-bin-linux64\"" + then "patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 \"$out/lib/node_modules/makam/makam-bin-linux64\"" else "" } ''; diff --git a/pkgs/development/python-modules/monotonic/default.nix b/pkgs/development/python-modules/monotonic/default.nix index a2271a595815..512e86b0d2e4 100644 --- a/pkgs/development/python-modules/monotonic/default.nix +++ b/pkgs/development/python-modules/monotonic/default.nix @@ -1,7 +1,6 @@ { lib, stdenv , buildPythonPackage , fetchPypi -, glibc }: buildPythonPackage rec { @@ -17,7 +16,7 @@ buildPythonPackage rec { patchPhase = lib.optionalString stdenv.isLinux '' substituteInPlace monotonic.py --replace \ - "ctypes.util.find_library('c')" "'${glibc.out}/lib/libc.so.6'" + "ctypes.util.find_library('c')" "'${stdenv.cc.libc}/lib/libc.so'" ''; meta = with lib; { diff --git a/pkgs/development/tools/eclipse-mat/default.nix b/pkgs/development/tools/eclipse-mat/default.nix index 5ba2a2fccb99..647e5200a3dc 100644 --- a/pkgs/development/tools/eclipse-mat/default.nix +++ b/pkgs/development/tools/eclipse-mat/default.nix @@ -1,5 +1,4 @@ { fetchurl -, glibc , fontconfig , freetype , glib @@ -58,7 +57,7 @@ stdenv.mkDerivation rec { mv mat $out # Patch binaries. - interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2) libCairo=$out/eclipse/libcairo-swt.so patchelf --set-interpreter $interpreter $out/mat/MemoryAnalyzer [ -f $libCairo ] && patchelf --set-rpath ${ diff --git a/pkgs/development/tools/iaca/2.1.nix b/pkgs/development/tools/iaca/2.1.nix index 3d59ab33381f..1b64b2a5302d 100644 --- a/pkgs/development/tools/iaca/2.1.nix +++ b/pkgs/development/tools/iaca/2.1.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, makeWrapper, requireFile, gcc, unzip, glibc }: +{ lib, stdenv, makeWrapper, requireFile, gcc, unzip }: with lib; # v2.1: last version with NHM/WSM arch support @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { ''; preFixup = let libPath = makeLibraryPath [ stdenv.cc.cc.lib gcc ]; in '' patchelf \ - --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 \ + --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 \ --set-rpath $out/lib:"${libPath}" \ $out/bin/iaca ''; diff --git a/pkgs/development/tools/iaca/3.0.nix b/pkgs/development/tools/iaca/3.0.nix index ab3a2f57db3f..d5a8f8aece44 100644 --- a/pkgs/development/tools/iaca/3.0.nix +++ b/pkgs/development/tools/iaca/3.0.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, requireFile, unzip, glibc }: +{ lib, stdenv, requireFile, unzip }: with lib; stdenv.mkDerivation rec { @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin cp iaca $out/bin - patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 $out/bin/iaca + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $out/bin/iaca ''; meta = { description = "Intel Architecture Code Analyzer"; diff --git a/pkgs/games/planetaryannihilation/default.nix b/pkgs/games/planetaryannihilation/default.nix index 6c337328669d..73adffab475a 100644 --- a/pkgs/games/planetaryannihilation/default.nix +++ b/pkgs/games/planetaryannihilation/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, glibc, config, fetchurl, patchelf, makeWrapper, gtk2, glib, udev, alsa-lib, atk +{ lib, stdenv, config, fetchurl, patchelf, makeWrapper, gtk2, glib, udev, alsa-lib, atk , nspr, fontconfig, cairo, pango, nss, freetype, gnome2, gdk-pixbuf, curl, systemd, xorg, requireFile }: stdenv.mkDerivation rec { @@ -23,12 +23,12 @@ stdenv.mkDerivation rec { ln -s ${systemd}/lib/libudev.so.1 $out/lib/libudev.so.0 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/PA" - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib xorg.libXdamage xorg.libXfixes gtk2 glib glibc.out "$out" xorg.libXext pango udev xorg.libX11 xorg.libXcomposite alsa-lib atk nspr fontconfig cairo pango nss freetype gnome2.GConf gdk-pixbuf xorg.libXrender ]}:{stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" "$out/host/CoherentUI_Host" + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib xorg.libXdamage xorg.libXfixes gtk2 glib stdenv.cc.libc "$out" xorg.libXext pango udev xorg.libX11 xorg.libXcomposite alsa-lib atk nspr fontconfig cairo pango nss freetype gnome2.GConf gdk-pixbuf xorg.libXrender ]}:{stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" "$out/host/CoherentUI_Host" - wrapProgram $out/PA --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib glibc.out xorg.libX11 xorg.libXcursor gtk2 glib curl "$out" ]}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" + wrapProgram $out/PA --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib stdenv.cc.libc xorg.libX11 xorg.libXcursor gtk2 glib curl "$out" ]}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" for f in $out/lib/*; do - patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib curl xorg.libX11 glibc.out xorg.libXcursor "$out" ]}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" $f + patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib curl xorg.libX11 stdenv.cc.libc xorg.libXcursor "$out" ]}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" $f done ''; diff --git a/pkgs/games/ue4demos/default.nix b/pkgs/games/ue4demos/default.nix index 34ea4726ce2f..ce3f3ad38f8d 100644 --- a/pkgs/games/ue4demos/default.nix +++ b/pkgs/games/ue4demos/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, unzip, patchelf, xorg, openal, glibc }: +{ lib, stdenv, fetchurl, unzip, patchelf, xorg, openal }: let urls = file: @@ -24,7 +24,7 @@ let cd $out unzip $src - interpreter=$(echo ${glibc.out}/lib/ld-linux*.so.2) + interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2) binary=$(find . -executable -type f) patchelf \ --set-interpreter $interpreter \ diff --git a/pkgs/misc/cups/drivers/brgenml1lpr/default.nix b/pkgs/misc/cups/drivers/brgenml1lpr/default.nix index 385c1df92f37..4fb2995ee3bc 100644 --- a/pkgs/misc/cups/drivers/brgenml1lpr/default.nix +++ b/pkgs/misc/cups/drivers/brgenml1lpr/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cups, perl, glibc, ghostscript, which, makeWrapper}: +{ lib, stdenv, fetchurl, cups, perl, ghostscript, which, makeWrapper}: /* [Setup instructions](http://support.brother.com/g/s/id/linux/en/instruction_prn1a.html). @@ -30,7 +30,7 @@ let myPatchElf = file: with lib; '' patchelf --set-interpreter \ - ${glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${stdenv.cc.libc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; in @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ cups perl glibc ghostscript which ]; + buildInputs = [ cups perl stdenv.cc.libc ghostscript which ]; dontBuild = true; diff --git a/pkgs/misc/cups/drivers/canon/default.nix b/pkgs/misc/cups/drivers/canon/default.nix index d9981cee95f4..e313b3a6ec25 100644 --- a/pkgs/misc/cups/drivers/canon/default.nix +++ b/pkgs/misc/cups/drivers/canon/default.nix @@ -23,7 +23,6 @@ , ghostscript , pkgs , pkgsi686Linux -, glibc , zlib }: @@ -151,9 +150,9 @@ stdenv.mkDerivation rec { ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so.1 - patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.glibc.out}/lib:${pkgsi686Linux.libxml2.out}/lib:$out/lib32" libcanonufr2r.so.1.0.0 - patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.glibc.out}/lib" libcaepcmufr2.so.1.0 - patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.glibc.out}/lib" libColorGearCufr2.so.2.0.0 + patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.stdenv.cc.libc}/lib:${pkgsi686Linux.libxml2.out}/lib:$out/lib32" libcanonufr2r.so.1.0.0 + patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.stdenv.cc.libc}/lib" libcaepcmufr2.so.1.0 + patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.stdenv.cc.libc}/lib" libColorGearCufr2.so.2.0.0 ) ( @@ -167,17 +166,17 @@ stdenv.mkDerivation rec { ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so.1 - patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64:$out/lib" libcanonufr2r.so.1.0.0 - patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" libcaepcmufr2.so.1.0 - patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" libColorGearCufr2.so.2.0.0 + patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" libcanonufr2r.so.1.0.0 + patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" libcaepcmufr2.so.1.0 + patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" libColorGearCufr2.so.2.0.0 ) ( cd $out/bin - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" cnsetuputil2 - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64" cnpdfdrv - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64:$out/lib" cnpkbidir - patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${glibc.out}/lib64:$out/lib" cnrsdrvufr2 + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" cnsetuputil2 + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" cnpdfdrv + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" cnpkbidir + patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" cnrsdrvufr2 mv cnsetuputil2 cnsetuputil2.wrapped echo "#!${runtimeShell} -e" > cnsetuputil2 diff --git a/pkgs/misc/cups/drivers/hl1110/default.nix b/pkgs/misc/cups/drivers/hl1110/default.nix index 8ab137a818ed..75bf92365059 100644 --- a/pkgs/misc/cups/drivers/hl1110/default.nix +++ b/pkgs/misc/cups/drivers/hl1110/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk, glibc }: +{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk }: let version = "3.0.1-1"; @@ -38,9 +38,9 @@ stdenv.mkDerivation { sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/HL1110/lpd/psconvert2 - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/brprintconflsr3 - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/rawtobr3 - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/inf/braddprinter + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/brprintconflsr3 + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/rawtobr3 + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/inf/braddprinter wrapProgram $out/opt/brother/Printers/HL1110/lpd/psconvert2 \ --prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] } diff --git a/pkgs/misc/cups/drivers/hl3140cw/default.nix b/pkgs/misc/cups/drivers/hl3140cw/default.nix index c977558c956d..2f90f83da1f4 100644 --- a/pkgs/misc/cups/drivers/hl3140cw/default.nix +++ b/pkgs/misc/cups/drivers/hl3140cw/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk, glibc}: +{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk }: let version = "1.1.4-0"; @@ -41,8 +41,8 @@ stdenv.mkDerivation { sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/hl3140cw/lpd/psconvertij2 - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/hl3140cw/lpd/brhl3140cwfilter - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_hl3140cw + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/hl3140cw/lpd/brhl3140cwfilter + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_hl3140cw wrapProgram $out/opt/brother/Printers/hl3140cw/lpd/psconvertij2 \ --prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] } diff --git a/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix index 47efdfe6f181..fdc88a36d29c 100644 --- a/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cups, dpkg, ghostscript, a2ps, coreutils, gnused, gawk, file, makeWrapper, glibc }: +{ lib, stdenv, fetchurl, cups, dpkg, ghostscript, a2ps, coreutils, gnused, gawk, file, makeWrapper }: stdenv.mkDerivation rec { pname = "mfcj470dw-cupswrapper"; @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter mkdir -p $out/lib/cups/filter/ ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw diff --git a/pkgs/os-specific/linux/mwprocapture/default.nix b/pkgs/os-specific/linux/mwprocapture/default.nix index 149207aff448..8a04386a7186 100644 --- a/pkgs/os-specific/linux/mwprocapture/default.nix +++ b/pkgs/os-specific/linux/mwprocapture/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, kernel, alsa-lib, glibc }: +{ lib, stdenv, fetchurl, kernel, alsa-lib }: with lib; @@ -7,7 +7,7 @@ let if stdenv.is64bit then "64" else "32"; - libpath = makeLibraryPath [ stdenv.cc.cc glibc alsa-lib ]; + libpath = makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc alsa-lib ]; in stdenv.mkDerivation rec { diff --git a/pkgs/os-specific/linux/sgx/ssl/default.nix b/pkgs/os-specific/linux/sgx/ssl/default.nix index f14355be1c8f..f3f6ce485063 100644 --- a/pkgs/os-specific/linux/sgx/ssl/default.nix +++ b/pkgs/os-specific/linux/sgx/ssl/default.nix @@ -1,5 +1,4 @@ { stdenv -, glibc , fetchFromGitHub , fetchpatch , fetchurl @@ -54,7 +53,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl sgx-sdk - glibc + stdenv.cc.libc which ]; diff --git a/pkgs/tools/compression/kzipmix/default.nix b/pkgs/tools/compression/kzipmix/default.nix index d0ab75f00618..4bfc39e87186 100644 --- a/pkgs/tools/compression/kzipmix/default.nix +++ b/pkgs/tools/compression/kzipmix/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, glibc }: +{ lib, stdenv, fetchurl }: stdenv.mkDerivation rec { pname = "kzipmix"; @@ -13,8 +13,8 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp amd64/{kzip,zipmix} $out/bin - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/bin/kzip - patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 $out/bin/zipmix + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/bin/kzip + patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/bin/zipmix ''; meta = with lib; { diff --git a/pkgs/tools/graphics/pngout/default.nix b/pkgs/tools/graphics/pngout/default.nix index 0149ce896149..02f3930a09c8 100644 --- a/pkgs/tools/graphics/pngout/default.nix +++ b/pkgs/tools/graphics/pngout/default.nix @@ -2,7 +2,6 @@ , stdenv , fetchurl , unzip -, glibc }: let @@ -37,7 +36,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp ${platform.folder}/pngout $out/bin '' + lib.optionalString stdenv.isLinux '' - patchelf --set-interpreter ${glibc.out}/lib/${platform.ld-linux} $out/bin/pngout + patchelf --set-interpreter ${stdenv.cc.libc}/lib/${platform.ld-linux} $out/bin/pngout ''; meta = { diff --git a/pkgs/tools/inputmethods/m17n-db/default.nix b/pkgs/tools/inputmethods/m17n-db/default.nix index a7a7df7ee0c3..92a783f46a4b 100644 --- a/pkgs/tools/inputmethods/m17n-db/default.nix +++ b/pkgs/tools/inputmethods/m17n-db/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, gettext, gawk, bash, glibc }: +{ lib, stdenv, fetchurl, gettext, gawk, bash }: stdenv.mkDerivation rec { pname = "m17n-db"; @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { strictDeps = true; - configureFlags = [ "--with-charmaps=${glibc.out}/share/i18n/charmaps" ] + configureFlags = [ "--with-charmaps=${stdenv.cc.libc}/share/i18n/charmaps" ] ; meta = { diff --git a/pkgs/tools/misc/nbench/default.nix b/pkgs/tools/misc/nbench/default.nix index 34ffcfe2d8a7..0ce1d66cf214 100644 --- a/pkgs/tools/misc/nbench/default.nix +++ b/pkgs/tools/misc/nbench/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, glibc }: +{ lib, stdenv, fetchurl }: stdenv.mkDerivation rec { pname = "nbench-byte"; @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { ''; buildInputs = lib.optionals stdenv.hostPlatform.isGnu [ - glibc.static + stdenv.cc.libc.static ]; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; diff --git a/pkgs/tools/networking/tgt/default.nix b/pkgs/tools/networking/tgt/default.nix index 7e57c8f49011..85c981c5c105 100644 --- a/pkgs/tools/networking/tgt/default.nix +++ b/pkgs/tools/networking/tgt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl, glibc +{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl , docbook_xsl, coreutils, lsof, rdma-core, makeWrapper, sg3_utils, util-linux }: @@ -29,8 +29,8 @@ stdenv.mkDerivation rec { preConfigure = '' sed -i 's|/usr/bin/||' doc/Makefile sed -i 's|/usr/include/libaio.h|${libaio}/include/libaio.h|' usr/Makefile - sed -i 's|/usr/include/sys/|${glibc.dev}/include/sys/|' usr/Makefile - sed -i 's|/usr/include/linux/|${glibc.dev}/include/linux/|' usr/Makefile + sed -i 's|/usr/include/sys/|${stdenv.cc.libc.dev}/include/sys/|' usr/Makefile + sed -i 's|/usr/include/linux/|${stdenv.cc.libc.dev}/include/linux/|' usr/Makefile ''; postInstall = '' diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix index 9a6147875da8..f4bbe75aafc3 100644 --- a/pkgs/tools/package-management/checkinstall/default.nix +++ b/pkgs/tools/package-management/checkinstall/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, gettext, glibc }: +{lib, stdenv, fetchurl, gettext }: stdenv.mkDerivation rec { pname = "checkinstall"; @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { substituteInPlace checkinstallrc-dist --replace /usr/local $out substituteInPlace installwatch/create-localdecls \ - --replace /usr/include/unistd.h ${glibc.dev}/include/unistd.h + --replace /usr/include/unistd.h ${stdenv.cc.libc.dev}/include/unistd.h ''; postInstall = diff --git a/pkgs/tools/system/hardinfo/default.nix b/pkgs/tools/system/hardinfo/default.nix index 828b295813d3..66669b5e850c 100644 --- a/pkgs/tools/system/hardinfo/default.nix +++ b/pkgs/tools/system/hardinfo/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, which, pkg-config, gtk2, pcre, glib, libxml2, glibc +{ lib, stdenv, fetchurl, which, pkg-config, gtk2, pcre, glib, libxml2 , libsoup ? null }: @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { sed -i -e "s/^CFLAGS = \(.*\)/CFLAGS = \1 -std=gnu89/" Makefile.in substituteInPlace ./arch/linux/common/modules.h --replace /sbin/modinfo modinfo - substituteInPlace ./arch/linux/common/os.h --replace /lib/libc.so.6 ${glibc.out}/lib/libc.so.6 + substituteInPlace ./arch/linux/common/os.h --replace /lib/libc.so.6 ${stdenv.cc.libc}/lib/libc.so ''; # Makefile supports DESTDIR but not PREFIX (it hardcodes $DESTDIR/usr/). From 7797c7ece5f7636ea506e08f50642d7b18fd45eb Mon Sep 17 00:00:00 2001 From: Artturin Date: Sun, 29 May 2022 19:25:54 +0300 Subject: [PATCH 4/4] glibc_multi: match output ordering of glibc glibc has an exception in that 'out' is the default output instead of 'bin' it should be matched here for consistency (cherry picked from commit 513b7f1010e737dcac47645c8af3d7483ddc29d4) --- pkgs/development/libraries/glibc/common.nix | 1 + pkgs/development/libraries/glibc/multi.nix | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 91c3d55926a3..4b58da1539d5 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -201,6 +201,7 @@ stdenv.mkDerivation ({ installFlags = [ "sysconfdir=$(out)/etc" ]; + # out as the first output is an exception exclusive to glibc outputs = [ "out" "bin" "dev" "static" ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; diff --git a/pkgs/development/libraries/glibc/multi.nix b/pkgs/development/libraries/glibc/multi.nix index 5d3626b95cc0..be190d77c736 100644 --- a/pkgs/development/libraries/glibc/multi.nix +++ b/pkgs/development/libraries/glibc/multi.nix @@ -6,7 +6,8 @@ let glibc64 = glibc; in runCommand "${nameVersion.name}-multi-${nameVersion.version}" - { outputs = [ "bin" "dev" "out"]; } # TODO: no static version here (yet) + # out as the first output is an exception exclusive to glibc + { outputs = [ "out" "bin" "dev" ]; } # TODO: no static version here (yet) '' mkdir -p "$out/lib" ln -s '${glibc64.out}'/lib/* "$out/lib"