Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search path fixes, v2 #14694

Closed
wants to merge 10 commits into from
26 changes: 12 additions & 14 deletions lib/attrsets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -438,23 +438,21 @@ rec {
overrideExisting = old: new:
old // listToAttrs (map (attr: nameValuePair attr (attrByPath [attr] old.${attr} new)) (attrNames old));

/* Try given attributes in order. If no attributes are found, return
attribute list itself.
/* Get a package output.
If no output is found, fallback to `.out` and then to the default.
Example:
tryAttrs ["a" "b"] { a = 1; b = 2; }
=> 1
tryAttrs ["a" "b"] { c = 3; }
=> { c = 3; }
getOutput "dev" pkgs.openssl
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-dev"
*/
tryAttrs = allAttrs: set:
let tryAttrs_ = attrs:
if attrs == [] then set
else
(let h = head attrs; in
if hasAttr h set then getAttr h set
else tryAttrs_ (tail attrs));
in tryAttrs_ allAttrs;
getOutput = output: pkg:
if pkg.outputUnspecified or false
then pkg.${output} or pkg.out or pkg
else pkg;

getBin = getOutput "bin";
getLib = getOutput "lib";
getDev = getOutput "dev";


/*** deprecated stuff ***/
Expand Down
19 changes: 7 additions & 12 deletions lib/strings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ rec {
makeSearchPath = subDir: packages:
concatStringsSep ":" (map (path: path + "/" + subDir) packages);

/* Construct a Unix-style search path, given trying outputs in order.
/* Construct a Unix-style search path, using given package output.
If no output is found, fallback to `.out` and then to the default.
Example:
makeSearchPathOutputs "bin" ["bin"] [ pkgs.openssl pkgs.zlib ]
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-bin/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin"
makeSearchPathOutput "dev" "bin" [ pkgs.openssl pkgs.zlib ]
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-dev/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin"
*/
makeSearchPathOutputs = subDir: outputs: pkgs:
makeSearchPath subDir (map (pkg: if pkg.outputUnspecified or false then lib.tryAttrs (outputs ++ ["out"]) pkg else pkg) pkgs);
makeSearchPathOutput = output: subDir: pkgs: makeSearchPath subDir (map (lib.getOutput output) pkgs);

/* Construct a library search path (such as RPATH) containing the
libraries for a set of packages
Expand All @@ -108,9 +107,7 @@ rec {
makeLibraryPath [ pkgs.openssl pkgs.zlib ]
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r/lib:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/lib"
*/
makeLibraryPath = pkgs: makeSearchPath "lib"
# try to guess the right output of each pkg
(map (pkg: if pkg.outputUnspecified or false then pkg.lib or (pkg.out or pkg) else pkg) pkgs);
makeLibraryPath = makeSearchPathOutput "lib" "lib";

/* Construct a binary search path (such as $PATH) containing the
binaries for a set of packages.
Expand All @@ -119,8 +116,7 @@ rec {
makeBinPath ["/root" "/usr" "/usr/local"]
=> "/root/bin:/usr/bin:/usr/local/bin"
*/
makeBinPath = pkgs: makeSearchPath "bin"
(map (pkg: if pkg.outputUnspecified or false then pkg.bin or (pkg.out or pkg) else pkg) pkgs);
makeBinPath = makeSearchPathOutput "bin" "bin";


/* Construct a perl search path (such as $PERL5LIB)
Expand All @@ -132,8 +128,7 @@ rec {
makePerlPath [ pkgs.perlPackages.NetSMTP ]
=> "/nix/store/n0m1fk9c960d8wlrs62sncnadygqqc6y-perl-Net-SMTP-1.25/lib/perl5/site_perl"
*/
makePerlPath = pkgs: makeSearchPath "lib/perl5/site_perl"
(map (pkg: if pkg.outputUnspecified or false then pkg.lib or (pkg.out or pkg) else pkg) pkgs);
makePerlPath = makeSearchPathOutput "lib" "lib/perl5/site_perl";

/* Dependening on the boolean `cond', return either the given string
or the empty string. Useful to contatenate against a bigger string.
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/octoprint.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ in
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = [ pluginsEnv ];
environment.PYTHONPATH = makeSearchPathOutputs pkgs.python.sitePackages ["lib"] [ pluginsEnv ];
environment.PYTHONPATH = makeSearchPathOutput "lib" pkgs.python.sitePackages [ pluginsEnv ];

preStart = ''
mkdir -p "${cfg.stateDir}"
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/web-servers/apache-httpd/trac.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ in
globalEnvVars = singleton
{ name = "PYTHONPATH";
value =
makeSearchPathOutputs "lib/${pkgs.python.libPrefix}/site-packages" ["lib"]
makeSearchPathOutput "lib" "lib/${pkgs.python.libPrefix}/site-packages"
[ pkgs.mod_python
pkgs.pythonPackages.trac
pkgs.setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
e = pkgs.enlightenment;
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.enlightenment;
GST_PLUGIN_PATH = lib.makeSearchPathOutputs "lib/gstreamer-1.0" ["lib"] [
GST_PLUGIN_PATH = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" [
pkgs.gst_all_1.gst-plugins-base
pkgs.gst_all_1.gst-plugins-good
pkgs.gst_all_1.gst-plugins-bad
Expand Down
3 changes: 1 addition & 2 deletions nixos/modules/system/activation/activation-script.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ let
'';
});

path = map # outputs TODO?
(pkg: (pkg.bin or (pkg.out or pkg)))
path = map getBin
[ pkgs.coreutils pkgs.gnugrep pkgs.findutils
pkgs.glibc # needed for getent
pkgs.shadow
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/loader/grub/grub.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let
path = (makeBinPath ([
pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.findutils pkgs.diffutils pkgs.btrfs-progs
pkgs.utillinux ] ++ (if cfg.efiSupport && (cfg.version == 2) then [pkgs.efibootmgr ] else [])
)) + ":" + (makeSearchPathOutputs "sbin" ["bin"] [
)) + ":" + (makeSearchPathOutput "bin" "sbin" [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding sbin to search paths is obsolete, since we automatically move sbin/* to bin/.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I saw several places in code where sbin was accounted for. Do we always move it, or are there exceptions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know of a possible reason not to move it. The occurrences are most likely just legacy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that dontMoveSbin is unused in nixpkgs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of looking through all our sbin uses and replace them, but we have too much of them: grep -r 'sbin' | wc -l shows 835 occurrences. I think removing them is out of scope of this PR, although I can remove those that I touched if desired.

Copy link
Member

@vcunat vcunat Apr 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more fitting for a separate mass-replace commit. And I'd still probably leave the automatic sbin -> bin symlinks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought of just removing things like mentions in PATH.

pkgs.mdadm pkgs.utillinux
]);
});
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/systemd-unit-options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ in rec {

path = mkOption {
default = [];
apply = ps: "${makeBinPath ps}:${makeSearchPathOutputs "sbin" ["bin"] ps}";
apply = ps: "${makeBinPath ps}:${makeSearchPathOutput "bin" "sbin" ps}";
description = ''
Packages added to the service's <envar>PATH</envar>
environment variable. Both the <filename>bin</filename>
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/atom/env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let
];

libPathNative = lib.makeLibraryPath packages;
libPath64 = lib.makeSearchPathOutputs "lib64" ["lib"] packages;
libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages;
libPath = "${libPathNative}:${libPath64}";

in { inherit packages libPath; }
2 changes: 1 addition & 1 deletion pkgs/applications/misc/guake/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gconftool-2 --recursive-unset /apps/guake
with lib;

let inputs = [ dbus gtk2 gconf python2 libutempter vte keybinder gnome3.gnome_common ];
pyPath = makeSearchPathOutputs python2.sitePackages ["lib"] (attrVals [ "dbus" "notify" "pyGtkGlade" "pyxdg" ] python2Packages ++ [ gnome2.gnome_python ]);
pyPath = makeSearchPathOutput "lib" python2.sitePackages (attrVals [ "dbus" "notify" "pyGtkGlade" "pyxdg" ] python2Packages ++ [ gnome2.gnome_python ]);
in stdenv.mkDerivation rec {
name = "guake-${version}";
version = "0.8.3";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/roxterm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ in stdenv.mkDerivation rec {
"-I${dbus_libs.lib}/lib/dbus-1.0/include" ];

# Fix up python path so the lockfile library is on it.
PYTHONPATH = stdenv.lib.makeSearchPathOutputs pythonFull.sitePackages ["lib"] [
PYTHONPATH = stdenv.lib.makeSearchPathOutput "lib" pythonFull.sitePackages [
pythonPackages.curses pythonPackages.lockfile
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/browsers/chromium/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let

patchPhase = let
rpaths = [ stdenv.cc.cc ];
mkrpath = p: "${makeSearchPathOutputs "lib64" ["lib"] p}:${makeLibraryPath p}";
mkrpath = p: "${makeSearchPathOutput "lib" "lib64" p}:${makeLibraryPath p}";
in ''
for sofile in PepperFlash/libpepflashplayer.so \
libwidevinecdm.so libwidevinecdmadapter.so; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ stdenv.mkDerivation {
libheimdal
libpulseaudio
systemd
] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [
stdenv.cc.cc
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ in stdenv.mkDerivation rec {
tar xf data.tar.xz
'';

rpath = makeLibraryPath deps + ":" + makeSearchPathOutputs "lib64" ["lib"] deps;
rpath = makeLibraryPath deps + ":" + makeSearchPathOutput "lib" "lib64" deps;
binpath = makeBinPath deps;

installPhase = ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/browsers/opera/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ stdenv.mkDerivation rec {

libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);

preFixup =
''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/browsers/vivaldi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ stdenv.mkDerivation rec {

libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);

buildPhase = ''
echo "Patching Vivaldi binaries"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ stdenv.mkDerivation {
nspr
nss
pango
] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [
stdenv.cc.cc
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/science/math/mathematica/9.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ stdenv.mkDerivation rec {

ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);

phases = "unpackPhase installPhase fixupPhase";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/science/math/mathematica/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ stdenv.mkDerivation rec {

ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);

phases = "unpackPhase installPhase fixupPhase";

Expand Down
44 changes: 22 additions & 22 deletions pkgs/applications/search/recoll/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, bison
{ stdenv, fetchurl, lib, bison
, qt4, xapian, file, python, perl
, djvulibre, groff, libxslt, unzip, poppler_utils, antiword, catdoc, lyx
, libwpd, unrtf, untex
Expand Down Expand Up @@ -26,27 +26,27 @@ stdenv.mkDerivation rec {
# the absolute path to the filtering command.
postInstall = ''
for f in $out/share/recoll/filters/* ; do
substituteInPlace $f --replace antiword ${antiword}/bin/antiword
substituteInPlace $f --replace awk ${gawk}/bin/awk
substituteInPlace $f --replace catppt ${catdoc}/bin/catppt
substituteInPlace $f --replace djvused ${djvulibre.bin}/bin/djvused
substituteInPlace $f --replace djvutxt ${djvulibre.bin}/bin/djvutxt
substituteInPlace $f --replace egrep ${gnugrep}/bin/egrep
substituteInPlace $f --replace groff ${groff}/bin/groff
substituteInPlace $f --replace gunzip ${gzip}/bin/gunzip
substituteInPlace $f --replace iconv ${libiconv.bin or libiconv}/bin/iconv
substituteInPlace $f --replace lyx ${lyx}/bin/lyx
substituteInPlace $f --replace pdftotext ${poppler_utils.out}/bin/pdftotext
substituteInPlace $f --replace pstotext ${ghostscript}/bin/ps2ascii
substituteInPlace $f --replace sed ${gnused}/bin/sed
substituteInPlace $f --replace tar ${gnutar}/bin/tar
substituteInPlace $f --replace unzip ${unzip}/bin/unzip
substituteInPlace $f --replace xls2csv ${catdoc}/bin/xls2csv
substituteInPlace $f --replace xsltproc ${libxslt.bin}/bin/xsltproc
substituteInPlace $f --replace unrtf ${unrtf}/bin/unrtf
substituteInPlace $f --replace untex ${untex}/bin/untex
substituteInPlace $f --replace wpd2html ${libwpd}/bin/wpd2html
substituteInPlace $f --replace /usr/bin/perl ${perl}/bin/perl
substituteInPlace $f --replace antiword ${lib.getBin antiword}/bin/antiword
substituteInPlace $f --replace awk ${lib.getBin gawk}/bin/awk
substituteInPlace $f --replace catppt ${lib.getBin catdoc}/bin/catppt
substituteInPlace $f --replace djvused ${lib.getBin djvulibre}/bin/djvused
substituteInPlace $f --replace djvutxt ${lib.getBin djvulibre}/bin/djvutxt
substituteInPlace $f --replace egrep ${lib.getBin gnugrep}/bin/egrep
substituteInPlace $f --replace groff ${lib.getBin groff}/bin/groff
substituteInPlace $f --replace gunzip ${lib.getBin gzip}/bin/gunzip
substituteInPlace $f --replace iconv ${lib.getBin libiconv}/bin/iconv
substituteInPlace $f --replace lyx ${lib.getBin lyx}/bin/lyx
substituteInPlace $f --replace pdftotext ${lib.getBin poppler_utils}/bin/pdftotext
substituteInPlace $f --replace pstotext ${lib.getBin ghostscript}/bin/ps2ascii
substituteInPlace $f --replace sed ${lib.getBin gnused}/bin/sed
substituteInPlace $f --replace tar ${lib.getBin gnutar}/bin/tar
substituteInPlace $f --replace unzip ${lib.getBin unzip}/bin/unzip
substituteInPlace $f --replace xls2csv ${lib.getBin catdoc}/bin/xls2csv
substituteInPlace $f --replace xsltproc ${lib.getBin libxslt}/bin/xsltproc
substituteInPlace $f --replace unrtf ${lib.getBin unrtf}/bin/unrtf
substituteInPlace $f --replace untex ${lib.getBin untex}/bin/untex
substituteInPlace $f --replace wpd2html ${lib.getBin libwpd}/bin/wpd2html
substituteInPlace $f --replace /usr/bin/perl ${lib.getBin perl}/bin/perl
done
'';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mkDerivation rec {
[ out git bazaar cvs darcs fossil mercurial
monotone rcs src subversion cvs_fast_export ]
);
pythonpath = makeSearchPathOutputs python27.sitePackages ["lib"] (
pythonpath = makeSearchPathOutput "lib" python27.sitePackages (
filter (x: x != null)
[ python27Packages.readline or null python27Packages.hglib or null ]
);
Expand Down
12 changes: 6 additions & 6 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ let
ccVersion = (builtins.parseDrvName cc.name).version;
ccName = (builtins.parseDrvName cc.name).name;

libc_bin = if nativeLibc then null else libc.bin or libc;
libc_dev = if nativeLibc then null else libc.dev or libc;
libc_lib = if nativeLibc then null else libc.out or libc;
cc_solib = cc.lib or cc;
binutils_bin = if nativeTools then "" else binutils.bin or binutils;
libc_bin = if nativeLibc then null else getBin libc;
libc_dev = if nativeLibc then null else getDev libc;
libc_lib = if nativeLibc then null else getLib libc;
cc_solib = getLib cc;
binutils_bin = if nativeTools then "" else getBin binutils;
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
coreutils_bin = if nativeTools then "" else coreutils.bin or coreutils;
coreutils_bin = if nativeTools then "" else getBin coreutils;
in

stdenv.mkDerivation {
Expand Down
12 changes: 6 additions & 6 deletions pkgs/build-support/gcc-wrapper-old/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# stdenv.mkDerivation provides a wrapper that sets up the right environment
# variables so that the compiler and the linker just "work".

{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
{ name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? ""
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
, zlib ? null
}:
Expand Down Expand Up @@ -41,13 +41,13 @@ stdenv.mkDerivation {
addFlags = ./add-flags;

inherit nativeTools nativeLibc nativePrefix gcc;
gcc_lib = gcc.lib or gcc;
gcc_lib = lib.getLib gcc;
libc = if nativeLibc then null else libc;
libc_dev = if nativeLibc then null else libc.dev or libc;
libc_bin = if nativeLibc then null else libc.bin or libc;
binutils = if nativeTools then null else binutils;
libc_dev = if nativeLibc then null else lib.getDev libc;
libc_bin = if nativeLibc then null else lib.getBin libc;
binutils = if nativeTools then null else lib.getBin binutils;
# The wrapper scripts use 'cat', so we may need coreutils
coreutils = if nativeTools then null else coreutils;
coreutils = if nativeTools then null else lib.getBin coreutils;

langC = if nativeTools then true else gcc.langC;
langCC = if nativeTools then true else gcc.langCC;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc-arm-embedded/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ stdenv.mkDerivation {

for f in $(find $out); do
if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 \
--set-rpath $out/lib:${gcc.lib or gcc}/lib:${ncurses.out}/lib \
patchelf --set-interpreter ${getLib glibc}/lib/ld-linux.so.2 \
--set-rpath $out/lib:${getLib gcc}/lib:${ncurses.out}/lib \
"$f" || true
fi
done
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/ghc/6.10.2-binary.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{stdenv, fetchurl, perl, libedit, ncurses, gmp}:
{stdenv, lib, fetchurl, perl, libedit, ncurses, gmp}:

stdenv.mkDerivation rec {
version = "6.10.2";
Expand Down Expand Up @@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
'' else "");

configurePhase = ''
./configure --prefix=$out --with-gmp-libraries=${gmp.out}/lib --with-gmp-includes=${gmp.dev or gmp}/include
./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include
'';

# Stripping combined with patchelf breaks the executables (they die
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/go/1.4.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
# Find the loader dynamically
LOADER="$(find ${libc.out or libc}/lib -name ld-linux\* | head -n 1)"
LOADER="$(find ${lib.getLib libc}/lib -name ld-linux\* | head -n 1)"
# Replace references to the loader
find src/cmd -name asm.c -exec sed -i "s,/lib/ld-linux.*\.so\.[0-9],$LOADER," {} \;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/interpreters/perl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ assert enableThreading -> (stdenv ? glibc);
let

libc = if stdenv.cc.libc or null != null then stdenv.cc.libc else "/usr";
libcInc = libc.dev or libc;
libcLib = libc.out or libc;
libcInc = lib.getDev libc;
libcLib = lib.getLib libc;
common = { version, sha256 }: stdenv.mkDerivation rec {
name = "perl-${version}";

Expand Down
Loading