about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorLuca Bruno <lethalman88@gmail.com>2015-11-29 16:50:26 +0100
committerLuca Bruno <lethalman88@gmail.com>2015-11-29 16:50:26 +0100
commit920b1d3591431837f4522ccff52fb65b241200cf (patch)
treea63a1acebbee20444f4b3e9e2695ec712ba7aae3 /pkgs/applications
parent07a0204282224891492e7e1cfe72830a1fc32355 (diff)
parenta9056371a0a62da46ff88183a6535635ed085dec (diff)
downloadnixlib-920b1d3591431837f4522ccff52fb65b241200cf.tar
nixlib-920b1d3591431837f4522ccff52fb65b241200cf.tar.gz
nixlib-920b1d3591431837f4522ccff52fb65b241200cf.tar.bz2
nixlib-920b1d3591431837f4522ccff52fb65b241200cf.tar.lz
nixlib-920b1d3591431837f4522ccff52fb65b241200cf.tar.xz
nixlib-920b1d3591431837f4522ccff52fb65b241200cf.tar.zst
nixlib-920b1d3591431837f4522ccff52fb65b241200cf.zip
Merge branch 'master' into closure-size
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/audio/faust/default.nix25
-rw-r--r--pkgs/applications/audio/faust/faust1.nix209
-rw-r--r--pkgs/applications/audio/gpodder/default.nix15
-rw-r--r--pkgs/applications/audio/id3v2/default.nix4
-rw-r--r--pkgs/applications/audio/keyfinder-cli/default.nix2
-rw-r--r--pkgs/applications/audio/mopidy-mopify/default.nix2
-rw-r--r--pkgs/applications/editors/eclipse/plugins.nix6
-rw-r--r--pkgs/applications/editors/leo-editor/default.nix9
-rw-r--r--pkgs/applications/graphics/apitrace/default.nix4
-rw-r--r--pkgs/applications/graphics/jbrout/default.nix34
-rw-r--r--pkgs/applications/misc/calibre/default.nix9
-rw-r--r--pkgs/applications/misc/gpsbabel/default.nix10
-rw-r--r--pkgs/applications/misc/ocropus/default.nix5
-rw-r--r--pkgs/applications/misc/printrun/default.nix4
-rw-r--r--pkgs/applications/misc/pytrainer/default.nix6
-rw-r--r--pkgs/applications/misc/weather/default.nix30
-rw-r--r--pkgs/applications/misc/ykpers/default.nix4
-rw-r--r--pkgs/applications/networking/cluster/mesos/default.nix6
-rw-r--r--pkgs/applications/networking/davmail/default.nix6
-rw-r--r--pkgs/applications/networking/feedreaders/rsstail/default.nix2
-rw-r--r--pkgs/applications/networking/mailreaders/claws-mail/default.nix6
-rw-r--r--pkgs/applications/networking/mailreaders/mailnag/default.nix6
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix6
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch39
-rw-r--r--pkgs/applications/office/zim/default.nix74
-rw-r--r--pkgs/applications/science/logic/coq/8.5.nix6
-rw-r--r--pkgs/applications/science/logic/sad/default.nix33
-rw-r--r--pkgs/applications/science/logic/sad/patch200
-rw-r--r--pkgs/applications/science/spyder/default.nix21
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-hub/default.nix2
-rw-r--r--pkgs/applications/video/devede/default.nix4
-rw-r--r--pkgs/applications/virtualization/virt-manager/default.nix32
-rw-r--r--pkgs/applications/window-managers/fbpanel/default.nix2
-rw-r--r--pkgs/applications/window-managers/stalonetray/default.nix2
34 files changed, 608 insertions, 217 deletions
diff --git a/pkgs/applications/audio/faust/default.nix b/pkgs/applications/audio/faust/default.nix
index 722c762b7b44..91e9fb66659e 100644
--- a/pkgs/applications/audio/faust/default.nix
+++ b/pkgs/applications/audio/faust/default.nix
@@ -1,20 +1,26 @@
 { stdenv
 , coreutils
-, fetchgit
+, fetchurl
 , makeWrapper
 , pkgconfig
+, clang
+, llvm
+, emscripten
+, openssl
+, libsndfile
+, libmicrohttpd
+, vim
 }:
 
 with stdenv.lib.strings;
 
 let
 
-  version = "8-1-2015";
+  version = "2.0-a41";
 
