diff --git a/pkgs/applications/version-management/bazaar/default.nix b/pkgs/applications/version-management/bazaar/default.nix index 1bfaf0cbd5d..8eb28ea04c7 100644 --- a/pkgs/applications/version-management/bazaar/default.nix +++ b/pkgs/applications/version-management/bazaar/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, python, pythonPackages, wrapPython }: +{ stdenv, fetchurl, pythonPackages }: stdenv.mkDerivation rec { version = "2.3"; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "07kx41w4gqv68bcykdflsg68wvpmcyqknzyb4vr1zqlf27hahp53"; }; - buildInputs = [ python wrapPython ]; + buildInputs = [ pythonPackages.python pythonPackages.wrapPython ]; # Readline support is needed by bzrtools. pythonPath = [ pythonPackages.ssl pythonPackages.readline ]; diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix index b688bf1e310..587f0c99f3a 100644 --- a/pkgs/applications/virtualization/xen/default.nix +++ b/pkgs/applications/virtualization/xen/default.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl, python +{ stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl , libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz -, lvm2, utillinux, procps, texinfo, perl, wrapPython, pythonPackages }: +, lvm2, utillinux, procps, texinfo, perl, pythonPackages }: with stdenv.lib; @@ -50,8 +50,9 @@ stdenv.mkDerivation { ]; buildInputs = - [ which zlib pkgconfig SDL openssl python libuuid gettext ncurses - dev86 iasl pciutils bzip2 xz texinfo perl wrapPython + [ which zlib pkgconfig SDL openssl libuuid gettext ncurses + dev86 iasl pciutils bzip2 xz texinfo perl + pythonPackages.python pythonPackages.wrapPython ]; pythonPath = [ pythonPackages.curses ]; diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 1998d91d126..5defdb55b95 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -45,13 +45,15 @@ rec { # Make a package that just contains a setup hook with the given contents. - makeSetupHook = deps: script: - runCommand "hook" { } + makeSetupHook = { deps ? [], substitutions ? {} }: script: + runCommand "hook" substitutions ('' ensureDir $out/nix-support cp ${script} $out/nix-support/setup-hook '' + stdenv.lib.optionalString (deps != []) '' echo ${toString deps} > $out/nix-support/propagated-build-native-inputs + '' + stdenv.lib.optionalString (substitutions != {}) '' + substituteAll ${script} $out/nix-support/setup-hook ''); diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh index fb20c5fd723..65f3229ca7c 100644 --- a/pkgs/development/python-modules/generic/wrap.sh +++ b/pkgs/development/python-modules/generic/wrap.sh @@ -35,7 +35,7 @@ _addToPythonPath() { local dir="$1" if [ -n "${pythonPathsSeen[$dir]}" ]; then return; fi pythonPathsSeen[$dir]=1 - addToSearchPath program_PYTHONPATH $dir/lib/python2.7/site-packages + addToSearchPath program_PYTHONPATH $dir/lib/@libPrefix@/site-packages addToSearchPath program_PATH $dir/bin local prop="$dir/nix-support/propagated-build-native-inputs" if [ -e $prop ]; then diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix index c531eafa05a..267665f7a8b 100644 --- a/pkgs/servers/gpsd/default.nix +++ b/pkgs/servers/gpsd/default.nix @@ -1,6 +1,6 @@ -{ fetchurl, stdenv, python, pkgconfig, dbus, dbus_glib -, ncurses, libX11, libXt, libXpm, libXaw, libXext, wrapPython -, libxslt, xmlto, gpsdUser ? "gpsd", pythonPackages }: +{ fetchurl, stdenv, pythonPackages, pkgconfig, dbus, dbus_glib +, ncurses, libX11, libXt, libXpm, libXaw, libXext +, libxslt, xmlto, gpsdUser ? "gpsd" }: stdenv.mkDerivation rec { name = "gpsd-2.39"; @@ -11,9 +11,9 @@ stdenv.mkDerivation rec { }; buildInputs = [ - python pkgconfig dbus dbus_glib ncurses - libX11 libXt libXpm libXaw libXext - wrapPython libxslt xmlto + pythonPackages.python pythonPackages.wrapPython + pkgconfig dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext + libxslt xmlto ]; pythonPath = [ pythonPackages.curses ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b0d77d6e066..de555d4582d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -312,9 +312,7 @@ let inherit stdenv perl cpio contents ubootChooser; }; - makeWrapper = makeSetupHook [] ../build-support/make-wrapper/make-wrapper.sh; - - wrapPython = makeSetupHook [ makeWrapper ] ../development/python-modules/generic/wrap.sh; + makeWrapper = makeSetupHook {} ../build-support/make-wrapper/make-wrapper.sh; makeModulesClosure = {kernel, rootModules, allowMissing ? false}: import ../build-support/kernel/modules-closure.nix { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dcbe03e615c..123c427c5f7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10,17 +10,23 @@ python.modules // rec { buildPythonPackage = import ../development/python-modules/generic { - inherit (pkgs) wrapPython lib; - inherit python setuptools; + inherit (pkgs) lib; + inherit python wrapPython setuptools; }; setuptools = import ../development/python-modules/setuptools { - inherit (pkgs) stdenv fetchurl wrapPython; - inherit python; + inherit (pkgs) stdenv fetchurl; + inherit python wrapPython; }; + wrapPython = pkgs.makeSetupHook + { deps = pkgs.makeWrapper; + substitutions.libPrefix = python.libPrefix; + } + ../development/python-modules/generic/wrap.sh; + argparse = buildPythonPackage (rec { name = "argparse-1.1";