From aa637fe12acf45eb86a2c3084be6e93c3f6b39ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9-Patrick=20Bubel?= <code@apb.name>
Date: Mon, 28 May 2018 21:52:55 +0200
Subject: [PATCH 01/26] medfile: init at 3.3.1

---
 .../development/libraries/medfile/default.nix | 24 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  4 ++++
 2 files changed, 28 insertions(+)
 create mode 100644 pkgs/development/libraries/medfile/default.nix

diff --git a/pkgs/development/libraries/medfile/default.nix b/pkgs/development/libraries/medfile/default.nix
new file mode 100644
index 00000000000..5a29a9219fb
--- /dev/null
+++ b/pkgs/development/libraries/medfile/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake, hdf5 }:
+
+stdenv.mkDerivation rec {
+  name = "medfile-${version}";
+  version = "3.3.1";
+
+  src = fetchurl {
+    url = "http://files.salome-platform.org/Salome/other/med-${version}.tar.gz";
+    sha256 = "1215sal10xp6xirgggdszay2bmx0sxhn9pgh7x0wg2w32gw1wqyx";
+  };
+
+  buildInputs = [ cmake hdf5 ];
+
+  checkPhase = "make test";
+
+  postInstall = "rm -r $out/bin/testc";
+
+  meta = with stdenv.lib; {
+    description = "Library to read and write MED files";
+    homepage = http://salome-platform.org/;
+    platforms = platforms.linux;
+    license = licenses.lgpl3Plus;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 34fd1a7672b..b0ac1fcd3d0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3369,6 +3369,10 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) CoreServices;
   };
 
+  medfile = callPackage ../development/libraries/medfile {
+    hdf5 = hdf5_1_8;
+  };
+
   memtester = callPackage ../tools/system/memtester { };
 
   minergate = callPackage ../applications/misc/minergate { };

From 95998480e69c83fd236b085f6a44092a078197af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9-Patrick=20Bubel?= <code@apb.name>
Date: Sun, 27 May 2018 17:22:24 +0200
Subject: [PATCH 02/26] freecad: 0.16.6712 -> 0.17

---
 pkgs/applications/graphics/freecad/default.nix | 12 ++++++++----
 pkgs/top-level/all-packages.nix                |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/pkgs/applications/graphics/freecad/default.nix b/pkgs/applications/graphics/freecad/default.nix
index d517306c1d6..87565a1e53e 100644
--- a/pkgs/applications/graphics/freecad/default.nix
+++ b/pkgs/applications/graphics/freecad/default.nix
@@ -1,19 +1,23 @@
 { stdenv, fetchurl, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts
-, boost, zlib, python27Packages, swig, gfortran, soqt, libf2c, makeWrapper, makeDesktopItem }:
+, hdf5, vtk, medfile, boost, zlib, python27Packages, swig, gfortran
+, soqt, libf2c, makeWrapper, makeDesktopItem
+, mpi ? null }:
+
+assert mpi != null;
 
 let
   pythonPackages = python27Packages;
 in stdenv.mkDerivation rec {
   name = "freecad-${version}";
-  version = "0.16.6712";
+  version = "0.17";
 
   src = fetchurl {
     url = "https://github.com/FreeCAD/FreeCAD/archive/${version}.tar.gz";
-    sha256 = "14hs26gvv7gbg9misxq34v4nrds2sbxjhj4yyw5kq3zbvl517alp";
+    sha256 = "1yv6abdzlpn4wxy315943xwrnbywxqfgkjib37qwfvbb8y9p60df";
   };
 
   buildInputs = with pythonPackages; [ cmake coin3d xercesc ode eigen qt4 opencascade gts boost
-    zlib python swig gfortran soqt libf2c makeWrapper matplotlib
+    zlib python swig gfortran soqt libf2c makeWrapper matplotlib mpi vtk hdf5 medfile
     pycollada pyside pysideShiboken pysideTools pivy
   ];
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index b0ac1fcd3d0..eb4f6d901f5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16021,7 +16021,7 @@ with pkgs;
 
   fomp = callPackage ../applications/audio/fomp { };
 
-  freecad = callPackage ../applications/graphics/freecad { };
+  freecad = callPackage ../applications/graphics/freecad { mpi = openmpi; };
 
   freemind = callPackage ../applications/misc/freemind { };
 

From 33a51d78a2c1e6c32f80e0bc321613e9bc78a17f Mon Sep 17 00:00:00 2001
From: Ruud van Asseldonk <dev@veniogames.com>
Date: Sun, 3 Jun 2018 12:00:27 +0200
Subject: [PATCH 03/26] imagemagick: depend on fftw for fft feature

---
 pkgs/applications/graphics/ImageMagick/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index 4b8d2ab291b..daa48e515b0 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -1,6 +1,6 @@
 { lib, stdenv, fetchFromGitHub, fetchpatch, pkgconfig, libtool
 , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
-, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp
+, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp, fftw
 , ApplicationServices
 , buildPlatform, hostPlatform
 }:
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
     ++ lib.optional stdenv.isDarwin ApplicationServices;
 
   propagatedBuildInputs =
-    [ bzip2 freetype libjpeg lcms2 ]
+    [ bzip2 freetype libjpeg lcms2 fftw ]
     ++ lib.optionals (!hostPlatform.isMinGW)
       [ libX11 libXext libXt libwebp ]
     ;

From 122f66a51315ecd9d7cd4b2d882a195a7ef4f550 Mon Sep 17 00:00:00 2001
From: Ruud van Asseldonk <dev@veniogames.com>
Date: Sun, 3 Jun 2018 12:09:02 +0200
Subject: [PATCH 04/26] imagemagick: set license metadata

---
 pkgs/applications/graphics/ImageMagick/default.nix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index daa48e515b0..3af6e19b701 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -101,5 +101,6 @@ stdenv.mkDerivation rec {
     description = "A software suite to create, edit, compose, or convert bitmap images";
     platforms = platforms.linux ++ platforms.darwin;
     maintainers = with maintainers; [ the-kenny wkennington ];
+    license = licenses.asl20;
   };
 }