-  src = fetchgit {
-    url = git://git.code.sf.net/p/faudiostream/code;
-    rev = "4db76fdc02b6aec8d15a5af77fcd5283abe963ce";
-    sha256 = "f1ac92092ee173e4bcf6b2cb1ac385a7c390fb362a578a403b2b6edd5dc7d5d0";
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/project/faudiostream/faust-2.0.a41.tgz";
+    sha256 = "1cq4x1cax0lswrcqv0limx5mjdi3187zlmh7cj2pndr0xq6b96cm";
   };
 
   meta = with stdenv.lib; {
@@ -31,19 +37,22 @@ let
 
     inherit src;
 
-    buildInputs = [ makeWrapper ];
+    buildInputs = [ makeWrapper llvm emscripten openssl libsndfile pkgconfig libmicrohttpd vim ];
+
 
     passthru = {
       inherit wrap wrapWithBuildEnv;
     };
 
+
     preConfigure = ''
-      makeFlags="$makeFlags prefix=$out"
+      makeFlags="$makeFlags prefix=$out LLVM_CONFIG='${llvm}/bin/llvm-config' world"
 
       # The faust makefiles use 'system ?= $(shell uname -s)' but nix
       # defines 'system' env var, so undefine that so faust detects the
       # correct system.
       unset system
+      sed -e "232s/LLVM_STATIC_LIBS/LLVMLIBS/" -i compiler/Makefile.unix
     '';
 
     # Remove most faust2appl scripts since they won't run properly
diff --git a/pkgs/applications/audio/faust/faust1.nix b/pkgs/applications/audio/faust/faust1.nix
new file mode 100644
index 000000000000..722c762b7b44
--- /dev/null
+++ b/pkgs/applications/audio/faust/faust1.nix
@@ -0,0 +1,209 @@
+{ stdenv
+, coreutils
+, fetchgit
+, makeWrapper
+, pkgconfig
+}:
+
+with stdenv.lib.strings;
+
+let
+
+  version = "8-1-2015";
+
+  src = fetchgit {
+    url = git://git.code.sf.net/p/faudiostream/code;
+    rev = "4db76fdc02b6aec8d15a5af77fcd5283abe963ce";
+    sha256 = "f1ac92092ee173e4bcf6b2cb1ac385a7c390fb362a578a403b2b6edd5dc7d5d0";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = http://faust.grame.fr/;
+    downloadPage = http://sourceforge.net/projects/faudiostream/files/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ magnetophon pmahoney ];
+  };
+
+  faust = stdenv.mkDerivation {
+
+    name = "faust-${version}";
+
+    inherit src;
+
+    buildInputs = [ makeWrapper ];
+
+    passthru = {
+      inherit wrap wrapWithBuildEnv;
+    };
+
+    preConfigure = ''
+      makeFlags="$makeFlags prefix=$out"
+
+      # The faust makefiles use 'system ?= $(shell uname -s)' but nix
+      # defines 'system' env var, so undefine that so faust detects the
+      # correct system.
+      unset system
+    '';
+
+    # Remove most faust2appl scripts since they won't run properly
+    # without additional paths setup. See faust.wrap,
+    # faust.wrapWithBuildEnv.
+    postInstall = ''
+      # syntax error when eval'd directly
+      pattern="faust2!(svg)"
+      (shopt -s extglob; rm "$out"/bin/$pattern)
+    '';
+
+    postFixup = ''
+      # Set faustpath explicitly.
+      substituteInPlace "$out"/bin/faustpath \
+        --replace "/usr/local /usr /opt /opt/local" "$out"
+
+      # The 'faustoptflags' is 'source'd into other faust scripts and
+      # not used as an executable, so patch 'uname' usage directly
+      # rather than use makeWrapper.
+      substituteInPlace "$out"/bin/faustoptflags \
+        --replace uname "${coreutils}/bin/uname"
+
+      # wrapper for scripts that don't need faust.wrap*
+      for script in "$out"/bin/faust2*; do
+        wrapProgram "$script" \
+          --prefix PATH : "$out"/bin
+      done
+    '';
+
+    meta = meta // {
+      description = "A functional programming language for realtime audio signal processing";
+      longDescription = ''
+        FAUST (Functional Audio Stream) is a functional programming
+        language specifically designed for real-time signal processing
+        and synthesis. FAUST targets high-performance signal processing
+        applications and audio plug-ins for a variety of platforms and
+        standards.
+        The Faust compiler translates DSP specifications into very
+        efficient C++ code. Thanks to the notion of architecture,
+        FAUST programs can be easily deployed on a large variety of
+        audio platforms and plugin formats (jack, alsa, ladspa, maxmsp,
+        puredata, csound, supercollider, pure, vst, coreaudio) without
+        any change to the FAUST code.
+
+        This package has just the compiler, libraries, and headers.
+        Install faust2* for specific faust2appl scripts.
+      '';
+    };
+
+  };
+
+  # Default values for faust2appl.
+  faust2ApplBase =
+    { baseName
+    , dir ? "tools/faust2appls"
+    , scripts ? [ baseName ]
+    , ...
+    }@args:
+
+    args // {
+      name = "${baseName}-${version}";
+
+      inherit src;
+
+      configurePhase = ":";
+
+      buildPhase = ":";
+
+      installPhase = ''
+        runHook preInstall
+
+        mkdir -p "$out/bin"
+        for script in ${concatStringsSep " " scripts}; do
+          cp "${dir}/$script" "$out/bin/"
+        done
+
+        runHook postInstall
+      '';
+
+      postInstall = ''
+        # For the faust2appl script, change 'faustpath' and
+        # 'faustoptflags' to absolute paths.
+        for script in "$out"/bin/*; do
+          substituteInPlace "$script" \
+            --replace ". faustpath" ". '${faust}/bin/faustpath'" \
+            --replace ". faustoptflags" ". '${faust}/bin/faustoptflags'"
+        done
+      '';
+
+      meta = meta // {
+        description = "The ${baseName} script, part of faust functional programming language for realtime audio signal processing";
+      };
+    };
+
+  # Some 'faust2appl' scripts, such as faust2alsa, run faust to
+  # generate cpp code, then invoke the c++ compiler to build the code.
+  # This builder wraps these scripts in parts of the stdenv such that
+  # when the scripts are called outside any nix build, they behave as
+  # if they were running inside a nix build in terms of compilers and
+  # paths being configured (e.g. rpath is set so that compiled
+  # binaries link to the libs inside the nix store)
+  #
+  # The function takes two main args: the appl name (e.g.
+  # 'faust2alsa') and an optional list of propagatedBuildInputs. It
+  # returns a derivation that contains only the bin/${appl} script,
+  # wrapped up so that it will run as if it was inside a nix build
+  # with those build inputs.
+  #
+  # The build input 'faust' is automatically added to the
+  # propagatedBuildInputs.
+  wrapWithBuildEnv =
+    { baseName
+    , propagatedBuildInputs ? [ ]
+    , ...
+    }@args:
+
+    stdenv.mkDerivation ((faust2ApplBase args) // {
+
+      buildInputs = [ makeWrapper pkgconfig ];
+
+      propagatedBuildInputs = [ faust ] ++ propagatedBuildInputs;
+
+      postFixup = ''
+
+        # export parts of the build environment
+        for script in "$out"/bin/*; do
+          wrapProgram "$script" \
+            --set FAUST_LIB_PATH "${faust}/lib/faust" \
+            --prefix PATH : "$PATH" \
+            --prefix PKG_CONFIG_PATH : "$PKG_CONFIG_PATH" \
+            --set NIX_CFLAGS_COMPILE "\"$NIX_CFLAGS_COMPILE\"" \
+            --set NIX_LDFLAGS "\"$NIX_LDFLAGS\""
+        done
+      '';
+    });
+
+  # Builder for 'faust2appl' scripts, such as faust2firefox that
+  # simply need to be wrapped with some dependencies on PATH.
+  #
+  # The build input 'faust' is automatically added to the PATH.
+  wrap =
+    { baseName
+    , runtimeInputs ? [ ]
+    , ...
+    }@args:
+
+    let
+
+      runtimePath = concatStringsSep ":" (map (p: "${p}/bin") ([ faust ] ++ runtimeInputs));
+
+    in stdenv.mkDerivation ((faust2ApplBase args) // {
+
+      buildInputs = [ makeWrapper ];
+
+      postFixup = ''
+        for script in "$out"/bin/*; do
+          wrapProgram "$script" --prefix PATH : "${runtimePath}"
+        done
+      '';
+
+    });
+
+in faust
diff --git a/pkgs/applications/audio/gpodder/default.nix b/pkgs/applications/audio/gpodder/default.nix
index 58b9be41545d..c2ea35105823 100644
--- a/pkgs/applications/audio/gpodder/default.nix
+++ b/pkgs/applications/audio/gpodder/default.nix
@@ -15,7 +15,7 @@ in buildPythonPackage rec {
   };
 
   buildInputs = [
-    coverage feedparser minimock sqlite3 mygpoclient intltool
+    coverage minimock sqlite3 mygpoclient intltool
     gnome3.gnome_themes_standard gnome3.defaultIconTheme
     gnome3.gsettings_desktop_schemas
   ];
@@ -27,8 +27,6 @@ in buildPythonPackage rec {
 
   postPatch = "sed -ie 's/PYTHONPATH=src/PYTHONPATH=\$(PYTHONPATH):src/' makefile";
 
-  checkPhase = "make unittest";
-
   preFixup = ''
     wrapProgram $out/bin/gpodder \
       --prefix XDG_DATA_DIRS : "${gnome3.gnome_themes_standard}/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
@@ -40,17 +38,6 @@ in buildPythonPackage rec {
   postFixup = ''
     wrapPythonPrograms
 
-    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
-
-    createBuildInputsPth build-inputs "$buildInputStrings"
-    for inputsfile in propagated-build-inputs propagated-native-build-inputs; do
-      if test -e $out/nix-support/$inputsfile; then
-          createBuildInputsPth $inputsfile "$(cat $out/nix-support/$inputsfile)"
-      fi
-    done
-
     sed -i "$out/bin/..gpodder-wrapped-wrapped" -e '{
         /import sys; sys.argv/d
     }'
diff --git a/pkgs/applications/audio/id3v2/default.nix b/pkgs/applications/audio/id3v2/default.nix
index 94c2cd810026..71dc88b9231e 100644
--- a/pkgs/applications/audio/id3v2/default.nix
+++ b/pkgs/applications/audio/id3v2/default.nix
@@ -11,8 +11,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ groff ];
   buildInputs = [ id3lib zlib ];
 
-  makeFlags = "PREFIX=$(out)";
-  buildFlags = "clean all";
+  makeFlags = [ "PREFIX=$(out)" ];
+  buildFlags = [ "clean" "all" ];
 
   preInstall = ''
     mkdir -p $out/{bin,share/man/man1}
diff --git a/pkgs/applications/audio/keyfinder-cli/default.nix b/pkgs/applications/audio/keyfinder-cli/default.nix
index dc90aeda47df..701bf6f82f44 100644
--- a/pkgs/applications/audio/keyfinder-cli/default.nix
+++ b/pkgs/applications/audio/keyfinder-cli/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libav libkeyfinder ];
 
-  makeFlagsArray = "PREFIX=$(out)";
+  makeFlags = [ "PREFIX=$(out)" ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/applications/audio/mopidy-mopify/default.nix b/pkgs/applications/audio/mopidy-mopify/default.nix
index 770a1a79556c..4792a02f341d 100644
--- a/pkgs/applications/audio/mopidy-mopify/default.nix
+++ b/pkgs/applications/audio/mopidy-mopify/default.nix
@@ -10,7 +10,7 @@ pythonPackages.buildPythonPackage rec {
     sha256 = "0hhdss4i5436dj37pndxk81a4g3g8f6zqjyv04lhpqcww01290as";
   };
 
-  propagatedBuildInputs = [ mopidy ];
+  propagatedBuildInputs = with pythonPackages; [ mopidy configobj ];
 
   doCheck = false;
 
diff --git a/pkgs/applications/editors/eclipse/plugins.nix b/pkgs/applications/editors/eclipse/plugins.nix
index 0d0c9d148149..3f454da04af4 100644
--- a/pkgs/applications/editors/eclipse/plugins.nix
+++ b/pkgs/applications/editors/eclipse/plugins.nix
@@ -335,16 +335,16 @@ rec {
 
   testng = buildEclipsePlugin rec {
     name = "testng-${version}";
-    version = "6.9.8.201510130443";
+    version = "6.9.10.201511281504";
 
     srcFeature = fetchurl {
       url = "http://beust.com/eclipse/features/org.testng.eclipse_${version}.jar";
-      sha256 = "0g0dva1zpqk0rz0vgr025g2cfc47snr857fsqcrssmp9qmy8x0i0";
+      sha256 = "1kjaifa1fc16yh82bzp5xa5pn3kgrpgc5jq55lyvgz29vjj6ss97";
     };
 
     srcPlugin = fetchurl {
       url = "http://beust.com/eclipse/plugins/org.testng.eclipse_${version}.jar";
-      sha256 = "16mnvqkakixqp3bcnyx6x2iwkhnv3k4q561c97kssz98xsrr8f54";
+      sha256 = "1njz4ynjwnhjjbsszfgqyjn2ixxzjv8qvnc7dqz8jldrz3jrjf07";
     };
 
     meta = with stdenv.lib; {
diff --git a/pkgs/applications/editors/leo-editor/default.nix b/pkgs/applications/editors/leo-editor/default.nix
index 4c7e3cc08af7..597f9148564b 100644
--- a/pkgs/applications/editors/leo-editor/default.nix
+++ b/pkgs/applications/editors/leo-editor/default.nix
@@ -1,9 +1,9 @@
 { stdenv, pythonPackages, fetchgit }:
+
 pythonPackages.buildPythonPackage rec {
   name = "leo-editor-${version}";
-  version = "5.1";
-
   namePrefix = "";
+  version = "5.1";
 
   src = fetchgit {
     url = "https://github.com/leo-editor/leo-editor";
@@ -13,6 +13,11 @@ pythonPackages.buildPythonPackage rec {
 
   propagatedBuildInputs = with pythonPackages; [ pyqt4 sqlite3 ];
 
+
+  patchPhase = ''
+    rm setup.cfg
+  '';
+
   meta = {
     homepage = "http://leoeditor.com";
     description = "A powerful folding editor";
diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix
index cd107a6d279d..10d4f703a825 100644
--- a/pkgs/applications/graphics/apitrace/default.nix
+++ b/pkgs/applications/graphics/apitrace/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchFromGitHub, cmake, libX11, procps, python, qt5 }:
 
-let version = "7.0"; in
+let version = "7.1"; in
 stdenv.mkDerivation {
   name = "apitrace-${version}";
 
   src = fetchFromGitHub {
-    sha256 = "0nn3z7i6cd4zkmms6jpp1v2q194gclbs06v0f5hyiwcsqaxzsg5b";
+    sha256 = "1n2gmsjnpyam7isg7n1ksggyh6y1l8drvx0a93bnvbcskr7jiz9a";
     rev = version;
     repo = "apitrace";
     owner = "apitrace";
diff --git a/pkgs/applications/graphics/jbrout/default.nix b/pkgs/applications/graphics/jbrout/default.nix
index 496078ffdb2e..e37c2c283e47 100644
--- a/pkgs/applications/graphics/jbrout/default.nix
+++ b/pkgs/applications/graphics/jbrout/default.nix
@@ -1,36 +1,36 @@
-{ stdenv, fetchsvn, buildPythonPackage, python, pyGtkGlade, makeWrapper, pyexiv2, lxml, pil, fbida, which }:
+{ stdenv, fetchsvn, buildPythonPackage, python, pyGtkGlade, makeWrapper, pyexiv2,  pythonPackages, fbida, which }:
 
-buildPythonPackage {
-  name = "jbrout-338";
+buildPythonPackage rec {
+  name = "jbrout-${version}";
   version = "338";
+
   src = fetchsvn {
     url = "http://jbrout.googlecode.com/svn/trunk";
-    rev = "338";
+    rev = version;
     sha256 = "0257ni4vkxgd0qhs73fw5ppw1qpf11j8fgwsqc03b1k1yv3hk4hf";
   };
 
   doCheck = false;
-# XXX: preConfigure to avoid this
-#  File "/nix/store/vnyjxn6h3rbrn49m25yyw7i1chlxglhw-python-2.7.1/lib/python2.7/zipfile.py", line 348, in FileHeader
-#    len(filename), len(extra))
-#struct.error: ushort format requires 0 <= number <= USHRT_MAX
 
-  preConfigure = ''
+  # XXX: patchPhase to avoid this
+  #  File "/nix/store/vnyjxn6h3rbrn49m25yyw7i1chlxglhw-python-2.7.1/lib/python2.7/zipfile.py", line 348, in FileHeader
+  #    len(filename), len(extra))
+  #struct.error: ushort format requires 0 <= number <= USHRT_MAX
+  patchPhase = ''
     find | xargs touch
+
+    substituteInPlace setup.py --replace "version=__version__" "version=baseVersion"
   '';
 
   postInstall = ''
-    mkdir -p $out/bin
-    echo '#!/bin/sh' > $out/bin/jbrout
-    echo "python $out/lib/python2.7/site-packages/jbrout-src-py2.7.egg/jbrout/jbrout.py" >> $out/bin/jbrout
+    mkdir $out/bin
+    echo "python $out/${python.sitePackages}/jbrout/jbrout.py" > $out/bin/jbrout
     chmod +x $out/bin/jbrout
-
-    wrapProgram $out/bin/jbrout \
-            --set PYTHONPATH "$out/lib/python:$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pyexiv2}):$(toPythonPath ${lxml}):$(toPythonPath ${pil}):$PYTHONPATH" \
-            --set PATH "${fbida}/bin:${which}/bin:$PATH"
   '';
 
-  buildInputs = [ python pyGtkGlade makeWrapper pyexiv2 lxml pil fbida which ];
+  buildInputs = [ python makeWrapper which ];
+  propagatedBuildInputs = with pythonPackages; [ pillow lxml pyGtkGlade pyexiv2 fbida ];
+
   meta = {
     homepage = "http://code.google.com/p/jbrout";
     description = "Photo manager";
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index f394b6e8105e..c8ee0ac1e96c 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -5,11 +5,12 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "calibre-${meta.version}";
+  version = "2.45.0";
+  name = "calibre-${version}";
 
   src = fetchurl {
-    url = "https://github.com/kovidgoyal/calibre/releases/download/v${meta.version}/${name}.tar.xz";
-    sha256 = "1ffqvnjqmplcpa398809gp4d4l7nqc6k8ky255mdkabfcdvf3kk3";
+    url = "http://download.calibre-ebook.com/${version}/${name}.tar.xz";
+    sha256 = "1s3wrrvp2d0mczs09g2xkkknvlk3max6ws7awpss5kkdpjvay6ma";
   };
 
   inherit python;
@@ -58,11 +59,11 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    version = "2.44.1";
     description = "Comprehensive e-book software";
     homepage = http://calibre-ebook.com;
     license = licenses.gpl3;
     maintainers = with maintainers; [ viric iElectric pSub AndersonTorres ];
     platforms = platforms.linux;
+    inherit version;
   };
 }
diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix
index 90de624c733f..172f1347f6b5 100644
--- a/pkgs/applications/misc/gpsbabel/default.nix
+++ b/pkgs/applications/misc/gpsbabel/default.nix
@@ -23,7 +23,9 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--with-zlib=system" ]
     # Floating point behavior on i686 causes test failures. Preventing
     # extended precision fixes this problem.
-    ++ stdenv.lib.optional stdenv.isi686 "CXXFLAGS=-ffloat-store";
+    ++ stdenv.lib.optionals stdenv.isi686 [
+      "CFLAGS=-ffloat-store" "CXXFLAGS=-ffloat-store"
+    ];
 
   enableParallelBuilding = true;
 
@@ -32,7 +34,11 @@ stdenv.mkDerivation rec {
     patchShebangs testo
     substituteInPlace testo \
       --replace "-x /usr/bin/hexdump" ""
-  '';
+  '' + (
+    # The raymarine and gtm tests fail on i686 despite -ffloat-store.
+    if stdenv.isi686 then "rm -v testo.d/raymarine.test testo.d/gtm.test;"
+    else ""
+  );
 
   meta = with stdenv.lib; {
     description = "Convert, upload and download data from GPS and Map programs";
diff --git a/pkgs/applications/misc/ocropus/default.nix b/pkgs/applications/misc/ocropus/default.nix
index b76852b035ad..b53a928931b6 100644
--- a/pkgs/applications/misc/ocropus/default.nix
+++ b/pkgs/applications/misc/ocropus/default.nix
@@ -32,14 +32,15 @@ pythonPackages.buildPythonPackage {
     matplotlib beautifulsoup4 pygtk lxml ];
 
   enableParallelBuilding = true;
-  
+
   preConfigure = with stdenv.lib; ''
-    ${concatStrings (map (x: "ln -s ${x.src} models/`basename ${x.name}`;")
+    ${concatStrings (map (x: "cp -R ${x.src} models/`basename ${x.name}`;")
       models)}
 
     substituteInPlace ocrolib/{common,default}.py --replace /usr/local $out
   '';
 
+  doCheck = false;  # fails
   checkPhase = ''
     patchShebangs .
     substituteInPlace ./run-test \
diff --git a/pkgs/applications/misc/printrun/default.nix b/pkgs/applications/misc/printrun/default.nix
index b407c739c703..7420441850b6 100644
--- a/pkgs/applications/misc/printrun/default.nix
+++ b/pkgs/applications/misc/printrun/default.nix
@@ -16,10 +16,10 @@ python27Packages.buildPythonPackage rec {
 
   doCheck = false;
 
+  setupPyBuildFlags = ["-i"];
+
   postPatch = ''
     sed -i -r "s|/usr(/local)?/share/|$out/share/|g" printrun/utils.py
-    sed -i "s|distutils.core|setuptools|" setup.py
-    sed -i "s|distutils.command.install |setuptools.command.install |" setup.py
   '';
 
   postInstall = ''
diff --git a/pkgs/applications/misc/pytrainer/default.nix b/pkgs/applications/misc/pytrainer/default.nix
index 843d0ab93d88..2f731fea1b0d 100644
--- a/pkgs/applications/misc/pytrainer/default.nix
+++ b/pkgs/applications/misc/pytrainer/default.nix
@@ -27,12 +27,12 @@ pythonPackages.buildPythonPackage rec {
   # string, which allows setting an explicit MIME type.
   patches = [ ./pytrainer-webkit.patch ];
 
-  pythonPath = with pythonPackages; [
+  propagatedBuildInputs = with pythonPackages; [
     dateutil lxml matplotlibGtk pyGtkGlade pywebkitgtk
-    sqlalchemy sqlalchemy_migrate
+    sqlalchemy_migrate
   ];
 
-  buildInputs = [gpsbabel sqlite] ++ pythonPath;
+  buildInputs = [ gpsbabel sqlite ];
 
   # This package contains no binaries to patch or strip.
   dontPatchELF = true;
diff --git a/pkgs/applications/misc/weather/default.nix b/pkgs/applications/misc/weather/default.nix
new file mode 100644
index 000000000000..dec18aea961d
--- /dev/null
+++ b/pkgs/applications/misc/weather/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, pkgs }:
+
+stdenv.mkDerivation rec {
+    version = "2.0";
+    name = "weather-${version}";
+
+    src = fetchurl {
+        url = "http://fungi.yuggoth.org/weather/src/${name}.tar.xz";
+        sha256 = "0yil363y9iyr4mkd7xxq0p2260wh50f9i5p0map83k9i5l0gyyl0";
+    };
+
+    phases = [ "unpackPhase" "installPhase" ];
+
+    installPhase = ''
+        mkdir $out/{share,man,bin} -p
+        cp weather{,.py} $out/bin/
+        cp {airports,overrides.{conf,log},places,slist,stations,weatherrc,zctas,zlist,zones} $out/share/
+        chmod +x $out/bin/weather
+        cp ./weather.1 $out/man/
+        cp ./weatherrc.5 $out/man/
+    '';
+
+    meta = {
+        homepage = "http://fungi.yuggoth.org/weather";
+        description = "Quick access to current weather conditions and forecasts";
+        license = stdenv.lib.licenses.isc;
+        maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+        platforms = with stdenv.lib.platforms; linux; # my only platform
+    };
+}
diff --git a/pkgs/applications/misc/ykpers/default.nix b/pkgs/applications/misc/ykpers/default.nix
index e7bfa8ded50e..53d260fdc75e 100644
--- a/pkgs/applications/misc/ykpers/default.nix
+++ b/pkgs/applications/misc/ykpers/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec
 {
-  version = "1.15.0";
+  version = "1.17.2";
   name = "ykpers-${version}";
 
   src = fetchurl
   {
     url = "http://opensource.yubico.com/yubikey-personalization/releases/${name}.tar.gz";
-    sha256 = "1n4s8kk31q5zh2rm7sj9qmv86yl8ibimdnpvk9ny391a88qlypyd";
+    sha256 = "1z6ybpdhl74phwzg2lhxhipqf7xnfhg52dykkzb3fbx21m0i4jkh";
   };
 
   buildInputs = [pkgconfig libusb1 libyubikey];
diff --git a/pkgs/applications/networking/cluster/mesos/default.nix b/pkgs/applications/networking/cluster/mesos/default.nix
index bb7a60f2b27f..0651f729cdc9 100644
--- a/pkgs/applications/networking/cluster/mesos/default.nix
+++ b/pkgs/applications/networking/cluster/mesos/default.nix
@@ -1,6 +1,6 @@
 { stdenv, lib, makeWrapper, fetchurl, curl, sasl, openssh, autoconf
 , automake114x, libtool, unzip, gnutar, jdk, maven, python, wrapPython
-, setuptools, distutils-cfg, boto, pythonProtobuf, apr, subversion
+, setuptools, boto, pythonProtobuf, apr, subversion
 , leveldb, glog, perf, utillinux, libnl, iproute
 }:
 
@@ -15,7 +15,7 @@ in stdenv.mkDerivation rec {
   dontDisableStatic = true;
 
   src = fetchurl {
-    url = "http://www.apache.org/dist/mesos/${version}/mesos-${version}.tar.gz";
+    url = "http://archive.apache.org/dist/mesos/${version}/${name}.tar.gz";
     sha256 = "1v5xpn4wal4vcrvcklchx9slkpa8xlwqkdbnxzy9zkzpq5g3arxr";
   };
 
@@ -26,7 +26,7 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [
     makeWrapper autoconf automake114x libtool curl sasl jdk maven
-    python wrapPython boto distutils-cfg setuptools leveldb
+    python wrapPython boto setuptools leveldb
     subversion apr glog
   ] ++ lib.optionals stdenv.isLinux [
     libnl
diff --git a/pkgs/applications/networking/davmail/default.nix b/pkgs/applications/networking/davmail/default.nix
index 37d4870d1818..7773fcaf0c47 100644
--- a/pkgs/applications/networking/davmail/default.nix
+++ b/pkgs/applications/networking/davmail/default.nix
@@ -1,10 +1,10 @@
 { fetchurl, stdenv, jre, glib, libXtst, gtk, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "davmail-4.6.1";
+  name = "davmail-4.7.0";
   src = fetchurl {
-    url = "mirror://sourceforge/davmail/davmail-linux-x86_64-4.6.1-2343.tgz";
-    sha256 = "15kpbrmw9pcifxj4k4m3q0azbl95kfgwvgb8bc9aj00q0yi3wgiq";
+    url = "mirror://sourceforge/davmail/4.7.0/davmail-linux-x86_64-4.7.0-2408.tgz";
+    sha256 = "1kasnqnvw8icm32m5vbvkpx5im1w4sifiaafb08rw4a1zn8asxv1";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/networking/feedreaders/rsstail/default.nix b/pkgs/applications/networking/feedreaders/rsstail/default.nix
index 62054ef0613d..40c165c2540c 100644
--- a/pkgs/applications/networking/feedreaders/rsstail/default.nix
+++ b/pkgs/applications/networking/feedreaders/rsstail/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     substituteInPlace Makefile --replace -liconv_hook ""
   '';
 
-  makeFlags = "prefix=$(out)";
+  makeFlags = [ "prefix=$(out)" ];
   enableParallelBuilding = true;
 
   doCheck = true;
diff --git a/pkgs/applications/networking/mailreaders/claws-mail/default.nix b/pkgs/applications/networking/mailreaders/claws-mail/default.nix
index 2c3b502e3c35..beb21546c0c9 100644
--- a/pkgs/applications/networking/mailreaders/claws-mail/default.nix
+++ b/pkgs/applications/networking/mailreaders/claws-mail/default.nix
@@ -30,7 +30,7 @@
 
 with stdenv.lib;
 
-let version = "3.12.0"; in
+let version = "3.13.0"; in
 
 stdenv.mkDerivation {
   name = "claws-mail-${version}";
@@ -40,12 +40,12 @@ stdenv.mkDerivation {
     homepage = http://www.claws-mail.org/;
     license = licenses.gpl3;
     platforms = platforms.linux;
-    maintainers = [ maintainers.khumba ];
+    maintainers = with maintainers; [ khumba fpletz ];
   };
 
   src = fetchurl {
     url = "http://www.claws-mail.org/download.php?file=releases/claws-mail-${version}.tar.xz";
-    sha256 = "1jnnwivpcplv8x4w0ibb1qcnasl37fr53lbfybhgb936l2mdcai7";
+    sha256 = "0fpr9gdgrs5yggm61a6135ca06x0cflddsh8dwfqmpb3dj07cl1n";
   };
 
   patches = [ ./mime.patch ];
diff --git a/pkgs/applications/networking/mailreaders/mailnag/default.nix b/pkgs/applications/networking/mailreaders/mailnag/default.nix
index e4253f5bff57..4818de49e42b 100644
--- a/pkgs/applications/networking/mailreaders/mailnag/default.nix
+++ b/pkgs/applications/networking/mailreaders/mailnag/default.nix
@@ -12,12 +12,6 @@ buildPythonPackage rec {
     sha256 = "0li4kvxjmbz3nqg6bysgn2wdazqrd7gm9fym3rd7148aiqqwa91r";
   };
 
-  # Sometimes the generated output isn't identical. It seems like there's a
-  # race condtion while patching the Mailnag/commons/dist_cfg.py file. This is
-  # a small workaround to produce deterministic builds.
-  # For more information see https://github.com/NixOS/nixpkgs/pull/8279
-  setupPyBuildFlags = [ "--build-base=$PWD" ];
-
   buildInputs = [
     gettext gtk3 pythonPackages.pygobject3 pythonPackages.dbus
     pythonPackages.pyxdg gdk_pixbuf libnotify gst_all_1.gstreamer
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index 65f3f256368e..b49c309f5ba6 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -10,7 +10,7 @@ assert withQt -> !withGtk && qt4 != null;
 with stdenv.lib;
 
 let
-  version = "1.12.7";
+  version = "2.0.0";
   variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
 in
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://www.wireshark.org/download/src/all-versions/wireshark-${version}.tar.bz2";
-    sha256 = "0b7rc1l1gvzcz7gfa6g7pcn32zrcfiqjx0rxm6cg3q1cwwa1qjn7";
+    sha256 = "1pci4vj23wamycfj4lxxmpxps96yq6jfmqn7hdvisw4539v6q0lh";
   };
 
   buildInputs = [
@@ -70,6 +70,6 @@ stdenv.mkDerivation {
     '';
 
     platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ simons bjornfor ];
+    maintainers = with stdenv.lib.maintainers; [ simons bjornfor fpletz ];
   };
 }
diff --git a/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch b/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch
index 9c517cc0e421..35b54c79e8f5 100644
--- a/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch
+++ b/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch
@@ -1,6 +1,6 @@
-From 188e8858243b2278239261aaaaea7ad07476d561 Mon Sep 17 00:00:00 2001
+From 5bef9deeff8a2e4401de0f45c9701cd6f98f29d8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
-Date: Sun, 13 Apr 2014 15:17:24 +0200
+Date: Thu, 26 Nov 2015 21:03:35 +0100
 Subject: [PATCH] Lookup dumpcap in PATH
 
 NixOS patch: Look for dumpcap in PATH first, because there may be a
@@ -10,20 +10,21 @@ non-setuid dumpcap binary.
 Also change execv() to execvp() because we've set argv[0] to "dumpcap"
 and have to enable PATH lookup. Wireshark is not a setuid program, so
 looking in PATH is not a security issue.
+
+Signed-off-by: Franz Pletz <fpletz@fnordicwalking.de>
 ---
- capture_sync.c | 18 ++++++++++++++----
- 1 file changed, 14 insertions(+), 4 deletions(-)
+ capchild/capture_sync.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
 
-diff --git a/capture_sync.c b/capture_sync.c
-index eb05fae..efb5675 100644
---- a/capture_sync.c
-+++ b/capture_sync.c
-@@ -326,8 +326,18 @@ init_pipe_args(int *argc) {
-     argv = (char **)g_malloc(sizeof (char *));
-     *argv = NULL;
- 
--    /* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */
--    exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap", progfile_dir);
+diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c
+index 970688e..49914d5 100644
+--- a/capchild/capture_sync.c
++++ b/capchild/capture_sync.c
+@@ -332,7 +332,18 @@ init_pipe_args(int *argc) {
+ #ifdef _WIN32
+     exename = g_strdup_printf("%s\\dumpcap.exe", progfile_dir);
+ #else
+-    exename = g_strdup_printf("%s/dumpcap", progfile_dir);
 +    /*
 +     * NixOS patch: Look for dumpcap in PATH first, because there may be a
 +     * dumpcap setuid-wrapper that we want to use instead of the default
@@ -34,12 +35,12 @@ index eb05fae..efb5675 100644
 +        exename = g_strdup_printf("dumpcap");
 +    } else {
 +        /* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */
-+        exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap", progfile_dir);
++        exename = g_strdup_printf("%s/dumpcap", progfile_dir);
 +    }
