From 5ef56700b9e142978673db5889579a0838956d49 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 13 Apr 2016 14:39:00 +0300 Subject: [PATCH 1/7] makeBinPath: guess outputs --- lib/strings.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/strings.nix b/lib/strings.nix index f9145f34832e..6818e589bc1c 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -109,7 +109,8 @@ rec { makeBinPath ["/root" "/usr" "/usr/local"] => "/root/bin:/usr/bin:/usr/local/bin" */ - makeBinPath = makeSearchPath "bin"; + makeBinPath = pkgs: makeSearchPath "bin" + (map (pkg: pkg.bin or (pkg.out or pkg)) pkgs); /* Construct a perl search path (such as $PERL5LIB) From 338340f993563551d8cb45941da987408abef65f Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 13 Apr 2016 15:33:11 +0300 Subject: [PATCH 2/7] tryAttrs: init function --- lib/attrsets.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 4161fa546c8f..70986195ae05 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -438,6 +438,24 @@ 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. + + 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 ***/ From 2a3b3d6f8b75eb10ab638d32c163bc6ca798ae50 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 13 Apr 2016 15:33:21 +0300 Subject: [PATCH 3/7] makeSearchPathOutputs: init function --- lib/strings.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/strings.nix b/lib/strings.nix index 6818e589bc1c..30c24f7bde5a 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -88,6 +88,16 @@ rec { 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 (lib.tryAttrs (outputs ++ ["out"])) pkgs); + /* Construct a library search path (such as RPATH) containing the libraries for a set of packages From e26119619f7ce64b065e692ba0cd31f53b9ef637 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 13 Apr 2016 15:33:32 +0300 Subject: [PATCH 4/7] makePerlPath: try to guess outputs --- lib/strings.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/strings.nix b/lib/strings.nix index 30c24f7bde5a..474475e27890 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -132,7 +132,8 @@ rec { makePerlPath [ pkgs.perlPackages.NetSMTP ] => "/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: pkg.lib or (pkg.out or pkg)) pkgs); /* Dependening on the boolean `cond', return either the given string or the empty string. Useful to contatenate against a bigger string. From 8b7ebaffeb3087ef18ff5c0f38cc3f44f7f8124e Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 13 Apr 2016 15:53:51 +0300 Subject: [PATCH 5/7] replace makeSearchPath tree-wise to take care of possible multiple outputs --- nixos/modules/services/misc/octoprint.nix | 2 +- .../services/web-servers/apache-httpd/trac.nix | 2 +- .../x11/desktop-managers/enlightenment.nix | 2 +- nixos/modules/system/boot/loader/grub/grub.nix | 4 ++-- .../modules/system/boot/systemd-unit-options.nix | 2 +- nixos/modules/virtualisation/azure-agent.nix | 2 +- .../modules/virtualisation/virtualbox-guest.nix | 2 +- pkgs/applications/misc/guake/default.nix | 5 ++--- pkgs/applications/misc/playonlinux/default.nix | 2 +- pkgs/applications/misc/roxterm/default.nix | 2 +- pkgs/applications/misc/zathura/default.nix | 2 +- .../networking/browsers/chromium/plugins.nix | 4 ++-- .../networking/browsers/firefox-bin/default.nix | 2 +- .../networking/browsers/opera/default.nix | 2 +- .../networking/browsers/vivaldi/default.nix | 2 +- pkgs/applications/networking/dropbox/default.nix | 2 +- .../instant-messengers/hipchat/default.nix | 2 +- .../instant-messengers/slack/default.nix | 2 +- .../mailreaders/thunderbird-bin/default.nix | 2 +- .../networking/spideroak/default.nix | 2 +- .../machine-learning/torch/torch-distro.nix | 4 ++-- pkgs/applications/science/math/mathematica/9.nix | 2 +- .../science/math/mathematica/default.nix | 2 +- .../applications/science/math/maxima/default.nix | 2 +- .../cvs-fast-export/default.nix | 2 +- .../version-management/cvs2svn/default.nix | 2 +- .../version-management/reposurgeon/default.nix | 4 ++-- .../version-management/smartgithg/default.nix | 2 +- pkgs/desktops/kde-5/applications-15.12/ark.nix | 2 +- .../development/arduino/arduino-core/default.nix | 2 +- pkgs/development/compilers/elm/default.nix | 2 +- pkgs/development/compilers/julia/default.nix | 2 +- pkgs/development/compilers/julia/git.nix | 4 ++-- .../haskell-modules/with-packages-wrapper.nix | 2 +- .../development/mobile/androidenv/androidndk.nix | 2 +- .../mobile/androidenv/androidndk_r8e.nix | 2 +- .../tools/haskell/lambdabot/default.nix | 16 ++++++++-------- pkgs/development/web/grails/default.nix | 2 +- pkgs/games/adom/default.nix | 2 +- pkgs/games/ue4demos/default.nix | 2 +- pkgs/misc/cups/filters.nix | 2 +- pkgs/os-specific/linux/fanctl/default.nix | 2 +- pkgs/os-specific/linux/pipework/default.nix | 2 +- pkgs/os-specific/linux/pm-utils/default.nix | 4 ++-- pkgs/servers/mail/dspam/default.nix | 2 +- pkgs/servers/xmpp/ejabberd/default.nix | 2 +- pkgs/tools/X11/bumblebee/default.nix | 2 +- pkgs/tools/cd-dvd/brasero/default.nix | 2 +- pkgs/tools/graphics/fgallery/default.nix | 2 +- pkgs/tools/graphics/imgur-screenshot/default.nix | 4 ++-- pkgs/tools/graphics/imgurbash2/default.nix | 2 +- pkgs/tools/misc/tlp/default.nix | 2 +- pkgs/tools/misc/xfstests/default.nix | 2 +- pkgs/tools/security/pass/default.nix | 2 +- pkgs/tools/security/pass/rofi-pass.nix | 2 +- pkgs/tools/security/pcsctools/default.nix | 2 +- 56 files changed, 71 insertions(+), 72 deletions(-) diff --git a/nixos/modules/services/misc/octoprint.nix b/nixos/modules/services/misc/octoprint.nix index 8ab2a9307a71..c0af3587205a 100644 --- a/nixos/modules/services/misc/octoprint.nix +++ b/nixos/modules/services/misc/octoprint.nix @@ -102,7 +102,7 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; path = [ pluginsEnv ]; - environment.PYTHONPATH = makeSearchPath pkgs.python.sitePackages [ pluginsEnv ]; + environment.PYTHONPATH = makeSearchPathOutputs pkgs.python.sitePackages ["lib"] [ pluginsEnv ]; preStart = '' mkdir -p "${cfg.stateDir}" diff --git a/nixos/modules/services/web-servers/apache-httpd/trac.nix b/nixos/modules/services/web-servers/apache-httpd/trac.nix index c5c11029010e..c4aa6b6ad3a3 100644 --- a/nixos/modules/services/web-servers/apache-httpd/trac.nix +++ b/nixos/modules/services/web-servers/apache-httpd/trac.nix @@ -96,7 +96,7 @@ in globalEnvVars = singleton { name = "PYTHONPATH"; value = - makeSearchPath "lib/${pkgs.python.libPrefix}/site-packages" + makeSearchPathOutputs "lib/${pkgs.python.libPrefix}/site-packages" ["lib"] [ pkgs.mod_python pkgs.pythonPackages.trac pkgs.setuptools diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index c981b40f74a6..11df7297833b 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -7,7 +7,7 @@ let e = pkgs.enlightenment; xcfg = config.services.xserver; 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-good pkgs.gst_all_1.gst-plugins-bad diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index d9f6f51f13a2..05322497a4bf 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -55,10 +55,10 @@ let version extraConfig extraPerEntryConfig extraEntries extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels timeout default fsIdentifier efiSupport gfxmodeEfi gfxmodeBios; - path = (makeSearchPath "bin" ([ + 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 []) - )) + ":" + (makeSearchPath "sbin" [ + )) + ":" + (makeSearchPathOutputs "sbin" ["bin"] [ pkgs.mdadm pkgs.utillinux ]); }); diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix index d4cab93b26b8..c8c9cda913c0 100644 --- a/nixos/modules/system/boot/systemd-unit-options.nix +++ b/nixos/modules/system/boot/systemd-unit-options.nix @@ -193,7 +193,7 @@ in rec { path = mkOption { default = []; - apply = ps: "${makeSearchPath "bin" ps}:${makeSearchPath "sbin" ps}"; + apply = ps: "${makeBinPath ps}:${makeSearchPathOutputs "sbin" ["bin"] ps}"; description = '' Packages added to the service's PATH environment variable. Both the bin diff --git a/nixos/modules/virtualisation/azure-agent.nix b/nixos/modules/virtualisation/azure-agent.nix index da97565fd6de..a89cd454dc73 100644 --- a/nixos/modules/virtualisation/azure-agent.nix +++ b/nixos/modules/virtualisation/azure-agent.nix @@ -42,7 +42,7 @@ let wrapProgram "$out/bin/waagent" \ --prefix PYTHONPATH : $PYTHONPATH \ - --prefix PATH : "${makeSearchPath "bin" runtimeDeps}" + --prefix PATH : "${makeBinPath runtimeDeps}" ''; }; diff --git a/nixos/modules/virtualisation/virtualbox-guest.nix b/nixos/modules/virtualisation/virtualbox-guest.nix index 9733bd6fac46..3a10871ce840 100644 --- a/nixos/modules/virtualisation/virtualbox-guest.nix +++ b/nixos/modules/virtualisation/virtualbox-guest.nix @@ -66,7 +66,7 @@ in 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 ''; diff --git a/pkgs/applications/misc/guake/default.nix b/pkgs/applications/misc/guake/default.nix index 4f6733e7d8de..81ac845c5cf8 100644 --- a/pkgs/applications/misc/guake/default.nix +++ b/pkgs/applications/misc/guake/default.nix @@ -16,8 +16,7 @@ gconftool-2 --recursive-unset /apps/guake with lib; let inputs = [ dbus gtk2 gconf python2 libutempter vte keybinder gnome3.gnome_common ]; - pySubDir = "lib/${python2.libPrefix}/site-packages"; - pyPath = makeSearchPath pySubDir (attrVals [ "dbus" "notify" "pyGtkGlade" "pyxdg" ] python2Packages ++ [ gnome2.gnome_python ]); + 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"; @@ -63,7 +62,7 @@ let inputs = [ dbus gtk2 gconf python2 libutempter vte keybinder gnome3.gnome_co wrapProgram $bin \ --prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \ --prefix LD_LIBRARY_PATH : ${makeLibraryPath inputs} \ - --prefix PYTHONPATH : "$out/${pySubDir}:${pyPath}:$PYTHONPATH" + --prefix PYTHONPATH : "$out/${python2.sitePackages}:${pyPath}:$PYTHONPATH" done ''; diff --git a/pkgs/applications/misc/playonlinux/default.nix b/pkgs/applications/misc/playonlinux/default.nix index 178fc13065b3..4bf6e36f1d26 100644 --- a/pkgs/applications/misc/playonlinux/default.nix +++ b/pkgs/applications/misc/playonlinux/default.nix @@ -26,7 +26,7 @@ assert stdenv.isLinux; let version = "4.2.9"; - binpath = stdenv.lib.makeSearchPath "bin" + binpath = stdenv.lib.makeBinPath [ cabextract python2Packages.python gettext diff --git a/pkgs/applications/misc/roxterm/default.nix b/pkgs/applications/misc/roxterm/default.nix index 93ee6470b7c3..ec055f3055fc 100644 --- a/pkgs/applications/misc/roxterm/default.nix +++ b/pkgs/applications/misc/roxterm/default.nix @@ -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.makeSearchPath "lib/${pythonFull.libPrefix}/site-packages" [ + PYTHONPATH = stdenv.lib.makeSearchPathOutputs pythonFull.sitePackages ["lib"] [ pythonPackages.curses pythonPackages.lockfile ]; diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix index 8b37e22d117a..0ad3bf2adb99 100644 --- a/pkgs/applications/misc/zathura/default.nix +++ b/pkgs/applications/misc/zathura/default.nix @@ -30,7 +30,7 @@ rec { name = "zathura-${zathura_core.version}"; - plugins_path = stdenv.lib.makeSearchPath "lib" [ + plugins_path = stdenv.lib.makeLibraryPath [ zathura_djvu zathura_ps (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler) diff --git a/pkgs/applications/networking/browsers/chromium/plugins.nix b/pkgs/applications/networking/browsers/chromium/plugins.nix index 82b3bc3ea59c..b7883454b349 100644 --- a/pkgs/applications/networking/browsers/chromium/plugins.nix +++ b/pkgs/applications/networking/browsers/chromium/plugins.nix @@ -64,8 +64,8 @@ let ''; patchPhase = let - rpaths = [ stdenv.cc.cc.lib ]; - mkrpath = p: "${makeSearchPath "lib64" p}:${makeSearchPath "lib" p}"; + rpaths = [ stdenv.cc.cc ]; + mkrpath = p: "${makeSearchPathOutputs "lib64" ["lib"] p}:${makeLibraryPath p}"; in '' for sofile in PepperFlash/libpepflashplayer.so \ libwidevinecdm.so libwidevinecdmadapter.so; do diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix index d2d6fcb59342..152089286b48 100644 --- a/pkgs/applications/networking/browsers/firefox-bin/default.nix +++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix @@ -105,7 +105,7 @@ stdenv.mkDerivation { libheimdal libpulseaudio systemd - ] + ":" + stdenv.lib.makeSearchPath "lib64" [ + ] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [ stdenv.cc.cc ]; diff --git a/pkgs/applications/networking/browsers/opera/default.nix b/pkgs/applications/networking/browsers/opera/default.nix index de7240d3a83b..325e855ec72e 100644 --- a/pkgs/applications/networking/browsers/opera/default.nix +++ b/pkgs/applications/networking/browsers/opera/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { libPath = stdenv.lib.makeLibraryPath buildInputs + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") - (":" + stdenv.lib.makeSearchPath "lib64" buildInputs); + (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs); preFixup = '' diff --git a/pkgs/applications/networking/browsers/vivaldi/default.nix b/pkgs/applications/networking/browsers/vivaldi/default.nix index 651f513356b6..7c3c167cf32d 100644 --- a/pkgs/applications/networking/browsers/vivaldi/default.nix +++ b/pkgs/applications/networking/browsers/vivaldi/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { libPath = stdenv.lib.makeLibraryPath buildInputs + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") - (":" + stdenv.lib.makeSearchPath "lib64" buildInputs); + (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs); buildPhase = '' echo "Patching Vivaldi binaries" diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix index e20db1892bb1..d27a6a7b8491 100644 --- a/pkgs/applications/networking/dropbox/default.nix +++ b/pkgs/applications/networking/dropbox/default.nix @@ -36,7 +36,7 @@ let # relative location where the dropbox libraries are stored appdir = "opt/dropbox"; - ldpath = stdenv.lib.makeSearchPath "lib" + ldpath = stdenv.lib.makeLibraryPath [ dbus_libs gcc.cc glib libdrm libffi libICE libSM libX11 libXmu ncurses popt qtbase qtdeclarative qtwebkit zlib diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix index 6449c9d3d1a5..b57b3394eea7 100644 --- a/pkgs/applications/networking/instant-messengers/hipchat/default.nix +++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix @@ -6,7 +6,7 @@ let version = "4.0.1631"; - rpath = stdenv.lib.makeSearchPath "lib" [ + rpath = stdenv.lib.makeLibraryPath [ xorg.libXext xorg.libSM xorg.libICE diff --git a/pkgs/applications/networking/instant-messengers/slack/default.nix b/pkgs/applications/networking/instant-messengers/slack/default.nix index 417eecb4ac8c..581d9d171b95 100644 --- a/pkgs/applications/networking/instant-messengers/slack/default.nix +++ b/pkgs/applications/networking/instant-messengers/slack/default.nix @@ -6,7 +6,7 @@ let version = "2.0.3"; - rpath = stdenv.lib.makeSearchPath "lib" [ + rpath = stdenv.lib.makeLibraryPath [ alsaLib atk cairo diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix index 388fc418de15..bbb51c7c1865 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix @@ -105,7 +105,7 @@ stdenv.mkDerivation { nspr nss pango - ] + ":" + stdenv.lib.makeSearchPath "lib64" [ + ] + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [ stdenv.cc.cc ]; diff --git a/pkgs/applications/networking/spideroak/default.nix b/pkgs/applications/networking/spideroak/default.nix index fd060ad08801..23c226b9f8a5 100644 --- a/pkgs/applications/networking/spideroak/default.nix +++ b/pkgs/applications/networking/spideroak/default.nix @@ -16,7 +16,7 @@ let else if stdenv.system == "i686-linux" then "8c23271291f40aa144bbf38ceb3cc2a05bed00759c87a65bd798cf8bb289d07a" else throw "Spideroak client for: ${stdenv.system} not supported!"; - ldpath = stdenv.lib.makeSearchPath "lib" [ + ldpath = stdenv.lib.makeLibraryPath [ glib fontconfig libXext libX11 freetype libXrender ]; diff --git a/pkgs/applications/science/machine-learning/torch/torch-distro.nix b/pkgs/applications/science/machine-learning/torch/torch-distro.nix index 067cb1341140..5ff510a52ce8 100644 --- a/pkgs/applications/science/machine-learning/torch/torch-distro.nix +++ b/pkgs/applications/science/machine-learning/torch/torch-distro.nix @@ -73,8 +73,8 @@ let for p in $out/bin/*; do wrapProgram $p \ - --suffix LD_LIBRARY_PATH ';' "${lib.makeSearchPath "lib" runtimeDeps_}" \ - --suffix PATH ';' "${lib.makeSearchPath "bin" runtimeDeps_}" \ + --suffix LD_LIBRARY_PATH ';' "${lib.makeLibraryPath runtimeDeps_}" \ + --suffix PATH ';' "${lib.makeBinPath runtimeDeps_}" \ --suffix LUA_PATH ';' "\"$LUA_PATH\"" \ --suffix LUA_PATH ';' "\"$out/share/lua/${lua.luaversion}/?.lua;$out/share/lua/${lua.luaversion}/?/init.lua\"" \ --suffix LUA_CPATH ';' "\"$LUA_CPATH\"" \ diff --git a/pkgs/applications/science/math/mathematica/9.nix b/pkgs/applications/science/math/mathematica/9.nix index 7573b8955b19..2a43cf5677fe 100644 --- a/pkgs/applications/science/math/mathematica/9.nix +++ b/pkgs/applications/science/math/mathematica/9.nix @@ -63,7 +63,7 @@ stdenv.mkDerivation rec { ldpath = stdenv.lib.makeLibraryPath buildInputs + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") - (":" + stdenv.lib.makeSearchPath "lib64" buildInputs); + (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs); phases = "unpackPhase installPhase fixupPhase"; diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix index 05c6f2622934..c2988331c4cd 100644 --- a/pkgs/applications/science/math/mathematica/default.nix +++ b/pkgs/applications/science/math/mathematica/default.nix @@ -73,7 +73,7 @@ stdenv.mkDerivation rec { ldpath = stdenv.lib.makeLibraryPath buildInputs + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") - (":" + stdenv.lib.makeSearchPath "lib64" buildInputs); + (":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] buildInputs); phases = "unpackPhase installPhase fixupPhase"; diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix index e42bd0f83ee0..4497356a29f8 100644 --- a/pkgs/applications/science/math/maxima/default.nix +++ b/pkgs/applications/science/math/maxima/default.nix @@ -5,7 +5,7 @@ let version = "5.36.1"; searchPath = - stdenv.lib.makeSearchPath "bin" + stdenv.lib.makeBinPath (stdenv.lib.filter (x: x != null) [ sbcl rlwrap tk gnuplot ]); in stdenv.mkDerivation { diff --git a/pkgs/applications/version-management/cvs-fast-export/default.nix b/pkgs/applications/version-management/cvs-fast-export/default.nix index 62a58ee985c0..eae18c39dadd 100644 --- a/pkgs/applications/version-management/cvs-fast-export/default.nix +++ b/pkgs/applications/version-management/cvs-fast-export/default.nix @@ -39,7 +39,7 @@ mkDerivation rec { postInstall = let - binpath = makeSearchPath "bin" [ out rcs cvs git coreutils rsync ]; + binpath = makeBinPath [ out rcs cvs git coreutils rsync ]; in '' for prog in cvs-fast-export cvsconvert cvssync; do wrapProgram $out/bin/$prog \ diff --git a/pkgs/applications/version-management/cvs2svn/default.nix b/pkgs/applications/version-management/cvs2svn/default.nix index 870248ed75d2..85749f978d1c 100644 --- a/pkgs/applications/version-management/cvs2svn/default.nix +++ b/pkgs/applications/version-management/cvs2svn/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { python ./setup.py install --prefix=$out for i in bzr svn git; do wrapProgram $out/bin/cvs2$i \ - --prefix PATH : "${lib.makeSearchPath "bin" [ cvs ]}" \ + --prefix PATH : "${lib.makeBinPath [ cvs ]}" \ --set PYTHONPATH "$(toPythonPath $out):$PYTHONPATH" done ''; diff --git a/pkgs/applications/version-management/reposurgeon/default.nix b/pkgs/applications/version-management/reposurgeon/default.nix index 5c2dde955721..669151adbcc8 100644 --- a/pkgs/applications/version-management/reposurgeon/default.nix +++ b/pkgs/applications/version-management/reposurgeon/default.nix @@ -46,12 +46,12 @@ mkDerivation rec { postInstall = let - binpath = makeSearchPath "bin" ( + binpath = makeBinPath ( filter (x: x != null) [ out git bazaar cvs darcs fossil mercurial monotone rcs src subversion cvs_fast_export ] ); - pythonpath = makeSearchPath (python27.sitePackages) ( + pythonpath = makeSearchPathOutputs python27.sitePackages ["lib"] ( filter (x: x != null) [ python27Packages.readline or null python27Packages.hglib or null ] ); diff --git a/pkgs/applications/version-management/smartgithg/default.nix b/pkgs/applications/version-management/smartgithg/default.nix index 292d6fc934b5..51d70156e9ce 100644 --- a/pkgs/applications/version-management/smartgithg/default.nix +++ b/pkgs/applications/version-management/smartgithg/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { pkg_path = "$out/${name}"; bin_path = "$out/bin"; install_freedesktop_items = ./install_freedesktop_items.sh; - runtime_paths = lib.makeSearchPath "bin" [ + runtime_paths = lib.makeBinPath [ jre #git mercurial subversion # the paths are requested in configuration which diff --git a/pkgs/desktops/kde-5/applications-15.12/ark.nix b/pkgs/desktops/kde-5/applications-15.12/ark.nix index 36a1ca7cfbd7..9e6f414db9e2 100644 --- a/pkgs/desktops/kde-5/applications-15.12/ark.nix +++ b/pkgs/desktops/kde-5/applications-15.12/ark.nix @@ -20,7 +20,7 @@ , zip }: -let PATH = lib.makeSearchPath "bin" [ +let PATH = lib.makeBinPath [ p7zip unrar unzipNLS zip ]; in diff --git a/pkgs/development/arduino/arduino-core/default.nix b/pkgs/development/arduino/arduino-core/default.nix index 7a960dc931b9..37947c804b8b 100644 --- a/pkgs/development/arduino/arduino-core/default.nix +++ b/pkgs/development/arduino/arduino-core/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { fi done - patchelf --set-rpath ${stdenv.lib.makeSearchPath "lib" [ libusb ]} \ + patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ libusb ]} \ "$out/share/arduino/hardware/tools/avrdude" ''; diff --git a/pkgs/development/compilers/elm/default.nix b/pkgs/development/compilers/elm/default.nix index 7fedbed28293..87211ff6e6ed 100644 --- a/pkgs/development/compilers/elm/default.nix +++ b/pkgs/development/compilers/elm/default.nix @@ -50,7 +50,7 @@ let doCheck = false; buildTools = drv.buildTools or [] ++ [ makeWrapper ]; postInstall = - let bins = lib.makeSearchPath "bin" [ nodejs self.elm-make ]; + let bins = lib.makeBinPath [ nodejs self.elm-make ]; in '' wrapProgram $out/bin/elm-repl \ --prefix PATH ':' ${bins} diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix index 0c0520533bcd..9886dc4d52ad 100644 --- a/pkgs/development/compilers/julia/default.nix +++ b/pkgs/development/compilers/julia/default.nix @@ -128,7 +128,7 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = [ "-fPIC" ]; - LD_LIBRARY_PATH = makeSearchPath "lib" [ + LD_LIBRARY_PATH = makeLibraryPath [ arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm openspecfun pcre2 suitesparse ]; diff --git a/pkgs/development/compilers/julia/git.nix b/pkgs/development/compilers/julia/git.nix index 1b3ef86cdbe7..2fbe50fbc9f1 100644 --- a/pkgs/development/compilers/julia/git.nix +++ b/pkgs/development/compilers/julia/git.nix @@ -130,10 +130,10 @@ stdenv.mkDerivation rec { 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 openspecfun pcre2 suitesparse - ])); + ]; dontStrip = true; dontPatchELF = true; diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 740047e2c27f..66e151aefe3c 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -41,7 +41,7 @@ let hasLibraries = lib.any (x: x.isHaskellLibrary) paths; # CLang is needed on Darwin for -fllvm to work: # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html - llvm = lib.makeSearchPath "bin" + llvm = lib.makeBinPath ([ llvmPackages.llvm ] ++ lib.optional stdenv.isDarwin llvmPackages.clang); in diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix index 0ae5fc3b5403..63ea07b78a60 100644 --- a/pkgs/development/mobile/androidenv/androidndk.nix +++ b/pkgs/development/mobile/androidenv/androidndk.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { sed_script_2 = "'s|^MYNDKDIR=`dirname $0`" + "|MYNDKDIR=`dirname $(readlink -f $(which $0))`|'"; - runtime_paths = (lib.makeSearchPath "bin" [ + runtime_paths = (lib.makeBinPath [ coreutils file findutils gawk gnugrep gnused jdk diff --git a/pkgs/development/mobile/androidenv/androidndk_r8e.nix b/pkgs/development/mobile/androidenv/androidndk_r8e.nix index 428cef49a2d1..1896a615ac1e 100644 --- a/pkgs/development/mobile/androidenv/androidndk_r8e.nix +++ b/pkgs/development/mobile/androidenv/androidndk_r8e.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { sed_script_2 = "'s|^MYNDKDIR=`dirname $0`" + "|MYNDKDIR=`dirname $(readlink -f $(which $0))`|'"; - runtime_paths = (lib.makeSearchPath "bin" [ + runtime_paths = (lib.makeBinPath [ coreutils file findutils gawk gnugrep gnused jdk diff --git a/pkgs/development/tools/haskell/lambdabot/default.nix b/pkgs/development/tools/haskell/lambdabot/default.nix index 01dfe339d141..85d4bfc93b6a 100644 --- a/pkgs/development/tools/haskell/lambdabot/default.nix +++ b/pkgs/development/tools/haskell/lambdabot/default.nix @@ -14,14 +14,14 @@ let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ pac inherit haskellPackages; packages = allPkgs; }; - bins = lib.makeSearchPath "bin" ([ mueval' - (haskellPackages.ghcWithPackages allPkgs) - haskellPackages.unlambda - haskellPackages.brainfuck - ] - ++ lib.optional withDjinn haskellPackages.djinn - ++ lib.optional (aspell != null) aspell - ); + bins = lib.makeBinPath ([ mueval' + (haskellPackages.ghcWithPackages allPkgs) + haskellPackages.unlambda + haskellPackages.brainfuck + ] + ++ lib.optional withDjinn haskellPackages.djinn + ++ lib.optional (aspell != null) aspell + ); modulesStr = lib.replaceChars ["\n"] [" "] modules; configStr = lib.replaceChars ["\n"] [" "] configuration; diff --git a/pkgs/development/web/grails/default.nix b/pkgs/development/web/grails/default.nix index 357e77009c4d..5b9e27b4829f 100644 --- a/pkgs/development/web/grails/default.nix +++ b/pkgs/development/web/grails/default.nix @@ -6,7 +6,7 @@ }: let - binpath = stdenv.lib.makeSearchPath "bin" + binpath = stdenv.lib.makeBinPath ([ coreutils ncurses gnused gnugrep ] ++ stdenv.lib.optional (jdk != null) jdk); in stdenv.mkDerivation rec { diff --git a/pkgs/games/adom/default.nix b/pkgs/games/adom/default.nix index 07075571c7e3..016c965b6c0b 100644 --- a/pkgs/games/adom/default.nix +++ b/pkgs/games/adom/default.nix @@ -6,7 +6,7 @@ let 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]; in diff --git a/pkgs/games/ue4demos/default.nix b/pkgs/games/ue4demos/default.nix index 026f974ff932..963dde91068b 100644 --- a/pkgs/games/ue4demos/default.nix +++ b/pkgs/games/ue4demos/default.nix @@ -12,7 +12,7 @@ let rtdeps = stdenv.lib.makeLibraryPath [ xorg.libXxf86vm xorg.libXext openal ] - + ":" + stdenv.lib.makeSearchPath "lib64" [ stdenv.cc.cc ]; + + ":" + stdenv.lib.makeSearchPathOutputs "lib64" ["lib"] [ stdenv.cc.cc ]; buildCommand = '' diff --git a/pkgs/misc/cups/filters.nix b/pkgs/misc/cups/filters.nix index 7118511f16d3..7394daefb7cb 100644 --- a/pkgs/misc/cups/filters.nix +++ b/pkgs/misc/cups/filters.nix @@ -4,7 +4,7 @@ }: 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 { name = "cups-filters-${version}"; diff --git a/pkgs/os-specific/linux/fanctl/default.nix b/pkgs/os-specific/linux/fanctl/default.nix index cb188b56c06d..f60951f5541e 100644 --- a/pkgs/os-specific/linux/fanctl/default.nix +++ b/pkgs/os-specific/linux/fanctl/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace fanctl \ --replace '@PATH@' \ - '${lib.makeSearchPath "bin" [ + '${lib.makeBinPath [ gnugrep gawk coreutils bridge-utils iproute dnsmasq iptables kmod utillinux gnused glibc # needed for getent diff --git a/pkgs/os-specific/linux/pipework/default.nix b/pkgs/os-specific/linux/pipework/default.nix index 225515cb70a2..a686bd5496d7 100644 --- a/pkgs/os-specific/linux/pipework/default.nix +++ b/pkgs/os-specific/linux/pipework/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp pipework $out/bin 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; { description = "Software-Defined Networking tools for LXC"; diff --git a/pkgs/os-specific/linux/pm-utils/default.nix b/pkgs/os-specific/linux/pm-utils/default.nix index 4fb7fc8cb0b8..19315ec2d0ba 100644 --- a/pkgs/os-specific/linux/pm-utils/default.nix +++ b/pkgs/os-specific/linux/pm-utils/default.nix @@ -3,10 +3,10 @@ let - binPath = stdenv.lib.makeSearchPath "bin" + binPath = stdenv.lib.makeBinPath [ coreutils gnugrep utillinux module_init_tools procps kbd dbus_tools ]; - sbinPath = stdenv.lib.makeSearchPath "sbin" + sbinPath = stdenv.lib.makeSearchPathOutputs "sbin" ["bin"] [ procps ]; in diff --git a/pkgs/servers/mail/dspam/default.nix b/pkgs/servers/mail/dspam/default.nix index 99f8d45b4c1d..3cd3ca7492dd 100644 --- a/pkgs/servers/mail/dspam/default.nix +++ b/pkgs/servers/mail/dspam/default.nix @@ -15,7 +15,7 @@ let ++ lib.optional withSQLite "sqlite3_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 { name = "dspam-3.10.2"; diff --git a/pkgs/servers/xmpp/ejabberd/default.nix b/pkgs/servers/xmpp/ejabberd/default.nix index 1f3f85e82760..10658ce4dd28 100644 --- a/pkgs/servers/xmpp/ejabberd/default.nix +++ b/pkgs/servers/xmpp/ejabberd/default.nix @@ -13,7 +13,7 @@ }: let - ctlpath = lib.makeSearchPath "bin" [ bash gnused gnugrep coreutils utillinux procps ]; + ctlpath = lib.makeBinPath [ bash gnused gnugrep coreutils utillinux procps ]; fakegit = writeScriptBin "git" '' #! ${stdenv.shell} -e diff --git a/pkgs/tools/X11/bumblebee/default.nix b/pkgs/tools/X11/bumblebee/default.nix index 2206905aa3e4..d1f2318d6d45 100644 --- a/pkgs/tools/X11/bumblebee/default.nix +++ b/pkgs/tools/X11/bumblebee/default.nix @@ -43,7 +43,7 @@ let 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 ]; xmodules = lib.concatStringsSep "," (map (x: "${x}/lib/xorg/modules") ([ xorgserver ] ++ lib.optional (!useNvidia) xf86videonouveau)); diff --git a/pkgs/tools/cd-dvd/brasero/default.nix b/pkgs/tools/cd-dvd/brasero/default.nix index 3185242f5ce4..91a5440df3ec 100644 --- a/pkgs/tools/cd-dvd/brasero/default.nix +++ b/pkgs/tools/cd-dvd/brasero/default.nix @@ -5,7 +5,7 @@ let major = "3.12"; minor = "0"; - binpath = stdenv.lib.makeSearchPath "bin" [ dvdauthor cdrdao dvdplusrwtools cdrtools ]; + binpath = stdenv.lib.makeBinPath [ dvdauthor cdrdao dvdplusrwtools cdrtools ]; in stdenv.mkDerivation rec { version = "${major}.${minor}"; diff --git a/pkgs/tools/graphics/fgallery/default.nix b/pkgs/tools/graphics/fgallery/default.nix index 6b8de80ee70e..4b263b555d21 100644 --- a/pkgs/tools/graphics/fgallery/default.nix +++ b/pkgs/tools/graphics/fgallery/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { wrapProgram "$out/share/fgallery/fgallery" \ --set PERL5LIB "$PERL5LIB" \ - --set PATH "${stdenv.lib.makeSearchPath "bin" + --set PATH "${stdenv.lib.makeBinPath [ coreutils zip imagemagick pngcrush lcms2 fbida ]}" ''; diff --git a/pkgs/tools/graphics/imgur-screenshot/default.nix b/pkgs/tools/graphics/imgur-screenshot/default.nix index 777139d47fee..26af637300ee 100644 --- a/pkgs/tools/graphics/imgur-screenshot/default.nix +++ b/pkgs/tools/graphics/imgur-screenshot/default.nix @@ -1,6 +1,6 @@ { 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 { version = "1.5.4"; name = "imgur-screenshot-${version}"; @@ -26,4 +26,4 @@ in stdenv.mkDerivation rec { license = licenses.mit; maintainers = with maintainers; [ lw ]; }; -} \ No newline at end of file +} diff --git a/pkgs/tools/graphics/imgurbash2/default.nix b/pkgs/tools/graphics/imgurbash2/default.nix index 5e7b4dcb3872..99ef87ca5dfe 100644 --- a/pkgs/tools/graphics/imgurbash2/default.nix +++ b/pkgs/tools/graphics/imgurbash2/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cat <$out/bin/imgurbash2 #!${bash}/bin/bash - PATH=${stdenv.lib.makeSearchPath "bin" [curl xsel]}:\$PATH + PATH=${stdenv.lib.makeBinPath [curl xsel]}:\$PATH EOF cat imgurbash2 >> $out/bin/imgurbash2 chmod +x $out/bin/imgurbash2 diff --git a/pkgs/tools/misc/tlp/default.nix b/pkgs/tools/misc/tlp/default.nix index 7b57458bd3f4..e20dc850008a 100644 --- a/pkgs/tools/misc/tlp/default.nix +++ b/pkgs/tools/misc/tlp/default.nix @@ -26,7 +26,7 @@ in stdenv.mkDerivation { buildInputs = [ perl ]; - paths = lib.makeSearchPath "bin" + paths = lib.makeBinPath ([ iw rfkill hdparm ethtool inetutils systemd module_init_tools pciutils smartmontools x86_energy_perf_policy gawk gnugrep coreutils ] diff --git a/pkgs/tools/misc/xfstests/default.nix b/pkgs/tools/misc/xfstests/default.nix index b7c1795c0372..957582a3687f 100644 --- a/pkgs/tools/misc/xfstests/default.nix +++ b/pkgs/tools/misc/xfstests/default.nix @@ -72,7 +72,7 @@ stdenv.mkDerivation { ln -s @out@/lib/xfstests/$f $f 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 "$@" ''; diff --git a/pkgs/tools/security/pass/default.nix b/pkgs/tools/security/pass/default.nix index 2f6769b929b8..534e06814e2b 100644 --- a/pkgs/tools/security/pass/default.nix +++ b/pkgs/tools/security/pass/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { '' else ""} ''; - wrapperPath = with stdenv.lib; makeSearchPath "bin/" ([ + wrapperPath = with stdenv.lib; makeBinPath ([ coreutils gnused getopt diff --git a/pkgs/tools/security/pass/rofi-pass.nix b/pkgs/tools/security/pass/rofi-pass.nix index 94dca5dca680..45cd0f0e20b0 100644 --- a/pkgs/tools/security/pass/rofi-pass.nix +++ b/pkgs/tools/security/pass/rofi-pass.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { cp -a $src/config.example $out/share/doc/rofi-pass/config.example ''; - wrapperPath = with stdenv.lib; makeSearchPath "bin/" [ + wrapperPath = with stdenv.lib; makeBinPath [ coreutils findutils gnugrep diff --git a/pkgs/tools/security/pcsctools/default.nix b/pkgs/tools/security/pcsctools/default.nix index af0090cdf965..2932143fa0e1 100644 --- a/pkgs/tools/security/pcsctools/default.nix +++ b/pkgs/tools/security/pcsctools/default.nix @@ -3,7 +3,7 @@ , perl, pcscperl, Glib, Gtk2, Pango }: -let deps = lib.makeSearchPath "bin" [ wget coreutils ]; +let deps = lib.makeBinPath [ wget coreutils ]; in stdenv.mkDerivation rec { name = "pcsc-tools-1.4.25"; From 9b9fea305f0384c0c37f3fc307f75d6d4ccd7179 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 13 Apr 2016 17:25:48 +0300 Subject: [PATCH 6/7] makeSearchPath (and derivatives): check outputUnspecified --- lib/strings.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/strings.nix b/lib/strings.nix index 474475e27890..bda96fb32da0 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -96,7 +96,7 @@ rec { => "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-bin/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin" */ makeSearchPathOutputs = subDir: outputs: pkgs: - makeSearchPath subDir (map (lib.tryAttrs (outputs ++ ["out"])) 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 @@ -110,7 +110,7 @@ rec { */ makeLibraryPath = pkgs: makeSearchPath "lib" # 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 binaries for a set of packages. @@ -120,7 +120,7 @@ rec { => "/root/bin:/usr/bin:/usr/local/bin" */ makeBinPath = pkgs: makeSearchPath "bin" - (map (pkg: pkg.bin or (pkg.out or pkg)) pkgs); + (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) @@ -133,7 +133,7 @@ rec { => "/nix/store/n0m1fk9c960d8wlrs62sncnadygqqc6y-perl-Net-SMTP-1.25/lib/perl5/site_perl" */ makePerlPath = pkgs: makeSearchPath "lib/perl5/site_perl" - (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); /* Dependening on the boolean `cond', return either the given string or the empty string. Useful to contatenate against a bigger string. From 39eefc0cd0a4c8e8861f776cc9d5795489fe298c Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 13 Apr 2016 18:30:38 +0300 Subject: [PATCH 7/7] atom: fix library paths --- pkgs/applications/editors/atom/default.nix | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/editors/atom/default.nix b/pkgs/applications/editors/atom/default.nix index 33813ca3a660..9f8f6f5fd0cd 100644 --- a/pkgs/applications/editors/atom/default.nix +++ b/pkgs/applications/editors/atom/default.nix @@ -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 , gvfs, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap, systemd }: let - atomEnv = buildEnv { - name = "env-atom"; - paths = [ - stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3 - fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss - xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst - xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr - xorg.libXcursor libcap systemd - ]; - }; + atomPkgs = [ + stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3 + fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss + xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst + xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr + xorg.libXcursor libcap systemd + ]; + atomLib = lib.makeLibraryPath atomPkgs; + atomLib64 = lib.makeSearchPathOutputs "lib64" ["lib"] atomPkgs; + in stdenv.mkDerivation rec { name = "atom-${version}"; version = "1.6.2"; @@ -24,7 +24,7 @@ in stdenv.mkDerivation rec { name = "${name}.deb"; }; - buildInputs = [ atomEnv gvfs makeWrapper ]; + nativeBuildInputs = [ makeWrapper ]; phases = [ "installPhase" "fixupPhase" ]; @@ -41,10 +41,10 @@ in stdenv.mkDerivation rec { patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ $out/share/atom/resources/app/apm/bin/node wrapProgram $out/bin/atom \ - --prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" \ + --prefix "LD_LIBRARY_PATH" : "${atomLib}:${atomLib64}" \ --prefix "PATH" : "${gvfs}/bin" wrapProgram $out/bin/apm \ - --prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" + --prefix "LD_LIBRARY_PATH" : "${atomLib}:${atomLib64}" ''; meta = with stdenv.lib; {