makeSearchPathOutputs: refactor to makeSearchPathOutput
This commit is contained in:
parent
7d3e75827b
commit
ab0a0c004e
@ -88,15 +88,14 @@ 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.
|
/* Construct a Unix-style search path, using given package output.
|
||||||
If no output is found, fallback to `.out` and then to the default.
|
If no output is found, fallback to `.out` and then to the default.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
makeSearchPathOutputs "bin" ["bin"] [ pkgs.openssl pkgs.zlib ]
|
makeSearchPathOutput "dev" "bin" [ pkgs.openssl pkgs.zlib ]
|
||||||
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-bin/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin"
|
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-dev/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin"
|
||||||
*/
|
*/
|
||||||
makeSearchPathOutputs = subDir: outputs: pkgs:
|
makeSearchPathOutput = output: subDir: pkgs: makeSearchPath subDir (map (lib.getOutput output) 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
|
||||||
|
@ -96,7 +96,7 @@ in
|
|||||||
globalEnvVars = singleton
|
globalEnvVars = singleton
|
||||||
{ name = "PYTHONPATH";
|
{ name = "PYTHONPATH";
|
||||||
value =
|
value =
|
||||||
makeSearchPathOutputs "lib/${pkgs.python.libPrefix}/site-packages" ["lib"]
|
makeSearchPathOutput "lib" "lib/${pkgs.python.libPrefix}/site-packages"
|
||||||
[ pkgs.mod_python
|
[ pkgs.mod_python
|
||||||
pkgs.pythonPackages.trac
|
pkgs.pythonPackages.trac
|
||||||
pkgs.setuptools
|
pkgs.setuptools
|
||||||
|
@ -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.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-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
|
||||||
|
@ -58,7 +58,7 @@ let
|
|||||||
path = (makeBinPath ([
|
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 [])
|
||||||
)) + ":" + (makeSearchPathOutputs "sbin" ["bin"] [
|
)) + ":" + (makeSearchPathOutput "bin" "sbin" [
|
||||||
pkgs.mdadm pkgs.utillinux
|
pkgs.mdadm pkgs.utillinux
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
@ -193,7 +193,7 @@ in rec {
|
|||||||
|
|
||||||
path = mkOption {
|
path = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
apply = ps: "${makeBinPath ps}:${makeSearchPathOutputs "sbin" ["bin"] ps}";
|
apply = ps: "${makeBinPath ps}:${makeSearchPathOutput "bin" "sbin" 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>
|
||||||
|
@ -16,7 +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 ];
|
||||||
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 {
|
in stdenv.mkDerivation rec {
|
||||||
name = "guake-${version}";
|
name = "guake-${version}";
|
||||||
version = "0.8.3";
|
version = "0.8.3";
|
||||||
|
@ -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.makeSearchPathOutputs pythonFull.sitePackages ["lib"] [
|
PYTHONPATH = stdenv.lib.makeSearchPathOutput "lib" pythonFull.sitePackages [
|
||||||
pythonPackages.curses pythonPackages.lockfile
|
pythonPackages.curses pythonPackages.lockfile
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ let
|
|||||||
|
|
||||||
patchPhase = let
|
patchPhase = let
|
||||||
rpaths = [ stdenv.cc.cc ];
|
rpaths = [ stdenv.cc.cc ];
|
||||||
mkrpath = p: "${makeSearchPathOutputs "lib64" ["lib"] p}:${makeLibraryPath p}";
|
mkrpath = p: "${makeSearchPathOutput "lib" "lib64" 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
|
||||||
|
@ -105,7 +105,7 @@ stdenv.mkDerivation {
|
|||||||
libheimdal
|
libheimdal
|
||||||
libpulseaudio
|
libpulseaudio
|
||||||
systemd
|
systemd
|
||||||
] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
|
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [
|
||||||
stdenv.cc.cc
|
stdenv.cc.cc
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ in stdenv.mkDerivation rec {
|
|||||||
tar xf data.tar.xz
|
tar xf data.tar.xz
|
||||||
'';
|
'';
|
||||||
|
|
||||||
rpath = makeLibraryPath deps + ":" + makeSearchPathOutputs "lib64" ["lib"] deps;
|
rpath = makeLibraryPath deps + ":" + makeSearchPathOutput "lib" "lib64" deps;
|
||||||
binpath = makeBinPath deps;
|
binpath = makeBinPath deps;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
@ -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.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
|
||||||
|
|
||||||
preFixup =
|
preFixup =
|
||||||
''
|
''
|
||||||
|
@ -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.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
echo "Patching Vivaldi binaries"
|
echo "Patching Vivaldi binaries"
|
||||||
|
@ -105,7 +105,7 @@ stdenv.mkDerivation {
|
|||||||
nspr
|
nspr
|
||||||
nss
|
nss
|
||||||
pango
|
pango
|
||||||
] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [
|
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [
|
||||||
stdenv.cc.cc
|
stdenv.cc.cc
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -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.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
|
||||||
|
|
||||||
phases = "unpackPhase installPhase fixupPhase";
|
phases = "unpackPhase installPhase fixupPhase";
|
||||||
|
|
||||||
|
@ -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.makeSearchPathOutputs "lib64" ["lib"] buildInputs);
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
|
||||||
|
|
||||||
phases = "unpackPhase installPhase fixupPhase";
|
phases = "unpackPhase installPhase fixupPhase";
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ mkDerivation rec {
|
|||||||
[ 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 = makeSearchPathOutputs python27.sitePackages ["lib"] (
|
pythonpath = makeSearchPathOutput "lib" python27.sitePackages (
|
||||||
filter (x: x != null)
|
filter (x: x != null)
|
||||||
[ python27Packages.readline or null python27Packages.hglib or null ]
|
[ python27Packages.readline or null python27Packages.hglib or null ]
|
||||||
);
|
);
|
||||||
|
@ -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.makeSearchPathOutputs "lib64" ["lib"] [ stdenv.cc.cc ];
|
+ ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [ stdenv.cc.cc ];
|
||||||
|
|
||||||
buildCommand =
|
buildCommand =
|
||||||
''
|
''
|
||||||
|
@ -6,7 +6,7 @@ let
|
|||||||
binPath = stdenv.lib.makeBinPath
|
binPath = stdenv.lib.makeBinPath
|
||||||
[ coreutils gnugrep utillinux kmod procps kbd dbus_tools ];
|
[ coreutils gnugrep utillinux kmod procps kbd dbus_tools ];
|
||||||
|
|
||||||
sbinPath = stdenv.lib.makeSearchPathOutputs "sbin" ["bin"]
|
sbinPath = stdenv.lib.makeSearchPathOutput "bin" "sbin"
|
||||||
[ procps ];
|
[ procps ];
|
||||||
|
|
||||||
in
|
in
|
||||||
|
Loading…
Reference in New Issue
Block a user