+ #endif
  
      /* Make that the first argument in the argument list (argv[0]). */
-     argv = sync_pipe_add_arg(argv, argc, exename);
-@@ -649,7 +659,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi
+@@ -729,7 +740,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi
           */
          dup2(sync_pipe[PIPE_WRITE], 2);
          ws_close(sync_pipe[PIPE_READ]);
@@ -48,7 +49,7 @@ index eb05fae..efb5675 100644
          g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
                     argv[0], g_strerror(errno));
          sync_pipe_errmsg_to_parent(2, errmsg, "");
-@@ -879,7 +889,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd,
+@@ -997,7 +1008,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd,
          dup2(sync_pipe[PIPE_WRITE], 2);
          ws_close(sync_pipe[PIPE_READ]);
          ws_close(sync_pipe[PIPE_WRITE]);
@@ -58,5 +59,5 @@ index eb05fae..efb5675 100644
                     argv[0], g_strerror(errno));
          sync_pipe_errmsg_to_parent(2, errmsg, "");
 -- 
-1.9.0
+2.6.3
 
diff --git a/pkgs/applications/office/zim/default.nix b/pkgs/applications/office/zim/default.nix
index 84a5680b1f40..d5163eef4d88 100644
--- a/pkgs/applications/office/zim/default.nix
+++ b/pkgs/applications/office/zim/default.nix
@@ -11,89 +11,25 @@ buildPythonPackage rec {
   name = "zim-${version}";
   version = "0.63";
   namePrefix = "";
-  
+
   src = fetchurl {
     url = "http://zim-wiki.org/downloads/${name}.tar.gz";
     sha256 = "077vf4h0hjmbk8bxj9l0z9rxcb3dw642n32lvfn6vjdna1qm910m";
   };
 
-  propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk /*pythonPackages.pyxdg*/ pygobject ];
+  propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk pythonPackages.pyxdg pygobject ];
 
   preBuild = ''
     mkdir -p /tmp/home
     export HOME="/tmp/home"
