···20 http://kent.dl.sourceforge.net/sourceforge/
21 ];
2223- sf = sourceforge;
24-25 # GNU (http://www.gnu.org/prep/ftp.html).
26 gnu = [
27 # This one redirects to a (supposedly) nearby and (supposedly) up-to-date
···20 http://kent.dl.sourceforge.net/sourceforge/
21 ];
220023 # GNU (http://www.gnu.org/prep/ftp.html).
24 gnu = [
25 # This one redirects to a (supposedly) nearby and (supposedly) up-to-date
+1-1
pkgs/build-support/release/source-tarball.nix
···9, versionSuffix ?
10 if officialRelease
11 then ""
12- else if src ? rev then "pre${toString src.rev}" else ""
13, src, stdenv, autoconf, automake, libtool
14, ... } @ args:
15
···9, versionSuffix ?
10 if officialRelease
11 then ""
12+ else "pre${toString (src.rev or src.revCount or "")}"
13, src, stdenv, autoconf, automake, libtool
14, ... } @ args:
15
···3 (http://pypi.python.org/pypi/setuptools/), which represents a large
4 number of Python packages nowadays. */
56-{ python, setuptools, wrapPython, lib, offlineDistutils, setuptoolsSite }:
78{ name, namePrefix ? "python-"
9···23 ''
24 easy_install --always-unzip --prefix="$out" .
25 ''
26-27, preConfigure ? "true"
2829, buildPhase ? "true"
···4849 name = namePrefix + name;
50051 phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase";
5253 buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath;
5455- # setuptoolsSite is responsible for loading pth files
56- propagatedBuildInputs = propagatedBuildInputs ++ [ setuptoolsSite ];
57-58- buildInputStrings = map toString buildInputs;
5960- pythonPath = [ setuptools] ++ pythonPath;
6162 preConfigure = ''
63 PYTHONPATH="${offlineDistutils}/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
···83 # Remove any site.py files generated by easy_install as these
84 # cause collisions. If pth files are to be processed a
85 # corresponding site.py needs to be included in the PYTHONPATH.
86- #
87- # leave them until we have a better solution: see #209
88- #rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
8990 ${postInstall}
91 '';
···3 (http://pypi.python.org/pypi/setuptools/), which represents a large
4 number of Python packages nowadays. */
56+{ python, setuptools, wrapPython, lib, offlineDistutils, recursivePthLoader }:
78{ name, namePrefix ? "python-"
9···23 ''
24 easy_install --always-unzip --prefix="$out" .
25 ''
26+27, preConfigure ? "true"
2829, buildPhase ? "true"
···4849 name = namePrefix + name;
5051+ # checkPhase after installPhase to run tests on installed packages
52 phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase";
5354 buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath;
5556+ propagatedBuildInputs = propagatedBuildInputs ++ [ recursivePthLoader ];
0005758+ pythonPath = [ setuptools ] ++ pythonPath;
5960 preConfigure = ''
61 PYTHONPATH="${offlineDistutils}/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
···81 # Remove any site.py files generated by easy_install as these
82 # cause collisions. If pth files are to be processed a
83 # corresponding site.py needs to be included in the PYTHONPATH.
84+ rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
008586 ${postInstall}
87 '';
+3
pkgs/development/python-modules/generic/wrap.sh
···51 local inputs="$2"
52 if [ foo"$inputs" != foo ]; then
53 for x in $inputs; do
00054 if test -d "$x"/lib/@libPrefix@/site-packages; then
55 echo $x/lib/@libPrefix@/site-packages \
56 >> "$out"/lib/@libPrefix@/site-packages/${name}-nix-python-$category.pth
···51 local inputs="$2"
52 if [ foo"$inputs" != foo ]; then
53 for x in $inputs; do
54+ if $(echo -n $x |grep -q python-recursive-pth-loader); then
55+ continue
56+ fi
57 if test -d "$x"/lib/@libPrefix@/site-packages; then
58 echo $x/lib/@libPrefix@/site-packages \
59 >> "$out"/lib/@libPrefix@/site-packages/${name}-nix-python-$category.pth
···1213 buildInputs = [ python pkgconfig glib ];
14000015 postInstall = ''
16- # All python code is installed into a "gtk-2.0" sub-directory. That
17- # sub-directory may be useful on systems which share several library
18- # versions in the same prefix, i.e. /usr/local, but on Nix that directory
19- # is useless. Furthermore, its existence makes it very hard to guess a
20- # proper $PYTHONPATH that allows "import gtk" to succeed.
21- cd $(toPythonPath $out)/gtk-2.0
22- for n in *; do
23- ln -s "gtk-2.0/$n" "../$n"
24- done
25 '';
2627 meta = {
···1213 buildInputs = [ python pkgconfig glib ];
1415+ # in a "normal" setup, pygobject and pygtk are installed into the
16+ # same site-packages: we need a pth file for both. pygtk.py would be
17+ # used to select a specific version, in our setup it should have no
18+ # effect, but we leave it in case somebody expects and calls it.
19 postInstall = ''
20+ mv $out/lib/${python.libPrefix}/site-packages/{pygtk.pth,${name}.pth}
0000000021 '';
2223 meta = {
+26-17
pkgs/development/python-modules/pygtk/default.nix
···1-{ stdenv, fetchurl, makeWrapper, python, pkgconfig, glib, gtk, pygobject, pycairo
2-, libglade ? null }:
34-stdenv.mkDerivation rec {
5 name = "pygtk-2.22.0";
67 src = fetchurl {
···10 };
1112 buildInputs =
13- [ makeWrapper python pkgconfig glib gtk ]
14 ++ stdenv.lib.optional (libglade != null) libglade;
1516 propagatedBuildInputs = [ pygobject pycairo ];
170000000000000000000018 postInstall = ''
19 rm $out/bin/pygtk-codegen-2.0
20 ln -s ${pygobject}/bin/pygobject-codegen-2.0 $out/bin/pygtk-codegen-2.0
21-22- # All python code is installed into a "gtk-2.0" sub-directory. That
23- # sub-directory may be useful on systems which share several library
24- # versions in the same prefix, i.e. /usr/local, but on Nix that directory
25- # is useless. Furthermore, its existence makes it very hard to guess a
26- # proper $PYTHONPATH that allows "import gtk" to succeed.
27- cd $(toPythonPath $out)/gtk-2.0
28- for n in *; do
29- ln -s "gtk-2.0/$n" "../$n"
30- done
31-32- wrapProgram $out/bin/pygtk-demo --prefix PYTHONPATH ":" \
33- $(toPythonPath "${pygobject} ${pycairo} $out")
34 '';
35}
···1Without this patch `virtualenv --python=python2.7 .` fails with an error because it notices that the python readline.so is not in the same path as python2.7. I assume this is to avoid copying the wrong file on systems where it is possible to find incompatible libraries by accident. Adding "/nix/store" to the prefix fixes this problem. Unfortunately readline is still not available if you just run `virtualenv .`.
23-4---- virtualenv-1.6.4/virtualenv.py 2012-05-20 00:40:38.070649647 +0200
5-+++ virtualenv-1.6.4/virtualenv.py 2012-05-20 00:45:10.596242604 +0200
6-@@ -951,13 +951,7 @@
789 def change_prefix(filename, dst_prefix):
10- prefixes = [sys.prefix]
11-
12-- if sys.platform == "darwin":
13- prefixes.extend((
14- os.path.join("/Library/Python", sys.version[:3], "site-packages"),
15- os.path.join(sys.prefix, "Extras", "lib", "python"),
16-- os.path.join("~", "Library", "Python", sys.version[:3], "site-packages")))
000017+ prefixes = ["/nix/store", sys.prefix]
1819 if hasattr(sys, 'real_prefix'):
20 prefixes.append(sys.real_prefix)
21-@@ -968,6 +962,8 @@
22- _, relpath = filename.split(src_prefix, 1)
23- assert relpath[0] == os.sep
24- relpath = relpath[1:]
25-+ if src_prefix == "/nix/store":
26-+ relpath = "/".join(relpath.split("/")[1:])
27 return join(dst_prefix, relpath)
28 assert False, "Filename %s does not start with any of these prefixes: %s" % \
29 (filename, prefixes)
···1Without this patch `virtualenv --python=python2.7 .` fails with an error because it notices that the python readline.so is not in the same path as python2.7. I assume this is to avoid copying the wrong file on systems where it is possible to find incompatible libraries by accident. Adding "/nix/store" to the prefix fixes this problem. Unfortunately readline is still not available if you just run `virtualenv .`.
23+--- virtualenv-1.8.4/virtualenv.py 2013-01-16 23:43:37.583615220 +0100
4++++ virtualenv-1.8.4/virtualenv.py 2013-01-16 23:44:47.885973431 +0100
5+@@ -1135,17 +1135,7 @@
0678 def change_prefix(filename, dst_prefix):
9- prefixes = [sys.prefix]
10-
11+- if is_darwin:
12- prefixes.extend((
13- os.path.join("/Library/Python", sys.version[:3], "site-packages"),
14- os.path.join(sys.prefix, "Extras", "lib", "python"),
15+- os.path.join("~", "Library", "Python", sys.version[:3], "site-packages"),
16+- # Python 2.6 no-frameworks
17+- os.path.join("~", ".local", "lib","python", sys.version[:3], "site-packages"),
18+- # System Python 2.7 on OSX Mountain Lion
19+- os.path.join("~", "Library", "Python", sys.version[:3], "lib", "python", "site-packages")))
20+ prefixes = ["/nix/store", sys.prefix]
2122 if hasattr(sys, 'real_prefix'):
23 prefixes.append(sys.real_prefix)
24+@@ -1162,6 +1152,8 @@
25+ if src_prefix != os.sep: # sys.prefix == "/"
26+ assert relpath[0] == os.sep
27+ relpath = relpath[1:]
28++ if src_prefix == "/nix/store":
29++ relpath = "/".join(relpath.split("/")[1:])
30 return join(dst_prefix, relpath)
31 assert False, "Filename %s does not start with any of these prefixes: %s" % \
32 (filename, prefixes)
···1+{stdenv, fetchurl, leptonica, zlib, libwebp, giflib, libjpeg, libpng, libtiff }: stdenv.mkDerivation {
2+ name = "jbig2enc-0.28";
3+4+ src = fetchurl {
5+ url = http://github.com/agl/jbig2enc/archive/0.28-dist.tar.gz;
6+ sha256 = "1wc0lmqz4jag3rhhk1xczlqpfv2qqp3fz7wzic2lba3vsbi1rrw3";
7+ };
8+9+ propagatedBuildInputs = [ leptonica zlib libwebp giflib libjpeg libpng libtiff ];
10+11+ # This is necessary, because the resulting library has
12+ # /tmp/nix-build-jbig2enc/src/.libs before /nix/store/jbig2enc/lib
13+ # in its rpath, which means that patchelf --shrink-rpath removes
14+ # the /nix/store one. By cleaning up before fixup, we ensure that
15+ # the /tmp/nix-build-jbig2enc/src/.libs directory is gone.
16+ preFixup = ''
17+ make clean
18+ '';
19+}