summary refs log tree commit diff
path: root/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2020-01-27 07:56:23 +0000
committeradisbladis <adisbladis@gmail.com>2020-01-27 07:56:23 +0000
commit45158b5c65ea064688d1bc0700420ef26f70116a (patch)
tree4f0c235a7325d6e5a87b49b06af7ae8bec98d4a1 /pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
parent61dbbe4121b8a6d3058e38c2d948b2ff143f0e5b (diff)
downloadnixpkgs-45158b5c65ea064688d1bc0700420ef26f70116a.tar
nixpkgs-45158b5c65ea064688d1bc0700420ef26f70116a.tar.gz
nixpkgs-45158b5c65ea064688d1bc0700420ef26f70116a.tar.bz2
nixpkgs-45158b5c65ea064688d1bc0700420ef26f70116a.tar.lz
nixpkgs-45158b5c65ea064688d1bc0700420ef26f70116a.tar.xz
nixpkgs-45158b5c65ea064688d1bc0700420ef26f70116a.tar.zst
nixpkgs-45158b5c65ea064688d1bc0700420ef26f70116a.zip
poetry2nix: 1.3.0 -> 1.4.0
Diffstat (limited to 'pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix')
-rw-r--r--pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix314
1 files changed, 221 insertions, 93 deletions
diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
index 48b8ff9859b..86260c03703 100644
--- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
+++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
@@ -21,11 +21,15 @@ self: super:
     }
   );
 
-  cffi = super.cffi.overrideAttrs (
-    old: {
-      buildInputs = old.buildInputs ++ [ pkgs.libffi ];
-    }
-  );
+  cffi =
+    # cffi is bundled with pypy
+    if self.python.implementation == "pypy" then null else (
+      super.cffi.overrideAttrs (
+        old: {
+          buildInputs = old.buildInputs ++ [ pkgs.libffi ];
+        }
+      )
+    );
 
   cftime = super.cftime.overrideAttrs (
     old: {
@@ -60,9 +64,30 @@ self: super:
     }
   );
 
+  dlib = super.dlib.overrideAttrs (
+    old: {
+      # Parallel building enabled
+      inherit (pkgs.python.pkgs.dlib) patches;
+
+      enableParallelBuilding = true;
+      dontUseCmakeConfigure = true;
+
+      nativeBuildInputs = old.nativeBuildInputs ++ pkgs.dlib.nativeBuildInputs;
+      buildInputs = old.buildInputs ++ pkgs.dlib.buildInputs;
+    }
+  );
+
   # Environment markers are not always included (depending on how a dep was defined)
   enum34 = if self.pythonAtLeast "3.4" then null else super.enum34;
 
+  faker = super.faker.overrideAttrs (
+    old: {
+      postPatch = ''
+        substituteInPlace setup.py --replace 'setup_requires=["pytest-runner"],' 'setup_requires=[],' || true
+      '';
+    }
+  );
+
   grandalf = super.grandalf.overrideAttrs (
     old: {
       postPatch = ''
@@ -135,22 +160,39 @@ self: super:
   );
 
   matplotlib = super.matplotlib.overrideAttrs (
-    old: {
-      NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${pkgs.libcxx}/include/c++/v1";
+    old: let
+      enableGhostscript = old.passthru.enableGhostscript or false;
+      enableGtk3 = old.passthru.enableTk or false;
+      enableQt = old.passthru.enableQt or false;
+      enableTk = old.passthru.enableTk or false;
 
-      XDG_RUNTIME_DIR = "/tmp";
+      inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;
 
-      nativeBuildInputs = old.nativeBuildInputs ++ [
-        pkgs.pkgconfig
-      ];
+    in
+      {
+        NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${pkgs.libcxx}/include/c++/v1";
 
-      propagatedBuildInputs = old.propagatedBuildInputs ++ [
-        pkgs.libpng
-        pkgs.freetype
-      ];
+        XDG_RUNTIME_DIR = "/tmp";
 
-      inherit (super.matplotlib) patches;
-    }
+        buildInputs = old.buildInputs
+        ++ lib.optional enableGhostscript pkgs.ghostscript
+        ++ lib.optional stdenv.isDarwin [ Cocoa ];
+
+        nativeBuildInputs = old.nativeBuildInputs ++ [
+          pkgs.pkgconfig
+        ];
+
+        propagatedBuildInputs = old.propagatedBuildInputs ++ [
+          pkgs.libpng
+          pkgs.freetype
+        ]
+        ++ stdenv.lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ]
+        ++ stdenv.lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ]
+        ++ stdenv.lib.optionals enableQt [ self.pyqt5 ]
+        ;
+
+        inherit (super.matplotlib) patches;
+      }
   );
 
   # Calls Cargo at build time for source builds and is really tricky to package