-  '';
-  
-  setupPyInstallFlags = ["--skip-xdg-cmd"];
-  
-  #
-  # Exactly identical to buildPythonPackage's version but for the
-  # `--old-and-unmanagable`, which I removed. This was removed because
-  # this is a setuptools specific flag and as zim is overriding 
-  # the install step, setuptools could not perform its monkey
-  # patching trick for the command. Alternate solutions were to
-  #
-  #  -  Remove the custom install step (tested as working but
-  #	also remove the possibility of performing the xdg-cmd
-  #     stuff).
-  #  -  Explicitly replace distutils import(s) by their setuptools
-  #	equivalent (untested). 
-  #
-  # Both solutions were judged unsatisfactory as altering the code
-  # would be required.
-  #
-  # Note that a improved solution would be to expose the use of 
-  # the `--old-and-unmanagable` flag as an option of passed to the
-  # buildPythonPackage function.
-  #
-  # Also note that I stripped all comments.
-  #
-  installPhase = ''
-    runHook preInstall
-
-    mkdir -p "$out/lib/${python.libPrefix}/site-packages"
-
-    export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
-
-    ${python}/bin/${python.executable} setup.py install \
-      --install-lib=$out/lib/${python.libPrefix}/site-packages \
-      --prefix="$out" ${lib.concatStringsSep " " setupPyInstallFlags}
 
