diff --git a/pkgs/applications/audio/lastwatch/default.nix b/pkgs/applications/audio/lastwatch/default.nix index 324a0b0bebc..c09d397eefa 100644 --- a/pkgs/applications/audio/lastwatch/default.nix +++ b/pkgs/applications/audio/lastwatch/default.nix @@ -19,8 +19,6 @@ pythonPackages.buildPythonPackage rec { propagatedBuildInputs = pythonPath; - installCommand = "python setup.py install --prefix=$out"; - meta = { homepage = "https://github.com/aszlig/LastWatch"; description = "An inotify-based last.fm audio scrobbler"; diff --git a/pkgs/applications/audio/quodlibet/default.nix b/pkgs/applications/audio/quodlibet/default.nix index c865314cb17..fa63c9f654a 100644 --- a/pkgs/applications/audio/quodlibet/default.nix +++ b/pkgs/applications/audio/quodlibet/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, python, buildPythonPackage, mutagen, pygtk, pygobject +{ stdenv, fetchurl, python, buildPythonPackage, mutagen, pygtk, pygobject, intltool , pythonDBus, gst_python, withGstPlugins ? false, gst_plugins_base ? null , gst_plugins_good ? null, gst_plugins_ugly ? null, gst_plugins_bad ? null }: @@ -29,6 +29,11 @@ buildPythonPackage { }) ]; + preConfigure = '' + # TODO: for now don't a apply gdist overrides, will be needed for shipping icons, gtk, etc + sed -i /distclass/d setup.py + ''; + sourceRoot = "quodlibet-${version}"; postUnpack = '' # the patch searches for plugins in directory ../plugins @@ -42,7 +47,7 @@ buildPythonPackage { ]; propagatedBuildInputs = [ - mutagen pygtk pygobject pythonDBus gst_python + mutagen pygtk pygobject pythonDBus gst_python intltool ]; postInstall = stdenv.lib.optionalString withGstPlugins '' diff --git a/pkgs/applications/video/miro/default.nix b/pkgs/applications/video/miro/default.nix index 5ca6c80dc7c..14aeca62a71 100644 --- a/pkgs/applications/video/miro/default.nix +++ b/pkgs/applications/video/miro/default.nix @@ -40,10 +40,6 @@ buildPythonPackage rec { plat/resources.py ''; - installCommand = '' - python setup.py install --prefix= --root="$out" - ''; - # Disabled for now, because it requires networking and even if we skip those # tests, the whole test run takes around 10-20 minutes. doCheck = false; @@ -51,6 +47,12 @@ buildPythonPackage rec { HOME="$TEMPDIR" LANG=en_US.UTF-8 python miro.real --unittest ''; + preInstall = '' + # see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix + ${python}/bin/${python.executable} setup.py install_data --root=$out + sed -i '/data_files=data_files/d' setup.py + ''; + postInstall = '' mv "$out/bin/miro.real" "$out/bin/miro" ''; diff --git a/pkgs/development/python-modules/distutils-cfg/default.nix b/pkgs/development/python-modules/distutils-cfg/default.nix new file mode 100644 index 00000000000..190c663b471 --- /dev/null +++ b/pkgs/development/python-modules/distutils-cfg/default.nix @@ -0,0 +1,31 @@ +# global distutils configuration, see http://docs.python.org/2/install/index.html#distutils-configuration-files + +{ stdenv, python, writeText, extraCfg ? "" }: + + +let + distutilsCfg = writeText "distutils.cfg" '' + [easy_install] + + # don't allow network connections during build to ensure purity + allow-hosts = None + + # make sure we always unzip installed packages otherwise setup hooks won't work + zip_ok = 0 + + ${extraCfg} + ''; +in stdenv.mkDerivation { + name = "${python.libPrefix}-distutils.cfg"; + + buildInputs = [ python ]; + + unpackPhase = "true"; + + installPhase = '' + dest="$out/lib/${python.libPrefix}/site-packages/distutils" + mkdir -p $dest + ln -s ${python}/lib/${python.libPrefix}/distutils/* $dest + ln -s ${distutilsCfg} $dest/distutils.cfg + ''; +} diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 6a7d5e5f3d5..067a1cdf2e2 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -1,84 +1,112 @@ /* This function provides a generic Python package builder. It is - intended to work with packages that use `setuptools' + intended to work with packages that use `distutils/setuptools' (http://pypi.python.org/pypi/setuptools/), which represents a large number of Python packages nowadays. */ -{ python, setuptools, wrapPython, lib, offlineDistutils, recursivePthLoader }: +{ python, setuptools, wrapPython, lib, recursivePthLoader, distutils-cfg }: -{ name, namePrefix ? python.libPrefix + "-" +{ name + +# by default prefix `name` e.g. "python3.3-${name}" +, namePrefix ? python.libPrefix + "-" , buildInputs ? [] +# pass extra information to the distutils global configuration (think as global setup.cfg) +, distutilsExtraCfg ? "" + +# propagate build dependencies so in case we have A -> B -> C, +# C can import propagated packages by A , propagatedBuildInputs ? [] -, # 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 ? [] +# passed to "python setup.py install" +, setupPyInstallFlags ? [] -, installCommand ? - '' - easy_install --always-unzip --prefix="$out" . - '' - -, preConfigure ? "true" - -, buildPhase ? "true" +# passed to "python setup.py build" +, setupPyBuildFlags ? [] +# enable tests by default , doCheck ? true -, checkPhase ? - '' - runHook preCheck - ${python}/bin/${python.executable} setup.py test - runHook postCheck - '' - -, preInstall ? "" -, postInstall ? "" +# 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 ? [] , meta ? {} , ... } @ attrs: -# Keep extra attributes from ATTR, e.g., `patchPhase', etc. +# Keep extra attributes from `attrs`, e.g., `patchPhase', etc. python.stdenv.mkDerivation (attrs // { - inherit doCheck buildPhase checkPhase; + inherit doCheck; name = namePrefix + name; - # default to python's platforms and add maintainer(s) to every - # package - meta = { - platforms = python.meta.platforms; - } // meta // { - maintainers = (meta.maintainers or []) ++ [ lib.maintainers.chaoflow lib.maintainers.iElectric ]; - }; - - # checkPhase after installPhase to run tests on installed packages - phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase"; - - buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath; + buildInputs = [ python wrapPython setuptools (distutils-cfg.override { extraCfg = distutilsExtraCfg; }) ] ++ buildInputs ++ pythonPath; propagatedBuildInputs = propagatedBuildInputs ++ [ recursivePthLoader ]; pythonPath = [ setuptools ] ++ pythonPath; - preConfigure = '' + configurePhase = attrs.configurePhase or '' + runHook preConfigure + + # patch python interpreter to write null timestamps when compiling python files + # with following var we tell python to activate the patch so that python doesn't + # try to update them when we freeze timestamps in nix store export DETERMINISTIC_BUILD=1 - PYTHONPATH="${offlineDistutils}/lib/${python.libPrefix}/site-packages:$PYTHONPATH" - ${preConfigure} + + # prepend following line to import setuptools before distutils + # this way we make sure setuptools monkeypatches distutils commands + # this way setuptools provides extra helpers such as "python setup.py test" + sed -i '0,/import distutils/s//import setuptools;import distutils/' setup.py + sed -i '0,/from distutils/s//import setuptools;from distutils/' setup.py + + runHook postConfigure ''; - installPhase = preInstall + '' + checkPhase = attrs.checkPhase or '' + runHook preCheck + + ${python}/bin/${python.executable} setup.py test + + runHook postCheck + ''; + + buildPhase = attrs.buildPhase or '' + runHook preBuild + + ${python}/bin/${python.executable} setup.py build ${lib.concatStringsSep " " setupPyBuildFlags} + + runHook postBuild + ''; + + installPhase = attrs.installPhase or '' + runHook preInstall + mkdir -p "$out/lib/${python.libPrefix}/site-packages" - echo "installing \`${name}' with \`easy_install'..." export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH" - ${installCommand} + + ${python}/bin/${python.executable} setup.py install \ + --install-lib=$out/lib/${python.libPrefix}/site-packages \ + --old-and-unmanageable \ + --prefix="$out" ${lib.concatStringsSep " " setupPyInstallFlags} + + # --install-lib: + # sometimes packages specify where files should be installed outside the usual + # python lib prefix, we override that back so all infrastructure (setup hooks) + # work as expected + + # --old-and-unmanagable: + # instruct setuptools not to use eggs but fallback to plan package install + # this also reduces one .pth file in the chain, but the main reason is to + # force install process to install only scripts for the package we are + # installing (otherwise it will install scripts also for dependencies) # A pth file might have been generated to load the package from # within its own site-packages, rename this package not to @@ -94,21 +122,22 @@ python.stdenv.mkDerivation (attrs // { # corresponding site.py needs to be included in the PYTHONPATH. rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py* - ${postInstall} + runHook postInstall ''; 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 + # If a user installs a Python package, they probably also wants its + # dependencies in the user environment profile (only way to find the # dependencies is to have them in the PYTHONPATH variable). + # Allows you to do: $ PYTHONPATH=~/.nix-profile/lib/python2.7/site-packages python 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 + # TODO: document createBuildInputsPth build-inputs "$buildInputStrings" for inputsfile in propagated-build-inputs propagated-native-build-inputs; do if test -e $out/nix-support/$inputsfile; then @@ -116,4 +145,13 @@ python.stdenv.mkDerivation (attrs // { fi done ''; + + meta = with lib.maintainers; { + # default to python's platforms + platforms = python.meta.platforms; + } // meta // { + # add extra maintainer(s) to every package + maintainers = (meta.maintainers or []) ++ [ chaoflow iElectric ]; + }; + }) diff --git a/pkgs/development/python-modules/offline-distutils/default.nix b/pkgs/development/python-modules/offline-distutils/default.nix deleted file mode 100644 index 269f67bf5cd..00000000000 --- a/pkgs/development/python-modules/offline-distutils/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -# Used during module installation to prevent easy_install and python -# setup.py install/test from downloading - -{ stdenv, python }: - -stdenv.mkDerivation { - name = "python-offline-distutils-${python.version}"; - - buildInputs = [ python ]; - - unpackPhase = "true"; - installPhase = '' - dst="$out/lib/${python.libPrefix}/site-packages" - ensureDir $dst/distutils - ln -s ${python}/lib/${python.libPrefix}/distutils/* $dst/distutils/ - cat < $dst/distutils/distutils.cfg -[easy_install] -allow-hosts = None -EOF - ''; -} diff --git a/pkgs/development/python-modules/pil/default.nix b/pkgs/development/python-modules/pil/default.nix index 1dfdfee08fb..0b462cb4e52 100644 --- a/pkgs/development/python-modules/pil/default.nix +++ b/pkgs/development/python-modules/pil/default.nix @@ -14,16 +14,15 @@ buildPythonPackage { doCheck = true; - configurePhase = '' + preConfigure = '' sed -i "setup.py" \ -e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = libinclude("${freetype}")|g ; s|^JPEG_ROOT =.*$|JPEG_ROOT = libinclude("${libjpeg}")|g ; s|^ZLIB_ROOT =.*$|ZLIB_ROOT = libinclude("${zlib}")|g ;' ''; - buildPhase = "python setup.py build_ext -i"; checkPhase = "python selftest.py"; - #installPhase = "python setup.py install --prefix=$out"; + buildPhase = "python setup.py build_ext -i"; meta = { homepage = http://www.pythonware.com/products/pil/; diff --git a/pkgs/development/python-modules/pycrypto/default.nix b/pkgs/development/python-modules/pycrypto/default.nix index ec741ba247e..5da727a08db 100644 --- a/pkgs/development/python-modules/pycrypto/default.nix +++ b/pkgs/development/python-modules/pycrypto/default.nix @@ -9,17 +9,7 @@ buildPythonPackage rec { sha256 = "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"; }; - buildInputs = [ python gmp ]; - - buildPhase = - '' - python ./setup.py build_ext --library-dirs=${gmp}/lib - ''; - -# installPhase = -# '' -# python ./setup.py install --prefix=$out -# ''; + buildInputs = [ gmp ]; meta = { homepage = "http://www.pycrypto.org/"; diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix index e291544911c..dfe805ec9e4 100644 --- a/pkgs/development/python-modules/pygtk/default.nix +++ b/pkgs/development/python-modules/pygtk/default.nix @@ -14,7 +14,12 @@ buildPythonPackage rec { propagatedBuildInputs = [ gtk pygobject pycairo ]; - installCommand = "make install"; + configurePhase = "configurePhase"; + + buildPhase = "buildPhase"; + + installPhase = "installPhase"; + checkPhase = stdenv.lib.optionalString (libglade == null) '' sed -i -e "s/glade = importModule('gtk.glade', buildDir)//" \ diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index e0c3e7837b4..35630be2255 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -1,19 +1,19 @@ -{ stdenv, fetchurl, python, wrapPython }: +{ stdenv, fetchurl, python, wrapPython, distutils-cfg }: stdenv.mkDerivation rec { shortName = "setuptools-${version}"; name = "${python.executable}-${shortName}"; - version = "2.0.2"; + version = "2.1"; src = fetchurl { url = "http://pypi.python.org/packages/source/s/setuptools/${shortName}.tar.gz"; - sha256 = "09nv5x45y8fgc0kjmmw4gig3hr0is9xlc5rq053vnbmkxr5q5xmi"; + sha256 = "1m8qjvj5bfbphdags5s6pgmvk3xnw509lgdlq9whkq5a9mgxf8m7"; }; - buildInputs = [ python wrapPython ]; + buildInputs = [ python wrapPython distutils-cfg ]; - buildPhase = "${python}/bin/${python.executable} setup.py build --build-base $out"; + buildPhase = "${python}/bin/${python.executable} setup.py build"; installPhase = '' diff --git a/pkgs/development/python-modules/setuptools/distribute-skip-sdist_with_utf8_encoded_filename.patch b/pkgs/development/python-modules/setuptools/distribute-skip-sdist_with_utf8_encoded_filename.patch deleted file mode 100644 index 96a4f81ee58..00000000000 --- a/pkgs/development/python-modules/setuptools/distribute-skip-sdist_with_utf8_encoded_filename.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -r f5ac515f062a setuptools/tests/test_sdist.py ---- a/setuptools/tests/test_sdist.py Fri Jul 26 09:52:26 2013 +0200 -+++ b/setuptools/tests/test_sdist.py Sat Jul 27 20:22:17 2013 +0200 -@@ -3,12 +3,14 @@ - - - import os -+import locale - import shutil - import sys - import tempfile - import unittest - import unicodedata - -+from setuptools.tests.py26compat import skipIf - from setuptools.compat import StringIO, unicode - from setuptools.command.sdist import sdist - from setuptools.command.egg_info import manifest_maker -@@ -318,6 +320,9 @@ - filename = filename.decode('latin-1') - self.assertFalse(filename in cmd.filelist.files) - -+ -+ @skipIf(sys.version_info >= (3,) and locale.getpreferredencoding() != 'UTF-8', -+ 'Unittest fails if locale is not utf-8 but the manifests is recorded correctly') - def test_sdist_with_utf8_encoded_filename(self): - # Test for #303. - dist = Distribution(SETUP_ATTRS) diff --git a/pkgs/development/python-modules/setuptools/site.nix b/pkgs/development/python-modules/setuptools/site.nix deleted file mode 100644 index 34e7b478595..00000000000 --- a/pkgs/development/python-modules/setuptools/site.nix +++ /dev/null @@ -1,16 +0,0 @@ -# Propagated by buildPythonPackge to process pth files - -{ stdenv, python, setuptools }: - -stdenv.mkDerivation { - name = "python-setuptools-site-${setuptools.version}"; - - buildInputs = [ python setuptools ]; - - unpackPhase = "true"; - installPhase = '' - dst="$out/lib/${python.libPrefix}/site-packages" - ensureDir $dst - ln -s ${setuptools}/lib/${python.libPrefix}/site-packages/site.* $dst/ - ''; -} diff --git a/pkgs/os-specific/linux/iotop/default.nix b/pkgs/os-specific/linux/iotop/default.nix index 8e181d3d5cf..7481edeee7b 100644 --- a/pkgs/os-specific/linux/iotop/default.nix +++ b/pkgs/os-specific/linux/iotop/default.nix @@ -11,12 +11,6 @@ buildPythonPackage rec { pythonPath = [ pythonPackages.curses ]; - postInstall = - '' - # Put the man page in the right place. - mv $out/lib/python*/site-packages/iotop-*/share $out - ''; - doCheck = false; meta = { diff --git a/pkgs/tools/X11/winswitch/default.nix b/pkgs/tools/X11/winswitch/default.nix index bd160940b57..2db0d172173 100644 --- a/pkgs/tools/X11/winswitch/default.nix +++ b/pkgs/tools/X11/winswitch/default.nix @@ -29,12 +29,10 @@ let }' winswitch/util/distro_packaging_util.py ''; - buildPhase = '' - python setup.py build - ''; - - installCommand = '' - PREFIX="$out" python ./setup.py install --prefix="$out" + preInstall = '' + # see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix + python setup.py install_data --install-dir=$out --root=$out + sed -i '/data_files = data_files/d' setup.py ''; doCheck = false; diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix index 35370ae2128..f96fa577323 100644 --- a/pkgs/tools/X11/xpra/default.nix +++ b/pkgs/tools/X11/xpra/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { }; buildInputs = [ - python cython pkgconfig + cython pkgconfig xorg.libX11 xorg.renderproto xorg.libXrender xorg.libXi xorg.inputproto xorg.kbproto xorg.randrproto xorg.damageproto xorg.compositeproto xorg.xextproto xorg.recordproto @@ -33,9 +33,15 @@ buildPythonPackage rec { # they don't have automated testing out of the box? http://xpra.org/trac/ticket/177 doCheck = false; - buildPhase = '' - NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0) $(pkg-config --cflags pygtk-2.0) $(pkg-config --cflags xtst)" - python ./setup.py build --enable-Xdummy + preBuild = '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0) $(pkg-config --cflags pygtk-2.0) $(pkg-config --cflags xtst)" + ''; + setupPyBuildFlags = ["--enable-Xdummy"]; + + preInstall = '' + # see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix + ${python}/bin/${python.executable} setup.py install_data --install-dir=$out --root=$out + sed -i '/ = data_files/d' setup.py ''; meta = { diff --git a/pkgs/tools/admin/gtk-vnc/default.nix b/pkgs/tools/admin/gtk-vnc/default.nix index 44a421e2ba3..d4c45b7ba96 100644 --- a/pkgs/tools/admin/gtk-vnc/default.nix +++ b/pkgs/tools/admin/gtk-vnc/default.nix @@ -1,62 +1,41 @@ -x@{builderDefsPackage - , python, gtk, pygtk, gnutls, cairo, libtool, glib, pkgconfig, libtasn1 - , libffi, cyrus_sasl, intltool, perl, perlPackages, firefoxPkgs - , kbproto, libX11, libXext, xextproto, pygobject, libgcrypt - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ - ["perlPackages" "firefoxPkgs"]; +{ stdenv, fetchurl +, python, gtk, pygtk, gnutls, cairo, libtool, glib, pkgconfig, libtasn1 +, libffi, cyrus_sasl, intltool, perl, perlPackages, firefoxPkgs, pulseaudio +, kbproto, libX11, libXext, xextproto, pygobject, libgcrypt }: - buildInputs = (map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames))) - ++ [perlPackages.TextCSV firefoxPkgs.xulrunner ]; - sourceInfo = rec { - baseName="gtk-vnc"; - majorVersion="0.4"; - minorVersion="2"; - version="${majorVersion}.${minorVersion}"; - name="${baseName}-${version}"; - url="mirror://gnome/sources/${baseName}/${majorVersion}/${name}.tar.gz"; - hash="1fkhzwpw50rnwp51lsbny16p2ckzx5rkcaiaqvkd90vwnm2cccls"; - }; -in -rec { - src = a.fetchurl { - url = sourceInfo.url; - sha256 = sourceInfo.hash; + +stdenv.mkDerivation rec { + name = "gtk-vnc-${version}"; + version = "0.5.3"; + + src = fetchurl { + url = "mirror://gnome/sources/gtk-vnc/0.5/${name}.tar.xz"; + sha256 = "1bww2ihxb3zzvifdrcsy1lifr664pvikq17hmr1hsm8fyk4ad46l"; }; - inherit (sourceInfo) name version; - inherit buildInputs; + buildInputs = [ + python gtk pygtk gnutls cairo libtool pkgconfig glib libffi libgcrypt + intltool cyrus_sasl pulseaudio pygobject perl perlPackages.TextCSV + ]; + NIX_CFLAGS_COMPILE = "-fstack-protector-all"; configureFlags = [ "--with-python" "--with-examples" ]; - /* doConfigure should be removed if not needed */ - phaseNames = ["fixMakefiles" "doConfigure" "doMakeInstall"]; + makeFlags = "CODEGENDIR=${pygobject}/share/pygobject/2.0/codegen/ DEFSDIR=${pygtk}/share/pygtk/2.0/defs/"; - fixMakefiles = a.fullDepEntry '' - find . -name 'Makefile*' -exec sed -i '{}' -e 's@=codegendir pygtk-2.0@=codegendir pygobject-2.0@' ';' - '' ["minInit" "doUnpack"]; - - meta = { + meta = with stdenv.lib; { description = "A GTK VNC widget"; - maintainers = with a.lib.maintainers; - [ - raskin - ]; - platforms = with a.lib.platforms; - linux; - license = a.lib.licenses.lgpl21; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; + license = licenses.lgpl21; }; + passthru = { updateInfo = { downloadPage = "http://ftp.gnome.org/pub/GNOME/sources/gtk-vnc"; }; }; -}) x - +} diff --git a/pkgs/tools/networking/getmail/default.nix b/pkgs/tools/networking/getmail/default.nix index 80d29835da5..6d9666506b8 100644 --- a/pkgs/tools/networking/getmail/default.nix +++ b/pkgs/tools/networking/getmail/default.nix @@ -11,8 +11,6 @@ buildPythonPackage rec { doCheck = false; - installCommand = "python setup.py install --prefix=\"\$prefix\""; - meta = { description = "A program for retrieving mail"; maintainers = [ stdenv.lib.maintainers.raskin stdenv.lib.maintainers.iElectric ]; diff --git a/pkgs/tools/security/fail2ban/default.nix b/pkgs/tools/security/fail2ban/default.nix index aa387eff3e7..b28c761ec2c 100644 --- a/pkgs/tools/security/fail2ban/default.nix +++ b/pkgs/tools/security/fail2ban/default.nix @@ -39,10 +39,6 @@ pythonPackages.buildPythonPackage { doCheck = false; - installCommand = '' - python setup.py install --prefix=$out - ''; - meta = with stdenv.lib; { homepage = http://www.fail2ban.org/; description = "A program that scans log files for repeated failing login attempts and bans IP addresses"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2958120f907..73919c330ba 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -20,10 +20,10 @@ pythonPackages = modules // import ./python-packages-generated.nix { callPackage = pkgs.lib.callPackageWith (pkgs // pythonPackages); - buildPythonPackage = import ../development/python-modules/generic { - inherit (pkgs) lib; - inherit python wrapPython setuptools recursivePthLoader offlineDistutils; - }; + # global distutils config used by buildPythonPackage + distutils-cfg = callPackage ../development/python-modules/distutils-cfg { }; + + buildPythonPackage = callPackage ../development/python-modules/generic { }; wrapPython = pkgs.makeSetupHook { deps = pkgs.makeWrapper; @@ -33,11 +33,6 @@ pythonPackages = modules // import ./python-packages-generated.nix { # specials - offlineDistutils = import ../development/python-modules/offline-distutils { - inherit (pkgs) stdenv; - inherit python; - }; - recursivePthLoader = import ../development/python-modules/recursive-pth-loader { inherit (pkgs) stdenv; inherit python; @@ -45,12 +40,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { setuptools = import ../development/python-modules/setuptools { inherit (pkgs) stdenv fetchurl; - inherit python wrapPython; - }; - - setuptoolsSite = import ../development/python-modules/setuptools/site.nix { - inherit (pkgs) stdenv; - inherit python setuptools; + inherit python wrapPython distutils-cfg; }; # packages defined elsewhere @@ -297,10 +287,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { ]; postInstall = '' - ln -s ${pyramid}/bin/pserve $out/bin ln -s ${pkgs.bacula}/bin/bconsole $out/bin - wrapProgram "$out/bin/pserve" \ - --suffix PYTHONPATH : "$out/lib/python2.7/site-packages" ''; meta = { @@ -554,7 +541,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; # tests depend on $HOME setting - configurePhase = "export HOME=$TMPDIR"; + preConfigure = "export HOME=$TMPDIR"; propagatedBuildInputs = [ pythonPackages.pyyaml @@ -1241,21 +1228,32 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; pytest = buildPythonPackage rec { - name = "pytest-2.3.5"; + name = "pytest-2.5.1"; src = fetchurl { url = "http://pypi.python.org/packages/source/p/pytest/${name}.tar.gz"; - md5 = "18f150e7be96b5fe3c388b0e817b8087"; + md5 = "4e155a0134e6757b37cc6698c20f3e9f"; }; - propagatedBuildInputs = [ pythonPackages.py ] + preCheck = '' + # broken on python3, fixed in master, remove in next release + rm doc/en/plugins_index/test_plugins_index.py + + # don't test bash builtins + rm testing/test_argcomplete.py + + # yaml test are failing + rm doc/en/example/nonpython/test_simple.yml + ''; + + propagatedBuildInputs = [ py ] ++ stdenv.lib.optional pkgs.config.pythonPackages.pytest.selenium or false pythonPackages.selenium; meta = with stdenv.lib; { maintainers = with maintainers; [ iElectric lovek323 ]; - platforms = platforms.unix; + platforms = platforms.unix; }; }; @@ -1697,14 +1695,23 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; gtimelog = buildPythonPackage rec { - name = "gtimelog-0.8.1"; + name = "gtimelog-${version}"; + version = "0.8.1"; + src = fetchurl { - url = https://launchpad.net/gtimelog/devel/0.8.1/+download/gtimelog-0.8.1.tar.gz; - sha256 = "010sbw4rmslf5ifg9bgicn0f6mgsy76v8218xi0jndi9z6pva7y6"; + url = "https://github.com/gtimelog/gtimelog/archive/${version}.tar.gz"; + sha256 = "0nwpfv284b26q97mfpagqkqb4n2ilw46cx777qsyi3plnywk1xa0"; }; + propagatedBuildInputs = [ pygtk ]; + + checkPhase = '' + patchShebangs ./runtests + ./runtests + ''; + meta = with stdenv.lib; { - description = "A small Gtk+ app for keeping track of your time. It's main goal is to be as unintrusive as possible."; + description = "A small Gtk+ app for keeping track of your time. It's main goal is to be as unintrusive as possible"; homepage = http://mg.pov.lt/gtimelog/; license = licenses.gpl2Plus; maintainers = [ maintainers.ocharles ]; @@ -1712,6 +1719,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; }; + # TODO: this shouldn't use a buildPythonPackage koji = buildPythonPackage (rec { name = "koji-1.8"; meta.maintainers = [ stdenv.lib.maintainers.mornfall ]; @@ -1721,8 +1729,9 @@ pythonPackages = modules // import ./python-packages-generated.nix { sha256 = "10dph209h4jgajb5jmbjhqy4z4hd22i7s2d93vm3ikdf01i8iwf1"; }; + configurePhase = ":"; buildPhase = ":"; - installCommand = "make install DESTDIR=$out/ && cp -R $out/nix/store/*/* $out/ && rm -rf $out/nix"; + installPhase = "make install DESTDIR=$out/ && cp -R $out/nix/store/*/* $out/ && rm -rf $out/nix"; doCheck = false; propagatedBuildInputs = [ pythonPackages.pycurl ]; @@ -1741,12 +1750,12 @@ pythonPackages = modules // import ./python-packages-generated.nix { paver = buildPythonPackage rec { - version = "1.2.1"; + version = "1.2.2"; name = "Paver-${version}"; src = fetchurl { url = "https://pypi.python.org/packages/source/P/Paver/Paver-${version}.tar.gz"; - sha256 = "1b1023jks1gi1rwphdy3y2zx7dh4bvwk2050kclp95j7xym1ya0y"; + sha256 = "0lix9d33ndb3yk56sm1zlj80fbmxp0w60yk0d9pr2xqxiwi88sqy"; }; buildInputs = [ cogapp mock virtualenv ]; @@ -2195,6 +2204,10 @@ pythonPackages = modules // import ./python-packages-generated.nix { sha256 = "0d2if633m3kbiricd5hgn1csccd8xab6lnab1bq9prdr9ks9i8h6"; }; + preConfigure = '' + sed -i "/use_setuptools/d" setup.py + ''; + buildInputs = [ pkgs.alsaLib pkgs.jackaudio ]; meta = with stdenv.lib; { @@ -2476,17 +2489,14 @@ pythonPackages = modules // import ./python-packages-generated.nix { dulwich = buildPythonPackage rec { - name = "dulwich-0.8.1"; + name = "dulwich-0.8.7"; src = fetchurl { url = "http://samba.org/~jelmer/dulwich/${name}.tar.gz"; - sha256 = "1a1619e9c7e63fe9bdc93356ee893be1016b7ea12ad953f4e1f1f5c0c5056ee8"; + sha256 = "041qp5v2x8fbwkmws6hwwiny74lavkz723dj8gwbm40b2383d8vv"; }; buildPhase = "make build"; - installCommand = '' - ${python}/bin/${python.executable} setup.py install --prefix="$out" --root=/ --record="$out/lib/${python.libPrefix}/site-packages/dulwich/list.txt" --single-version-externally-managed - ''; # For some reason "python setup.py test" doesn't work with Python 2.6. # pretty sure that is about import behaviour. @@ -3448,9 +3458,6 @@ pythonPackages = modules // import ./python-packages-generated.nix { buildInputs = [ pkgs.libxml2 pkgs.libxslt ]; propagatedBuildInputs = [ ]; doCheck = false; - installCommand = '' - easy_install --always-unzip --no-deps --prefix="$out" . - ''; meta = { description = "Pythonic binding for the libxml2 and libxslt libraries"; @@ -3502,21 +3509,15 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; }; - magic = pkgs.stdenv.mkDerivation rec { - name = "python-${pkgs.file.name}"; + magic = buildPythonPackage rec { + name = "${pkgs.file.name}"; src = pkgs.file.src; patches = [ ../tools/misc/file/python.patch ]; buildInputs = [ python pkgs.file ]; - configurePhase = "cd python"; - - buildPhase = "${python}/bin/${python.executable} setup.py build"; - - installPhase = '' - ${python}/bin/${python.executable} setup.py install --prefix=$out - ''; + preConfigure = "cd python"; meta = { description = "A Python wrapper around libmagic"; @@ -3536,7 +3537,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { buildInputs = [ pkgs.swig pkgs.openssl ]; - buildPhase = "${python}/bin/${python.executable} setup.py build_ext --openssl=${pkgs.openssl}"; + preBuild = "${python}/bin/${python.executable} setup.py build_ext --openssl=${pkgs.openssl}"; doCheck = false; # another test that depends on the network. @@ -4210,19 +4211,14 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; }); - notmuch = pkgs.stdenv.mkDerivation rec { + notmuch = buildPythonPackage rec { name = "python-${pkgs.notmuch.name}"; src = pkgs.notmuch.src; + sourceRoot = "${pkgs.notmuch.name}/bindings/python"; + buildInputs = [ python pkgs.notmuch ]; - #propagatedBuildInputs = [ python pkgs.notmuch ]; - - configurePhase = "cd bindings/python"; - - buildPhase = "python setup.py build"; - - installPhase = "python setup.py install --prefix=$out"; meta = { description = "A Python wrapper around notmuch"; @@ -4241,15 +4237,15 @@ pythonPackages = modules // import ./python-packages-generated.nix { preConfigure = '' sed -i 's/-faltivec//' numpy/distutils/system_info.py + sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py ''; - # TODO: add ATLAS=${pkgs.atlas} - installCommand = '' + preBuild = '' export BLAS=${pkgs.blas} LAPACK=${pkgs.liblapack} - ${python}/bin/${python.executable} setup.py build --fcompiler="gnu95" - ${python}/bin/${python.executable} setup.py install --prefix=$out ''; + setupPyBuildFlags = ["--fcompiler='gnu95'"]; + # error: invalid command 'test' doCheck = false; @@ -4618,16 +4614,13 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; pip = buildPythonPackage rec { - version = "1.4.1"; + version = "1.5"; name = "pip-${version}"; src = fetchurl { url = "http://pypi.python.org/packages/source/p/pip/pip-${version}.tar.gz"; - sha256 = "0knhj3c1nqqzxgqin8l0gzy6nzsbcxinyr0cbp1j99hi8xahcyjf"; + sha256 = "0j700f70mj0brdlvs2cz4a7h4jwmzgymgp8qk1qb3lsm1qd1vy15"; }; - buildInputs = [ mock scripttest virtualenv nose ]; - # ValueError: Working directory tests not found, or not a directory - # see https://github.com/pypa/pip/issues/92 - doCheck = false; + buildInputs = [ mock scripttest virtualenv pytest ]; }; @@ -4644,17 +4637,17 @@ pythonPackages = modules // import ./python-packages-generated.nix { pillow = buildPythonPackage rec { - name = "Pillow-2.2.1"; + name = "Pillow-2.3.0"; src = fetchurl { url = "http://pypi.python.org/packages/source/P/Pillow/${name}.zip"; - md5 = "d1d20d3db5d1ab312da0951ff061e6bf"; + md5 = "56b6614499aacb7d6b5983c4914daea7"; }; buildInputs = [ pkgs.freetype pkgs.libjpeg pkgs.unzip pkgs.zlib pkgs.libtiff pkgs.libwebp ]; # NOTE: we use LCMS_ROOT as WEBP root since there is not other setting for webp. - configurePhase = '' + preConfigure = '' sed -i "setup.py" \ -e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = _lib_include("${pkgs.freetype}")|g ; s|^JPEG_ROOT =.*$|JPEG_ROOT = _lib_include("${pkgs.libjpeg}")|g ; @@ -4663,7 +4656,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { s|^TIFF_ROOT =.*$|TIFF_ROOT = _lib_include("${pkgs.libtiff}")|g ;' ''; - doCheck = true; + meta = { homepage = http://python-imaging.github.com/Pillow; @@ -4774,10 +4767,6 @@ pythonPackages = modules // import ./python-packages-generated.nix { protobuf = buildPythonPackage rec { inherit (pkgs.protobuf) name src; - buildPhase = '' - python setup.py build - ''; - propagatedBuildInputs = [pkgs.protobuf]; sourceRoot = "${name}/python"; @@ -4848,7 +4837,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { src = fetchurl { url = "https://pypi.python.org/packages/source/p/py/${name}.tar.gz"; - md5 = "3857dc8309d5f284669b81184253c2bb"; + md5 = "d2e24b4363d834bf9192247f143435bc"; }; }; @@ -5199,6 +5188,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { propagatedBuildInputs = [ urlgrabber ]; checkPhase = '' + export PYTHONPATH="$PYTHONPATH:." ${python}/bin/${python.executable} tests/baseclass.py -vv ''; @@ -5277,7 +5267,8 @@ pythonPackages = modules // import ./python-packages-generated.nix { propagatedBuildInputs = [ pkgs.parted ]; checkPhase = '' - ${python}/bin/${python.executable} -m unittest discover -v + patchShebangs Makefile + make test PYTHON=${python.executable} ''; meta = { @@ -5319,14 +5310,14 @@ pythonPackages = modules // import ./python-packages-generated.nix { }); python_fedora = buildPythonPackage (rec { - name = "python-fedora-0.3.32.3"; + name = "python-fedora-0.3.33"; meta.maintainers = [ stdenv.lib.maintainers.mornfall ]; src = fetchurl { - url = "https://fedorahosted.org/releases/p/y/python-fedora/python-fedora-0.3.32.3.tar.gz"; - sha256 = "0qwmbid4pkdj6z9gwa43fzs97fr6ci2h2vj1hyk0gp0vqim4kv4l"; + url = "https://fedorahosted.org/releases/p/y/python-fedora/${name}.tar.gz"; + sha256 = "1g05bh7d5d0gzrlnhpnca7jpqbgs2rgnlzzbvzzxmdbmlkqi3mws"; }; - propagatedBuildInputs = [ kitchen requests bunch ]; + propagatedBuildInputs = [ kitchen requests bunch paver ]; doCheck = false; }); @@ -5631,7 +5622,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { # There seems to be no way to pass that path to configure. NIX_CFLAGS_COMPILE="-I${pkgs.aprutil}/include/apr-1"; - configurePhase = '' + preConfigure = '' cd Source python setup.py backport python setup.py configure \ @@ -5753,11 +5744,11 @@ pythonPackages = modules // import ./python-packages-generated.nix { pyyaml = buildPythonPackage (rec { - name = "PyYAML-3.09"; + name = "PyYAML-3.10"; src = fetchurl { - url = "http://pyyaml.org/download/pyyaml/PyYAML-3.09.zip"; - sha256 = "204aca8b42dbe90e460794d743dd16182011da85507bfd4f092f9f76e0688040"; + url = "http://pyyaml.org/download/pyyaml/${name}.zip"; + sha256 = "1r127fa354ppb667f4acxlzwxixap1jgzjrr790bw8mcpxv2hqaa"; }; buildInputs = [ pkgs.unzip pkgs.pyrex ]; @@ -6182,16 +6173,16 @@ pythonPackages = modules // import ./python-packages-generated.nix { buildInputs = [pkgs.gfortran]; propagatedBuildInputs = [ numpy ]; + # TODO: add ATLAS=${pkgs.atlas} + preConfigure = '' + export BLAS=${pkgs.blas} LAPACK=${pkgs.liblapack} + ''; + + setupPyBuildFlags = [ "--fcompiler='gnu95'" ]; + # error: invalid command 'test' doCheck = false; - # TODO: add ATLAS=${pkgs.atlas} - installCommand = '' - export BLAS=${pkgs.blas} LAPACK=${pkgs.liblapack} - ${python}/bin/${python.executable} setup.py build --fcompiler="gnu95" - ${python}/bin/${python.executable} setup.py install --prefix=$out - ''; - meta = { description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering. "; homepage = http://www.scipy.org/; @@ -6200,15 +6191,15 @@ pythonPackages = modules // import ./python-packages-generated.nix { scripttest = buildPythonPackage rec { - version = "1.1.1"; + version = "1.3"; name = "scripttest-${version}"; src = fetchurl { - url = "http://pypi.python.org/packages/source/S/ScriptTest/ScriptTest-${version}.tar.gz"; - md5 = "592ce890764c3f546d35b4d7c40c32ef"; + url = "http://pypi.python.org/packages/source/s/scripttest/scripttest-${version}.tar.gz"; + md5 = "1d1c5117ccfc7b5961cae6c1020c0848"; }; - buildInputs = [ nose ]; + buildInputs = [ nose pytest ]; meta = { description = "A library for testing interactive command-line applications"; @@ -6322,7 +6313,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { md5 = "93c93725674c0702583a638f5a09c9e4"; }; - propagatedBuildInputs = [ jinja2 markdown pillow pilkit clint argh ]; + propagatedBuildInputs = [ jinja2 markdown pillow pilkit clint argh pytest ]; meta = with stdenv.lib; { description = "Yet another simple static gallery generator"; @@ -6583,7 +6574,10 @@ pythonPackages = modules // import ./python-packages-generated.nix { }; buildInputs = [ mock ]; - propagatedBuildInputs = [ meld3 ]; + propagatedBuildInputs = [ meld3 ]; + + # failing tests when building under chroot as root user doesn't exist + doCheck = false; meta = { description = "A system for controlling process state under UNIX"; @@ -6723,10 +6717,16 @@ pythonPackages = modules // import ./python-packages-generated.nix { md5 = "051dd9de0757714d33c3ecd5ab37b97d"; }; - buildInputs = [ pytest webob pkgs.imagemagick ]; + buildInputs = [ pytest webob pkgs.imagemagick nose ]; propagatedBuildInputs = [ sqlalchemy8 wand ]; - checkPhase = "cd tests && LD_LIBRARY_PATH=${pkgs.imagemagick}/lib py.test"; + checkPhase = '' + cd tests + export LD_LIBRARY_PATH=${pkgs.imagemagick}/lib + export PYTHONPATH=$PYTHONPATH:../ + py.test + cd .. + ''; meta = { homepage = https://github.com/crosspop/sqlalchemy-imageattach; @@ -7206,10 +7206,10 @@ pythonPackages = modules // import ./python-packages-generated.nix { }); virtualenv = buildPythonPackage rec { - name = "virtualenv-1.10"; + name = "virtualenv-1.11"; src = fetchurl { url = "http://pypi.python.org/packages/source/v/virtualenv/${name}.tar.gz"; - md5 = "9745c28256c70c76d36adb3767a00212"; + md5 = "d1a7cf95b539a861a8215827f387c4eb"; }; inherit recursivePthLoader; @@ -7826,8 +7826,8 @@ pythonPackages = modules // import ./python-packages-generated.nix { propagatedBuildInputs = [ zope_proxy ]; # ignore circular dependency on zope_schema - installCommand = '' - easy_install --always-unzip --no-deps --prefix="$out" . + preBuild = '' + sed -i '/zope.schema/d' setup.py ''; doCheck = false; @@ -7880,12 +7880,7 @@ pythonPackages = modules // import ./python-packages-generated.nix { md5 = "e7e581af8193551831560a736a53cf58"; }; - propagatedBuildInputs = [ zope_event zope_interface zope_testing ] ++ optional isPy26 ordereddict; - - # ignore circular dependency on zope_location - installCommand = '' - easy_install --no-deps --prefix="$out" . - ''; + propagatedBuildInputs = [ zope_location zope_event zope_interface zope_testing ] ++ optional isPy26 ordereddict; meta = { maintainers = [ stdenv.lib.maintainers.goibhniu ];