makeSearchPathOutputs: refactor to makeSearchPathOutput

Changed files
+21 -22
lib
nixos
modules
services
web-servers
apache-httpd
x11
desktop-managers
system
pkgs
applications
misc
guake
roxterm
networking
browsers
chromium
firefox-bin
google-chrome
opera
vivaldi
mailreaders
thunderbird-bin
science
math
mathematica
version-management
reposurgeon
games
ue4demos
os-specific
linux
pm-utils
+4 -5
lib/strings.nix
···
makeSearchPath = 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
libraries for a set of packages
···
makeSearchPath = subDir: packages:
concatStringsSep ":" (map (path: path + "/" + subDir) packages);
+
/* Construct a Unix-style search path, using given package output.
If no output is found, fallback to `.out` and then to the default.
Example:
+
makeSearchPathOutput "dev" "bin" [ pkgs.openssl pkgs.zlib ]
+
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-dev/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin"
*/
+
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
+1 -1
nixos/modules/services/web-servers/apache-httpd/trac.nix
···
globalEnvVars = singleton
{ name = "PYTHONPATH";
value =
-
makeSearchPathOutputs "lib/${pkgs.python.libPrefix}/site-packages" ["lib"]
[ pkgs.mod_python
pkgs.pythonPackages.trac
pkgs.setuptools
···
globalEnvVars = singleton
{ name = "PYTHONPATH";
value =
+
makeSearchPathOutput "lib" "lib/${pkgs.python.libPrefix}/site-packages"
[ pkgs.mod_python
pkgs.pythonPackages.trac
pkgs.setuptools
+1 -1
nixos/modules/services/x11/desktop-managers/enlightenment.nix
···
e = pkgs.enlightenment;
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.enlightenment;
-
GST_PLUGIN_PATH = lib.makeSearchPathOutputs "lib/gstreamer-1.0" ["lib"] [
pkgs.gst_all_1.gst-plugins-base
pkgs.gst_all_1.gst-plugins-good
pkgs.gst_all_1.gst-plugins-bad
···
e = pkgs.enlightenment;
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.enlightenment;
+
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
+1 -1
nixos/modules/system/boot/loader/grub/grub.nix
···
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"] [
pkgs.mdadm pkgs.utillinux
]);
});
···
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 [])
+
)) + ":" + (makeSearchPathOutput "bin" "sbin" [
pkgs.mdadm pkgs.utillinux
]);
});
+1 -1
nixos/modules/system/boot/systemd-unit-options.nix
···
path = mkOption {
default = [];
-
apply = ps: "${makeBinPath ps}:${makeSearchPathOutputs "sbin" ["bin"] ps}";
description = ''
Packages added to the service's <envar>PATH</envar>
environment variable. Both the <filename>bin</filename>
···
path = mkOption {
default = [];
+
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>
+1 -1
pkgs/applications/misc/guake/default.nix
···
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 ]);
in stdenv.mkDerivation rec {
name = "guake-${version}";
version = "0.8.3";
···
with lib;
let inputs = [ dbus gtk2 gconf python2 libutempter vte keybinder gnome3.gnome_common ];
+
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";
+1 -1
pkgs/applications/misc/roxterm/default.nix
···
"-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"] [
pythonPackages.curses pythonPackages.lockfile
];
···
"-I${dbus_libs.lib}/lib/dbus-1.0/include" ];
# Fix up python path so the lockfile library is on it.
+
PYTHONPATH = stdenv.lib.makeSearchPathOutput "lib" pythonFull.sitePackages [
pythonPackages.curses pythonPackages.lockfile
];
+1 -1
pkgs/applications/networking/browsers/chromium/plugins.nix
···
patchPhase = let
rpaths = [ stdenv.cc.cc ];
-
mkrpath = p: "${makeSearchPathOutputs "lib64" ["lib"] p}:${makeLibraryPath p}";
in ''
for sofile in PepperFlash/libpepflashplayer.so \
libwidevinecdm.so libwidevinecdmadapter.so; do
···
patchPhase = let
rpaths = [ stdenv.cc.cc ];
+
mkrpath = p: "${makeSearchPathOutput "lib" "lib64" p}:${makeLibraryPath p}";
in ''
for sofile in PepperFlash/libpepflashplayer.so \
libwidevinecdm.so libwidevinecdmadapter.so; do
+1 -1
pkgs/applications/networking/browsers/firefox-bin/default.nix
···
libheimdal
libpulseaudio
systemd
-
] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
stdenv.cc.cc
];
···
libheimdal
libpulseaudio
systemd
+
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [
stdenv.cc.cc
];
+1 -1
pkgs/applications/networking/browsers/google-chrome/default.nix
···
tar xf data.tar.xz
'';
-
rpath = makeLibraryPath deps + ":" + makeSearchPathOutputs "lib64" ["lib"] deps;
binpath = makeBinPath deps;
installPhase = ''
···
tar xf data.tar.xz
'';
+
rpath = makeLibraryPath deps + ":" + makeSearchPathOutput "lib" "lib64" deps;
binpath = makeBinPath deps;
installPhase = ''
+1 -1
pkgs/applications/networking/browsers/opera/default.nix
···
libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
-
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
preFixup =
''
···
libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
+
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
preFixup =
''
+1 -1
pkgs/applications/networking/browsers/vivaldi/default.nix
···
libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
-
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
buildPhase = ''
echo "Patching Vivaldi binaries"
···
libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
+
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
buildPhase = ''
echo "Patching Vivaldi binaries"
+1 -1
pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
···
nspr
nss
pango
-
] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
stdenv.cc.cc
];
···
nspr
nss
pango
+
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [
stdenv.cc.cc
];
+1 -1
pkgs/applications/science/math/mathematica/9.nix
···
ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
-
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
phases = "unpackPhase installPhase fixupPhase";
···
ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
+
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
phases = "unpackPhase installPhase fixupPhase";
+1 -1
pkgs/applications/science/math/mathematica/default.nix
···
ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
-
(":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
phases = "unpackPhase installPhase fixupPhase";
···
ldpath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
+
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
phases = "unpackPhase installPhase fixupPhase";
+1 -1
pkgs/applications/version-management/reposurgeon/default.nix
···
[ out git bazaar cvs darcs fossil mercurial
monotone rcs src subversion cvs_fast_export ]
);
-
pythonpath = makeSearchPathOutputs python27.sitePackages ["lib"] (
filter (x: x != null)
[ python27Packages.readline or null python27Packages.hglib or null ]
);
···
[ out git bazaar cvs darcs fossil mercurial
monotone rcs src subversion cvs_fast_export ]
);
+
pythonpath = makeSearchPathOutput "lib" python27.sitePackages (
filter (x: x != null)
[ python27Packages.readline or null python27Packages.hglib or null ]
);
+1 -1
pkgs/games/ue4demos/default.nix
···
rtdeps = stdenv.lib.makeLibraryPath
[ xorg.libXxf86vm xorg.libXext openal ]
-
+ ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [ stdenv.cc.cc ];
buildCommand =
''
···
rtdeps = stdenv.lib.makeLibraryPath
[ xorg.libXxf86vm xorg.libXext openal ]
+
+ ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [ stdenv.cc.cc ];
buildCommand =
''
+1 -1
pkgs/os-specific/linux/pm-utils/default.nix
···
binPath = stdenv.lib.makeBinPath
[ coreutils gnugrep utillinux kmod procps kbd dbus_tools ];
-
sbinPath = stdenv.lib.makeSearchPathOutputs "sbin" ["bin"]
[ procps ];
in
···
binPath = stdenv.lib.makeBinPath
[ coreutils gnugrep utillinux kmod procps kbd dbus_tools ];
+
sbinPath = stdenv.lib.makeSearchPathOutput "bin" "sbin"
[ procps ];
in