-    eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth
-    if [ -e "$eapth" ]; then
-	# move colliding easy_install.pth to specifically named one
-	mv "$eapth" $(dirname "$eapth")/${name}.pth
-    fi
-
-    rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
-
-    runHook postInstall
+    sed -i '/zim_install_class,/d' setup.py
   '';
 
-  # FIXME: this is quick and dirty hack, because zim expects the
-  # path to the executable in argv[0] therefore the wrapper is
-  # modified accordingly.
-  postFixup = ''
-    wrapProgram "$out/bin/zim" \
-      --prefix XDG_DATA_DIRS : "$out/share"
-
-    wrapPythonPrograms
-
-    sed -i "s#sys\.argv\[0\] = '.zim-wrapped'#sys.argv[0] = '$out/bin/zim'#g" \
-      $out/bin/..zim-wrapped-wrapped
-
-    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
 
-    createBuildInputsPth build-inputs "$buildInputStrings"
-    for inputsfile in propagated-build-inputs propagated-native-build-inputs; do
-      if test -e $out/nix-support/$inputsfile; then
-          createBuildInputsPth $inputsfile "$(cat $out/nix-support/$inputsfile)"
-      fi
-    done
+  preFixup = ''
+    export makeWrapperArgs="--prefix XDG_DATA_DIRS : $out/share --argv0 $out/bin/.zim-wrapped"
   '';