@@ -191,7 +233,7 @@ self: super:
 
   numpy = super.numpy.overrideAttrs (
     old: let
-      blas = pkgs.openblasCompat;
+      blas = old.passthru.args.blas or pkgs.openblasCompat;
       blasImplementation = lib.nameFromURL blas.name "-";
       cfg = pkgs.writeTextFile {
         name = "site.cfg";
@@ -222,6 +264,19 @@ self: super:
       }
   );
 
+  peewee = super.peewee.overridePythonAttrs (
+    old: let
+      withPostgres = old.passthru.withPostgres or false;
+      withMysql = old.passthru.withMysql or false;
+    in
+      {
+        buildInputs = old.buildInputs ++ [ self.cython pkgs.sqlite ];
+        propagatedBuildInputs = old.propagatedBuildInputs
+        ++ lib.optional withPostgres self.psycopg2
+        ++ lib.optional withMysql self.mysql-connector;
+      }
+  );
+
   pillow = super.pillow.overrideAttrs (
     old: {
       nativeBuildInputs = [ pkgs.pkgconfig ] ++ old.nativeBuildInputs;
@@ -297,84 +352,106 @@ self: super:
     }
   );
 
-  pyqt5 = super.pyqt5.overridePythonAttrs (
-    old: {
-      format = "other";
-
-      nativeBuildInputs = old.nativeBuildInputs ++ [
-        pkgs.pkgconfig
-        pkgs.qt5.qmake
-        pkgs.xorg.lndir
-        pkgs.qt5.qtbase
-        pkgs.qt5.qtsvg
-        pkgs.qt5.qtdeclarative
-        pkgs.qt5.qtwebchannel
-        # self.pyqt5-sip
-        self.sip
-      ];
-
-      buildInputs = old.buildInputs ++ [
-        pkgs.dbus
-        pkgs.qt5.qtbase
-        pkgs.qt5.qtsvg
-        pkgs.qt5.qtdeclarative
-        self.sip
-      ];
-
-      # Fix dbus mainloop
-      inherit (pkgs.python3.pkgs.pyqt5) patches;
-
-      configurePhase = ''
-        runHook preConfigure
-
-        export PYTHONPATH=$PYTHONPATH:$out/${self.python.sitePackages}
-
-        mkdir -p $out/${self.python.sitePackages}/dbus/mainloop
-        ${self.python.executable} configure.py  -w \
-          --confirm-license \
-          --no-qml-plugin \
-          --bindir=$out/bin \
-          --destdir=$out/${self.python.sitePackages} \
-          --stubsdir=$out/${self.python.sitePackages}/PyQt5 \
-          --sipdir=$out/share/sip/PyQt5 \
-          --designer-plugindir=$out/plugins/designer
-
-        runHook postConfigure
-      '';
+  pyqt5 = let
+    drv = super.pyqt5;
+    withConnectivity = drv.passthru.args.withConnectivity or false;
+    withMultimedia = drv.passthru.args.withMultimedia or false;
+    withWebKit = drv.passthru.args.withWebKit or false;
+    withWebSockets = drv.passthru.args.withWebSockets or false;
+  in
+    super.pyqt5.overridePythonAttrs (
+      old: {
+        format = "other";
 
-      postInstall = ''
-        ln -s ${self.pyqt5-sip}/${self.python.sitePackages}/PyQt5/sip.* $out/${self.python.sitePackages}/PyQt5/
-        for i in $out/bin/*; do
-          wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
-        done
-
-        # # Let's make it a namespace package
-        # cat << EOF > $out/${self.python.sitePackages}/PyQt5/__init__.py
-        # from pkgutil import extend_path
-        # __path__ = extend_path(__path__, __name__)
-        # EOF
-      '';
+        nativeBuildInputs = old.nativeBuildInputs ++ [
+          pkgs.pkgconfig
+          pkgs.qt5.qmake
+          pkgs.xorg.lndir
+          pkgs.qt5.qtbase
+          pkgs.qt5.qtsvg
+          pkgs.qt5.qtdeclarative
+          pkgs.qt5.qtwebchannel
+          # self.pyqt5-sip
+          self.sip
+        ]
+        ++ lib.optional withConnectivity pkgs.qt5.qtconnectivity
+        ++ lib.optional withMultimedia pkgs.qt5.qtmultimedia
+        ++ lib.optional withWebKit pkgs.qt5.qtwebkit
+        ++ lib.optional withWebSockets pkgs.qt5.qtwebsockets
+        ;
+
+        buildInputs = old.buildInputs ++ [
+          pkgs.dbus
+          pkgs.qt5.qtbase
+          pkgs.qt5.qtsvg
+          pkgs.qt5.qtdeclarative
+          self.sip
+        ]
+        ++ lib.optional withConnectivity pkgs.qt5.qtconnectivity
+        ++ lib.optional withWebKit pkgs.qt5.qtwebkit
+        ++ lib.optional withWebSockets pkgs.qt5.qtwebsockets
+        ;
+
+        # Fix dbus mainloop
+        patches = pkgs.python3.pkgs.pyqt5.patches or [];
+
+        configurePhase = ''
+          runHook preConfigure
+
+          export PYTHONPATH=$PYTHONPATH:$out/${self.python.sitePackages}
+
+          mkdir -p $out/${self.python.sitePackages}/dbus/mainloop
+          ${self.python.executable} configure.py  -w \
+            --confirm-license \
+            --no-qml-plugin \
+            --bindir=$out/bin \
+            --destdir=$out/${self.python.sitePackages} \
+            --stubsdir=$out/${self.python.sitePackages}/PyQt5 \
+            --sipdir=$out/share/sip/PyQt5 \
+            --designer-plugindir=$out/plugins/designer
+
+          runHook postConfigure
+        '';
 
-      installCheckPhase = let
-        modules = [
-          "PyQt5"
-          "PyQt5.QtCore"
-          "PyQt5.QtQml"
-          "PyQt5.QtWidgets"
-          "PyQt5.QtGui"
-        ];
-        imports = lib.concatMapStrings (module: "import ${module};") modules;
-      in
-        ''
-          echo "Checking whether modules can be imported..."
-          ${self.python.interpreter} -c "${imports}"
+        postInstall = ''
+          ln -s ${self.pyqt5-sip}/${self.python.sitePackages}/PyQt5/sip.* $out/${self.python.sitePackages}/PyQt5/
+          for i in $out/bin/*; do
+            wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
+          done
+
+          # Let's make it a namespace package
+          cat << EOF > $out/${self.python.sitePackages}/PyQt5/__init__.py
+          from pkgutil import extend_path
+          __path__ = extend_path(__path__, __name__)
+          EOF
         '';
 
-      doCheck = true;
+        installCheckPhase = let
+          modules = [
+            "PyQt5"
+            "PyQt5.QtCore"
+            "PyQt5.QtQml"
+            "PyQt5.QtWidgets"
+            "PyQt5.QtGui"
+          ]
+          ++ lib.optional withWebSockets "PyQt5.QtWebSockets"
+          ++ lib.optional withWebKit "PyQt5.QtWebKit"
+          ++ lib.optional withMultimedia "PyQt5.QtMultimedia"
+          ++ lib.optional withConnectivity "PyQt5.QtConnectivity"
+          ;
+
+          imports = lib.concatMapStrings (module: "import ${module};") modules;
+        in
+          ''
+            echo "Checking whether modules can be imported..."
+            ${self.python.interpreter} -c "${imports}"
+          '';
+
+        doCheck = true;
 
-      enableParallelBuilding = true;
-    }
-  );
+        enableParallelBuilding = true;
+      }
+    );
 
   pytest-datadir = super.pytest-datadir.overrideAttrs (
     old: {
@@ -400,9 +477,21 @@ self: super:
     }
   );
 
+  # Pybind11 is an undeclared dependency of scipy that we need to pick from nixpkgs
+  # Make it not fail with infinite recursion
+  pybind11 = super.pybind11.overridePythonAttrs (
+    old: {
+      cmakeFlags = (old.cmakeFlags or []) ++ [
+        "-DPYBIND11_TEST=off"
+      ];
+      doCheck = false; # Circular test dependency
+    }
+  );
+
   scipy = super.scipy.overrideAttrs (
     old: {
       nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gfortran ];
+      propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.pybind11 ];
       setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
       enableParallelBuilding = true;
       buildInputs = old.buildInputs ++ [ self.numpy.blas ];
@@ -416,10 +505,27 @@ self: super:
     }
   );
 
+  scikit-learn = super.scikit-learn.overridePythonAttrs (
+    old: {
+      buildInputs = old.buildInputs ++ [
+        pkgs.gfortran
+        pkgs.glibcLocales
+      ] ++ lib.optionals stdenv.cc.isClang [
+        pkgs.llvmPackages.openmp
+      ];
+
+      nativeBuildInputs = old.nativeBuildInputs ++ [
+        self.cython
+      ];
+
+      enableParallelBuilding = true;
+    }
+  );
+
   shapely = super.shapely.overrideAttrs (
     old: {
       buildInputs = old.buildInputs ++ [ pkgs.geos self.cython ];
-      inherit (super.shapely) patches GEOS_LIBRARY_PATH;
+      inherit (pkgs.python3.pkgs.shapely) patches GEOS_LIBRARY_PATH;
     }
   );
 
@@ -431,7 +537,7 @@ self: super:
     }
   );
 
-  vose-alias-method = super.pytest-datadir.overrideAttrs (
+  vose-alias-method = super.vose-alias-method.overrideAttrs (
     old: {
       postInstall = ''
         rm -f $out/LICENSE
@@ -439,6 +545,15 @@ self: super:
     }
   );
 
+  uvloop = super.uvloop.overrideAttrs (
+    old: {
+      buildInputs = old.buildInputs ++ lib.optionals stdenv.isDarwin [
+        pkgs.darwin.apple_sdk.frameworks.ApplicationServices
+        pkgs.darwin.apple_sdk.frameworks.CoreServices
+      ];
+    }
+  );
+
   # Stop infinite recursion by using bootstrapped pkg from nixpkgs
   wheel = (
     pkgs.python3.pkgs.override {
@@ -450,4 +565,17 @@ self: super:
     }
   );
 
+  zipp =
+    if lib.versionAtLeast super.zipp.version "2.0.0" then (
+      super.zipp.overridePythonAttrs (
+        old: {
+          prePatch = ''
+            substituteInPlace setup.py --replace \
+            'setuptools.setup()' \
+            'setuptools.setup(version="${super.zipp.version}")'
+          '';
+        }
+      )
+    ) else super.zipp;
+
 }