@@ -1,14 +1,16 @@
11{ lib
22, stdenv
33, fetchurl
4+, autoreconfHook
45, boost
5−, fastjet
66, gfortran
77, lhapdf
8−, python2
9−, root
8+, ncurses
9+, python
10+, swig
1011, yoda
1112, zlib
13+, withPython ? false
1214}:
1315
1416stdenv.mkDerivation rec {
@@ -20,19 +22,20 @@ stdenv.mkDerivation rec {
2022 sha256 = "0fm9k732pmi3prbicj2yaq815nmcjll95fagjqzf542ng3swpqnb";
2123 };
2224
25+ nativeBuildInputs = lib.optional withPython autoreconfHook;
26+
2327 buildInputs = [
2428 boost
25− fastjet
2629 gfortran
2730 gfortran.cc.lib
2831 lhapdf
29− python2
30− root
3132 yoda
32− ];
33+ ] ++ lib.optional withPython python
34+ ++ lib.optional (withPython && python.isPy3k) ncurses;
35+
3336 propagatedBuildInputs = [
3437 zlib
35− ];
38+ ] ++ lib.optional withPython swig;
3639
3740 preConfigure = ''
3841 substituteInPlace ./fastnlotoolkit/Makefile.in \
@@ -41,7 +44,7 @@ stdenv.mkDerivation rec {
4144
4245 configureFlags = [
4346 "--with-yoda=${yoda}"
44− ];
47+ ] ++ lib.optional withPython "--enable-pyext";
4548
4649 enableParallelBuilding = true;
4750