Merge pull request #14658 from abbradar/search-path-fixes

Search path fixes
This commit is contained in:
Nikolay Amiantov 2016-04-14 03:08:41 +04:00
commit 6f3e72eef6
59 changed files with 118 additions and 89 deletions

View File

@ -438,6 +438,24 @@ rec {
overrideExisting = old: new: overrideExisting = old: new:
old // listToAttrs (map (attr: nameValuePair attr (attrByPath [attr] old.${attr} new)) (attrNames old)); 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.
Example:
tryAttrs ["a" "b"] { a = 1; b = 2; }
=> 1
tryAttrs ["a" "b"] { c = 3; }
=> { c = 3; }
*/
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;
/*** deprecated stuff ***/ /*** deprecated stuff ***/

View File

@ -88,6 +88,16 @@ rec {
makeSearchPath = subDir: packages: makeSearchPath = subDir: packages:
concatStringsSep ":" (map (path: path + "/" + subDir) packages); concatStringsSep ":" (map (path: path + "/" + subDir) packages);
/* Construct a Unix-style search path, given trying outputs in order.
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"
*/
makeSearchPathOutputs = subDir: outputs: pkgs:
makeSearchPath subDir (map (pkg: if pkg.outputUnspecified or false then lib.tryAttrs (outputs ++ ["out"]) pkg else pkg) pkgs);
/* Construct a library search path (such as RPATH) containing the /* Construct a library search path (such as RPATH) containing the
libraries for a set of packages libraries for a set of packages
@ -100,7 +110,7 @@ rec {
*/ */
makeLibraryPath = pkgs: makeSearchPath "lib" makeLibraryPath = pkgs: makeSearchPath "lib"
# try to guess the right output of each pkg # try to guess the right output of each pkg
(map (pkg: pkg.lib or (pkg.out or pkg)) pkgs); (map (pkg: if pkg.outputUnspecified or false then pkg.lib or (pkg.out or pkg) else pkg) pkgs);
/* Construct a binary search path (such as $PATH) containing the /* Construct a binary search path (such as $PATH) containing the
binaries for a set of packages. binaries for a set of packages.
@ -109,7 +119,8 @@ rec {
makeBinPath ["/root" "/usr" "/usr/local"] makeBinPath ["/root" "/usr" "/usr/local"]
=> "/root/bin:/usr/bin:/usr/local/bin" => "/root/bin:/usr/bin:/usr/local/bin"
*/ */
makeBinPath = makeSearchPath "bin"; makeBinPath = pkgs: makeSearchPath "bin"
(map (pkg: if pkg.outputUnspecified or false then pkg.bin or (pkg.out or pkg) else pkg) pkgs);
/* Construct a perl search path (such as $PERL5LIB) /* Construct a perl search path (such as $PERL5LIB)
@ -121,7 +132,8 @@ rec {
makePerlPath [ pkgs.perlPackages.NetSMTP ] makePerlPath [ pkgs.perlPackages.NetSMTP ]
=> "/nix/store/n0m1fk9c960d8wlrs62sncnadygqqc6y-perl-Net-SMTP-1.25/lib/perl5/site_perl" => "/nix/store/n0m1fk9c960d8wlrs62sncnadygqqc6y-perl-Net-SMTP-1.25/lib/perl5/site_perl"
*/ */
makePerlPath = makeSearchPath "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);
/* Dependening on the boolean `cond', return either the given string /* Dependening on the boolean `cond', return either the given string
or the empty string. Useful to contatenate against a bigger string. or the empty string. Useful to contatenate against a bigger string.

View File

@ -102,7 +102,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ]; after = [ "network.target" ];
path = [ pluginsEnv ]; path = [ pluginsEnv ];
environment.PYTHONPATH = makeSearchPath pkgs.python.sitePackages [ pluginsEnv ]; environment.PYTHONPATH = makeSearchPathOutputs pkgs.python.sitePackages ["lib"] [ pluginsEnv ];
preStart = '' preStart = ''
mkdir -p "${cfg.stateDir}" mkdir -p "${cfg.stateDir}"

View File

@ -96,7 +96,7 @@ in
globalEnvVars = singleton globalEnvVars = singleton
{ name = "PYTHONPATH"; { name = "PYTHONPATH";
value = value =
makeSearchPath "lib/${pkgs.python.libPrefix}/site-packages" makeSearchPathOutputs "lib/${pkgs.python.libPrefix}/site-packages" ["lib"]
[ pkgs.mod_python [ pkgs.mod_python
pkgs.pythonPackages.trac pkgs.pythonPackages.trac
pkgs.setuptools pkgs.setuptools

View File

@ -7,7 +7,7 @@ let
e = pkgs.enlightenment; e = pkgs.enlightenment;
xcfg = config.services.xserver; xcfg = config.services.xserver;
cfg = xcfg.desktopManager.enlightenment; cfg = xcfg.desktopManager.enlightenment;
GST_PLUGIN_PATH = lib.makeSearchPath "lib/gstreamer-1.0" [ GST_PLUGIN_PATH = lib.makeSearchPathOutputs "lib/gstreamer-1.0" ["lib"] [
pkgs.gst_all_1.gst-plugins-base pkgs.gst_all_1.gst-plugins-base
pkgs.gst_all_1.gst-plugins-good pkgs.gst_all_1.gst-plugins-good
pkgs.gst_all_1.gst-plugins-bad pkgs.gst_all_1.gst-plugins-bad

View File

@ -55,10 +55,10 @@ let
version extraConfig extraPerEntryConfig extraEntries version extraConfig extraPerEntryConfig extraEntries
extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels timeout extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels timeout
default fsIdentifier efiSupport gfxmodeEfi gfxmodeBios; default fsIdentifier efiSupport gfxmodeEfi gfxmodeBios;
path = (makeSearchPath "bin" ([ path = (makeBinPath ([
pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.findutils pkgs.diffutils pkgs.btrfs-progs 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 []) pkgs.utillinux ] ++ (if cfg.efiSupport && (cfg.version == 2) then [pkgs.efibootmgr ] else [])
)) + ":" + (makeSearchPath "sbin" [ )) + ":" + (makeSearchPathOutputs "sbin" ["bin"] [
pkgs.mdadm pkgs.utillinux pkgs.mdadm pkgs.utillinux
]); ]);
}); });

View File

@ -193,7 +193,7 @@ in rec {
path = mkOption { path = mkOption {
default = []; default = [];
apply = ps: "${makeSearchPath "bin" ps}:${makeSearchPath "sbin" ps}"; apply = ps: "${makeBinPath ps}:${makeSearchPathOutputs "sbin" ["bin"] ps}";
description = '' description = ''
Packages added to the service's <envar>PATH</envar> Packages added to the service's <envar>PATH</envar>
environment variable. Both the <filename>bin</filename> environment variable. Both the <filename>bin</filename>

View File

@ -42,7 +42,7 @@ let
wrapProgram "$out/bin/waagent" \ wrapProgram "$out/bin/waagent" \
--prefix PYTHONPATH : $PYTHONPATH \ --prefix PYTHONPATH : $PYTHONPATH \
--prefix PATH : "${makeSearchPath "bin" runtimeDeps}" --prefix PATH : "${makeBinPath runtimeDeps}"
''; '';
}; };

View File

@ -66,7 +66,7 @@ in
services.xserver.displayManager.sessionCommands = services.xserver.displayManager.sessionCommands =
'' ''
PATH=${makeSearchPath "bin" [ pkgs.gnugrep pkgs.which pkgs.xorg.xorgserver.out ]}:$PATH \ PATH=${makeBinPath [ pkgs.gnugrep pkgs.which pkgs.xorg.xorgserver.out ]}:$PATH \
${kernel.virtualboxGuestAdditions}/bin/VBoxClient-all ${kernel.virtualboxGuestAdditions}/bin/VBoxClient-all
''; '';

View File

@ -1,19 +1,19 @@
{ stdenv, fetchurl, buildEnv, makeDesktopItem, makeWrapper, zlib, glib, alsaLib { stdenv, fetchurl, lib, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf , dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
, gvfs, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap, systemd , gvfs, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap, systemd
}: }:
let let
atomEnv = buildEnv { atomPkgs = [
name = "env-atom";
paths = [
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3 stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
xorg.libXcursor libcap systemd xorg.libXcursor libcap systemd
]; ];
}; atomLib = lib.makeLibraryPath atomPkgs;
atomLib64 = lib.makeSearchPathOutputs "lib64" ["lib"] atomPkgs;
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "atom-${version}"; name = "atom-${version}";
version = "1.6.2"; version = "1.6.2";
@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
name = "${name}.deb"; name = "${name}.deb";
}; };
buildInputs = [ atomEnv gvfs makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
phases = [ "installPhase" "fixupPhase" ]; phases = [ "installPhase" "fixupPhase" ];
@ -41,10 +41,10 @@ in stdenv.mkDerivation rec {
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/share/atom/resources/app/apm/bin/node $out/share/atom/resources/app/apm/bin/node
wrapProgram $out/bin/atom \ wrapProgram $out/bin/atom \
--prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" \ --prefix "LD_LIBRARY_PATH" : "${atomLib}:${atomLib64}" \
--prefix "PATH" : "${gvfs}/bin" --prefix "PATH" : "${gvfs}/bin"
wrapProgram $out/bin/apm \ wrapProgram $out/bin/apm \
--prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" --prefix "LD_LIBRARY_PATH" : "${atomLib}:${atomLib64}"
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -16,8 +16,7 @@ gconftool-2 --recursive-unset /apps/guake
with lib; with lib;
let inputs = [ dbus gtk2 gconf python2 libutempter vte keybinder gnome3.gnome_common ]; let inputs = [ dbus gtk2 gconf python2 libutempter vte keybinder gnome3.gnome_common ];
pySubDir = "lib/${python2.libPrefix}/site-packages"; pyPath = makeSearchPathOutputs python2.sitePackages ["lib"] (attrVals [ "dbus" "notify" "pyGtkGlade" "pyxdg" ] python2Packages ++ [ gnome2.gnome_python ]);
pyPath = makeSearchPath pySubDir (attrVals [ "dbus" "notify" "pyGtkGlade" "pyxdg" ] python2Packages ++ [ gnome2.gnome_python ]);
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "guake-${version}"; name = "guake-${version}";
version = "0.8.3"; version = "0.8.3";
@ -63,7 +62,7 @@ let inputs = [ dbus gtk2 gconf python2 libutempter vte keybinder gnome3.gnome_co
wrapProgram $bin \ wrapProgram $bin \
--prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \ --prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
--prefix LD_LIBRARY_PATH : ${makeLibraryPath inputs} \ --prefix LD_LIBRARY_PATH : ${makeLibraryPath inputs} \
--prefix PYTHONPATH : "$out/${pySubDir}:${pyPath}:$PYTHONPATH" --prefix PYTHONPATH : "$out/${python2.sitePackages}:${pyPath}:$PYTHONPATH"
done done
''; '';

View File

@ -26,7 +26,7 @@ assert stdenv.isLinux;
let let
version = "4.2.9"; version = "4.2.9";
binpath = stdenv.lib.makeSearchPath "bin" binpath = stdenv.lib.makeBinPath
[ cabextract [ cabextract
python2Packages.python python2Packages.python
gettext gettext

View File

@ -29,7 +29,7 @@ in stdenv.mkDerivation rec {
"-I${dbus_libs.lib}/lib/dbus-1.0/include" ]; "-I${dbus_libs.lib}/lib/dbus-1.0/include" ];
# Fix up python path so the lockfile library is on it. # Fix up python path so the lockfile library is on it.
PYTHONPATH = stdenv.lib.makeSearchPath "lib/${pythonFull.libPrefix}/site-packages" [ PYTHONPATH = stdenv.lib.makeSearchPathOutputs pythonFull.sitePackages ["lib"] [
pythonPackages.curses pythonPackages.lockfile pythonPackages.curses pythonPackages.lockfile
]; ];

View File

@ -30,7 +30,7 @@ rec {
name = "zathura-${zathura_core.version}"; name = "zathura-${zathura_core.version}";
plugins_path = stdenv.lib.makeSearchPath "lib" [ plugins_path = stdenv.lib.makeLibraryPath [
zathura_djvu zathura_djvu
zathura_ps zathura_ps
(if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler) (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler)

View File

@ -64,8 +64,8 @@ let
''; '';
patchPhase = let patchPhase = let
rpaths = [ stdenv.cc.cc.lib ]; rpaths = [ stdenv.cc.cc ];
mkrpath = p: "${makeSearchPath "lib64" p}:${makeSearchPath "lib" p}"; mkrpath = p: "${makeSearchPathOutputs "lib64" ["lib"] p}:${makeLibraryPath p}";
in '' in ''
for sofile in PepperFlash/libpepflashplayer.so \ for sofile in PepperFlash/libpepflashplayer.so \
libwidevinecdm.so libwidevinecdmadapter.so; do libwidevinecdm.so libwidevinecdmadapter.so; do

View File

@ -105,7 +105,7 @@ stdenv.mkDerivation {
libheimdal libheimdal
libpulseaudio libpulseaudio
systemd systemd
] + ":" + stdenv.lib.makeSearchPath "lib64" [ ] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
stdenv.cc.cc stdenv.cc.cc
]; ];

View File

@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
libPath = stdenv.lib.makeLibraryPath buildInputs libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux") + stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPath "lib64" buildInputs); (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
preFixup = preFixup =
'' ''

View File

@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
libPath = stdenv.lib.makeLibraryPath buildInputs libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux") + stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPath "lib64" buildInputs); (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
buildPhase = '' buildPhase = ''
echo "Patching Vivaldi binaries" echo "Patching Vivaldi binaries"

View File

@ -36,7 +36,7 @@ let
# relative location where the dropbox libraries are stored # relative location where the dropbox libraries are stored
appdir = "opt/dropbox"; appdir = "opt/dropbox";
ldpath = stdenv.lib.makeSearchPath "lib" ldpath = stdenv.lib.makeLibraryPath
[ [
dbus_libs gcc.cc glib libdrm libffi libICE libSM libX11 libXmu dbus_libs gcc.cc glib libdrm libffi libICE libSM libX11 libXmu
ncurses popt qtbase qtdeclarative qtwebkit zlib ncurses popt qtbase qtdeclarative qtwebkit zlib

View File

@ -6,7 +6,7 @@ let
version = "4.0.1631"; version = "4.0.1631";
rpath = stdenv.lib.makeSearchPath "lib" [ rpath = stdenv.lib.makeLibraryPath [
xorg.libXext xorg.libXext
xorg.libSM xorg.libSM
xorg.libICE xorg.libICE

View File

@ -6,7 +6,7 @@ let
version = "2.0.3"; version = "2.0.3";
rpath = stdenv.lib.makeSearchPath "lib" [ rpath = stdenv.lib.makeLibraryPath [
alsaLib alsaLib
atk atk
cairo cairo

View File

@ -105,7 +105,7 @@ stdenv.mkDerivation {
nspr nspr
nss nss
pango pango
] + ":" + stdenv.lib.makeSearchPath "lib64" [ ] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
stdenv.cc.cc stdenv.cc.cc
]; ];

View File

@ -16,7 +16,7 @@ let
else if stdenv.system == "i686-linux" then "8c23271291f40aa144bbf38ceb3cc2a05bed00759c87a65bd798cf8bb289d07a" else if stdenv.system == "i686-linux" then "8c23271291f40aa144bbf38ceb3cc2a05bed00759c87a65bd798cf8bb289d07a"
else throw "Spideroak client for: ${stdenv.system} not supported!"; else throw "Spideroak client for: ${stdenv.system} not supported!";
ldpath = stdenv.lib.makeSearchPath "lib" [ ldpath = stdenv.lib.makeLibraryPath [
glib fontconfig libXext libX11 freetype libXrender glib fontconfig libXext libX11 freetype libXrender
]; ];

View File

@ -73,8 +73,8 @@ let
for p in $out/bin/*; do for p in $out/bin/*; do
wrapProgram $p \ wrapProgram $p \
--suffix LD_LIBRARY_PATH ';' "${lib.makeSearchPath "lib" runtimeDeps_}" \ --suffix LD_LIBRARY_PATH ';' "${lib.makeLibraryPath runtimeDeps_}" \
--suffix PATH ';' "${lib.makeSearchPath "bin" runtimeDeps_}" \ --suffix PATH ';' "${lib.makeBinPath runtimeDeps_}" \
--suffix LUA_PATH ';' "\"$LUA_PATH\"" \ --suffix LUA_PATH ';' "\"$LUA_PATH\"" \
--suffix LUA_PATH ';' "\"$out/share/lua/${lua.luaversion}/?.lua;$out/share/lua/${lua.luaversion}/?/init.lua\"" \ --suffix LUA_PATH ';' "\"$out/share/lua/${lua.luaversion}/?.lua;$out/share/lua/${lua.luaversion}/?/init.lua\"" \
--suffix LUA_CPATH ';' "\"$LUA_CPATH\"" \ --suffix LUA_CPATH ';' "\"$LUA_CPATH\"" \

View File

@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
ldpath = stdenv.lib.makeLibraryPath buildInputs ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux") + stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPath "lib64" buildInputs); (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
phases = "unpackPhase installPhase fixupPhase"; phases = "unpackPhase installPhase fixupPhase";

View File

@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
ldpath = stdenv.lib.makeLibraryPath buildInputs ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux") + stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
(":" + stdenv.lib.makeSearchPath "lib64" buildInputs); (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
phases = "unpackPhase installPhase fixupPhase"; phases = "unpackPhase installPhase fixupPhase";

View File

@ -5,7 +5,7 @@ let
version = "5.36.1"; version = "5.36.1";
searchPath = searchPath =
stdenv.lib.makeSearchPath "bin" stdenv.lib.makeBinPath
(stdenv.lib.filter (x: x != null) [ sbcl rlwrap tk gnuplot ]); (stdenv.lib.filter (x: x != null) [ sbcl rlwrap tk gnuplot ]);
in in
stdenv.mkDerivation { stdenv.mkDerivation {

View File

@ -39,7 +39,7 @@ mkDerivation rec {
postInstall = postInstall =
let let
binpath = makeSearchPath "bin" [ out rcs cvs git coreutils rsync ]; binpath = makeBinPath [ out rcs cvs git coreutils rsync ];
in '' in ''
for prog in cvs-fast-export cvsconvert cvssync; do for prog in cvs-fast-export cvsconvert cvssync; do
wrapProgram $out/bin/$prog \ wrapProgram $out/bin/$prog \

View File

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
python ./setup.py install --prefix=$out python ./setup.py install --prefix=$out
for i in bzr svn git; do for i in bzr svn git; do
wrapProgram $out/bin/cvs2$i \ wrapProgram $out/bin/cvs2$i \
--prefix PATH : "${lib.makeSearchPath "bin" [ cvs ]}" \ --prefix PATH : "${lib.makeBinPath [ cvs ]}" \
--set PYTHONPATH "$(toPythonPath $out):$PYTHONPATH" --set PYTHONPATH "$(toPythonPath $out):$PYTHONPATH"
done done
''; '';

View File

@ -46,12 +46,12 @@ mkDerivation rec {
postInstall = postInstall =
let let
binpath = makeSearchPath "bin" ( binpath = makeBinPath (
filter (x: x != null) filter (x: x != null)
[ out git bazaar cvs darcs fossil mercurial [ out git bazaar cvs darcs fossil mercurial
monotone rcs src subversion cvs_fast_export ] monotone rcs src subversion cvs_fast_export ]
); );
pythonpath = makeSearchPath (python27.sitePackages) ( pythonpath = makeSearchPathOutputs python27.sitePackages ["lib"] (
filter (x: x != null) filter (x: x != null)
[ python27Packages.readline or null python27Packages.hglib or null ] [ python27Packages.readline or null python27Packages.hglib or null ]
); );

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
pkg_path = "$out/${name}"; pkg_path = "$out/${name}";
bin_path = "$out/bin"; bin_path = "$out/bin";
install_freedesktop_items = ./install_freedesktop_items.sh; install_freedesktop_items = ./install_freedesktop_items.sh;
runtime_paths = lib.makeSearchPath "bin" [ runtime_paths = lib.makeBinPath [
jre jre
#git mercurial subversion # the paths are requested in configuration #git mercurial subversion # the paths are requested in configuration
which which

View File

@ -20,7 +20,7 @@
, zip , zip
}: }:
let PATH = lib.makeSearchPath "bin" [ let PATH = lib.makeBinPath [
p7zip unrar unzipNLS zip p7zip unrar unzipNLS zip
]; ];
in in

View File

@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
fi fi
done done
patchelf --set-rpath ${stdenv.lib.makeSearchPath "lib" [ libusb ]} \ patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ libusb ]} \
"$out/share/arduino/hardware/tools/avrdude" "$out/share/arduino/hardware/tools/avrdude"
''; '';

View File

@ -50,7 +50,7 @@ let
doCheck = false; doCheck = false;
buildTools = drv.buildTools or [] ++ [ makeWrapper ]; buildTools = drv.buildTools or [] ++ [ makeWrapper ];
postInstall = postInstall =
let bins = lib.makeSearchPath "bin" [ nodejs self.elm-make ]; let bins = lib.makeBinPath [ nodejs self.elm-make ];
in '' in ''
wrapProgram $out/bin/elm-repl \ wrapProgram $out/bin/elm-repl \
--prefix PATH ':' ${bins} --prefix PATH ':' ${bins}

View File

@ -128,7 +128,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = [ "-fPIC" ]; NIX_CFLAGS_COMPILE = [ "-fPIC" ];
LD_LIBRARY_PATH = makeSearchPath "lib" [ LD_LIBRARY_PATH = makeLibraryPath [
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
openspecfun pcre2 suitesparse openspecfun pcre2 suitesparse
]; ];

View File

@ -130,10 +130,10 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = [ "-fPIC" ]; NIX_CFLAGS_COMPILE = [ "-fPIC" ];
LD_LIBRARY_PATH = makeSearchPath "lib" (concatLists (map (x : x.all) [ LD_LIBRARY_PATH = makeLibraryPath [
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
openspecfun pcre2 suitesparse openspecfun pcre2 suitesparse
])); ];
dontStrip = true; dontStrip = true;
dontPatchELF = true; dontPatchELF = true;

View File

@ -41,7 +41,7 @@ let
hasLibraries = lib.any (x: x.isHaskellLibrary) paths; hasLibraries = lib.any (x: x.isHaskellLibrary) paths;
# CLang is needed on Darwin for -fllvm to work: # CLang is needed on Darwin for -fllvm to work:
# https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html
llvm = lib.makeSearchPath "bin" llvm = lib.makeBinPath
([ llvmPackages.llvm ] ([ llvmPackages.llvm ]
++ lib.optional stdenv.isDarwin llvmPackages.clang); ++ lib.optional stdenv.isDarwin llvmPackages.clang);
in in

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
sed_script_2 = sed_script_2 =
"'s|^MYNDKDIR=`dirname $0`" + "'s|^MYNDKDIR=`dirname $0`" +
"|MYNDKDIR=`dirname $(readlink -f $(which $0))`|'"; "|MYNDKDIR=`dirname $(readlink -f $(which $0))`|'";
runtime_paths = (lib.makeSearchPath "bin" [ runtime_paths = (lib.makeBinPath [
coreutils file findutils coreutils file findutils
gawk gnugrep gnused gawk gnugrep gnused
jdk jdk

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
sed_script_2 = sed_script_2 =
"'s|^MYNDKDIR=`dirname $0`" + "'s|^MYNDKDIR=`dirname $0`" +
"|MYNDKDIR=`dirname $(readlink -f $(which $0))`|'"; "|MYNDKDIR=`dirname $(readlink -f $(which $0))`|'";
runtime_paths = (lib.makeSearchPath "bin" [ runtime_paths = (lib.makeBinPath [
coreutils file findutils coreutils file findutils
gawk gnugrep gnused gawk gnugrep gnused
jdk jdk

View File

@ -14,7 +14,7 @@ let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ pac
inherit haskellPackages; inherit haskellPackages;
packages = allPkgs; packages = allPkgs;
}; };
bins = lib.makeSearchPath "bin" ([ mueval' bins = lib.makeBinPath ([ mueval'
(haskellPackages.ghcWithPackages allPkgs) (haskellPackages.ghcWithPackages allPkgs)
haskellPackages.unlambda haskellPackages.unlambda
haskellPackages.brainfuck haskellPackages.brainfuck

View File

@ -6,7 +6,7 @@
}: }:
let let
binpath = stdenv.lib.makeSearchPath "bin" binpath = stdenv.lib.makeBinPath
([ coreutils ncurses gnused gnugrep ] ++ stdenv.lib.optional (jdk != null) jdk); ([ coreutils ncurses gnused gnugrep ] ++ stdenv.lib.optional (jdk != null) jdk);
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {

View File

@ -6,7 +6,7 @@ let
inherit (xorg) libXext libX11; inherit (xorg) libXext libX11;
lpath = "${stdenv.cc.cc}/lib64:" + stdenv.lib.makeSearchPath "lib" [ lpath = "${stdenv.cc.cc.lib}/lib64:" + stdenv.lib.makeLibraryPath [
zlib libmad libpng12 libcaca libXext libX11 mesa alsaLib libpulseaudio]; zlib libmad libpng12 libcaca libXext libX11 mesa alsaLib libpulseaudio];
in in

View File

@ -12,7 +12,7 @@ let
rtdeps = stdenv.lib.makeLibraryPath rtdeps = stdenv.lib.makeLibraryPath
[ xorg.libXxf86vm xorg.libXext openal ] [ xorg.libXxf86vm xorg.libXext openal ]
+ ":" + stdenv.lib.makeSearchPath "lib64" [ stdenv.cc.cc ]; + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [ stdenv.cc.cc ];
buildCommand = buildCommand =
'' ''

View File

@ -4,7 +4,7 @@
}: }:
let let
binPath = stdenv.lib.makeSearchPath "bin" [ coreutils gnused bc gawk gnugrep which ]; binPath = stdenv.lib.makeBinPath [ coreutils gnused bc gawk gnugrep which ];
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "cups-filters-${version}"; name = "cups-filters-${version}";

View File

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
substituteInPlace fanctl \ substituteInPlace fanctl \
--replace '@PATH@' \ --replace '@PATH@' \
'${lib.makeSearchPath "bin" [ '${lib.makeBinPath [
gnugrep gawk coreutils bridge-utils iproute dnsmasq gnugrep gawk coreutils bridge-utils iproute dnsmasq
iptables kmod utillinux gnused iptables kmod utillinux gnused
glibc # needed for getent glibc # needed for getent

View File

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin mkdir -p $out/bin
cp pipework $out/bin cp pipework $out/bin
wrapProgram $out/bin/pipework --prefix PATH : \ wrapProgram $out/bin/pipework --prefix PATH : \
${lib.makeSearchPath "bin" [ bridge-utils iproute lxc openvswitch docker busybox dhcpcd dhcp ]}; ${lib.makeBinPath [ bridge-utils iproute lxc openvswitch docker busybox dhcpcd dhcp ]};
''; '';
meta = with lib; { meta = with lib; {
description = "Software-Defined Networking tools for LXC"; description = "Software-Defined Networking tools for LXC";

View File

@ -3,10 +3,10 @@
let let
binPath = stdenv.lib.makeSearchPath "bin" binPath = stdenv.lib.makeBinPath
[ coreutils gnugrep utillinux module_init_tools procps kbd dbus_tools ]; [ coreutils gnugrep utillinux module_init_tools procps kbd dbus_tools ];
sbinPath = stdenv.lib.makeSearchPath "sbin" sbinPath = stdenv.lib.makeSearchPathOutputs "sbin" ["bin"]
[ procps ]; [ procps ];
in in

View File

@ -15,7 +15,7 @@ let
++ lib.optional withSQLite "sqlite3_drv" ++ lib.optional withSQLite "sqlite3_drv"
++ lib.optional withDB "libdb4_drv" ++ lib.optional withDB "libdb4_drv"
); );
maintenancePath = lib.makeSearchPath "bin" [ gawk gnused gnugrep coreutils which ]; maintenancePath = lib.makeBinPath [ gawk gnused gnugrep coreutils which ];
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "dspam-3.10.2"; name = "dspam-3.10.2";

View File

@ -13,7 +13,7 @@
}: }:
let let
ctlpath = lib.makeSearchPath "bin" [ bash gnused gnugrep coreutils utillinux procps ]; ctlpath = lib.makeBinPath [ bash gnused gnugrep coreutils utillinux procps ];
fakegit = writeScriptBin "git" '' fakegit = writeScriptBin "git" ''
#! ${stdenv.shell} -e #! ${stdenv.shell} -e

View File

@ -43,7 +43,7 @@ let
nvidiaLibs = lib.makeLibraryPath nvidia_x11s; nvidiaLibs = lib.makeLibraryPath nvidia_x11s;
bbdPath = lib.makeSearchPath "bin" [ module_init_tools xorgserver ]; bbdPath = lib.makeBinPath [ module_init_tools xorgserver ];
bbdLibs = lib.makeLibraryPath [ libX11 libXext ]; bbdLibs = lib.makeLibraryPath [ libX11 libXext ];
xmodules = lib.concatStringsSep "," (map (x: "${x}/lib/xorg/modules") ([ xorgserver ] ++ lib.optional (!useNvidia) xf86videonouveau)); xmodules = lib.concatStringsSep "," (map (x: "${x}/lib/xorg/modules") ([ xorgserver ] ++ lib.optional (!useNvidia) xf86videonouveau));

View File

@ -5,7 +5,7 @@
let let
major = "3.12"; major = "3.12";
minor = "0"; minor = "0";
binpath = stdenv.lib.makeSearchPath "bin" [ dvdauthor cdrdao dvdplusrwtools cdrtools ]; binpath = stdenv.lib.makeBinPath [ dvdauthor cdrdao dvdplusrwtools cdrtools ];
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
version = "${major}.${minor}"; version = "${major}.${minor}";

View File

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
wrapProgram "$out/share/fgallery/fgallery" \ wrapProgram "$out/share/fgallery/fgallery" \
--set PERL5LIB "$PERL5LIB" \ --set PERL5LIB "$PERL5LIB" \
--set PATH "${stdenv.lib.makeSearchPath "bin" --set PATH "${stdenv.lib.makeBinPath
[ coreutils zip imagemagick pngcrush lcms2 fbida ]}" [ coreutils zip imagemagick pngcrush lcms2 fbida ]}"
''; '';

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, makeWrapper, curl, gnugrep, libnotify, scrot, which, xclip }: { stdenv, fetchFromGitHub, makeWrapper, curl, gnugrep, libnotify, scrot, which, xclip }:
let deps = stdenv.lib.makeSearchPath "bin" [ curl gnugrep libnotify scrot which xclip ]; let deps = stdenv.lib.makeBinPath [ curl gnugrep libnotify scrot which xclip ];
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
version = "1.5.4"; version = "1.5.4";
name = "imgur-screenshot-${version}"; name = "imgur-screenshot-${version}";

View File

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin mkdir -p $out/bin
cat <<EOF >$out/bin/imgurbash2 cat <<EOF >$out/bin/imgurbash2
#!${bash}/bin/bash #!${bash}/bin/bash
PATH=${stdenv.lib.makeSearchPath "bin" [curl xsel]}:\$PATH PATH=${stdenv.lib.makeBinPath [curl xsel]}:\$PATH
EOF EOF
cat imgurbash2 >> $out/bin/imgurbash2 cat imgurbash2 >> $out/bin/imgurbash2
chmod +x $out/bin/imgurbash2 chmod +x $out/bin/imgurbash2

View File

@ -26,7 +26,7 @@ in stdenv.mkDerivation {
buildInputs = [ perl ]; buildInputs = [ perl ];
paths = lib.makeSearchPath "bin" paths = lib.makeBinPath
([ iw rfkill hdparm ethtool inetutils systemd module_init_tools pciutils smartmontools ([ iw rfkill hdparm ethtool inetutils systemd module_init_tools pciutils smartmontools
x86_energy_perf_policy gawk gnugrep coreutils x86_energy_perf_policy gawk gnugrep coreutils
] ]

View File

@ -72,7 +72,7 @@ stdenv.mkDerivation {
ln -s @out@/lib/xfstests/$f $f ln -s @out@/lib/xfstests/$f $f
done done
export PATH=${lib.makeSearchPath "bin" [acl attr bc e2fsprogs fio gawk libcap_progs lvm2 perl procps psmisc su utillinux which xfsprogs]}:$PATH export PATH=${lib.makeBinPath [acl attr bc e2fsprogs fio gawk libcap_progs lvm2 perl procps psmisc su utillinux which xfsprogs]}:$PATH
exec ./check "$@" exec ./check "$@"
''; '';

View File

@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
'' else ""} '' else ""}
''; '';
wrapperPath = with stdenv.lib; makeSearchPath "bin/" ([ wrapperPath = with stdenv.lib; makeBinPath ([
coreutils coreutils
gnused gnused
getopt getopt

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
cp -a $src/config.example $out/share/doc/rofi-pass/config.example cp -a $src/config.example $out/share/doc/rofi-pass/config.example
''; '';
wrapperPath = with stdenv.lib; makeSearchPath "bin/" [ wrapperPath = with stdenv.lib; makeBinPath [
coreutils coreutils
findutils findutils
gnugrep gnugrep

View File

@ -3,7 +3,7 @@
, perl, pcscperl, Glib, Gtk2, Pango , perl, pcscperl, Glib, Gtk2, Pango
}: }:
let deps = lib.makeSearchPath "bin" [ wget coreutils ]; let deps = lib.makeBinPath [ wget coreutils ];
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "pcsc-tools-1.4.25"; name = "pcsc-tools-1.4.25";