-  
   # Testing fails.
   doCheck = false;
 
diff --git a/pkgs/applications/science/logic/coq/8.5.nix b/pkgs/applications/science/logic/coq/8.5.nix
index 48013bfc4014..2afa18d40a4b 100644
--- a/pkgs/applications/science/logic/coq/8.5.nix
+++ b/pkgs/applications/science/logic/coq/8.5.nix
@@ -6,7 +6,7 @@
 {stdenv, fetchurl, writeText, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null, csdp ? null}:
 
 let
-  version = "8.5b3";
+  version = "8.5b2";
   coq-version = "8.5";
   buildIde = lablgtk != null;
   ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else "";
@@ -23,8 +23,8 @@ stdenv.mkDerivation {
   inherit ocaml camlp5;
 
   src = fetchurl {
-    url = https://coq.inria.fr/distrib/V8.5beta3/files/coq-8.5beta3.tar.gz;
-    sha256 = "12nnvfz5rsz660j4knhfhfbwq49y2va0rgfrxyiyrr1q4ic84wn6";
+    url = https://coq.inria.fr/distrib/V8.5beta2/files/coq-8.5beta2.tar.gz;
+    sha256 = "1z34ch56lld86srgsjdwdq3girz0k0wqmvyxsa7jwvvxn3qmmq2v";
   };
 
   buildInputs = [ pkgconfig ocaml findlib camlp5 ncurses lablgtk ];
diff --git a/pkgs/applications/science/logic/sad/default.nix b/pkgs/applications/science/logic/sad/default.nix
new file mode 100644
index 000000000000..d9d36b991177
--- /dev/null
+++ b/pkgs/applications/science/logic/sad/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, ghc, spass }:
+
+stdenv.mkDerivation {
+  name = "system-for-automated-deduction-2.3.25";
+  src = fetchurl {
+    url = "http://nevidal.org/download/sad-2.3-25.tar.gz";
+    sha256 = "10jd93xgarik7xwys5lq7fx4vqp7c0yg1gfin9cqfch1k1v8ap4b";
+  };
+  buildInputs = [ ghc spass ];
+  patches = [ ./patch ];
+  postPatch = ''
+    substituteInPlace Alice/Main.hs --replace init.opt $out/init.opt
+    '';
+  installPhase = ''
+    mkdir -p $out/{bin,provers}
+    install alice $out/bin
+    install provers/moses $out/provers
+    substituteAll provers/provers.dat $out/provers/provers.dat
+    substituteAll init.opt $out/init.opt
+    cp -r examples $out
+    '';
+  inherit spass;
+  meta = {
+    description = "A program for automated proving of mathematical texts";
+    longDescription = ''
+      The system for automated deduction is intended for automated processing of formal mathematical texts 
+      written in a special language called ForTheL (FORmal THEory Language) or in a traditional first-order language
+      '';
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ stdenv.lib.maintainers.schmitthenner ];
+    homepage = http://nevidal.org/sad.en.html;
+  };  
+}
diff --git a/pkgs/applications/science/logic/sad/patch b/pkgs/applications/science/logic/sad/patch
new file mode 100644
index 000000000000..a5b1d6177083
--- /dev/null
+++ b/pkgs/applications/science/logic/sad/patch
@@ -0,0 +1,200 @@
+diff -aur serious/sad-2.3-25/Alice/Core/Base.hs sad-2.3-25/Alice/Core/Base.hs
+--- serious/sad-2.3-25/Alice/Core/Base.hs	2008-03-29 18:24:12.000000000 +0000
++++ sad-2.3-25/Alice/Core/Base.hs	2015-11-27 06:38:28.740840823 +0000
+@@ -21,6 +21,7 @@
+ module Alice.Core.Base where
+ 
+ import Control.Monad
++import Control.Applicative
+ import Data.IORef
+ import Data.List
+ import Data.Time
+@@ -61,10 +62,21 @@
+ type CRMC a b = IORef RState -> IO a -> (b -> IO a) -> IO a
+ newtype CRM b = CRM { runCRM :: forall a . CRMC a b }
+ 
++instance Functor CRM where
++  fmap = liftM
++  
++instance Applicative CRM where
++  pure = return
++  (<*>) = ap
++
+ instance Monad CRM where
+   return r  = CRM $ \ _ _ k -> k r
+   m >>= n   = CRM $ \ s z k -> runCRM m s z (\ r -> runCRM (n r) s z k)
+ 
++instance Alternative CRM where
++  (<|>) = mplus
++  empty = mzero
++  
+ instance MonadPlus CRM where
+   mzero     = CRM $ \ _ z _ -> z
+   mplus m n = CRM $ \ s z k -> runCRM m s (runCRM n s z k) k
+diff -aur serious/sad-2.3-25/Alice/Core/Thesis.hs sad-2.3-25/Alice/Core/Thesis.hs
+--- serious/sad-2.3-25/Alice/Core/Thesis.hs	2008-03-05 13:10:50.000000000 +0000
++++ sad-2.3-25/Alice/Core/Thesis.hs	2015-11-27 06:35:08.311015166 +0000
+@@ -21,6 +21,7 @@
+ module Alice.Core.Thesis (thesis) where
+ 
+ import Control.Monad
++import Control.Applicative
+ import Data.List
+ import Data.Maybe
+ 
+@@ -126,11 +127,22 @@
+ 
+ newtype TM res = TM { runTM :: [String] -> [([String], res)] }
+ 
++instance Functor TM where
++  fmap = liftM
++
++instance Applicative TM where
++  pure = return
++  (<*>) = ap
++
+ instance Monad TM where
+   return r  = TM $ \ s -> [(s, r)]
+   m >>= k   = TM $ \ s -> concatMap apply (runTM m s)
+     where apply (s, r) = runTM (k r) s
+ 
++instance Alternative TM where
++  (<|>) = mplus
++  empty = mzero
++    
+ instance MonadPlus TM where
+   mzero     = TM $ \ _ -> []
+   mplus m k = TM $ \ s -> runTM m s ++ runTM k s
+diff -aur serious/sad-2.3-25/Alice/Export/Base.hs sad-2.3-25/Alice/Export/Base.hs
+--- serious/sad-2.3-25/Alice/Export/Base.hs	2008-03-09 09:36:39.000000000 +0000
++++ sad-2.3-25/Alice/Export/Base.hs	2015-11-27 06:32:47.782738005 +0000
+@@ -39,7 +39,7 @@
+ -- Database reader
+ 
+ readPrDB :: String -> IO [Prover]
+-readPrDB file = do  inp <- catch (readFile file) $ die . ioeGetErrorString
++readPrDB file = do  inp <- catchIOError (readFile file) $ die . ioeGetErrorString
+ 
+                     let dws = dropWhile isSpace
+                         cln = reverse . dws . reverse . dws
+diff -aur serious/sad-2.3-25/Alice/Export/Prover.hs sad-2.3-25/Alice/Export/Prover.hs
+--- serious/sad-2.3-25/Alice/Export/Prover.hs	2008-03-09 09:36:39.000000000 +0000
++++ sad-2.3-25/Alice/Export/Prover.hs	2015-11-27 06:36:47.632919161 +0000
+@@ -60,7 +60,7 @@
+       when (askIB IBPdmp False ins) $ putStrLn tsk
+ 
+       seq (length tsk) $ return $
+-        do  (wh,rh,eh,ph) <- catch run
++        do  (wh,rh,eh,ph) <- catchIOError run
+                 $ \ e -> die $ "run error: " ++ ioeGetErrorString e
+ 
+             hPutStrLn wh tsk ; hClose wh
+diff -aur serious/sad-2.3-25/Alice/ForTheL/Base.hs sad-2.3-25/Alice/ForTheL/Base.hs
+--- serious/sad-2.3-25/Alice/ForTheL/Base.hs	2008-03-09 09:36:39.000000000 +0000
++++ sad-2.3-25/Alice/ForTheL/Base.hs	2015-11-27 06:31:51.921230428 +0000
+@@ -226,7 +226,7 @@
+ varlist = do  vs <- chainEx (char ',') var
+               nodups vs ; return vs
+ 
+-nodups vs = unless (null $ dups vs) $
++nodups vs = unless ((null :: [a] -> Bool) $ dups vs) $
+               fail $ "duplicate names: " ++ show vs
+ 
+ hidden  = askPS psOffs >>= \ n -> return ('h':show n)
+diff -aur serious/sad-2.3-25/Alice/Import/Reader.hs sad-2.3-25/Alice/Import/Reader.hs
+--- serious/sad-2.3-25/Alice/Import/Reader.hs	2008-03-09 09:36:39.000000000 +0000
++++ sad-2.3-25/Alice/Import/Reader.hs	2015-11-27 06:36:41.818866167 +0000
+@@ -24,7 +24,7 @@
+ import Control.Monad
+ import System.IO
+ import System.IO.Error
+-import System.Exit
++import System.Exit hiding (die)
+ 
+ import Alice.Data.Text
+ import Alice.Data.Instr
+@@ -44,7 +44,7 @@
+ readInit ""   = return []
+ 
+ readInit file =
+-  do  input <- catch (readFile file) $ die file . ioeGetErrorString
++  do  input <- catchIOError (readFile file) $ die file . ioeGetErrorString
+       let tkn = tokenize input ; ips = initPS ()
+           inp = ips { psRest = tkn, psFile = file, psLang = "Init" }
+       liftM fst $ fireLPM instf inp
+@@ -74,7 +74,7 @@
+ reader lb fs (ps:ss) [TI (InStr ISfile file)] =
+   do  let gfl = if null file  then hGetContents stdin
+                               else readFile file
+-      input <- catch gfl $ die file . ioeGetErrorString
++      input <- catchIOError gfl $ die file . ioeGetErrorString
+       let tkn = tokenize input
+           ips = initPS $ (psProp ps) { tvr_expr = [] }
+           sps = ips { psRest = tkn, psFile = file, psOffs = psOffs ps }
+diff -aur serious/sad-2.3-25/Alice/Parser/Base.hs sad-2.3-25/Alice/Parser/Base.hs
+--- serious/sad-2.3-25/Alice/Parser/Base.hs	2008-03-09 09:36:40.000000000 +0000
++++ sad-2.3-25/Alice/Parser/Base.hs	2015-11-27 06:14:28.616734527 +0000
+@@ -20,6 +20,7 @@
+ 
+ module Alice.Parser.Base where
+ 
++import Control.Applicative
+ import Control.Monad
+ import Data.List
+ 
+@@ -45,11 +46,22 @@
+ type CPMC a b c = (c -> CPMS a b) -> (String -> CPMS a b) -> CPMS a b
+ newtype CPM a c = CPM { runCPM :: forall b . CPMC a b c }
+ 
++instance Functor (CPM a) where
++  fmap = liftM
++
++instance Applicative (CPM a) where
++  pure = return
++  (<*>) = ap
++
+ instance Monad (CPM a) where
+   return r  = CPM $ \ k _ -> k r
+   m >>= n   = CPM $ \ k l -> runCPM m (\ b -> runCPM (n b) k l) l
+   fail e    = CPM $ \ _ l -> l e
+ 
++instance Alternative (CPM a) where
++    (<|>) = mplus
++    empty = mzero
++  
+ instance MonadPlus (CPM a) where
+   mzero     = CPM $ \ _ _ _ z -> z
+   mplus m n = CPM $ \ k l s -> runCPM m k l s . runCPM n k l s
+diff -aur serious/sad-2.3-25/init.opt sad-2.3-25/init.opt
+--- serious/sad-2.3-25/init.opt	2007-10-11 15:25:45.000000000 +0000
++++ sad-2.3-25/init.opt	2015-11-27 07:23:41.372816854 +0000
+@@ -1,6 +1,6 @@
+ # Alice init options
+-[library examples]
+-[provers provers/provers.dat]
++[library @out@/examples]
++[provers @out@/provers/provers.dat]
+ [prover spass]
+ [timelimit 3]
+ [depthlimit 7]
+diff -aur serious/sad-2.3-25/provers/provers.dat sad-2.3-25/provers/provers.dat
+--- serious/sad-2.3-25/provers/provers.dat	2008-08-26 21:20:25.000000000 +0000
++++ sad-2.3-25/provers/provers.dat	2015-11-27 07:24:18.878169702 +0000
+@@ -3,7 +3,7 @@
+ Pmoses
+ LMoses
+ Fmoses
+-Cprovers/moses
++C@out@/provers/moses
+ Yproved in
+ Nfound unprovable in
+ Utimeout in
+@@ -12,7 +12,7 @@
+ Pspass
+ LSPASS
+ Fdfg
+-Cprovers/SPASS -CNFOptSkolem=0 -PProblem=0 -PGiven=0 -Stdin -TimeLimit=%d
++C@spass@/bin/SPASS -CNFOptSkolem=0 -PProblem=0 -PGiven=0 -Stdin -TimeLimit=%d
+ YSPASS beiseite: Proof found.
+ NSPASS beiseite: Completion found.
+ USPASS beiseite: Ran out of time.
diff --git a/pkgs/applications/science/spyder/default.nix b/pkgs/applications/science/spyder/default.nix
index 382a5cb5532a..4bc160a2c284 100644
--- a/pkgs/applications/science/spyder/default.nix
+++ b/pkgs/applications/science/spyder/default.nix
@@ -9,26 +9,21 @@
 
 buildPythonPackage rec {
   name = "spyder-${version}";
-  version = "2.3.6";
+  version = "2.3.7";
   namePrefix = "";
 
   src = fetchurl {
     url = "https://pypi.python.org/packages/source/s/spyder/${name}.zip";
-    sha256 = "0e6502e0d3f270ea8916d1a3d7ca29915801d31932db399582bc468c01d535e2";
+    sha256 = "0ywgvgcp9s64ys25nfscd2648f7di8544a21b5lb59d4f48z028h";
   };
 
-  buildInputs = [ unzip ];
+  # NOTE: sphinx makes the build fail with: ValueError: ZIP does not support timestamps before 1980
   propagatedBuildInputs =
-    [ pyside pyflakes rope sphinx numpy scipy matplotlib ipython pylint pep8 ];
+    [ pyside pyflakes rope  numpy scipy matplotlib ipython pylint pep8 ];
 
   # There is no test for spyder
   doCheck = false;
 
-  # Use setuptools instead of distutils.
-  preConfigure = ''
-    export USE_SETUPTOOLS=True
-  '';
-
   desktopItem = makeDesktopItem {
     name = "Spyder";
     exec = "spyder";
@@ -41,11 +36,9 @@ buildPythonPackage rec {
 
   # Create desktop item
   postInstall = ''
-    mkdir -p $out/share/applications
-    cp $desktopItem/share/applications/* $out/share/applications/
-
-    mkdir -p $out/share/icons
-    cp spyderlib/images/spyder.svg $out/share/icons/
+    mkdir -p $out/share/{applications,icons}
+    cp  $desktopItem/share/applications/* $out/share/applications/
+    cp  spyderlib/images/spyder.svg $out/share/icons/
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/version-management/git-and-tools/git-hub/default.nix b/pkgs/applications/version-management/git-and-tools/git-hub/default.nix
index e657215f2cd5..271e1244820f 100644
--- a/pkgs/applications/version-management/git-and-tools/git-hub/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-hub/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  installFlags = "prefix=$(out)";
+  installFlags = [ "prefix=$(out)" ];
 
   postInstall = ''
     # Remove inert ftdetect vim plugin and a README that's a man page subset:
diff --git a/pkgs/applications/video/devede/default.nix b/pkgs/applications/video/devede/default.nix
index b48f0f42936d..6520f7ac21fa 100644
--- a/pkgs/applications/video/devede/default.nix
+++ b/pkgs/applications/video/devede/default.nix
@@ -14,11 +14,10 @@ in buildPythonPackage rec {
 
   buildInputs = [ ffmpeg ];
 
-  pythonPath = [ pygtk dbus ffmpeg mplayer dvdauthor vcdimager cdrkit ];
+  propagatedBuildInputs = [ pygtk dbus ffmpeg mplayer dvdauthor vcdimager cdrkit ];
 
   postPatch = ''
     substituteInPlace devede --replace "/usr/share/devede" "$out/share/devede"
-
   '';
 
   meta = with stdenv.lib; {
@@ -26,5 +25,6 @@ in buildPythonPackage rec {
     homepage = http://www.rastersoft.com/programas/devede.html;
     license = licenses.gpl3;
     maintainers = [ maintainers.bdimcheff ];
+    broken = true;  # tarball is gone
   };
 }
diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix
index 0b1cf9ebc527..243b6464bb5e 100644
--- a/pkgs/applications/virtualization/virt-manager/default.nix
+++ b/pkgs/applications/virtualization/virt-manager/default.nix
@@ -18,40 +18,26 @@ buildPythonPackage rec {
   };
 
   propagatedBuildInputs =
-    [ eventlet greenlet gflags netaddr sqlalchemy carrot routes
-      PasteDeploy m2crypto ipy twisted sqlalchemy_migrate
+    [ eventlet greenlet gflags netaddr carrot routes
+      PasteDeploy m2crypto ipy twisted sqlalchemy_migrate_0_7
       distutils_extra simplejson readline glance cheetah lockfile httplib2
       urlgrabber virtinst pyGtkGlade pythonDBus gnome_python pygobject3
-      libvirt libxml2Python ipaddr vte libosinfo
+      libvirt libxml2Python ipaddr vte libosinfo gobjectIntrospection gtk3 mox
+      gtkvnc libvirt-glib glib gsettings_desktop_schemas gnome3.defaultIconTheme
+      wrapGAppsHook
     ] ++ optional spiceSupport spice_gtk;
 
-  buildInputs =
-    [ mox
-      intltool
-      gtkvnc
-      gtk3
-      libvirt-glib
-      avahi
-      glib
-      gobjectIntrospection
-      gsettings_desktop_schemas
-      gnome3.defaultIconTheme
-      wrapGAppsHook
-      dconf
-    ];
+  buildInputs = [ dconf avahi intltool ];
 
   patchPhase = ''
     sed -i 's|/usr/share/libvirt/cpu_map.xml|${system-libvirt}/share/libvirt/cpu_map.xml|g' virtinst/capabilities.py
+    sed -i "/'install_egg_info'/d" setup.py
   '';
 
-  configurePhase = ''
-    sed -i 's/from distutils.core/from setuptools/g' setup.py
-    sed -i 's/from distutils.command.install/from setuptools.command.install/g' setup.py
-    python setup.py configure --prefix=$out
+  postConfigure = ''
+    ${python.interpreter} setup.py configure --prefix=$out
   '';
 
-  buildPhase = "true";
-
   postInstall = ''
     ${glib}/bin/glib-compile-schemas "$out"/share/glib-2.0/schemas
   '';
diff --git a/pkgs/applications/window-managers/fbpanel/default.nix b/pkgs/applications/window-managers/fbpanel/default.nix
index ba021a584212..7e23dd605036 100644
--- a/pkgs/applications/window-managers/fbpanel/default.nix
+++ b/pkgs/applications/window-managers/fbpanel/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "A stand-alone panel";
     maintainers = with maintainers; [ raskin ];
-    platforms = with platforms; linux;
+    platforms = platforms.linux;
   };
 
   passthru = {
diff --git a/pkgs/applications/window-managers/stalonetray/default.nix b/pkgs/applications/window-managers/stalonetray/default.nix
index 0c362dce60b5..5ef5ba769c42 100644
--- a/pkgs/applications/window-managers/stalonetray/default.nix
+++ b/pkgs/applications/window-managers/stalonetray/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "Stand alone tray";
     maintainers = with maintainers; [ raskin ];
-    platforms = with platforms; linux;
+    platforms = platforms.linux;
   };
 
   passthru = {