From 613e4dec6b5360b7a0af02fd78e6ebd60c1462dd Mon Sep 17 00:00:00 2001
From: Ioannis Koutras <ioannis.koutras@gmail.com>
Date: Wed, 23 May 2018 10:55:16 +0300
Subject: [PATCH 05/26] jetbrains.idea-community: 2018.1.3 -> 2018.1.4

---
 pkgs/applications/editors/jetbrains/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix
index 5c882738a0b..777ceeec843 100644
--- a/pkgs/applications/editors/jetbrains/default.nix
+++ b/pkgs/applications/editors/jetbrains/default.nix
@@ -276,12 +276,12 @@ in
 
   idea-community = buildIdea rec {
     name = "idea-community-${version}";
-    version = "2018.1.3"; /* updated by script */
+    version = "2018.1.4"; /* updated by script */
     description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
     license = stdenv.lib.licenses.asl20;
     src = fetchurl {
       url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
-      sha256 = "0ws5s8bvjpz60pdyak3vb22x27qi00ajxx18wia1hql8831gsk3m"; /* updated by script */
+      sha256 = "1qb425wg4690474g348yizhkcqcgigz2synp4blcfv4p0pg79ri6"; /* updated by script */
     };
     wmClass = "jetbrains-idea-ce";
     update-channel = "IDEA_Release";

From 60762627bf1bd358264876be00ad87ea88e15a0a Mon Sep 17 00:00:00 2001
From: Ioannis Koutras <ioannis.koutras@gmail.com>
Date: Wed, 23 May 2018 10:56:13 +0300
Subject: [PATCH 06/26] jetbrains.idea-ultimate: 2018.1.3 -> 2018.1.4

---
 pkgs/applications/editors/jetbrains/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix
index 777ceeec843..8064ffeb7f5 100644
--- a/pkgs/applications/editors/jetbrains/default.nix
+++ b/pkgs/applications/editors/jetbrains/default.nix
@@ -289,12 +289,12 @@ in
 
   idea-ultimate = buildIdea rec {
     name = "idea-ultimate-${version}";
-    version = "2018.1.3"; /* updated by script */
+    version = "2018.1.4"; /* updated by script */
     description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
     license = stdenv.lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/idea/ideaIU-${version}-no-jdk.tar.gz";
-      sha256 = "14h71x3jidwiwv73g48f6bd0y4p3s33jb4wdr5grdhm677pqb702"; /* updated by script */
+      sha256 = "0jn771z09bscnk283kwrki0zyzhh4v4n6mr2swbd0ccs9v12dx71"; /* updated by script */
     };
     wmClass = "jetbrains-idea";
     update-channel = "IDEA_Release";

From 646767e9615bd3fff5d0765f011393008d31bc4d Mon Sep 17 00:00:00 2001
From: Benjamin Hipple <bhipple@protonmail.com>
Date: Sun, 3 Jun 2018 12:15:51 -0400
Subject: [PATCH 07/26] ctags: fix source url (#41382)

---
 pkgs/development/tools/misc/ctags/default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/development/tools/misc/ctags/default.nix b/pkgs/development/tools/misc/ctags/default.nix
index af40f3df20f..86136084d84 100644
--- a/pkgs/development/tools/misc/ctags/default.nix
+++ b/pkgs/development/tools/misc/ctags/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   revision = "816";
 
   src = fetchsvn {
-    url = "https://ctags.svn.sourceforge.net/svnroot/ctags/trunk";
+    url = https://svn.code.sf.net/p/ctags/code/trunk;
     rev = revision;
     sha256 = "0jmbkrmscbl64j71qffcc39x005jrmphx8kirs1g2ws44wil39hf";
   };

From 2c382eda621c47976a3448a38275cecf8cfbc9b0 Mon Sep 17 00:00:00 2001
From: Vladyslav M <dywedir@pm.me>
Date: Sun, 3 Jun 2018 20:02:28 +0300
Subject: [PATCH 08/26] skim: 0.3.2 -> 0.4.0 (#41417)

---
 pkgs/tools/misc/skim/default.nix | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkgs/tools/misc/skim/default.nix b/pkgs/tools/misc/skim/default.nix
index 709cbbe0791..169389928d0 100644
--- a/pkgs/tools/misc/skim/default.nix
+++ b/pkgs/tools/misc/skim/default.nix
@@ -2,18 +2,18 @@
 
 rustPlatform.buildRustPackage rec {
   name = "skim-${version}";
-  version = "0.3.2";
+  version = "0.4.0";
 
   src = fetchFromGitHub {
     owner = "lotabout";
     repo = "skim";
     rev = "v${version}";
-    sha256 = "0spkkgjjrch1grb0115rn0wxzsh8pzmm96a7j69zy5pc1il2m5lp";
+    sha256 = "067ds1sdi9ya1yqz9saczj1vml8arwzd46w35gmvdxgmxx4wmihs";
   };
 
   outputs = [ "out" "vim" ];
 
-  cargoSha256 = "0zbjnii8r41ih2m2vqhm3wdiwgi13kipvxx75sg4vm4maf4wpmhv";
+  cargoSha256 = "18lgjh1b1wfm9xsd6y6slfj1i3dwrvzkzszdzk3lmqx1f8515gx7";
 
   patchPhase = ''
     sed -i -e "s|expand('<sfile>:h:h')|'$out'|" plugin/skim.vim
@@ -37,7 +37,7 @@ rustPlatform.buildRustPackage rec {
     description = "Fuzzy Finder in rust!";
     homepage = https://github.com/lotabout/skim;
     license = licenses.mit;
-    maintainers = [];
+    maintainers = with maintainers; [ dywedir ];
     platforms = platforms.all;
   };
 }

From e92c4285935fa97a14946fdc649a51aecd8dd692 Mon Sep 17 00:00:00 2001
From: Vladyslav M <dywedir@pm.me>
Date: Sun, 3 Jun 2018 20:10:38 +0300
Subject: [PATCH 09/26] synapse-bt: init at 2018-06-04 (#41402)

---
 .../networking/p2p/synapse-bt/default.nix     | 27 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  2 ++
 2 files changed, 29 insertions(+)
 create mode 100644 pkgs/applications/networking/p2p/synapse-bt/default.nix

diff --git a/pkgs/applications/networking/p2p/synapse-bt/default.nix b/pkgs/applications/networking/p2p/synapse-bt/default.nix
new file mode 100644
index 00000000000..c8d54e945bf
--- /dev/null
+++ b/pkgs/applications/networking/p2p/synapse-bt/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig, openssl }:
+
+rustPlatform.buildRustPackage rec {
+  name = "synapse-bt-unstable-${version}";
+  version = "2018-06-04";
+
+  src = fetchFromGitHub {
+    owner = "Luminarys";
+    repo = "synapse";
+    rev = "ec8f23a14af21426ab0c4f8953dd954f747850ab";
+    sha256 = "0d1rrwnk333zz9g8s40i75xgdkpz6a1j01ajsh32yvzvbi045zkw";
+  };
+
+  cargoSha256 = "1psrmgf6ddzqwx7gf301rx84asfnvxpsvkx2fan453v65819k960";
+
+  buildInputs = [ pkgconfig openssl ];
+
+  cargoBuildFlags = [ "--all" ];
+
+  meta = with stdenv.lib; {
+    description = "Flexible and fast BitTorrent daemon";
+    homepage = https://synapse-bt.org/;
+    license = licenses.isc;
+    maintainers = with maintainers; [ dywedir ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 943781e3e6f..8079f6a416d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17138,6 +17138,8 @@ with pkgs;
     inherit (gnome3) libgee;
   };
 
+  synapse-bt = callPackage ../applications/networking/p2p/synapse-bt { };
+
   synfigstudio = callPackage ../applications/graphics/synfigstudio {
     fontsConf = makeFontsConf { fontDirectories = [ freefont_ttf ]; };
     inherit (gnome3) defaultIconTheme;

From fdafb70453ac17e139015f549176bbf90f52b4b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janne=20He=C3=9F?= <janne@hess.ooo>
Date: Sun, 3 Jun 2018 20:46:01 +0200
Subject: [PATCH 10/26] Add myself as maintainer

---
 maintainers/maintainer-list.nix | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 4f28823f0c2..e11e7edcc69 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -58,6 +58,11 @@
     github = "DamienCassou";
     name = "Damien Cassou";
   };
+  das_j = {
+    email = "janne@hess.ooo";
+    github = "dasJ";
+    name = "Janne Heß";
+  };
   DerGuteMoritz = {
     email = "moritz@twoticketsplease.de";
     github = "DerGuteMoritz";

From c1419f0e63ea885ba374608d721aa16d44a83c76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janne=20He=C3=9F?= <janne@hess.ooo>
Date: Sun, 3 Jun 2018 20:46:40 +0200
Subject: [PATCH 11/26] Add myself as maintainer for dnsdist

See Mic92's comment at #38658
---
 pkgs/servers/dns/dnsdist/default.nix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pkgs/servers/dns/dnsdist/default.nix b/pkgs/servers/dns/dnsdist/default.nix
index 7369713dc86..772292b0a57 100644
--- a/pkgs/servers/dns/dnsdist/default.nix
+++ b/pkgs/servers/dns/dnsdist/default.nix
@@ -30,5 +30,6 @@
     description = "DNS Loadbalancer";
     homepage = "https://dnsdist.org";
     license = licenses.gpl2;
+    maintainers = with maintainers; [ das_j ];
   };
 }

From b3e7923b94bb99cebb699bcd75486aa1e277dfe2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janne=20He=C3=9F?= <janne@hess.ooo>
Date: Sun, 3 Jun 2018 21:22:55 +0200
Subject: [PATCH 12/26] nixos/exim: Add unit restart trigger (#41418)

---
 nixos/modules/services/mail/exim.nix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nixos/modules/services/mail/exim.nix b/nixos/modules/services/mail/exim.nix
index 440eae281f4..f9ee3f90966 100644
--- a/nixos/modules/services/mail/exim.nix
+++ b/nixos/modules/services/mail/exim.nix
@@ -94,6 +94,7 @@ in
     systemd.services.exim = {
       description = "Exim Mail Daemon";
       wantedBy = [ "multi-user.target" ];
+      restartTriggers = [ config.environment.etc."exim.conf".source ];
       serviceConfig = {
         ExecStart   = "${exim}/bin/exim -bdf -q30m";
         ExecReload  = "${coreutils}/bin/kill -HUP $MAINPID";

From f569a0a684f07dcdf41bd398cc881caaa20c9f7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janne=20He=C3=9F?= <janne@hess.ooo>
Date: Sun, 3 Jun 2018 20:48:17 +0200
Subject: [PATCH 13/26] schema2ldif: Init at 1.3

---
 pkgs/tools/text/schema2ldif/default.nix | 31 +++++++++++++++++++++++++
 pkgs/top-level/all-packages.nix         |  2 ++
 2 files changed, 33 insertions(+)
 create mode 100644 pkgs/tools/text/schema2ldif/default.nix

diff --git a/pkgs/tools/text/schema2ldif/default.nix b/pkgs/tools/text/schema2ldif/default.nix
new file mode 100644
index 00000000000..699d2d28b82
--- /dev/null
+++ b/pkgs/tools/text/schema2ldif/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, makeWrapper, perl, perlPackages }: stdenv.mkDerivation rec {
+  name = "schema2ldif-${version}";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "https://repos.fusiondirectory.org/sources/schema2ldif/schema2ldif-${version}.tar.gz";
+    sha256 = "00cd9xx9g0mnnfn5lvay3vg166z84jla0ya1x34ljdc8bflxsr9a";
+  };
+
+  buildInputs = [ perl ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/man/man1
+
+    cp bin/{schema2ldif,ldap-schema-manager} $out/bin
+    gzip -c man/schema2ldif.1 > $out/share/man/man1/schema2ldif.1.gz
+    gzip -c man/ldap-schema-manager.1 > $out/share/man/man1/ldap-schema-manager.1.gz
+
+    wrapProgram $out/bin/schema2ldif \
+       --prefix PERL5PATH : "${stdenv.lib.makePerlPath [ perlPackages.GetoptLong perlPackages.PodUsage ]}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Utilities to manage schema in .schema and .ldif format";
+    homepage = "https://www.fusiondirectory.org/schema2ldif-project-and-components/";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ das_j ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index cc8bd077376..f5616b5f57b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -4911,6 +4911,8 @@ with pkgs;
 
   sharutils = callPackage ../tools/archivers/sharutils { };
 
+  schema2ldif = callPackage ../tools/text/schema2ldif { };
+
   shocco = callPackage ../tools/text/shocco { };
 
   shotwell = callPackage ../applications/graphics/shotwell { };

From 96606abf82caafb6defbe32a91b4ec14deaa1740 Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Sun, 3 Jun 2018 19:43:24 +0000
Subject: [PATCH 14/26] SDL: propagate libiconv

SDL/SDL.h includes SDL/SDL_stdinc.h which includes iconv.h, therefore all
packages that include SDL.h should be able to include iconv.h

Fixes SDL_gfx, SDL_image etc. on Darwin.
---
 pkgs/development/libraries/SDL/default.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 7e96cf84686..d40b25cd804 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  propagatedBuildInputs = [ ]
+  propagatedBuildInputs = [ libiconv ]
     ++ optionals x11Support [ libXext libICE libXrandr ]
     ++ optional stdenv.isLinux libcap
     ++ optionals openglSupport [ libGL libGLU ]
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     ++ optional pulseaudioSupport libpulseaudio
     ++ optional stdenv.isDarwin Cocoa;
 
-  buildInputs = [ libiconv ]
+  buildInputs = [ ]
     ++ optional (!hostPlatform.isMinGW) audiofile
     ++ optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ];
 
@@ -119,6 +119,8 @@ stdenv.mkDerivation rec {
 
   passthru = { inherit openglSupport; };
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "A cross-platform multimedia library";
     homepage    = "http://www.libsdl.org/";

From a47d34cebe37e80329c2ce551c3f895b2b5f3e58 Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
Date: Sun, 3 Jun 2018 22:11:29 +0200
Subject: [PATCH 15/26] pythonPackages.jira: fix build (#41419)

The build for `pythonPackages.jira` failed with the following error:

```
Download error on https://pypi.python.org/simple/sphinx/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'sphinx' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or working download links found for sphinx>=1.6.5
Traceback (most recent call last):
  ...
  File "/nix/store/bp4dillg6xxblpf00v8d9nxfx3bnggfy-python3.6-bootstrapped-pip-10.0.1/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 667, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('sphinx>=1.6.5')
builder for '/nix/store/8dv7mpspyk6kxwnzqb43rzm4q5j14xp0-python3.6-jira-1.0.15.drv' failed with exit code 1
```

The root issue is most likely caused by some docs fixes upstream
(https://github.com/pycontribs/jira/commit/519183d874fde26e676a75aa53496968643aaac0)
which were released in 1.0.15. The bump (without the fix) has been
performed in 7a6bf668fb73cd4d1096fa1c0162d9c6009f1d7e. Since `sphinx`
isn't needed during runtime, it's not necessary to use it as
`propagatedBuildInput`. In order to work around this the dependency had
to be removed from from `setup.py`.

See https://hydra.nixos.org/build/75004048 for further reference
---
 .../python-modules/jira/default.nix            | 18 ++++++++++++------
 .../python-modules/jira/sphinx-fix.patch       | 11 +++++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)
 create mode 100644 pkgs/development/python-modules/jira/sphinx-fix.patch

diff --git a/pkgs/development/python-modules/jira/default.nix b/pkgs/development/python-modules/jira/default.nix
index 2a1abe7b59c..ac4f45f4e9d 100644
--- a/pkgs/development/python-modules/jira/default.nix
+++ b/pkgs/development/python-modules/jira/default.nix
@@ -1,29 +1,35 @@
 { lib, buildPythonPackage, fetchPypi, isPy3k
 , pytest, pytestrunner, pbr, glibcLocales , pytestcov
-, requests, requests_oauthlib, requests_toolbelt, defusedxml }:
+, requests, requests_oauthlib, requests_toolbelt, defusedxml
+, ipython
+}:
 
 buildPythonPackage rec {
   pname = "jira";
   version = "1.0.15";
 
+  PBR_VERSION = version;
+
   src = fetchPypi {
     inherit pname version;
     sha256 = "20108a1d5b0dd058d5d4e0047f2d09ee06aaa413b22ca4d5c249e86167417fe8";
   };
 
   buildInputs = [ glibcLocales pytest pytestcov pytestrunner pbr ];
-  propagatedBuildInputs = [ requests requests_oauthlib requests_toolbelt defusedxml ];
+  propagatedBuildInputs = [ requests requests_oauthlib requests_toolbelt defusedxml pbr ipython ];
+
+  # impure tests because of connectivity attempts to jira servers
+  doCheck = false;
+
+  patches = [ ./sphinx-fix.patch ];
 
   LC_ALL = "en_US.utf8";
 
   disabled = !isPy3k;
 
-  # no tests in release tarball
-  doCheck = false;
-
   meta = with lib; {
     description = "This library eases the use of the JIRA REST API from Python.";
     license = licenses.bsd2;
-    maintainers = with maintainers; [ globin ];
+    maintainers = with maintainers; [ globin ma27 ];
   };
 }
diff --git a/pkgs/development/python-modules/jira/sphinx-fix.patch b/pkgs/development/python-modules/jira/sphinx-fix.patch
new file mode 100644
index 00000000000..ccc47ac4b9c
--- /dev/null
+++ b/pkgs/development/python-modules/jira/sphinx-fix.patch
@@ -0,0 +1,11 @@
+diff --git a/setup.py b/setup.py
+index c49a24d..31aeec2 100644
+--- a/setup.py
++++ b/setup.py
+@@ -11,5 +11,5 @@ except ImportError:
+ 
+ 
+ setuptools.setup(
+-    setup_requires=['pbr>=3.0.0', 'setuptools>=17.1', 'pytest-runner', 'sphinx>=1.6.5'],
++    setup_requires=['pbr>=3.0.0', 'setuptools>=17.1', 'pytest-runner'],
+     pbr=True)

From 76f6dc177220296ca32bb76ad662198b5d5eaced Mon Sep 17 00:00:00 2001
From: Mario Rodas <marsam@users.noreply.github.com>
Date: Sun, 3 Jun 2018 15:20:21 -0500
Subject: [PATCH 16/26] shadowsocks-libev: supports darwin (#41421)

---
 .../networking/shadowsocks-libev/default.nix      | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/pkgs/tools/networking/shadowsocks-libev/default.nix b/pkgs/tools/networking/shadowsocks-libev/default.nix
index 2823917fc31..d2e8a9a3051 100644
--- a/pkgs/tools/networking/shadowsocks-libev/default.nix
+++ b/pkgs/tools/networking/shadowsocks-libev/default.nix
@@ -24,6 +24,19 @@ stdenv.mkDerivation rec {
     cp lib/* $out/lib
     chmod +x $out/bin/*
     mv $out/pkgconfig $out/lib
+
+    ${stdenv.lib.optionalString stdenv.isDarwin ''
+      install_name_tool -change libcork.dylib $out/lib/libcork.dylib $out/lib/libipset.dylib
+      install_name_tool -change libbloom.dylib $out/lib/libbloom.dylib $out/lib/libipset.dylib
+
+      for exe in $out/bin/*; do
+        install_name_tool -change libmbedtls.dylib ${mbedtls}/lib/libmbedtls.dylib $exe
+        install_name_tool -change libmbedcrypto.dylib ${mbedtls}/lib/libmbedcrypto.dylib $exe
+        install_name_tool -change libcork.dylib $out/lib/libcork.dylib $exe
+        install_name_tool -change libipset.dylib $out/lib/libipset.dylib $exe
+        install_name_tool -change libbloom.dylib $out/lib/libbloom.dylib $exe
+      done
+    ''}
   '';
 
   meta = with stdenv.lib; {
@@ -35,6 +48,6 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/shadowsocks/shadowsocks-libev;
     license = licenses.gpl3Plus;
     maintainers = [ maintainers.nfjinjing ];
-    platforms = platforms.linux;
+    platforms = platforms.all;
   };
 }

From 214b35d11521573de3f6b3dcf3cc421d41ce4b7e Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Sun, 3 Jun 2018 20:37:40 +0000
Subject: [PATCH 17/26] freeimage: fix build with glibc 2.27

---
 pkgs/development/libraries/freeimage/default.nix | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pkgs/development/libraries/freeimage/default.nix b/pkgs/development/libraries/freeimage/default.nix
index 157f9f3936e..b2c66ad346d 100644
--- a/pkgs/development/libraries/freeimage/default.nix
+++ b/pkgs/development/libraries/freeimage/default.nix
@@ -19,6 +19,10 @@ stdenv.mkDerivation {
       url = patchURL + "/Fix-CVE-2016-5684.patch";
       sha256 = "14ffgqbnwg28r6sjvm3z89zbnnm9ghbc81hdhrzxlyk3vwvd6cw3";
     })
+    (fetchurl {
+      url = https://raw.githubusercontent.com/buildroot/buildroot/2018.05/package/libfreeimage/0005-Manage-powf64-with-glibc.patch;
+      sha256 = "1lis479ad5cfkhqm044nk4x97wfwm3hry3bvij1w5xkndnlfppc2";
+    })
   ];
 
   buildInputs = [ unzip ] ++ stdenv.lib.optional stdenv.isDarwin darwin.cctools;
@@ -57,6 +61,8 @@ stdenv.mkDerivation {
 
   NIX_CFLAGS_COMPILE = "-Wno-narrowing";
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Open Source library for accessing popular graphics image file formats";
     homepage = http://freeimage.sourceforge.net/;

From 64fd1ceb38009c20ba8f56542aad154532384d20 Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Sun, 3 Jun 2018 20:41:36 +0000
Subject: [PATCH 18/26] certbot: disable check on darwin

On Hydra it fails with "Too many open files":
https://hydra.nixos.org/build/64286041
https://hydra.nixos.org/build/75419471
---
 pkgs/tools/admin/certbot/default.nix | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pkgs/tools/admin/certbot/default.nix b/pkgs/tools/admin/certbot/default.nix
index 7a26896bbc2..353abe9c8bc 100644
--- a/pkgs/tools/admin/certbot/default.nix
+++ b/pkgs/tools/admin/certbot/default.nix
@@ -42,6 +42,8 @@ pythonPackages.buildPythonApplication rec {
     done
   '';
 
+  doCheck = !stdenv.isDarwin; # On Hydra Darwin tests fail with "Too many open files".
+
   meta = with stdenv.lib; {
     homepage = src.meta.homepage;
     description = "ACME client that can obtain certs and extensibly update server configurations";

From 93cb47a2fc93637b4c5a92f2648e53c5b0de00c9 Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Sun, 3 Jun 2018 20:48:42 +0000
Subject: [PATCH 19/26] python.pkgs.detox: 0.11 -> 0.12

Fixes build with python.pkgs.tox 3.0.0.
---
 pkgs/development/python-modules/detox/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/python-modules/detox/default.nix b/pkgs/development/python-modules/detox/default.nix
index ea50eebb38c..7c3aa87e9b8 100644
--- a/pkgs/development/python-modules/detox/default.nix
+++ b/pkgs/development/python-modules/detox/default.nix
@@ -3,11 +3,11 @@
 
 buildPythonPackage rec {
   pname = "detox";
-  version = "0.11";
+  version = "0.12";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "4719ca48c4ea5ffd908b1bc3d5d1b593b41e71dee17180d58d8a3e7e8f588d45";
+    sha256 = "06svvkszg6xlg0fr471smn4rmpfga960d6qqsyhyiwa48k59n4gk";
   };
 
   buildInputs = [ pytest ];

From 332b9dedc87b364a652c80aca675cd5282268519 Mon Sep 17 00:00:00 2001
From: Matthew Justin Bauer <mjbauer95@gmail.com>
Date: Sun, 3 Jun 2018 16:56:17 -0400
Subject: [PATCH 20/26] rust: disable tests on darwin

See https://github.com/rust-lang/rust/issues/51006

Tests frequently fail on Darwin. Not sure why but it's easier to just disable for now.
---
 pkgs/development/compilers/rust/rustc.nix | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index 19c4a590e45..277ffda20af 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -10,7 +10,11 @@
 , targets
 , targetPatches
 , targetToolchains
-, doCheck ? true
+
+# Tests frequently break on Darwin
+# See the rust issue: https://github.com/rust-lang/rust/issues/51006
+, doCheck ? (!stdenv.isDarwin)
+
 , broken ? false
 , buildPlatform, hostPlatform
 } @ args:

From 0644b4d9483704a04ecef3134ca55549255af83d Mon Sep 17 00:00:00 2001
From: lewo <lewo@abesis.fr>
Date: Sun, 3 Jun 2018 22:58:23 +0200
Subject: [PATCH 21/26] dockerTools.pullImage: expose image* attributes
 (#41366)

Attributes `imageName` and `imageTag` are exposed if the image is
built by our Nix tools but not if the image is pulled. So, we expose
these attributes for convenience and homogeneity.
---
 pkgs/build-support/docker/default.nix | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix
index 0e10ba036a0..b01f0b72272 100644
--- a/pkgs/build-support/docker/default.nix
+++ b/pkgs/build-support/docker/default.nix
@@ -47,6 +47,8 @@ rec {
     }:
 
     runCommand name {
+      inherit imageName imageDigest;
+      imageTag = finalImageTag;
       impureEnvVars = pkgs.stdenv.lib.fetchers.proxyImpureEnvVars;
       outputHashMode = "flat";
       outputHashAlgo = "sha256";

From ea52ca64e8fe1553316f851cb8a4a542e8b120ad Mon Sep 17 00:00:00 2001
From: Will Fancher <elvishjerricco@gmail.com>
Date: Sun, 3 Jun 2018 17:28:17 -0400
Subject: [PATCH 22/26] Fix GHCJS 8.4/8.2 in sandboxed builds (#41411)

---
 .../compilers/ghcjs-ng/configured-ghcjs-src.nix          | 7 ++++++-
 pkgs/development/compilers/ghcjs-ng/default.nix          | 9 ++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix b/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix
index e8c24b21134..57d9fccd266 100644
--- a/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix
+++ b/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix
@@ -6,6 +6,8 @@
 , cabal-install
 , gmp
 , runCommand
+, lib
+, stdenv
 
 , ghc
 , happy
@@ -20,15 +22,18 @@ runCommand "configured-ghcjs-src" {
     autoconf
     automake
     python3
-    gcc
     ghc
     happy
     alex
     cabal-install
+  ] ++ lib.optionals stdenv.isDarwin [
+    gcc # https://github.com/ghcjs/ghcjs/issues/663
   ];
   inherit ghcjsSrc;
 } ''
   export HOME=$(pwd)
+  mkdir $HOME/.cabal
+  touch $HOME/.cabal/config
   cp -r "$ghcjsSrc" "$out"
   chmod -R +w "$out"
   cd "$out"
diff --git a/pkgs/development/compilers/ghcjs-ng/default.nix b/pkgs/development/compilers/ghcjs-ng/default.nix
index 7f13c373942..04c3431f6f2 100644
--- a/pkgs/development/compilers/ghcjs-ng/default.nix
+++ b/pkgs/development/compilers/ghcjs-ng/default.nix
@@ -50,13 +50,10 @@ let
   };
 
   bootGhcjs = haskellLib.justStaticExecutables passthru.bootPkgs.ghcjs;
-  libexec =
-    if builtins.compareVersions bootGhcjs.version "8.3" <= 0
-      then "${bootGhcjs}/bin"
-      else "${bootGhcjs}/libexec/${builtins.replaceStrings ["darwin"] ["osx"] stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}";
+  libexec = "${bootGhcjs}/libexec/${builtins.replaceStrings ["darwin"] ["osx"] stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}";
 
 in stdenv.mkDerivation {
-    name = "ghcjs";
+    name = bootGhcjs.name;
     src = passthru.configuredSrc;
     nativeBuildInputs = [
       bootGhcjs
@@ -73,6 +70,8 @@ in stdenv.mkDerivation {
     phases = ["unpackPhase" "buildPhase"];
     buildPhase = ''
       export HOME=$TMP
+      mkdir $HOME/.cabal
+      touch $HOME/.cabal/config
       cd lib/boot
 
       mkdir -p $out/bin

From 5b96694e2d85e3c4bd3324719b630a0d2a6b2423 Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Sun, 3 Jun 2018 21:11:39 +0000
Subject: [PATCH 23/26] perlPackages.CPANPLUS: restore build inputs removed in
 #41394

---
 pkgs/top-level/perl-packages.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index d4a3ee1234e..6081e832e06 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -2905,7 +2905,7 @@ let self = _self // overrides; _self = with self; {
       url = "mirror://cpan/authors/id/B/BI/BINGOS/${name}.tar.gz";
       sha256 = "1q4b0fkdn4sh8ym9dig21w96p7kzrhq66lqhn0dy1l3pgx413zlc";
     };
-    doCheck = false;
+    propagatedBuildInputs = [ ArchiveExtract LogMessage ModulePluggable ObjectAccessor PackageConstants ];
     meta = {
       homepage = https://github.com/jib/cpanplus-devel;
       description = "Ameliorated interface to the CPAN";

From 39c2df48d510a287fba3790a0fda9bda8e82bc2c Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Sun, 3 Jun 2018 21:19:54 +0000
Subject: [PATCH 24/26] freecell-solver: fix build

---
 pkgs/games/freecell-solver/default.nix | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/pkgs/games/freecell-solver/default.nix b/pkgs/games/freecell-solver/default.nix
index a096b17b71a..3dc9857d455 100644
--- a/pkgs/games/freecell-solver/default.nix
+++ b/pkgs/games/freecell-solver/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, pkgconfig, cmake
 , perl, gmp, libtap, gperf
-, perlPackages, python3Packages }:
+, perlPackages, python3 }:
 
 with stdenv.lib;
 stdenv.mkDerivation rec{
@@ -13,11 +13,20 @@ stdenv.mkDerivation rec{
     sha256 = "1cmaib69pijmcpvgjvrdry8j4xys8l906l80b8z21vvyhdwrfdnn";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake perl gmp libtap gperf
-    perlPackages.TemplateToolkit perlPackages.StringShellQuote
-    perlPackages.GamesSolitaireVerify perlPackages.TaskFreecellSolverTesting
-    python3Packages.python python3Packages.random2 ];
+  nativeBuildInputs = [
+    cmake perl pkgconfig
+  ] ++ (with perlPackages; TaskFreecellSolverTesting.buildInputs ++ [
+    GamesSolitaireVerify StringShellQuote TaskFreecellSolverTesting TemplateToolkit
+  ]);
+
+  buildInputs = [
+    gmp libtap gperf
+    python3 python3.pkgs.random2
+  ];
+
+  # "ninja t/CMakeFiles/delta-states-test.t.exe.dir/__/delta_states.c.o" fails
+  # to depend on the generated "is_king.h".
+  enableParallelBuilding = false;
 
   meta = {
     description = "A FreeCell automatic solver";

From 264254568b46d4280bea65214f94a0e751ca16e7 Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Mon, 4 Jun 2018 02:00:32 +0000
Subject: [PATCH 25/26] python.pkgs.cairocffi: 0.8.0 -> 0.8.1

---
 pkgs/development/python-modules/cairocffi/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/python-modules/cairocffi/default.nix b/pkgs/development/python-modules/cairocffi/default.nix
index a8a8ac110f1..dbc747399b4 100644
--- a/pkgs/development/python-modules/cairocffi/default.nix
+++ b/pkgs/development/python-modules/cairocffi/default.nix
@@ -16,11 +16,11 @@
 
 buildPythonPackage rec {
   pname = "cairocffi";
-  version = "0.8.0";
+  version = "0.8.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0i9m3p39g9wrkpjvpawch2qmnmm3cnim7niz3nmmbcp2hrkixwk5";
+    sha256 = "0y373vafv7q35msg7gqdn7niifr3j4j4n070hflxshahs59irss7";
   };
 
   LC_ALL = "en_US.UTF-8";

From 6db9f4685a310f1ae65e35afacd977d2ed8fb01d Mon Sep 17 00:00:00 2001
From: Orivej Desh <orivej@gmx.fr>
Date: Mon, 4 Jun 2018 02:35:39 +0000
Subject: [PATCH 26/26] python.pkgs.cairocffi: update tests for Cairo 1.15.12

Fixes #41183
---
 .../cairocffi-0.8.1-cairo-1.15.12.patch       | 24 +++++++++++++++++++
 .../python-modules/cairocffi/default.nix      |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 pkgs/development/python-modules/cairocffi/cairocffi-0.8.1-cairo-1.15.12.patch

diff --git a/pkgs/development/python-modules/cairocffi/cairocffi-0.8.1-cairo-1.15.12.patch b/pkgs/development/python-modules/cairocffi/cairocffi-0.8.1-cairo-1.15.12.patch
new file mode 100644
index 00000000000..4d142275b9e
--- /dev/null
+++ b/pkgs/development/python-modules/cairocffi/cairocffi-0.8.1-cairo-1.15.12.patch
@@ -0,0 +1,24 @@
+diff --git a/cairocffi/test_cairo.py b/cairocffi/test_cairo.py
+index 1588349..5452910 100644
+--- a/cairocffi/test_cairo.py
++++ b/cairocffi/test_cairo.py
+@@ -292,7 +292,8 @@ def test_pdf_surface():
+         pdf_bytes = file_obj.getvalue()
+         assert pdf_bytes.startswith(b'%PDF')
+         assert b'/MediaBox [ 0 0 123 432 ]' in pdf_bytes
+-        assert pdf_bytes.count(b'/Type /Page\n') == 1
++        assert pdf_bytes.count(b'/Type /Pages') == 1
++        assert pdf_bytes.count(b'/Type /Page') == 2
+ 
+     file_obj = io.BytesIO()
+     surface = PDFSurface(file_obj, 1, 1)
+@@ -306,7 +307,8 @@ def test_pdf_surface():
+     assert b'/MediaBox [ 0 0 1 1 ]' not in pdf_bytes
+     assert b'/MediaBox [ 0 0 12 100 ]' in pdf_bytes
+     assert b'/MediaBox [ 0 0 42 700 ]' in pdf_bytes
+-    assert pdf_bytes.count(b'/Type /Page\n') == 2
++    assert pdf_bytes.count(b'/Type /Pages') == 1
++    assert pdf_bytes.count(b'/Type /Page') == 3
+ 
+ 
+ def test_svg_surface():
diff --git a/pkgs/development/python-modules/cairocffi/default.nix b/pkgs/development/python-modules/cairocffi/default.nix
index dbc747399b4..a9c4a3437b5 100644
--- a/pkgs/development/python-modules/cairocffi/default.nix
+++ b/pkgs/development/python-modules/cairocffi/default.nix
@@ -47,6 +47,7 @@ buildPythonPackage rec {
       gdk_pixbuf = gdk_pixbuf.out;
     })
     ./fix_test_scaled_font.patch
+    ./cairocffi-0.8.1-cairo-1.15.12.patch
   ];
 
   meta = with lib; {