diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index 3dc6a427f25..f892cf175c1 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, python, pyqt4, sip, popplerQt4, pkgconfig, libpng -, imagemagick, libjpeg, fontconfig, podofo, qt4, mechanize, lxml, dateutil -, pil, cssutils, beautifulsoap, makeWrapper, unrar, chmlib +, imagemagick, libjpeg, fontconfig, podofo, qt4 +, pil, makeWrapper, unrar, chmlib, pythonPackages }: stdenv.mkDerivation rec { @@ -15,8 +15,9 @@ stdenv.mkDerivation rec { buildInputs = [ python pyqt4 sip popplerQt4 pkgconfig libpng imagemagick libjpeg - fontconfig podofo qt4 mechanize lxml dateutil pil makeWrapper - cssutils beautifulsoap chmlib + fontconfig podofo qt4 pil makeWrapper chmlib + pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil + pythonPackages.cssutils pythonPackages.beautifulsoap pythonPackages.sqlite3 ]; installPhase = '' diff --git a/pkgs/applications/office/keepnote/default.nix b/pkgs/applications/office/keepnote/default.nix index dc7946d1e82..514b8fd3151 100644 --- a/pkgs/applications/office/keepnote/default.nix +++ b/pkgs/applications/office/keepnote/default.nix @@ -1,14 +1,15 @@ -{stdenv, fetchurl, buildPythonPackage, pygtk}: +{ stdenv, fetchurl, buildPythonPackage, pythonPackages, pygtk }: buildPythonPackage { name = "keepnote-0.6.5"; + namePrefix = ""; src = fetchurl { url = http://rasm.ods.org/keepnote/download/keepnote-0.6.5.tar.gz; sha256 = "0kipcy90r50z4m9p8pyy9wi4dknsiwdrgy974xgakris2rh4lafw"; }; - propagatedBuildInputs = [ pygtk ]; + propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk ]; # Testing fails. doCheck = false; diff --git a/pkgs/applications/version-management/bazaar/default.nix b/pkgs/applications/version-management/bazaar/default.nix index 46a09ccf422..8eb28ea04c7 100644 --- a/pkgs/applications/version-management/bazaar/default.nix +++ b/pkgs/applications/version-management/bazaar/default.nix @@ -1,30 +1,27 @@ -{stdenv, fetchurl, python, makeWrapper}: +{ stdenv, fetchurl, pythonPackages }: stdenv.mkDerivation rec { - version = "2.2"; - release = ".0"; + version = "2.3"; + release = ".1"; name = "bazaar-${version}${release}"; src = fetchurl { url = "http://launchpad.net/bzr/${version}/${version}${release}/+download/bzr-${version}${release}.tar.gz"; - sha256 = "64cd6c23097884e40686adc7f0ad4a8200e2292bdc5e0caba3563b6f5c32bacf"; + sha256 = "07kx41w4gqv68bcykdflsg68wvpmcyqknzyb4vr1zqlf27hahp53"; }; - buildInputs = [python makeWrapper]; + buildInputs = [ pythonPackages.python pythonPackages.wrapPython ]; + + # Readline support is needed by bzrtools. + pythonPath = [ pythonPackages.ssl pythonPackages.readline ]; installPhase = '' python setup.py install --prefix=$out - wrapProgram $out/bin/bzr --prefix PYTHONPATH : "$(toPythonPath $out)" + wrapPythonPrograms ''; - passthru = { - # If someone wants to assert python features.. - inherit python; - }; - meta = { homepage = http://bazaar-vcs.org/; description = "A distributed version control system that Just Works"; }; - } diff --git a/pkgs/applications/version-management/bazaar/tools.nix b/pkgs/applications/version-management/bazaar/tools.nix index 5e5292cf130..5a4b706f418 100644 --- a/pkgs/applications/version-management/bazaar/tools.nix +++ b/pkgs/applications/version-management/bazaar/tools.nix @@ -1,9 +1,5 @@ args : with args; -if ! bazaar.python.readlineSupport then - throw "Bazaar Tools require readline support in python." -else - rec { version = "2.2.0"; src = fetchurl { diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index cee9770d732..913a0aca36b 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, python, makeWrapper, docutils -, guiSupport ? false, tk ? null }: +, guiSupport ? false, tk ? null, ssl }: stdenv.mkDerivation rec { name = "mercurial-1.7.5"; @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { '' for i in $(cd $out/bin && ls); do wrapProgram $out/bin/$i \ - --prefix PYTHONPATH : "$(toPythonPath $out)" \ + --prefix PYTHONPATH : "$(toPythonPath "$out ${ssl}")" \ $WRAP_TK done diff --git a/pkgs/applications/virtualization/nova/default.nix b/pkgs/applications/virtualization/nova/default.nix new file mode 100644 index 00000000000..e28f9012fc6 --- /dev/null +++ b/pkgs/applications/virtualization/nova/default.nix @@ -0,0 +1,82 @@ +{ stdenv, fetchurl, pythonPackages, intltool, libvirt, libxml2Python, curl }: + +with stdenv.lib; + +let version = "2011.1.1"; in + +stdenv.mkDerivation rec { + name = "nova-${version}"; + + src = fetchurl { + url = "http://launchpad.net/nova/bexar/${version}/+download/nova-${version}.tar.gz"; + sha256 = "0xd7cxn60vzhkvjwnj0i6jfcxaggwwyw2pnhl4qnb759q9hvk1b9"; + }; + + patches = + [ ./fix-dhcpbridge-output.patch ]; + + pythonPath = with pythonPackages; + [ setuptools eventlet greenlet gflags netaddr sqlalchemy carrot routes + paste_deploy m2crypto ipy boto_1_9 twisted sqlalchemy_migrate + distutils_extra simplejson readline glance cheetah + # !!! should libvirt be a build-time dependency? Note that + # libxml2Python is a dependency of libvirt.py. + libvirt libxml2Python + ]; + + buildInputs = + [ pythonPackages.python + pythonPackages.wrapPython + pythonPackages.mox + intltool + ] ++ pythonPath; + + PYTHON_EGG_CACHE = "`pwd`/.egg-cache"; + + preConfigure = + '' + # Set the built-in state location to something sensible. + sed -i nova/flags.py \ + -e "/DEFINE.*'state_path'/ s|../|/var/lib/nova|" + + substituteInPlace nova/virt/images.py --replace /usr/bin/curl ${curl}/bin/curl + ''; + + buildPhase = "python setup.py build"; + + installPhase = + '' + p=$(toPythonPath $out) + export PYTHONPATH=$p:$PYTHONPATH + mkdir -p $p + python setup.py install --prefix=$out + + # Nova doesn't like to be called ".nova-foo-wrapped" because it + # computes some stuff from its own argv[0]. So call the wrapped + # programs ".nova-foo" by overriding wrapProgram. + wrapProgram() { + local prog="$1" + local hidden="$(dirname "$prog")/.$(basename "$prog")" + mv $prog $hidden + makeWrapper $hidden $prog "$@" + } + + wrapPythonPrograms + + mkdir -p $out/etc/nova + cp etc/nova-api.conf $out/etc/nova/ + + # Nova makes some weird assumptions about where to find its own + # programs relative to the Python directory. + ln -sfn $out/bin $out/lib/${pythonPackages.python.libPrefix}/site-packages/bin + ''; + + doCheck = false; # !!! fix + + checkPhase = "python setup.py test"; + + meta = { + homepage = http://nova.openstack.org/; + description = "OpenStack Compute (a.k.a. Nova), a cloud computing fabric controller"; + }; +} diff --git a/pkgs/applications/virtualization/nova/fix-dhcpbridge-output.patch b/pkgs/applications/virtualization/nova/fix-dhcpbridge-output.patch new file mode 100644 index 00000000000..cef1473e574 --- /dev/null +++ b/pkgs/applications/virtualization/nova/fix-dhcpbridge-output.patch @@ -0,0 +1,124 @@ +Prevent dnsmasq from segfaulting. + +https://code.launchpad.net/~soren/nova/dnsmasq-leasesfile-init/+merge/52421 + +diff -ru nova-2011.1.1-orig//bin/nova-dhcpbridge nova-2011.1.1//bin/nova-dhcpbridge +--- nova-2011.1.1-orig//bin/nova-dhcpbridge 2011-02-24 19:51:54.000000000 +0100 ++++ nova-2011.1.1//bin/nova-dhcpbridge 2011-04-01 17:49:53.848659259 +0200 +@@ -94,7 +94,7 @@ + """Get the list of hosts for an interface.""" + ctxt = context.get_admin_context() + network_ref = db.network_get_by_bridge(ctxt, interface) +- return linux_net.get_dhcp_hosts(ctxt, network_ref['id']) ++ return linux_net.get_dhcp_leases(ctxt, network_ref['id']) + + + def main(): +diff -ru nova-2011.1.1-orig//nova/network/linux_net.py nova-2011.1.1//nova/network/linux_net.py +--- nova-2011.1.1-orig//nova/network/linux_net.py 2011-02-24 19:51:54.000000000 +0100 ++++ nova-2011.1.1//nova/network/linux_net.py 2011-04-01 17:50:37.315585644 +0200 +@@ -18,6 +18,7 @@ + """ + + import os ++import calendar + + from nova import db + from nova import flags +@@ -48,6 +49,8 @@ + 'location of nova-dhcpbridge') + flags.DEFINE_string('routing_source_ip', '$my_ip', + 'Public IP of network host') ++flags.DEFINE_integer('dhcp_lease_time', 120, ++ 'Lifetime of a DHCP lease') + flags.DEFINE_bool('use_nova_chains', False, + 'use the nova_ routing chains instead of default') + +@@ -218,8 +221,17 @@ + _confirm_rule("FORWARD", "-j nova-local") + + ++def get_dhcp_leases(context, network_id): ++ """Return a network's hosts config in dnsmasq leasefile format""" ++ hosts = [] ++ for fixed_ip_ref in db.network_get_associated_fixed_ips(context, ++ network_id): ++ hosts.append(_host_lease(fixed_ip_ref)) ++ return '\n'.join(hosts) ++ ++ + def get_dhcp_hosts(context, network_id): +- """Get a string containing a network's hosts config in dnsmasq format""" ++ """Get a string containing a network's hosts config in dhcp-host format""" + hosts = [] + for fixed_ip_ref in db.network_get_associated_fixed_ips(context, + network_id): +@@ -310,8 +322,24 @@ + utils.get_my_linklocal(network_ref['bridge'])}) + + ++def _host_lease(fixed_ip_ref): ++ """Return a host string for an address in leasefile format""" ++ instance_ref = fixed_ip_ref['instance'] ++ if instance_ref['updated_at']: ++ timestamp = instance_ref['updated_at'] ++ else: ++ timestamp = instance_ref['created_at'] ++ ++ seconds_since_epoch = calendar.timegm(timestamp.utctimetuple()) ++ ++ return "%d %s %s %s *" % (seconds_since_epoch + FLAGS.dhcp_lease_time, ++ instance_ref['mac_address'], ++ fixed_ip_ref['address'], ++ instance_ref['hostname'] or '*') ++ ++ + def _host_dhcp(fixed_ip_ref): +- """Return a host string for an address""" ++ """Return a host string for an address in dhcp-host format""" + instance_ref = fixed_ip_ref['instance'] + return "%s,%s.novalocal,%s" % (instance_ref['mac_address'], + instance_ref['hostname'], +diff -ru nova-2011.1.1-orig//nova/tests/test_network.py nova-2011.1.1//nova/tests/test_network.py +--- nova-2011.1.1-orig//nova/tests/test_network.py 2011-02-24 19:51:54.000000000 +0100 ++++ nova-2011.1.1//nova/tests/test_network.py 2011-04-01 17:49:53.849659365 +0200 +@@ -20,6 +20,7 @@ + """ + import IPy + import os ++import time + + from nova import context + from nova import db +@@ -320,6 +321,31 @@ + network['id']) + self.assertEqual(ip_count, num_available_ips) + ++ def test_dhcp_lease_output(self): ++ admin_ctxt = context.get_admin_context() ++ address = self._create_address(0, self.instance_id) ++ lease_ip(address) ++ network_ref = db.network_get_by_instance(admin_ctxt, self.instance_id) ++ leases = linux_net.get_dhcp_leases(context.get_admin_context(), ++ network_ref['id']) ++ for line in leases.split('\n'): ++ seconds, mac, ip, hostname, client_id = line.split(' ') ++ self.assertTrue(int(seconds) > time.time(), 'Lease expires in ' ++ 'the past') ++ octets = mac.split(':') ++ self.assertEqual(len(octets), 6, "Wrong number of octets " ++ "in %s" % (max,)) ++ for octet in octets: ++ self.assertEqual(len(octet), 2, "Oddly sized octet: %s" ++ % (octet,)) ++ # This will throw an exception if the octet is invalid ++ int(octet, 16) ++ ++ # And this will raise an exception in case of an invalid IP ++ IPy.IP(ip) ++ ++ release_ip(address) ++ + + def is_allocated_in_project(address, project_id): + """Returns true if address is in specified project""" diff --git a/pkgs/applications/virtualization/openstack-compute/default.nix b/pkgs/applications/virtualization/openstack-compute/default.nix deleted file mode 100644 index f00e1a3dda0..00000000000 --- a/pkgs/applications/virtualization/openstack-compute/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ stdenv, fetchurl, python, setuptools, pythonPackages }: - -let version = "2011.1"; in - -stdenv.mkDerivation { - name = "openstack-compute-2011.1"; - - src = fetchurl { - url = http://launchpad.net/nova/bexar/2011.1/+download/nova-2011.1.tar.gz; - sha256 = "1g8f75mzjpkzhqk91hga5wpjh8d0kbc9fxxjk0px0qjk20qrmb45"; - }; - - buildInputs = - [ python setuptools pythonPackages.gflags pythonPackages.netaddr pythonPackages.eventlet - ]; - - preConfigure = "export HOME=$(pwd)"; - - buildPhase = "python setup.py build"; - - installPhase = - '' - p=$(toPythonPath $out) - export PYTHONPATH=$p:$PYTHONPATH - mkdir -p $p - python setup.py install --prefix=$out - ''; - - meta = { - homepage = http://nova.openstack.org/; - description = "OpenStack Compute (a.k.a. Nova), a cloud computing fabric controller"; - }; -} diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix index 4c93a277e98..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 }: +, lvm2, utillinux, procps, texinfo, perl, pythonPackages }: with stdenv.lib; @@ -50,10 +50,13 @@ stdenv.mkDerivation { ]; buildInputs = - [ which zlib pkgconfig SDL openssl python libuuid gettext ncurses + [ which zlib pkgconfig SDL openssl libuuid gettext ncurses dev86 iasl pciutils bzip2 xz texinfo perl + pythonPackages.python pythonPackages.wrapPython ]; + pythonPath = [ pythonPackages.curses ]; + makeFlags = "PREFIX=$(out) CONFIG_DIR=/etc"; buildFlags = "xen tools stubdom"; @@ -121,19 +124,7 @@ stdenv.mkDerivation { cp -prvd dist/install/boot $out/boot cp -prvd dist/install/etc $out/etc cp -dR docs/man1 docs/man5 $out/share/man/ - ''; # */ - - postFixup = - '' - # Set the Python search path in all Python scripts. - for fn in $(grep -l '#!.*python' $out/bin/* $out/sbin/*); do - sed -i "$fn" -e "1 a import sys\nsys.path = ['$out/lib/python2.6/site-packages'] + sys.path" - done - - # Remove calls to `env'. - for fn in $(grep -l '#!.*/env.*python' $out/bin/* $out/sbin/*); do - sed -i "$fn" -e "1 s^/nix/store/.*/env.*python^${python}/bin/python^" - done + wrapPythonPrograms ''; # */ meta = { diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 992e28476f0..5defdb55b95 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -45,12 +45,16 @@ rec { # Make a package that just contains a setup hook with the given contents. - makeSetupHook = 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 + ''); # Write the references (i.e. the runtime dependencies in the Nix store) of `path' to a file. diff --git a/pkgs/development/interpreters/erlang/default.nix b/pkgs/development/interpreters/erlang/default.nix index ec7438c2341..64c8e7830b3 100644 --- a/pkgs/development/interpreters/erlang/default.nix +++ b/pkgs/development/interpreters/erlang/default.nix @@ -1,13 +1,13 @@ { stdenv, fetchurl, perl, gnum4, ncurses, openssl }: -let version = "R14A"; in +let version = "R14B02"; in stdenv.mkDerivation { name = "erlang-" + version; src = fetchurl { url = "http://www.erlang.org/download/otp_src_" + version + ".tar.gz"; - sha256 = "170n5p6al1bxwngdmafm1c6892xjxppb96gzgki9gfb0mla6li73"; + sha256 = "1g85a85w031jr5pmz9b0x3p11d44glkf7qpy64l9y7l2b45hb7c4"; }; buildInputs = [ perl gnum4 ncurses openssl ]; diff --git a/pkgs/development/interpreters/python/2.4/default.nix b/pkgs/development/interpreters/python/2.4/default.nix deleted file mode 100644 index f9673cc68d9..00000000000 --- a/pkgs/development/interpreters/python/2.4/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2}: - -assert zlibSupport -> zlib != null; - -with stdenv.lib; - -let - - buildInputs = - optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ - [bzip2] ++ - optional zlibSupport zlib; - -in - -stdenv.mkDerivation { - name = "python-2.4.6"; - majorVersion = "2.4"; - version = "2.4.6"; - - src = fetchurl { - url = http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tar.bz2; - sha256 = "021y88a4ki07dgq19yhg6zfvmncfiz7h5b2255438i9zmlwl246s"; - }; - - patches = [ - # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. - ./search-path.patch - ]; - - inherit buildInputs; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - - configureFlags = "--enable-shared"; - - preConfigure = '' - # Purity. - for i in /usr /sw /opt /pkg; do - substituteInPlace ./setup.py --replace $i /no-such-path - done - ''; - - setupHook = ./setup-hook.sh; - - postInstall = '' - rm -rf $out/lib/python2.4/test - ''; - - passthru = { - inherit zlibSupport; - libPrefix = "python2.4"; - }; -} diff --git a/pkgs/development/interpreters/python/2.4/search-path.patch b/pkgs/development/interpreters/python/2.4/search-path.patch deleted file mode 100644 index 2e7b7526c0c..00000000000 --- a/pkgs/development/interpreters/python/2.4/search-path.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -rc Python-2.4.4-orig/setup.py Python-2.4.4/setup.py -*** Python-2.4.4-orig/setup.py 2006-10-08 19:41:25.000000000 +0200 ---- Python-2.4.4/setup.py 2007-05-27 16:04:54.000000000 +0200 -*************** -*** 279,288 **** - # Check for AtheOS which has libraries in non-standard locations - if platform == 'atheos': - lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] -- lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) - inc_dirs += ['/system/include', '/atheos/autolnk/include'] -- inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) - - # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) - if platform in ['osf1', 'unixware7', 'openunix8']: - lib_dirs += ['/usr/ccs/lib'] ---- 279,289 ---- - # Check for AtheOS which has libraries in non-standard locations - if platform == 'atheos': - lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] - inc_dirs += ['/system/include', '/atheos/autolnk/include'] - -+ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) -+ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) -+ - # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) - if platform in ['osf1', 'unixware7', 'openunix8']: - lib_dirs += ['/usr/ccs/lib'] diff --git a/pkgs/development/interpreters/python/2.4/setup-hook.sh b/pkgs/development/interpreters/python/2.4/setup-hook.sh deleted file mode 100644 index 8334fbc21a8..00000000000 --- a/pkgs/development/interpreters/python/2.4/setup-hook.sh +++ /dev/null @@ -1,15 +0,0 @@ -addPythonPath() { - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python2.4/site-packages -} - -toPythonPath() { - local paths="$1" - local result= - for i in $paths; do - p="$i/lib/python2.4/site-packages" - result="${result}${result:+:}$p" - done - echo $result -} - -envHooks=(${envHooks[@]} addPythonPath) diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix deleted file mode 100644 index 53428de33f4..00000000000 --- a/pkgs/development/interpreters/python/2.6/default.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2 -, gdbmSupport ? true, gdbm ? null -, sqlite ? null -, db4 ? null -, readline ? null -, openssl ? null -, tk ? null -, tcl ? null -, libX11 ? null -, xproto ? null -, arch ? null -, sw_vers ? null -, ncurses ? null -}: - -assert zlibSupport -> zlib != null; -assert gdbmSupport -> gdbm != null; -assert stdenv.isDarwin -> arch != null; -assert stdenv.isDarwin -> sw_vers != null; - -with stdenv.lib; - -let - - majorVersion = "2.6"; - version = "${majorVersion}.5"; - - buildInputs = - optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ - [bzip2] - ++ optional zlibSupport zlib - ++ optional gdbmSupport gdbm - ++ optional (sqlite != null) sqlite - ++ optional (db4 != null) db4 - ++ optional (readline != null) readline - ++ optional (openssl != null) openssl - ++ optional (tk != null) tk - ++ optional (tcl != null) tcl - ++ optional (libX11 != null) libX11 - ++ optional (xproto != null) xproto - ++ optional (arch != null) arch - ++ optional (sw_vers != null) sw_vers - ++ optional (ncurses != null) ncurses - ; - -in - -stdenv.mkDerivation ( { - name = "python-${version}"; - inherit majorVersion version; - - src = fetchurl { - url = "http://www.python.org/ftp/python/${version}/Python-${version}.tar.bz2"; - sha256 = "62da62eb685621ede2be1275f11b89fa0e0be578db8daa5320d0a7855c0a9ebc"; - }; - - patches = [ - # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. - ./search-path.patch - ]; - - inherit buildInputs; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configureFlags = "--enable-shared --with-threads --enable-unicode --with-wctype-functions"; - - preConfigure = '' - # Purity. - for i in /usr /sw /opt /pkg; do - substituteInPlace ./setup.py --replace $i /no-such-path - done - '' + (if readline != null then '' - export NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" - '' else ""); - - setupHook = ./setup-hook.sh; - - postInstall = '' - rm -rf "$out/lib/python${majorVersion}/test" - ''; - - passthru = { - inherit zlibSupport; - sqliteSupport = sqlite != null; - db4Support = db4 != null; - readlineSupport = readline != null; - opensslSupport = openssl != null; - tkSupport = (tk != null) && (tcl != null); - libPrefix = "python${majorVersion}"; - }; - - enableParallelBuilding = true; - - meta = { - platforms = stdenv.lib.platforms.all; - }; -} // (if stdenv.isDarwin then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch]; } else {} ) ) diff --git a/pkgs/development/interpreters/python/2.6/search-path.patch b/pkgs/development/interpreters/python/2.6/search-path.patch deleted file mode 100644 index 2e7b7526c0c..00000000000 --- a/pkgs/development/interpreters/python/2.6/search-path.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -rc Python-2.4.4-orig/setup.py Python-2.4.4/setup.py -*** Python-2.4.4-orig/setup.py 2006-10-08 19:41:25.000000000 +0200 ---- Python-2.4.4/setup.py 2007-05-27 16:04:54.000000000 +0200 -*************** -*** 279,288 **** - # Check for AtheOS which has libraries in non-standard locations - if platform == 'atheos': - lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] -- lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) - inc_dirs += ['/system/include', '/atheos/autolnk/include'] -- inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) - - # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) - if platform in ['osf1', 'unixware7', 'openunix8']: - lib_dirs += ['/usr/ccs/lib'] ---- 279,289 ---- - # Check for AtheOS which has libraries in non-standard locations - if platform == 'atheos': - lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] - inc_dirs += ['/system/include', '/atheos/autolnk/include'] - -+ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) -+ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) -+ - # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) - if platform in ['osf1', 'unixware7', 'openunix8']: - lib_dirs += ['/usr/ccs/lib'] diff --git a/pkgs/development/interpreters/python/2.6/setup-hook.sh b/pkgs/development/interpreters/python/2.6/setup-hook.sh deleted file mode 100644 index 290525c3571..00000000000 --- a/pkgs/development/interpreters/python/2.6/setup-hook.sh +++ /dev/null @@ -1,15 +0,0 @@ -addPythonPath() { - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python2.6/site-packages -} - -toPythonPath() { - local paths="$1" - local result= - for i in $paths; do - p="$i/lib/python2.6/site-packages" - result="${result}${result:+:}$p" - done - echo $result -} - -envHooks=(${envHooks[@]} addPythonPath) diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix index d80e215ce05..cefa1d6c917 100644 --- a/pkgs/development/interpreters/python/2.7/default.nix +++ b/pkgs/development/interpreters/python/2.7/default.nix @@ -1,22 +1,11 @@ { stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2 -, gdbmSupport ? true, gdbm ? null -, sqlite ? null -, db4 ? null -, readline ? null -, openssl ? null -, tk ? null -, tcl ? null -, libX11 ? null -, xproto ? null -, arch ? null -, sw_vers ? null -, ncurses ? null +, sqlite, tcl, tk, x11, openssl, readline, db4, ncurses, gdbm +, darwinArchUtility ? null, darwinSwVersUtility ? null }: assert zlibSupport -> zlib != null; -assert gdbmSupport -> gdbm != null; -assert stdenv.isDarwin -> arch != null; -assert stdenv.isDarwin -> sw_vers != null; +assert stdenv.isDarwin -> darwinArchUtility != null; +assert stdenv.isDarwin -> darwinSwVersUtility != null; with stdenv.lib; @@ -25,86 +14,172 @@ let majorVersion = "2.7"; version = "${majorVersion}.1"; - buildInputs = - optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ - [bzip2] - ++ optional zlibSupport zlib - ++ optional gdbmSupport gdbm - ++ optional (sqlite != null) sqlite - ++ optional (db4 != null) db4 - ++ optional (readline != null) readline - ++ optional (openssl != null) openssl - ++ optional (tk != null) tk - ++ optional (tcl != null) tcl - ++ optional (libX11 != null) libX11 - ++ optional (xproto != null) xproto - ++ optional (arch != null) arch - ++ optional (sw_vers != null) sw_vers - ++ optional (ncurses != null) ncurses - ; - -in - -stdenv.mkDerivation ( { - name = "python-${version}"; - inherit majorVersion version; - src = fetchurl { url = "http://www.python.org/ftp/python/${version}/Python-${version}.tar.bz2"; sha256 = "14i2c7yqa7ljmx2i2bb827n61q33zn23ax96czi8rbkyyny8gqw0"; }; + + patches = + [ # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. + ./search-path.patch - patches = [ - # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. - ./search-path.patch - ]; + # Python recompiles a Python if the mtime stored *in* the + # pyc/pyo file differs from the mtime of the source file. This + # doesn't work in Nix because Nix changes the mtime of files in + # the Nix store to 1. So treat that as a special case. + ./nix-store-mtime.patch + ]; - inherit buildInputs; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configureFlags = "--enable-shared --with-threads --enable-unicode --with-wctype-functions"; + buildInputs = + optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ + [ bzip2 ] + ++ optional zlibSupport zlib + ++ optionals stdenv.isDarwin [ darwinArchUtility darwinSwVersUtility ]; - preConfigure = '' - # Purity. - for i in /usr /sw /opt /pkg; do - substituteInPlace ./setup.py --replace $i /no-such-path - done - '' + (if readline != null then '' - export NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" - '' else ""); + + # Build the basic Python interpreter without modules that have + # external dependencies. + python = stdenv.mkDerivation { + name = "python-${version}"; + + inherit majorVersion version src patches buildInputs; - setupHook = ./setup-hook.sh; + C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); + LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - postInstall = '' - rm -rf "$out/lib/python${majorVersion}/test" - ''; + configureFlags = "--enable-shared --with-threads --enable-unicode --with-wctype-functions"; - passthru = { - inherit zlibSupport; - sqliteSupport = sqlite != null; - db4Support = db4 != null; - readlineSupport = readline != null; - opensslSupport = openssl != null; - tkSupport = (tk != null) && (tcl != null); - libPrefix = "python${majorVersion}"; + preConfigure = + '' + # Purity. + for i in /usr /sw /opt /pkg; do + substituteInPlace ./setup.py --replace $i /no-such-path + done + '' + optionalString stdenv.isCygwin '' + # On Cygwin, `make install' tries to read this Makefile. + mkdir -p $out/lib/python2.7/config + touch $out/lib/python2.7/config/Makefile + mkdir -p $out/include/python2.7 + touch $out/include/python2.7/pyconfig.h + ''; + + NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; + + setupHook = ./setup-hook.sh; + + postInstall = + '' + rm -rf "$out/lib/python${majorVersion}/test" + ''; + + passthru = { + inherit zlibSupport; + libPrefix = "python${majorVersion}"; + }; + + enableParallelBuilding = true; + + meta = { + homepage = "http://python.org"; + description = "Python -- a high-level dynamically-typed programming language"; + longDescription = '' + Python is a remarkably powerful dynamic programming language that + is used in a wide variety of application domains. Some of its key + distinguishing features include: clear, readable syntax; strong + introspection capabilities; intuitive object orientation; natural + expression of procedural code; full modularity, supporting + hierarchical packages; exception-based error handling; and very + high level dynamic data types. + ''; + license = "GPLv2"; + platforms = stdenv.lib.platforms.all; + maintainers = [ stdenv.lib.maintainers.simons ]; + }; }; - enableParallelBuilding = true; - meta = { - homepage = "http://python.org"; - description = "Python -- a high-level dynamically-typed programming language"; - longDescription = '' - Python is a remarkably powerful dynamic programming language that - is used in a wide variety of application domains. Some of its key - distinguishing features include: clear, readable syntax; strong - introspection capabilities; intuitive object orientation; natural - expression of procedural code; full modularity, supporting - hierarchical packages; exception-based error handling; and very - high level dynamic data types. - ''; - license = "GPLv2"; - platforms = stdenv.lib.platforms.all; - maintainers = [ stdenv.lib.maintainers.simons ]; + # This function builds a Python module included in the main Python + # distribution in a separate derivation. + buildInternalPythonModule = + { moduleName + , internalName ? "_" + moduleName + , deps + }: + stdenv.mkDerivation rec { + name = "python-${moduleName}-${python.version}"; + + inherit src patches; + + buildInputs = [ python ] ++ deps; + + C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); + LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); + + configurePhase = "true"; + + buildPhase = + '' + # Fake the build environment that setup.py expects. + ln -s ${python}/include/python*/pyconfig.h . + ln -s ${python}/lib/python*/config/Setup Modules/ + ln -s ${python}/lib/python*/config/Setup.local Modules/ + + substituteInPlace setup.py --replace 'self.extensions = extensions' \ + 'self.extensions = [ext for ext in self.extensions if ext.name in ["${internalName}"]]' + + python ./setup.py build_ext + ''; + + installPhase = + '' + dest=$out/lib/${python.libPrefix}/site-packages + mkdir -p $dest + cp -p $(find . -name "*.${if stdenv.isCygwin then "dll" else "so"}") $dest/ + ''; + }; + + + # The Python modules included in the main Python distribution, built + # as separate derivations. + modules = { + + bsddb = buildInternalPythonModule { + moduleName = "bsddb"; + deps = [ db4 ]; + }; + + curses = buildInternalPythonModule { + moduleName = "curses"; + deps = [ ncurses ]; + }; + + gdbm = buildInternalPythonModule { + moduleName = "gdbm"; + internalName = "gdbm"; + deps = [ gdbm ]; + }; + + sqlite3 = buildInternalPythonModule { + moduleName = "sqlite3"; + deps = [ sqlite ]; + }; + + ssl = buildInternalPythonModule { + moduleName = "ssl"; + deps = [ openssl ]; + }; + + tkinter = buildInternalPythonModule { + moduleName = "tkinter"; + deps = [ tcl tk x11 ]; + }; + + readline = buildInternalPythonModule { + moduleName = "readline"; + internalName = "readline"; + deps = [ readline ]; + }; + }; -} // (if stdenv.isDarwin then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch]; } else {} ) ) + +in python // { inherit modules; } diff --git a/pkgs/development/interpreters/python/2.7/nix-store-mtime.patch b/pkgs/development/interpreters/python/2.7/nix-store-mtime.patch new file mode 100644 index 00000000000..83f3fea1931 --- /dev/null +++ b/pkgs/development/interpreters/python/2.7/nix-store-mtime.patch @@ -0,0 +1,12 @@ +diff -ru -x '*~' Python-2.7.1-orig/Python/import.c Python-2.7.1/Python/import.c +--- Python-2.7.1-orig/Python/import.c 2010-05-20 20:37:55.000000000 +0200 ++++ Python-2.7.1/Python/import.c 2011-01-04 15:55:11.000000000 +0100 +@@ -751,7 +751,7 @@ + return NULL; + } + pyc_mtime = PyMarshal_ReadLongFromFile(fp); +- if (pyc_mtime != mtime) { ++ if (pyc_mtime != mtime && mtime != 1) { + if (Py_VerboseFlag) + PySys_WriteStderr("# %s has bad mtime\n", cpathname); + fclose(fp); diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix index 0e390c06d5b..ee9fdb1fe7f 100644 --- a/pkgs/development/libraries/libvirt/default.nix +++ b/pkgs/development/libraries/libvirt/default.nix @@ -1,16 +1,16 @@ { stdenv, fetchurl, pkgconfig, libxml2, gnutls, devicemapper, perl, python , iproute, iptables, readline, lvm2, utillinux, udev, libpciaccess, gettext -, libtasn1 +, libtasn1, ebtables }: -let version = "0.8.8"; in +let version = "0.9.0"; in stdenv.mkDerivation { name = "libvirt-${version}"; src = fetchurl { url = "http://libvirt.org/sources/libvirt-${version}.tar.gz"; - sha256 = "04z1757qpi3ssnjv5h2qnw1sds2m50yxk67cbdam6w4i50vyl2h3"; + sha256 = "0rlhn08zgj9v0jrh0pq0hfdw6vmw98fg3c573k8mpnwm2byc3gby"; }; buildInputs = @@ -20,12 +20,12 @@ stdenv.mkDerivation { preConfigure = '' - PATH=${iproute}/sbin:${iptables}/sbin:${lvm2}/sbin:${udev}/sbin:$PATH + PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${udev}/sbin:$PATH ''; - configureFlags = "--localstatedir=/var --with-init-script=redhat"; + configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-init-script=redhat"; - installFlags = "localstatedir=$(TMPDIR)/var"; + installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc"; postInstall = '' diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 9dad415d835..46149177320 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -3,48 +3,49 @@ (http://pypi.python.org/pypi/setuptools/), which represents a large number of Python packages nowadays. */ -{ python, setuptools, makeWrapper, lib }: +{ python, setuptools, wrapPython, lib }: + +{ name, namePrefix ? "python-" + +, buildInputs ? [] + +, # List of packages that should be added to the PYTHONPATH + # environment variable in programs built by this function. Packages + # in the standard `propagatedBuildInputs' variable are also added. + # The difference is that `pythonPath' is not propagated to the user + # environment. This is preferrable for programs because it doesn't + # pollute the user environment. + pythonPath ? [] + +, installCommand ? + '' + easy_install --prefix="$out" . + '' + +, buildPhase ? "true" + +, doCheck ? true + +, checkPhase ? + '' + runHook preCheck + python setup.py test + runHook postCheck + '' -{ name, namePrefix ? "python-", src, meta, patches ? [] -, installCommand ? "" -, doCheck ? true, checkPhase ? "python setup.py test" , postInstall ? "" + , ... } @ attrs: -let - defaultInstallCommand = ''easy_install --prefix="$out" .''; +# Keep extra attributes from ATTR, e.g., `patchPhase', etc. +python.stdenv.mkDerivation (attrs // { + inherit doCheck buildPhase checkPhase; - # Return the list of recursively propagated build inputs of PKG. - recursiveBuildInputs = - pkg: - [ pkg ] ++ - (if pkg ? propagatedBuildNativeInputs - then lib.concatLists (map recursiveBuildInputs - pkg.propagatedBuildNativeInputs) - else []); + name = namePrefix + name; -in + buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath; -python.stdenv.mkDerivation ( - # Keep extra attributes from ATTR, e.g., `patchPhase', etc. - attrs - - // - - (rec { - inherit src meta patches doCheck checkPhase; - - name = namePrefix + attrs.name; - - buildInputs = [ python setuptools makeWrapper ] ++ - (if attrs ? buildInputs then attrs.buildInputs else []); - - propagatedBuildInputs = [ setuptools ] ++ - (if attrs ? propagatedBuildInputs - then attrs.propagatedBuildInputs - else []); - - buildPhase = "true"; + pythonPath = [ setuptools] ++ pythonPath; # XXX: Should we run `easy_install --always-unzip'? It doesn't seem # to have a noticeable impact on small scripts. @@ -53,49 +54,21 @@ python.stdenv.mkDerivation ( echo "installing \`${name}' with \`easy_install'..." export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH" - ${if installCommand == "" then defaultInstallCommand else installCommand} + ${installCommand} ${postInstall} ''; - postFixup = '' - # Wrap scripts that are under `{s,}bin/' so that they get the right - # $PYTHONPATH. - for i in "$out/bin/"* "$out/sbin/"* - do - if head -n1 "$i" | grep -q "${python}" - then - echo "wrapping \`$i'..." - - # Compute a $PATH prefix for the program. - program_PATH="" - ${lib.concatStrings - (map (path: - ''if [ -d "${path}/bin" ] - then - program_PATH="${path}/bin'' + "\$" + ''{program_PATH:+:}$program_PATH" - fi - '') - (lib.concatMap recursiveBuildInputs propagatedBuildInputs))} - - wrapProgram "$i" \ - --prefix PYTHONPATH ":" \ - ${lib.concatStringsSep ":" - ([ "$out/lib/${python.libPrefix}/site-packages" ] ++ - (map (path: path + "/lib/${python.libPrefix}/site-packages") - (lib.concatMap recursiveBuildInputs - propagatedBuildInputs)))} \ - --prefix PATH ":" "$program_PATH" - + postFixup = + '' + wrapPythonPrograms + + # If a user installs a Python package, she probably also wants its + # dependencies in the user environment (since Python modules don't + # have something like an RPATH, so the only way to find the + # dependencies is to have them in the PYTHONPATH variable). + if test -e $out/nix-support/propagated-build-inputs; then + ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages fi - done - - # If a user installs a Python package, she probably also wants its - # dependencies in the user environment (since Python modules don't - # have something like an RPATH, so the only way to find the - # dependencies is to have them in the PYTHONPATH variable). - if test -e $out/nix-support/propagated-build-inputs; then - ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages - fi - ''; -})) + ''; +}) diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh new file mode 100644 index 00000000000..65f3229ca7c --- /dev/null +++ b/pkgs/development/python-modules/generic/wrap.sh @@ -0,0 +1,47 @@ +wrapPythonPrograms() { + wrapPythonProgramsIn $out "$out $pythonPath" +} + +wrapPythonProgramsIn() { + local dir="$1" + local pythonPath="$2" + local python="$(type -p python)" + local i + + declare -A pythonPathsSeen=() + program_PYTHONPATH= + program_PATH= + for i in $pythonPath; do + _addToPythonPath $i + done + + for i in $(find "$dir" -type f -perm +0100); do + + # Rewrite "#! .../env python" to "#! /nix/store/.../python". + if head -n1 "$i" | grep -q '#!.*/env.*python'; then + sed -i "$i" -e "1 s^.*/env[ ]*python^#! $python^" + fi + + if head -n1 "$i" | grep -q /python; then + echo "wrapping \`$i'..." + wrapProgram "$i" \ + --prefix PYTHONPATH ":" $program_PYTHONPATH \ + --prefix PATH ":" $program_PATH + fi + done +} + +_addToPythonPath() { + local dir="$1" + if [ -n "${pythonPathsSeen[$dir]}" ]; then return; fi + pythonPathsSeen[$dir]=1 + 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 + local i + for i in $(cat $prop); do + _addToPythonPath $i + done + fi +} diff --git a/pkgs/development/python-modules/rhpl/builder.sh b/pkgs/development/python-modules/rhpl/builder.sh index 5c56b70c24f..b37e9081832 100644 --- a/pkgs/development/python-modules/rhpl/builder.sh +++ b/pkgs/development/python-modules/rhpl/builder.sh @@ -4,8 +4,9 @@ rpm2cpio $src | cpio -idv tar xfvj rhpl-*.tar.bz2 rm rhpl-*.tar.bz2 cd rhpl-* -sed -i -e "s@/usr/include/\$(PYTHON)@$python/include/python2.6@" \ - -e "s@PYTHONLIBDIR = /usr/\$(LIBDIR)/\$(PYTHON)/site-packages@PYTHONLIBDIR = $out/lib/python2.6/site-packages@" Makefile.inc +incl=$(echo $python/include/python2.*) +sed -i -e "s@/usr/include/\$(PYTHON)@$incl@" \ + -e "s@PYTHONLIBDIR = /usr/\$(LIBDIR)/\$(PYTHON)/site-packages@PYTHONLIBDIR = $(toPythonPath $out)@" Makefile.inc sed -i -e "s@/usr/bin/install@install@g" \ -e "s@\$(DESTDIR)/usr/share/locale@$out/share/locale@" po/Makefile make PREFIX=$out diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index 1cdbb2e2624..50b73aaf8f6 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -1,48 +1,29 @@ -a : -let - fetchurl = a.fetchurl; +{ stdenv, fetchurl, python, wrapPython }: - version = a.lib.attrByPath ["version"] "0.6c11" a; - buildInputs = with a; [ - python makeWrapper - ]; -in -rec { - name = "setuptools-" + version; +stdenv.mkDerivation rec { + name = "setuptools-0.6c11"; src = fetchurl { url = "http://pypi.python.org/packages/source/s/setuptools/${name}.tar.gz"; sha256 = "1lx1hwxkhipyh206bgl90ddnfcnb68bzcvyawczbf833fadyl3v3"; }; - inherit buildInputs; - configureFlags = []; + buildInputs = [ python wrapPython ]; - doCheck = true; + buildPhase = "python setup.py build --build-base $out"; - doMakeCheck = a.fullDepEntry ('' - python setup.py test - '') ["minInit" "doUnpack" "addInputs" "doBuild"]; + installPhase = + '' + dst=$out/lib/${python.libPrefix}/site-packages + mkdir -p $dst + PYTHONPATH=$dst:$PYTHONPATH + python setup.py install --prefix=$out + wrapPythonPrograms + ''; - doBuild = a.fullDepEntry('' - python setup.py build --build-base $out - '') ["addInputs" "doUnpack"]; + doCheck = false; # doesn't work with Python 2.7 - doInstall = a.fullDepEntry('' - ensureDir "$out/lib/${a.python.libPrefix}/site-packages" - - PYTHONPATH="$out/lib/${a.python.libPrefix}/site-packages:$PYTHONPATH" \ - python setup.py install --prefix="$out" - - for i in "$out/bin/"* - do - wrapProgram "$i" \ - --prefix PYTHONPATH ":" \ - "$out/lib/${a.python.libPrefix}/site-packages" - done - '') ["doBuild"]; - - phaseNames = ["doBuild" "doInstall"]; + checkPhase = "python setup.py test"; meta = { description = "Utilities to facilitate the installation of Python packages"; diff --git a/pkgs/os-specific/linux/ebtables/default.nix b/pkgs/os-specific/linux/ebtables/default.nix new file mode 100644 index 00000000000..1f0539add93 --- /dev/null +++ b/pkgs/os-specific/linux/ebtables/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "ebtables-2.0.9-2"; + + src = fetchurl { + url = mirror://sourceforge/ebtables/ebtables-v2.0.9-2.tar.gz; + sha256 = "18yni9zzhfi1ygkgifzj8qpn95cwwiw7j6b3wsl1bij39mj5z1cq"; + }; + + makeFlags = + "LIBDIR=$(out)/lib BINDIR=$(out)/sbin MANDIR=$(out)/share/man " + + "ETCDIR=$(out)/etc INITDIR=$(TMPDIR) SYSCONFIGDIR=$(out)/etc/sysconfig"; + + preBuild = + '' + substituteInPlace Makefile --replace '-o root -g root' "" + ''; + + preInstall = "mkdir -p $out/etc/sysconfig"; + + meta = { + description = "A filtering tool for Linux-based bridging firewalls"; + homepage = http://ebtables.sourceforge.net/; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/iotop/default.nix b/pkgs/os-specific/linux/iotop/default.nix index 54a6cf8e457..e394b612388 100644 --- a/pkgs/os-specific/linux/iotop/default.nix +++ b/pkgs/os-specific/linux/iotop/default.nix @@ -1,46 +1,21 @@ -x@{builderDefsPackage - , python, makeWrapper - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ - []; +{ stdenv, fetchurl, buildPythonPackage, pythonPackages }: - buildInputs = map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); - sourceInfo = rec { - baseName="iotop"; - version="0.4.1"; - name="${baseName}-${version}"; - url="http://guichaz.free.fr/${baseName}/files/${name}.tar.bz2"; - hash="1dfvw3khr2rvqllvs9wad9ca3ld4i7szqf0ibq87rn36ickrf3ll"; - }; -in -rec { - src = a.fetchurl { - url = sourceInfo.url; - sha256 = sourceInfo.hash; +buildPythonPackage rec { + name = "iotop-0.4.1"; + namePrefix = ""; + + src = fetchurl { + url = "http://guichaz.free.fr/iotop/files/${name}.tar.bz2"; + sha256 = "1dfvw3khr2rvqllvs9wad9ca3ld4i7szqf0ibq87rn36ickrf3ll"; }; - inherit (sourceInfo) name version; - inherit buildInputs; + pythonPath = [ pythonPackages.curses ]; + + doCheck = false; - phaseNames = ["installPythonPackage" "wrapBinContentsPython"]; - meta = { description = "A tool to find out the processes doing the most IO"; - maintainers = with a.lib.maintainers; - [ - raskin - ]; - platforms = with a.lib.platforms; - linux; + maintainers = [ stdenv.lib.maintainers.raskin ]; + platforms = stdenv.lib.platforms.linux; }; - passthru = { - updateInfo = { - downloadPage = "http://guichaz.free.fr/iotop/"; - }; - }; -}) x - +} diff --git a/pkgs/os-specific/linux/qemu-kvm/default.nix b/pkgs/os-specific/linux/qemu-kvm/default.nix index 012e9bb46a7..92ebe93eebe 100644 --- a/pkgs/os-specific/linux/qemu-kvm/default.nix +++ b/pkgs/os-specific/linux/qemu-kvm/default.nix @@ -24,6 +24,11 @@ stdenv.mkDerivation rec { '' # extboot.bin isn't installed due to a bug in the Makefile. cp pc-bios/optionrom/extboot.bin $out/share/qemu/ + + # Libvirt expects us to be called `qemu-kvm'. Otherwise it will + # set the domain type to "qemu" rather than "kvm", which can + # cause architecture selection to misbehave. + ln -s $(cd $out/bin && echo qemu-system-*) $out/bin/qemu-kvm ''; meta = { diff --git a/pkgs/servers/amqp/rabbitmq-server/default.nix b/pkgs/servers/amqp/rabbitmq-server/default.nix new file mode 100644 index 00000000000..1d93c0c5f22 --- /dev/null +++ b/pkgs/servers/amqp/rabbitmq-server/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, erlang, python, libxml2, libxslt, xmlto +, docbook_xml_dtd_45, docbook_xsl }: + +stdenv.mkDerivation rec { + name = "rabbitmq-server-2.4.0"; + + src = fetchurl { + url = "http://www.rabbitmq.com/releases/rabbitmq-server/v2.4.0/${name}.tar.gz"; + sha256 = "0zvyyqw9kpzi791hvv8qj1aw0fpx5m5cgqfvffxfrdz8daxx3nma"; + }; + + buildInputs = + [ erlang python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl ]; + + preBuild = + '' + # Fix the "/usr/bin/env" in "calculate-relative". + patchShebangs . + ''; + + installFlags = "TARGET_DIR=$(out)/libexec/rabbitmq SBIN_DIR=$(out)/sbin MAN_DIR=$(out)/share/man"; + + postInstall = + '' + echo 'PATH=${erlang}/bin:${PATH:+:}$PATH' >> $out/sbin/rabbitmq-env + ''; # */ + + meta = { + homepage = http://www.rabbitmq.com/; + description = "An implementation of the AMQP messaging protocol"; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix index 067e7c4446b..267665f7a8b 100644 --- a/pkgs/servers/gpsd/default.nix +++ b/pkgs/servers/gpsd/default.nix @@ -1,5 +1,5 @@ -{ fetchurl, stdenv, python, pkgconfig, dbus, dbus_glib -, ncurses, libX11, libXt, libXpm, libXaw, libXext, makeWrapper +{ fetchurl, stdenv, pythonPackages, pkgconfig, dbus, dbus_glib +, ncurses, libX11, libXt, libXpm, libXaw, libXext , libxslt, xmlto, gpsdUser ? "gpsd" }: stdenv.mkDerivation rec { @@ -11,30 +11,20 @@ stdenv.mkDerivation rec { }; buildInputs = [ - python pkgconfig dbus dbus_glib ncurses - libX11 libXt libXpm libXaw libXext - makeWrapper libxslt xmlto + pythonPackages.python pythonPackages.wrapPython + pkgconfig dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext + libxslt xmlto ]; - configureFlags = "--enable-dbus --enable-gpsd-user=${gpsdUser} " + pythonPath = [ pythonPackages.curses ]; + configureFlags = "--enable-dbus --enable-gpsd-user=${gpsdUser} " # Make sure `xgpsspeed' has libXt and libX11 in its RPATH. + "LDFLAGS=-Wl,--rpath=${libXt}/lib:${libX11}/lib"; doCheck = true; - postInstall = '' - for prog in "$out/bin"/* - do - if grep -q python "$prog" - then - echo "patching \`$prog'..." - wrapProgram "$prog" \ - --prefix PATH ":" "${python}/bin" \ - --prefix PYTHONPATH ":" "$out/lib/${python.libPrefix}/site-packages" - fi - done - ''; + postInstall = "wrapPythonPrograms"; meta = { description = "`gpsd', a GPS service daemon"; diff --git a/pkgs/shells/ipython/default.nix b/pkgs/shells/ipython/default.nix index 68064dded3d..2c029b764b0 100644 --- a/pkgs/shells/ipython/default.nix +++ b/pkgs/shells/ipython/default.nix @@ -1,13 +1,16 @@ -{ stdenv, fetchurl, buildPythonPackage }: +{ stdenv, fetchurl, buildPythonPackage, pythonPackages }: buildPythonPackage { name = "ipython-0.10.1"; + namePrefix = ""; src = fetchurl { url = "http://ipython.scipy.org/dist/0.10.1/ipython-0.10.1.tar.gz"; sha256 = "18zwrg25zn72w4rmcwxzcw11ibgp001fawm2sz189zv86z70fxi2"; }; + propagatedBuildInputs = [ pythonPackages.readline ]; + doCheck = false; meta = { diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 2203601f836..7e0116e342c 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -212,17 +212,18 @@ rec { }; gccWithStaticLibs = stdenvLinuxBoot3Pkgs.gcc.gcc.override (rec { - ppl = stdenvLinuxBoot3Pkgs.ppl.override { - static = true; - gmpxx = stdenvLinuxBoot3Pkgs.gmpxx.override { - static = true; - }; - }; - cloogppl = stdenvLinuxBoot3Pkgs.cloogppl.override { - inherit ppl; - static = true; - }; - }); + ppl = stdenvLinuxBoot3Pkgs.ppl.override { + static = true; + gmpxx = stdenvLinuxBoot3Pkgs.gmpxx.override { + static = true; + }; + }; + cloogppl = stdenvLinuxBoot3Pkgs.cloogppl.override { + inherit ppl; + static = true; + }; + }); + # 8) Construct a fourth stdenv identical to the second, except that # this one uses the dynamically linked GCC and Binutils from step diff --git a/pkgs/tools/networking/dhcp/default.nix b/pkgs/tools/networking/dhcp/default.nix index 47fec622db0..7fa1fce66a5 100644 --- a/pkgs/tools/networking/dhcp/default.nix +++ b/pkgs/tools/networking/dhcp/default.nix @@ -13,6 +13,11 @@ stdenv.mkDerivation rec { # recover when the wlan interface goes down. Instead just flush # all addresses, routes and neighbours of the interface. ./flush-if.patch + + # Make sure that the hostname gets set on reboot. Without this + # patch, the hostname doesn't get set properly if the old + # hostname (i.e. before reboot) is equal to the new hostname. + ./set-hostname.patch ]; # Fixes "socket.c:591: error: invalid application of 'sizeof' to diff --git a/pkgs/tools/networking/dhcp/set-hostname.patch b/pkgs/tools/networking/dhcp/set-hostname.patch new file mode 100644 index 00000000000..495a8a124be --- /dev/null +++ b/pkgs/tools/networking/dhcp/set-hostname.patch @@ -0,0 +1,14 @@ +diff -ru -x '*~' dhcp-4.1.2-P1-orig//client/scripts/linux dhcp-4.1.2-P1//client/scripts/linux +--- dhcp-4.1.2-P1-orig//client/scripts/linux 2010-09-15 00:49:48.000000000 +0200 ++++ dhcp-4.1.2-P1//client/scripts/linux 2011-04-01 16:08:10.984372269 +0200 +@@ -133,9 +133,7 @@ + [ x$current_hostname = "x(none)" ] || \ + [ x$current_hostname = xlocalhost ] || \ + [ x$current_hostname = x$old_host_name ]; then +- if [ x$new_host_name != x$old_host_name ]; then +- hostname "$new_host_name" +- fi ++ hostname "$new_host_name" + fi + + if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \ diff --git a/pkgs/tools/networking/getmail/default.nix b/pkgs/tools/networking/getmail/default.nix index 4e10a2b3be1..23fe3ad3674 100644 --- a/pkgs/tools/networking/getmail/default.nix +++ b/pkgs/tools/networking/getmail/default.nix @@ -1,48 +1,23 @@ -x@{builderDefsPackage - , python, makeWrapper - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ - []; +{ stdenv, fetchurl, buildPythonPackage, pythonPackages }: - buildInputs = map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); - sourceInfo = rec { - baseName="getmail"; - version="4.20.0"; - name="${baseName}-${version}"; - url="http://pyropus.ca/software/${baseName}/old-versions/${name}.tar.gz"; - hash="17cpyra61virk1d223w8pdwhv2qzhbwdbnrr1ab1znf4cv9m3knn"; - }; -in -rec { - src = a.fetchurl { - url = sourceInfo.url; - sha256 = sourceInfo.hash; +buildPythonPackage rec { + name = "getmail-4.20.0"; + namePrefix = ""; + + src = fetchurl { + url = "http://pyropus.ca/software/getmail/old-versions/${name}.tar.gz"; + sha256 = "17cpyra61virk1d223w8pdwhv2qzhbwdbnrr1ab1znf4cv9m3knn"; }; - inherit (sourceInfo) name version; - inherit buildInputs; + pythonPath = [ pythonPackages.ssl ]; - /* doConfigure should be removed if not needed */ - phaseNames = ["installPythonPackage" "patchShebangs" "wrapBinContentsPython"]; - patchShebangs = (a.doPatchShebangs "$out/bin"); - + doCheck = false; + + installCommand = "python setup.py install --prefix=\"\$prefix\""; + meta = { - description = "A program for retrieval of mail"; - maintainers = with a.lib.maintainers; - [ - raskin - ]; - platforms = with a.lib.platforms; - linux; + description = "A program for retrieving mail"; + maintainers = [ stdenv.lib.maintainers.raskin ]; + platforms = stdenv.lib.platforms.linux; }; - passthru = { - updateInfo = { - downloadPage = "http://pyropus.ca/software/getmail/"; - }; - }; -}) x - +} diff --git a/pkgs/tools/networking/offlineimap/default.nix b/pkgs/tools/networking/offlineimap/default.nix index bb123d87bdf..8f0dd8e9a6c 100644 --- a/pkgs/tools/networking/offlineimap/default.nix +++ b/pkgs/tools/networking/offlineimap/default.nix @@ -1,4 +1,4 @@ -{fetchurl, buildPythonPackage}: +{ fetchurl, buildPythonPackage, ssl }: buildPythonPackage { name = "offlineimap-6.2.0.2"; @@ -8,10 +8,9 @@ buildPythonPackage { sha256 = "1w69qv1dm37m53k8cd068lk5z3qjlscnjxr397gs8kdsfds67v7c"; }; - doCheck = false; + propagatedBuildInputs = [ ssl ]; - preConfigure = "set -x"; - buildInputs = [ ]; + doCheck = false; meta = { description = "IMAP to local files bridge"; diff --git a/pkgs/tools/networking/vlan/default.nix b/pkgs/tools/networking/vlan/default.nix new file mode 100644 index 00000000000..221d0f17642 --- /dev/null +++ b/pkgs/tools/networking/vlan/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "vlan-1.9"; + + src = fetchurl { + url = mirror://gentoo/distfiles/vlan.1.9.tar.gz; + sha256 = "1jjc5f26hj7bk8nkjxsa8znfxcf8pgry2ipnwmj2fr6ky0dhm3rv"; + }; + + preBuild = + '' + # Ouch, the tarball contains pre-compiled binaries. + make clean + ''; + + installPhase = + '' + mkdir -p $out/sbin + cp vconfig $out/sbin/ + + mkdir -p $out/share/man/man8 + cp vconfig.8 $out/share/man/man8/ + ''; + + meta = { + description = "User mode programs to enable VLANs on Ethernet devices"; + }; +} diff --git a/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix b/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix index e242b1e69d1..0160b1bbe19 100644 --- a/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix +++ b/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, unzip, makeWrapper, jre }: stdenv.mkDerivation { - name = "ec2-api-tools-1.3-53907"; + name = "ec2-api-tools-1.4.2.2"; src = fetchurl { url = http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip; - sha256 = "1jdkc74a9fmjqwvq1pnbsnfqyxxjg5zgaynybmdms5piinvb204d"; + sha256 = "0qv3dy6zx5yxix3g90agj39k35sry3cifhzlhprv35lapiynsd0j"; }; buildInputs = [ unzip makeWrapper ]; diff --git a/pkgs/tools/virtualization/euca2ools/default.nix b/pkgs/tools/virtualization/euca2ools/default.nix new file mode 100644 index 00000000000..b82f7de1b2a --- /dev/null +++ b/pkgs/tools/virtualization/euca2ools/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchurl, which, pythonPackages }: + +stdenv.mkDerivation rec { + name = "euca2ools-1.3.1"; + namePrefix = ""; + + src = fetchurl { + url = "http://eucalyptussoftware.com/downloads/releases/${name}.tar.gz"; + sha256 = "1k4hakbxqsv2gzcdrf6dbyrpnajcan9yilddhs47cg7lgqw7b41f"; + }; + + makeFlags = "PREFIX=$(out)"; + + buildInputs = [ which pythonPackages.python pythonPackages.wrapPython ]; + + # We need boto 1.9 for now. See https://bugs.launchpad.net/euca2ools/devel/+bug/623888 + pythonPath = [ pythonPackages.setuptools pythonPackages.boto_1_9 pythonPackages.m2crypto pythonPackages.ssl ]; + + preBuild = + '' + substituteInPlace Makefile --replace "-o root" "" + + substituteInPlace euca2ools/Makefile \ + --replace 'python setup.py install' "python setup.py install --prefix=$out" + ''; + + postInstall = "wrapPythonPrograms"; + + meta = { + homepage = http://open.eucalyptus.com/downloads; + description = "Tools for interacting with Amazon EC2/S3-compatible cloud computing services"; + maintainers = [ stdenv.lib.maintainers.eelco ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7ba8f90eb7e..d8a25c7f7bf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -312,7 +312,7 @@ let inherit stdenv perl cpio contents ubootChooser; }; - makeWrapper = makeSetupHook ../build-support/make-wrapper/make-wrapper.sh; + makeWrapper = makeSetupHook {} ../build-support/make-wrapper/make-wrapper.sh; makeModulesClosure = {kernel, rootModules, allowMissing ? false}: import ../build-support/kernel/modules-closure.nix { @@ -343,6 +343,7 @@ let }; platforms = import ./platforms.nix; + ### TOOLS @@ -603,6 +604,8 @@ let ethtool = callPackage ../tools/misc/ethtool { }; + euca2ools = callPackage ../tools/virtualization/euca2ools { }; + exif = callPackage ../tools/graphics/exif { }; exiftags = callPackage ../tools/graphics/exiftags { }; @@ -669,9 +672,7 @@ let gengetopt = callPackage ../development/tools/misc/gengetopt { }; - getmail = callPackage ../tools/networking/getmail { - python = pythonFull; - }; + getmail = callPackage ../tools/networking/getmail { }; getopt = callPackage ../tools/misc/getopt { }; @@ -1005,19 +1006,8 @@ let obexftp = callPackage ../tools/bluetooth/obexftp { }; - offlineimap = import ../tools/networking/offlineimap { - inherit fetchurl; - # I did not find any better way of reusing buildPythonPackage+setuptools - # for a python with openssl support - buildPythonPackage = assert pythonFull.opensslSupport; - import ../development/python-modules/generic { - inherit makeWrapper lib; - python = pythonFull; - setuptools = builderDefsPackage (import ../development/python-modules/setuptools) { - inherit makeWrapper; - python = pythonFull; - }; - }; + offlineimap = callPackage ../tools/networking/offlineimap { + ssl = pythonPackages.ssl; }; opendbx = callPackage ../development/libraries/opendbx { }; @@ -1420,6 +1410,8 @@ let uptimed = callPackage ../tools/system/uptimed { }; + vlan = callPackage ../tools/networking/vlan { }; + w3cCSSValidator = callPackage ../tools/misc/w3c-css-validator { tomcat = tomcat6; }; @@ -1533,19 +1525,7 @@ let dash = callPackage ../shells/dash { }; - ipython = callPackage ../shells/ipython { - # I did not find any better way of reusing buildPythonPackage+setuptools - # for a python with openssl support - buildPythonPackage = assert pythonFull.readlineSupport; - import ../development/python-modules/generic { - inherit makeWrapper lib; - python = pythonFull; - setuptools = builderDefsPackage (import ../development/python-modules/setuptools) { - inherit makeWrapper; - python = pythonFull; - }; - }; - }; + ipython = callPackage ../shells/ipython { }; tcsh = callPackage ../shells/tcsh { }; @@ -2370,51 +2350,19 @@ let polyml = callPackage ../development/compilers/polyml { }; - python = if getConfig ["python" "full"] false then pythonFull else pythonBase; - python26 = if getConfig ["python" "full"] false then python26Full else python26Base; - python27 = if getConfig ["python" "full"] false then python27Full else python27Base; - pythonBase = python26Base; - pythonFull = python26Full; - - pythonWrapper = callPackage ../development/interpreters/python/wrapper.nix { }; - - python24 = callPackage ../development/interpreters/python/2.4 { }; - - python26Base = lowPrio (makeOverridable (import ../development/interpreters/python/2.6) { - inherit (pkgs) fetchurl stdenv zlib bzip2 gdbm; - arch = if stdenv.isDarwin then darwinArchUtility else null; - sw_vers = if stdenv.isDarwin then darwinSwVersUtility else null; - }); - - python26Full = lowPrio (python26Base.override { - # FIXME: We lack ncurses support, needed, e.g., for `gpsd'. - db4 = if getConfig ["python" "db4Support"] true then db4 else null; - sqlite = if getConfig ["python" "sqliteSupport"] true then sqlite else null; - readline = if getConfig ["python" "readlineSupport"] true then readline else null; - openssl = if getConfig ["python" "opensslSupport"] true then openssl else null; - tk = if getConfig ["python" "tkSupport"] true then tk else null; - tcl = if getConfig ["python" "tkSupport"] true then tcl else null; - libX11 = if getConfig ["python" "tkSupport"] true then xlibs.libX11 else null; - xproto = if getConfig ["python" "tkSupport"] true then xlibs.xproto else null; - ncurses = if getConfig ["python" "curses"] true then ncurses else null; - }); - - python27Base = lowPrio (makeOverridable (import ../development/interpreters/python/2.7) { - inherit (pkgs) fetchurl stdenv zlib bzip2 gdbm; - arch = if stdenv.isDarwin then pkgs.darwinArchUtility else null; - sw_vers = if stdenv.isDarwin then pkgs.darwinSwVersUtility else null; - }); - - python27Full = lowPrio (python27Base.override { - inherit (pkgs) db4 sqlite readline openssl tcl tk ncurses; - inherit (pkgs.xlibs) libX11 xproto; - }); + python = python27; + + python27 = callPackage ../development/interpreters/python/2.7 { }; python3 = callPackage ../development/interpreters/python/3.1 { arch = if stdenv.isDarwin then pkgs.darwinArchUtility else null; sw_vers = if stdenv.isDarwin then pkgs.darwinSwVersUtility else null; }; + pythonFull = callPackage ../development/interpreters/python/wrapper.nix { + extraLibs = lib.attrValues python.modules; + }; + pyrex = pyrex095; pyrex095 = callPackage ../development/interpreters/pyrex/0.9.5.nix { }; @@ -4445,34 +4393,13 @@ let ### DEVELOPMENT / PYTHON MODULES - buildPythonPackage = import ../development/python-modules/generic { - inherit python setuptools makeWrapper lib; - }; + buildPythonPackage = pythonPackages.buildPythonPackage; - buildPython26Package = import ../development/python-modules/generic { - inherit makeWrapper lib; - python = python26; - setuptools = setuptools.override { python = python26; }; - }; - - buildPython27Package = import ../development/python-modules/generic { - inherit makeWrapper lib; - python = python27; - setuptools = setuptools.override { python = python27; doCheck = false; }; - }; - - pythonPackages = python26Packages; - - python26Packages = recurseIntoAttrs (import ./python-packages.nix { - inherit pkgs; - python = python26; - buildPythonPackage = buildPython26Package; - }); + pythonPackages = python27Packages; python27Packages = recurseIntoAttrs (import ./python-packages.nix { inherit pkgs; python = python27; - buildPythonPackage = buildPython27Package; }); foursuite = callPackage ../development/python-modules/4suite { }; @@ -4515,9 +4442,7 @@ let pyxml = callPackage ../development/python-modules/pyxml { }; - setuptools = builderDefsPackage (import ../development/python-modules/setuptools) { - inherit python makeWrapper; - }; + setuptools = pythonPackages.setuptools; wxPython = wxPython26; @@ -4531,10 +4456,13 @@ let ZopeInterface = pythonPackages.zopeInterface; + /* zope = callPackage ../development/python-modules/zope { python = python24; }; + */ + ### SERVERS rdf4store = callPackage ../servers/http/4store { }; @@ -4545,7 +4473,7 @@ let sabnzbd = callPackage ../servers/sabnzbd { }; - bind = callPackage ../servers/dns/bind/default.nix { + bind = callPackage ../servers/dns/bind { inherit openssl libtool perl; }; @@ -4669,6 +4597,8 @@ let inherit xmpppy python makeWrapper fetchcvs; }; + rabbitmq_server = callPackage ../servers/amqp/rabbitmq-server { }; + radius = callPackage ../servers/radius { }; redstore = callPackage ../servers/http/redstore { }; @@ -4702,17 +4632,8 @@ let inherit fetchurl fetchsvn stdenv pkgconfig freetype fontconfig libxslt expat libdrm libpng zlib perl mesa xkeyboard_config dbus hal libuuid openssl gperf m4 - autoconf libtool xmlto asciidoc udev bison flex; - - # XXX: Update to newer Automake on the next big rebuild; better yet: - # remove the dependency on Automake. + autoconf libtool xmlto asciidoc udev flex bison python; automake = automake110x; - - # !!! pythonBase is used instead of python because this causes an - # infinite recursion when the flag python.full is set to true. - # Packages contained in the loop are python, tk, xlibs-wrapper, - # libX11, libxcd (and xcb-proto). - python = pythonBase; }); xorgReplacements = callPackage ../servers/x11/xorg/replacements.nix { }; @@ -4819,6 +4740,8 @@ let e3cfsprogs = callPackage ../os-specific/linux/e3cfsprogs { }; + ebtables = callPackage ../os-specific/linux/ebtables { }; + eject = callPackage ../os-specific/linux/eject { }; fbterm = builderDefsPackage (import ../os-specific/linux/fbterm) { @@ -4897,9 +4820,7 @@ let ifplugd = callPackage ../os-specific/linux/ifplugd { }; - iotop = callPackage ../os-specific/linux/iotop { - python = pythonFull; - }; + iotop = callPackage ../os-specific/linux/iotop { }; iproute = callPackage ../os-specific/linux/iproute { }; @@ -5794,9 +5715,7 @@ let batik = callPackage ../applications/graphics/batik { }; - bazaar = callPackage ../applications/version-management/bazaar { - python = pythonFull; - }; + bazaar = callPackage ../applications/version-management/bazaar { }; bazaarTools = builderDefsPackage (import ../applications/version-management/bazaar/tools.nix) { inherit bazaar; @@ -5809,7 +5728,7 @@ let bibletime = newScope pkgs.kde45 ../applications/misc/bibletime { qt = qt4; - } ; + }; bitcoin = callPackage ../applications/misc/bitcoin { wxGTK = wxGTK290; @@ -5819,19 +5738,7 @@ let bitlbee = callPackage ../applications/networking/instant-messengers/bitlbee { }; - # commented out because it's using the new configuration style proposal which is unstable - #biew = import ../applications/misc/biew { - # inherit lib stdenv fetchurl ncurses; - #}; - - # only to be able to compile blender - I couldn't compile the default openal software - # Perhaps this can be removed - don't know which one openal{,soft} is better - freealut_soft = callPackage ../development/libraries/freealut { - openal = openalSoft; }; - - blender = callPackage ../applications/misc/blender/2.49.nix { - python = python26Base; - }; + blender = callPackage ../applications/misc/blender/2.49.nix { }; blender_2_50 = lowPrio (import ../applications/misc/blender { inherit stdenv fetchurl cmake mesa gettext libjpeg libpng zlib openal SDL openexr @@ -5842,10 +5749,7 @@ let bvi = callPackage ../applications/editors/bvi { }; - calibre = callPackage ../applications/misc/calibre { - python = python26Full; - inherit (python26Packages) mechanize lxml dateutil cssutils beautifulsoap; - }; + calibre = callPackage ../applications/misc/calibre { }; carrier = builderDefsPackage (import ../applications/networking/instant-messengers/carrier/2.5.0.nix) { inherit fetchurl stdenv pkgconfig perl perlXMLParser libxml2 openssl nss @@ -6283,10 +6187,7 @@ let gpscorrelate = callPackage ../applications/misc/gpscorrelate { }; - gpsd = callPackage ../servers/gpsd { - # We need a Python with NCurses bindings. - python = pythonFull; - }; + gpsd = callPackage ../servers/gpsd { }; guitone = callPackage ../applications/version-management/guitone { }; @@ -6398,18 +6299,6 @@ let kdevelop = newScope pkgs.kde4 ../applications/editors/kdevelop { }; keepnote = callPackage ../applications/office/keepnote { - # I did not find any better way of reusing buildPythonPackage+setuptools - # for a python with openssl support - buildPythonPackage = assert pythonFull.sqliteSupport; - import ../development/python-modules/generic { - inherit makeWrapper lib; - python = pythonFull; - setuptools = builderDefsPackage (import ../development/python-modules/setuptools) { - inherit makeWrapper; - python = pythonFull; - }; - }; - # How could this pygtk use also pythonFull, I don't know. pygtk = pyGtkGlade; }; @@ -6490,10 +6379,7 @@ let mercurial = callPackage ../applications/version-management/mercurial { guiSupport = getConfig ["mercurial" "guiSupport"] false; # for hgk (gitk gui for hg) - python = # allow cloning sources from https servers. - if getConfig ["mercurial" "httpsSupport"] true - then pythonFull - else pythonBase; + inherit (pythonPackages) ssl; }; merkaartor = callPackage ../applications/misc/merkaartor { @@ -6604,6 +6490,8 @@ let notmuch = callPackage ../applications/networking/mailreaders/notmuch { }; + nova = callPackage ../applications/virtualization/nova { }; + nvi = callPackage ../applications/editors/nvi { }; ocrad = callPackage ../applications/graphics/ocrad { }; @@ -6626,8 +6514,6 @@ let neon = neon029; }; - openstack_compute = callPackage ../applications/virtualization/openstack-compute { }; - opera = callPackage ../applications/networking/browsers/opera { qt = qt3; }; @@ -6817,8 +6703,7 @@ let tahoelafs = callPackage ../tools/networking/p2p/tahoe-lafs { inherit (pythonPackages) twisted foolscap simplejson nevow zfec pycryptopp pysqlite darcsver setuptoolsTrial setuptoolsDarcs - numpy pyasn1; - mock = pythonPackages.mock060; + numpy pyasn1 mock; }; tailor = builderDefsPackage (import ../applications/version-management/tailor) { @@ -7002,9 +6887,7 @@ let xdg_utils = callPackage ../tools/X11/xdg-utils { }; - xen = callPackage ../applications/virtualization/xen { - python = pythonFull; - }; + xen = callPackage ../applications/virtualization/xen { }; xfig = callPackage ../applications/graphics/xfig { stdenv = overrideGCC stdenv gcc34; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6731d853f4f..723f63d1c39 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1,8 +1,65 @@ -{ pkgs, python, buildPythonPackage }: +{ pkgs, python }: + +python.modules // rec { + + inherit python; -rec { inherit (pkgs) fetchurl fetchsvn stdenv; + + buildPythonPackage = import ../development/python-modules/generic { + inherit (pkgs) lib; + inherit python wrapPython setuptools; + }; + + + setuptools = import ../development/python-modules/setuptools { + inherit (pkgs) stdenv fetchurl; + inherit python wrapPython; + }; + + + wrapPython = pkgs.makeSetupHook + { deps = pkgs.makeWrapper; + substitutions.libPrefix = python.libPrefix; + } + ../development/python-modules/generic/wrap.sh; + + + anyjson = buildPythonPackage rec { + name = "anyjson-0.3.1"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/a/anyjson/${name}.tar.gz"; + md5 = "2b53b5d53fc40af4da7268d3c3e35a50"; + }; + + buildInputs = [ nose ]; + + meta = { + homepage = http://pypi.python.org/pypi/anyjson/; + description = "Wrapper that selects the best available JSON implementation"; + }; + }; + + + amqplib = buildPythonPackage rec { + name = "amqplib-0.6.1"; + + src = fetchurl { + url = "http://py-amqplib.googlecode.com/files/${name}.tgz"; + sha1 = "f124e5e4a6644bf6d1734032a01ac44db1b25a29"; + }; + + doCheck = false; + + meta = { + homepage = http://code.google.com/p/py-amqplib/; + description = "Python client for the Advanced Message Queuing Procotol (AMQP)"; + }; + }; + + argparse = buildPythonPackage (rec { name = "argparse-1.1"; @@ -54,12 +111,14 @@ rec { }; }); - boto = buildPythonPackage (rec { + + # euca2ools (and maybe Nova) needs boto 1.9, 2.0 doesn't work. + boto_1_9 = buildPythonPackage (rec { name = "boto-1.9b"; src = fetchurl { url = "http://boto.googlecode.com/files/${name}.tar.gz"; - sha256 = "0kir3ddm79rxdf7wb5czmxpbnqzgj3j966q4mach29kkb98p48wz"; + sha1 = "00a033b0a593c3ca82927867950f73d88b831155"; }; meta = { @@ -77,6 +136,70 @@ rec { }; }); + + boto = buildPythonPackage (rec { + name = "boto-2.0b4"; + + src = fetchurl { + url = "http://boto.googlecode.com/files/${name}.tar.gz"; + sha1 = "3e1deab58b8432d01baef1d37f17cbf6fa999f8d"; + }; + + meta = { + homepage = http://code.google.com/p/boto/; + + license = "bsd"; + + description = "Python interface to Amazon Web Services"; + + longDescription = '' + The boto module is an integrated interface to current and + future infrastructural services offered by Amazon Web + Services. This includes S3, SQS, EC2, among others. + ''; + }; + }); + + + carrot = buildPythonPackage rec { + name = "carrot-0.10.7"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/c/carrot/${name}.tar.gz"; + md5 = "530a0614de3a669314c3acd4995c54d5"; + }; + + buildInputs = [ nose ]; + + propagatedBuildInputs = [ amqplib anyjson ]; + + doCheck = false; # depends on the network + + meta = { + homepage = http://pypi.python.org/pypi/carrot; + description = "AMQP Messaging Framework for Python"; + }; + }; + + + cheetah = buildPythonPackage rec { + version = "2.4.4"; + name = "cheetah-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/C/Cheetah/Cheetah-${version}.tar.gz"; + md5 = "853917116e731afbc8c8a43c37e6ddba"; + }; + + propagatedBuildInputs = [ markdown ]; + + meta = { + homepage = http://www.cheetahtemplate.org/; + description = "A template engine and code generation tool"; + }; + }; + + cherrypy = buildPythonPackage (rec { name = "cherrypy-3.1.2"; @@ -133,18 +256,23 @@ rec { }); darcsver = buildPythonPackage (rec { - name = "darcsver-1.5.1"; + name = "darcsver-1.7.2"; src = fetchurl { url = "http://pypi.python.org/packages/source/d/darcsver/${name}.tar.gz"; - sha256 = "e643d607f27e4b8cc96565432ff1abdc2af5e9061c70798e2f33e78c07b66b3a"; + md5 = "94ca7e8c9ea0f69c0f3fc6f9fc88f65a"; }; + buildInputs = [ mock ]; + # Note: We don't actually need to provide Darcs as a build input. # Darcsver will DTRT when Darcs isn't available. See news.gmane.org # http://thread.gmane.org/gmane.comp.file-systems.tahoe.devel/3200 for a # discussion. + # Gives "ValueError: Empty module name" with no clue as to why. + doCheck = false; + meta = { description = "Darcsver, generate a version number from Darcs history"; @@ -172,6 +300,50 @@ rec { }); + decorator = buildPythonPackage rec { + name = "decorator-3.3.0"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/d/decorator/${name}.tar.gz"; + md5 = "0d62c81d9db4923e88e6a94581807cf6"; + }; + + meta = { + homepage = http://pypi.python.org/pypi/decorator; + }; + }; + + + distutils_extra = buildPythonPackage rec { + name = "distutils-extra-2.26"; + + src = fetchurl { + url = "http://launchpad.net/python-distutils-extra/trunk/2.26/+download/python-${name}.tar.gz"; + md5 = "7caded30a45907b5cdb10ac4182846eb"; + }; + + meta = { + homepage = https://launchpad.net/python-distutils-extra; + description = "Enhancements to Python's distutils"; + }; + }; + + + dtopt = buildPythonPackage rec { + name = "dtopt-0.1"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/d/dtopt/${name}.tar.gz"; + md5 = "9a41317149e926fcc408086aedee6bab"; + }; + + meta = { + description = "Add options to doctest examples while they are running"; + homepage = http://pypi.python.org/pypi/dtopt; + }; + }; + + eventlet = buildPythonPackage rec { name = "eventlet-0.9.14"; @@ -180,14 +352,13 @@ rec { md5 = "dfc96ed14b27392fdc529abcafeed880"; }; - buildInputs = [ nose httplib2 ]; + buildInputs = [ nose httplib2 ]; propagatedBuildInputs = [ greenlet ]; - # It tries to scribble in ~/.python-eggs. - preConfigure = "export HOME=$(pwd)"; + PYTHON_EGG_CACHE = "`pwd`/.egg-cache"; - doCheck = false; # !!! fix; test requires ssl support in Python + doCheck = false; # !!! fix; tests access the network meta = { homepage = http://pypi.python.org/pypi/eventlet/; @@ -290,6 +461,27 @@ rec { }; + glance = buildPythonPackage rec { + name = "glance-0.1.7"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/g/glance/${name}.tar.gz"; + md5 = "e733713ccd23e4a6253386a47971cfb5"; + }; + + buildInputs = [ nose mox ]; + + propagatedBuildInputs = [ gflags sqlalchemy webob routes eventlet python.modules.ssl ]; + + PYTHON_EGG_CACHE = "`pwd`/.egg-cache"; + + meta = { + homepage = https://launchpad.net/glance; + description = "Services for discovering, registering, and retrieving virtual machine images"; + }; + }; + + greenlet = buildPythonPackage rec { name = "greenlet-0.3.1"; @@ -322,6 +514,24 @@ rec { }; + ipy = buildPythonPackage rec { + version = "0.74"; + name = "ipy-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/I/IPy/IPy-${version}.tar.gz"; + md5 = "f4f7ddc7c5e55a47222a5cc6c0a87b6d"; + }; + + doCheck = false; + + meta = { + description = "Class and tools for handling of IPv4 and IPv6 addresses and networks"; + homepage = http://pypi.python.org/pypi/IPy; + }; + }; + + jinja2 = buildPythonPackage { name = "jinja2-2.2.1"; @@ -377,6 +587,66 @@ rec { }; }); + + magic = pkgs.stdenv.mkDerivation rec { + name = "python-${pkgs.file.name}"; + + src = pkgs.file.src; + + buildInputs = [ python pkgs.file ]; + + configurePhase = "cd python"; + + buildPhase = "python setup.py build"; + + installPhase = "python setup.py install --prefix=$out"; + + meta = { + description = "A Python wrapper around libmagic"; + homepage = http://www.darwinsys.com/file/; + }; + }; + + + m2crypto = buildPythonPackage rec { + version = "0.21.1"; + name = "m2crypto-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-${version}.tar.gz"; + md5 = "f93d8462ff7646397a9f77a2fe602d17"; + }; + + buildInputs = [ pkgs.swig pkgs.openssl ]; + + buildPhase = "python setup.py build_ext --openssl=${pkgs.openssl}"; + + doCheck = false; # another test that depends on the network. + + meta = { + description = "A Python crypto and SSL toolkit"; + homepage = http://chandlerproject.org/Projects/MeTooCrypto; + }; + }; + + + markdown = buildPythonPackage rec { + version = "2.0.3"; + name = "markdown-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/M/Markdown/Markdown-2.0.3.tar.gz"; + md5 = "751e8055be2433dfd1a82e0fb1b12f13"; + }; + + doCheck = false; + + meta = { + homepage = http://www.freewisdom.org/projects/python-markdown; + }; + }; + + matplotlib = buildPythonPackage ( rec { name = "matplotlib-0.99.1.2"; @@ -414,25 +684,16 @@ rec { }; }); + mock = buildPythonPackage (rec { - name = "mock-0.1.0"; + name = "mock-0.7.0"; src = fetchurl { - url = "mirror://sourceforge/python-mock/pythonmock-0.1.0.zip"; - sha256 = "0r17f8sjq6pjlfh2sq2x80bd5r6y9sb3n5l05x5sf25iaba7sg9z"; + url = "http://pypi.python.org/packages/source/m/mock/${name}.tar.gz"; + md5 = "be029f8c963c55250a452c400e10cf42"; }; - buildInputs = [ pkgs.unzip ]; - - phases = "unpackPhase"; - - unpackPhase = - '' mkdir "${name}" - unzip "$src" - - ensureDir "$out/lib/${python.libPrefix}/site-packages" - cp -v mock.py "$out/lib/${python.libPrefix}/site-packages" - ''; + buildInputs = [ unittest2 ]; meta = { description = "Mock objects for Python"; @@ -443,25 +704,24 @@ rec { }; }); - mock060 = pkgs.lowPrio (buildPythonPackage (rec { - # TODO: This appears to be an unofficially hacked version of 'mock' - # from above. This could probably replace the previous - # package, but I don't have time to test that right now. - name = "mock-0.6.0"; + + mox = buildPythonPackage rec { + name = "mox-0.5.3"; src = fetchurl { - url = "http://tahoe-lafs.org/source/tahoe-lafs/deps/tahoe-dep-sdists/${name}.tar.bz2"; - sha256 = "1vwxzr2sjyl3x5jqgz9swpmp6cyhmwmab65akysfglf6acmn3czf"; + url = "http://pymox.googlecode.com/files/${name}.tar.gz"; + sha1 = "b71aeaacf31898c3b38d8b9ca5bcc0664499c0de"; }; - doCheck = false; # Package doesn't have any tests. + + doCheck = false; meta = { - description = "Mock objects for Python, provided by tahoe-lafs.org"; - homepage = "http://python-mock.sourceforge.net/"; - license = "mBSD"; + homepage = http://code.google.com/p/pymox/; + description = "A mock object framework for Python."; }; - })); + }; + mutagen = buildPythonPackage (rec { name = "mutagen-1.20"; @@ -478,6 +738,26 @@ rec { }); + MySQL_python = buildPythonPackage { + name = "MySQL-python-1.2.3"; + + doCheck = false; + + src = fetchurl { + url = mirror://sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz; + sha256 = "0vkyg9dmj29hzk7fy77f42p7bfj28skyzsjsjry4wqr3z6xnzrkx"; + }; + + propagatedBuildInputs = [ pkgs.mysql pkgs.zlib nose ]; + + meta = { + description = "MySQL database binding for Python"; + + homepage = http://sourceforge.net/projects/mysql-python; + }; + }; + + namebench = buildPythonPackage (rec { name = "namebench-1.0.5"; @@ -571,11 +851,11 @@ rec { }); nose = buildPythonPackage { - name = "nose-0.11.3"; + name = "nose-1.0.0"; src = fetchurl { - url = http://python-nose.googlecode.com/files/nose-0.11.3.tar.gz; - sha256 = "1hl3lbwdfl2a64q3dxc73kbiks4iwx5cixlbavyryd8xdr7iziww"; + url = http://somethingaboutorange.com/mrl/projects/nose/nose-1.0.0.tar.gz; + sha256 = "0qm6q232h5r071gwfkiszkmfqc60k7abl15bk495lcdkk62m91db"; }; meta = { @@ -713,6 +993,46 @@ rec { }; }; + + paste = buildPythonPackage rec { + name = "paste-1.7.5.1"; + + src = fetchurl { + url = http://pypi.python.org/packages/source/P/Paste/Paste-1.7.5.1.tar.gz; + md5 = "7ea5fabed7dca48eb46dc613c4b6c4ed"; + }; + + buildInputs = [ nose ]; + + doCheck = false; # some files required by the test seem to be missing + + meta = { + description = "Tools for using a Web Server Gateway Interface stack"; + homepage = http://pythonpaste.org/; + }; + }; + + + paste_deploy = buildPythonPackage rec { + version = "1.3.4"; + name = "paste-deploy-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/P/PasteDeploy/PasteDeploy-${version}.tar.gz"; + md5 = "eb4b3e2543d54401249c2cbd9f2d014f"; + }; + + buildInputs = [ nose ]; + + doCheck = false; # can't find "FakeEgg.app", apparently missing from the tarball + + meta = { + description = "Load, configure, and compose WSGI applications and servers"; + homepage = http://pythonpaste.org/deploy/; + }; + }; + + pexpect = buildPythonPackage { name = "pexpect-2.3"; @@ -958,6 +1278,54 @@ rec { }; }); + + pysvn = pkgs.stdenv.mkDerivation { + name = "pysvn-1.7.2"; + + src = fetchurl { + url = "http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.2.tar.gz"; + sha256 = "2b2980d200515e754e00a12d99dbce25c1ea90fddf8cba2bfa354c9305c5e455"; + }; + + buildInputs = [ python pkgs.subversion pkgs.apr pkgs.aprutil pkgs.expat pkgs.neon pkgs.openssl ] + ++ (if stdenv.isLinux then [pkgs.e2fsprogs] else []); + + # There seems to be no way to pass that path to configure. + NIX_CFLAGS_COMPILE="-I${pkgs.aprutil}/include/apr-1"; + + configurePhase = '' + cd Source + python setup.py backport + python setup.py configure \ + --apr-inc-dir=${pkgs.apr}/include/apr-1 \ + --apr-lib-dir=${pkgs.apr}/lib \ + --svn-root-dir=${pkgs.subversion} + '' + (if !stdenv.isDarwin then "" else '' + sed -i -e 's|libpython2.7.dylib|lib/libpython2.7.dylib|' Makefile + ''); + + # The regression test suite expects locale support, which our glibc + # doesn't have by default. + doCheck = false; + checkPhase = "make -C ../Tests"; + + installPhase = '' + dest=$(toPythonPath $out)/pysvn + ensureDir $dest + cp pysvn/__init__.py $dest/ + cp pysvn/_pysvn*.so $dest/ + ensureDir $out/share/doc + mv -v ../Docs $out/share/doc/pysvn-1.7.2 + rm -v $out/share/doc/pysvn-1.7.2/generate_cpp_docs_from_html_docs.py + ''; + + meta = { + description = "Python bindings for Subversion"; + homepage = "http://pysvn.tigris.org/"; + }; + }; + + pyutil = buildPythonPackage (rec { name = "pyutil-1.7.9"; @@ -1076,90 +1444,42 @@ rec { }; }; - pysvn = pkgs.stdenv.mkDerivation { - name = "pysvn-1.7.2"; - + + routes = buildPythonPackage rec { + name = "routes-1.12.3"; + src = fetchurl { - url = "http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.2.tar.gz"; - sha256 = "2b2980d200515e754e00a12d99dbce25c1ea90fddf8cba2bfa354c9305c5e455"; + url = http://pypi.python.org/packages/source/R/Routes/Routes-1.12.3.tar.gz; + md5 = "9740ff424ff6b841632c784a38fb2be3"; }; - buildInputs = [ python pkgs.subversion pkgs.apr pkgs.aprutil pkgs.expat pkgs.neon pkgs.openssl ] - ++ (if stdenv.isLinux then [pkgs.e2fsprogs] else []); - - # There seems to be no way to pass that path to configure. - NIX_CFLAGS_COMPILE="-I${pkgs.aprutil}/include/apr-1"; - - configurePhase = '' - cd Source - python setup.py backport - python setup.py configure \ - --apr-inc-dir=${pkgs.apr}/include/apr-1 \ - --apr-lib-dir=${pkgs.apr}/lib \ - --svn-root-dir=${pkgs.subversion} - '' + (if !stdenv.isDarwin then "" else '' - sed -i -e 's|libpython2.7.dylib|lib/libpython2.7.dylib|' Makefile - ''); - - # The regression test suite expects locale support, which our glibc - # doesn't have by default. - doCheck = false; - checkPhase = "make -C ../Tests"; - - installPhase = '' - dest=$(toPythonPath $out)/pysvn - ensureDir $dest - cp pysvn/__init__.py $dest/ - cp pysvn/_pysvn*.so $dest/ - ensureDir $out/share/doc - mv -v ../Docs $out/share/doc/pysvn-1.7.2 - rm -v $out/share/doc/pysvn-1.7.2/generate_cpp_docs_from_html_docs.py - ''; + propagatedBuildInputs = [ paste webtest ]; meta = { - description = "Python bindings for Subversion"; - homepage = "http://pysvn.tigris.org/"; + description = "A Python re-implementation of the Rails routes system for mapping URLs to application actions"; + homepage = http://routes.groovie.org/; }; }; - magic = pkgs.stdenv.mkDerivation rec { - name = "python-${pkgs.file.name}"; - - src = pkgs.file.src; - - buildInputs = [ python pkgs.file ]; - - configurePhase = "cd python"; - - buildPhase = "python setup.py build"; - - installPhase = "python setup.py install --prefix=$out"; - - meta = { - description = "A Python wrapper around libmagic"; - homepage = http://www.darwinsys.com/file/; - }; - }; - - MySQL_python = buildPythonPackage { - name = "MySQL-python-1.2.3"; - - doCheck = false; - + + scripttest = buildPythonPackage rec { + version = "1.1.1"; + name = "scripttest-${version}"; + src = fetchurl { - url = mirror://sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz; - sha256 = "0vkyg9dmj29hzk7fy77f42p7bfj28skyzsjsjry4wqr3z6xnzrkx"; + url = "http://pypi.python.org/packages/source/S/ScriptTest/ScriptTest-${version}.tar.gz"; + md5 = "592ce890764c3f546d35b4d7c40c32ef"; }; - propagatedBuildInputs = [ pkgs.mysql pkgs.zlib nose ]; + buildInputs = [ nose ]; meta = { - description = "MySQL database binding for Python"; - - homepage = http://sourceforge.net/projects/mysql-python; + description = "A library for testing interactive command-line applications"; + homepage = http://pypi.python.org/pypi/ScriptTest/; }; }; + setuptoolsDarcs = buildPythonPackage { name = "setuptools-darcs-1.2.9"; @@ -1182,11 +1502,11 @@ rec { }; setuptoolsTrial = buildPythonPackage { - name = "setuptools-trial-0.5.9"; + name = "setuptools-trial-0.5.12"; src = fetchurl { - url = "http://pypi.python.org/packages/source/s/setuptools_trial/setuptools_trial-0.5.9.tar.gz"; - sha256 = "4e3b5a183b9cf6ff637777c9852dfe8eaab156289e7a578525d68b1cfb3c9f29"; + url = "http://pypi.python.org/packages/source/s/setuptools_trial/setuptools_trial-0.5.12.tar.gz"; + md5 = "f16f4237c9ee483a0cd13208849d96ad"; }; propagatedBuildInputs = [ twisted ]; @@ -1201,11 +1521,11 @@ rec { }; simplejson = buildPythonPackage (rec { - name = "simplejson-2.1.1"; + name = "simplejson-2.1.3"; src = fetchurl { url = "http://pypi.python.org/packages/source/s/simplejson/${name}.tar.gz"; - sha256 = "8c1c833c5b997bf7b75bf9a02a2d2884b8427816228eac0fb84791be44d2f612"; + md5 = "58d9b1d8fa17ea4ce205cea088607e02"; }; meta = { @@ -1225,6 +1545,71 @@ rec { }; }); + + sqlalchemy = buildPythonPackage { + name = "sqlalchemy-0.6.6"; + + src = fetchurl { + url = mirror://sourceforge/sqlalchemy/0.6.6/SQLAlchemy-0.6.6.tar.gz; + sha256 = "0inj9b66pi447cw500mqn7d09dij20ic3k5bnyhj6rpdl2l83a0l"; + }; + + buildInputs = [ nose ]; + + propagatedBuildInputs = [ python.modules.sqlite3 ]; + + meta = { + homepage = http://www.sqlalchemy.org/; + description = "A Python SQL toolkit and Object Relational Mapper"; + }; + }; + + + sqlalchemy_migrate = buildPythonPackage rec { + name = "sqlalchemy-migrate-0.6.1"; + + src = fetchurl { + url = "http://sqlalchemy-migrate.googlecode.com/files/${name}.tar.gz"; + sha1 = "17168b5fa066bd56fd93f26345525377e8a83d8a"; + }; + + buildInputs = [ nose unittest2 scripttest ]; + + propagatedBuildInputs = [ tempita decorator sqlalchemy ]; + + preCheck = + '' + echo sqlite:///__tmp__ > test_db.cfg + ''; + + # Some tests fail with "unexpected keyword argument 'script_path'". + doCheck = false; + + meta = { + homepage = http://code.google.com/p/sqlalchemy-migrate/; + description = "Schema migration tools for SQLAlchemy"; + }; + }; + + + tempita = buildPythonPackage rec { + version = "0.4"; + name = "tempita-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/T/Tempita/Tempita-${version}.tar.gz"; + md5 = "0abe015a72e748d0c6284679a497426c"; + }; + + buildInputs = [ nose ]; + + meta = { + homepage = http://pythonpaste.org/tempita/; + description = "A very small text templating language"; + }; + }; + + trac = buildPythonPackage { name = "trac-0.11.5"; @@ -1246,12 +1631,12 @@ rec { }; }; - twisted = buildPythonPackage { - name = "twisted-10.1.0"; + twisted = buildPythonPackage rec { + name = "twisted-10.2.0"; src = fetchurl { - url = http://tmrc.mit.edu/mirror/twisted/Twisted/10.1/Twisted-10.1.0.tar.bz2; - sha256 = "eda6e0e9e5ef6f6c19ab75bcb094f83a12ee25fe589fbcddf946e8a655c8070b"; + url = http://tmrc.mit.edu/mirror/twisted/Twisted/10.2/Twisted-10.2.0.tar.bz2; + sha256 = "110c30z622jn14yany1sxfaqj5qx20n9rc9zqacxlwma30fdcbjn"; }; propagatedBuildInputs = [ zopeInterface ]; @@ -1279,6 +1664,61 @@ rec { }; }; + + unittest2 = buildPythonPackage rec { + name = "unittest2-0.5.1"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/u/unittest2/${name}.tar.gz"; + md5 = "a0af5cac92bbbfa0c3b0e99571390e0f"; + }; + + meta = { + description = "A backport of the new features added to the unittest testing framework in Python 2.7"; + homepage = http://pypi.python.org/pypi/unittest2; + }; + }; + + + webob = buildPythonPackage rec { + version = "1.0.6"; + name = "webob-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/W/WebOb/WebOb-${version}.zip"; + md5 = "8e46dd755f6998d471bfbcb4def897ff"; + }; + + buildInputs = [ pkgs.unzip ]; + + # The test requires "webtest", which is a cyclic dependency. (WTF?) + doCheck = false; + + meta = { + description = "WSGI request and response object"; + homepage = http://pythonpaste.org/webob/; + }; + }; + + + webtest = buildPythonPackage rec { + version = "1.2.3"; + name = "webtest-${version}"; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/W/WebTest/WebTest-${version}.tar.gz"; + md5 = "585f9331467e6d99acaba4051c1c5878"; + }; + + propagatedBuildInputs = [ nose webob dtopt ]; + + meta = { + description = "Helper to test WSGI applications"; + homepage = http://pythonpaste.org/webtest/; + }; + }; + + zbase32 = buildPythonPackage (rec { name = "zbase32-1.1.2"; @@ -1345,4 +1785,5 @@ rec { license = "ZPL"; }; }; + }