From 25b9f3b3e05700e873d511a8585236ae771c7dee Mon Sep 17 00:00:00 2001 From: adisbladis Date: Mon, 8 Jun 2020 23:52:47 +0200 Subject: [PATCH] poetry2nix: 1.9.0 -> 1.9.2 --- .../tools/poetry2nix/poetry2nix/default.nix | 2 +- .../tools/poetry2nix/poetry2nix/lib.nix | 2 +- .../tools/poetry2nix/poetry2nix/overrides.nix | 64 +++++++++++++++++++ .../tools/poetry2nix/poetry2nix/pep425.nix | 11 +++- 4 files changed, 75 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/default.nix b/pkgs/development/tools/poetry2nix/poetry2nix/default.nix index eecad922d4e..50a0c3447bd 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/default.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/default.nix @@ -7,7 +7,7 @@ let inherit (poetryLib) isCompatible readTOML moduleName; # Poetry2nix version - version = "1.8.0"; + version = "1.9.2"; /* The default list of poetry2nix override overlays */ defaultPoetryOverrides = (import ./overrides.nix { inherit pkgs lib; }); diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix index 4d3d36fd769..39233929abb 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix @@ -146,7 +146,7 @@ let else pkgs.fetchurl { url = predictURLFromPypi { inherit pname file hash kind; }; - sha256 = builtins.elemAt (builtins.match "sha256:(.*)" hash) 0; # nix 2.0 backwards compatibility. + inherit hash; } ); getBuildSystemPkgs = diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix index ccb8d9342f6..c5ae5e19121 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix @@ -6,6 +6,12 @@ self: super: { + automat = super.automat.overridePythonAttrs ( + old: rec { + propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.m2r ]; + } + ); + astroid = super.astroid.overridePythonAttrs ( old: rec { buildInputs = old.buildInputs ++ [ self.pytest-runner ]; @@ -211,6 +217,12 @@ self: super: } ); + intreehooks = super.intreehooks.overridePythonAttrs ( + old: { + doCheck = false; + } + ); + isort = super.isort.overridePythonAttrs ( old: { propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.setuptools ]; @@ -398,6 +410,12 @@ self: super: } ); + parsel = super.parsel.overridePythonAttrs ( + old: rec { + nativeBuildInputs = old.nativeBuildInputs ++ [ self.pytest-runner ]; + } + ); + peewee = super.peewee.overridePythonAttrs ( old: let @@ -517,6 +535,46 @@ self: super: } ); + pygame = super.pygame.overridePythonAttrs ( + old: rec { + nativeBuildInputs = [ + pkgs.pkg-config + pkgs.SDL + ]; + + buildInputs = [ + pkgs.SDL + pkgs.SDL_image + pkgs.SDL_mixer + pkgs.SDL_ttf + pkgs.libpng + pkgs.libjpeg + pkgs.portmidi + pkgs.xorg.libX11 + pkgs.freetype + ]; + + # Tests fail because of no audio device and display. + doCheck = false; + preConfigure = '' + sed \ + -e "s/origincdirs = .*/origincdirs = []/" \ + -e "s/origlibdirs = .*/origlibdirs = []/" \ + -e "/'\/lib\/i386-linux-gnu', '\/lib\/x86_64-linux-gnu']/d" \ + -e "/\/include\/smpeg/d" \ + -i buildconfig/config_unix.py + ${lib.concatMapStrings (dep: '' + sed \ + -e "/origincdirs =/a\ origincdirs += ['${lib.getDev dep}/include']" \ + -e "/origlibdirs =/a\ origlibdirs += ['${lib.getLib dep}/lib']" \ + -i buildconfig/config_unix.py + '') buildInputs + } + LOCALBASE=/ ${self.python.interpreter} buildconfig/config.py + ''; + } + ); + pygobject = super.pygobject.overridePythonAttrs ( old: { nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ]; @@ -537,6 +595,12 @@ self: super: } ); + pytoml = super.pytoml.overridePythonAttrs ( + old: { + doCheck = false; + } + ); + pyqt5 = let drv = super.pyqt5; diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix b/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix index 496c4ff1581..7135cace287 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix @@ -20,7 +20,9 @@ let # toWheelAttrs = str: let - entries = splitString "-" str; + entries' = splitString "-" str; + # Hack: Remove version "suffixes" like 2.11.4-1 + entries = builtins.filter (x: builtins.match "[0-9]" x == null) entries'; p = removeSuffix ".whl" (builtins.elemAt entries 4); in { @@ -60,7 +62,12 @@ let selectWheel = files: let filesWithoutSources = (builtins.filter (x: hasSuffix ".whl" x.file) files); - isPyAbiCompatible = pyabi: x: x == "none" || pyabi == x; + isPyAbiCompatible = pyabi: x: x == "none" || lib.hasPrefix pyabi x || ( + # The CPython stable ABI is abi3 as in the shared library suffix. + python.passthru.implementation == "cpython" && + builtins.elemAt (lib.splitString "." python.version) 0 == "3" && + x == "abi3" + ); withPython = ver: abi: x: (isPyVersionCompatible ver x.pyVer) && (isPyAbiCompatible abi x.abi); withPlatform = if isLinux