diff --git a/nixos/doc/manual/development/settings-options.section.md b/nixos/doc/manual/development/settings-options.section.md index f9bb6ff9cc41..d569e23adbdc 100644 --- a/nixos/doc/manual/development/settings-options.section.md +++ b/nixos/doc/manual/development/settings-options.section.md @@ -32,6 +32,20 @@ type of this option should represent the format. The most common formats have a predefined type and string generator already declared under `pkgs.formats`: +`pkgs.formats.javaProperties` { *`comment`* ? `"Generated with Nix"` } + +: A function taking an attribute set with values + + `comment` + + : A string to put at the start of the + file in a comment. It can have multiple + lines. + + It returns the `type`: `attrsOf str` and a function + `generate` to build a Java `.properties` file, taking + care of the correct escaping, etc. + `pkgs.formats.json` { } : A function taking an empty attribute set (for future extensibility) diff --git a/nixos/doc/manual/from_md/development/settings-options.section.xml b/nixos/doc/manual/from_md/development/settings-options.section.xml index 746011a2d075..d26dd96243db 100644 --- a/nixos/doc/manual/from_md/development/settings-options.section.xml +++ b/nixos/doc/manual/from_md/development/settings-options.section.xml @@ -53,6 +53,38 @@ pkgs.formats: + + + pkgs.formats.javaProperties { + comment ? + "Generated with Nix" } + + + + A function taking an attribute set with values + + + + + comment + + + + A string to put at the start of the file in a comment. + It can have multiple lines. + + + + + + It returns the type: + attrsOf str and a function + generate to build a Java + .properties file, taking care of the + correct escaping, etc. + + + pkgs.formats.json { } diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index a9ed8f251283..c4958c36ea00 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -977,6 +977,7 @@ ./services/security/shibboleth-sp.nix ./services/security/sks.nix ./services/security/sshguard.nix + ./services/security/sslmate-agent.nix ./services/security/step-ca.nix ./services/security/tor.nix ./services/security/torify.nix diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 48e119a86187..3528b0f40e7b 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -302,6 +302,7 @@ in environment.systemPackages = with pkgs.pantheon; [ contractor file-roller-contract + gnome-bluetooth-contract ]; environment.pathsToLink = [ diff --git a/pkgs/applications/editors/vscode/vscodium.nix b/pkgs/applications/editors/vscode/vscodium.nix index a91227d9db40..0101b896e8cf 100644 --- a/pkgs/applications/editors/vscode/vscodium.nix +++ b/pkgs/applications/editors/vscode/vscodium.nix @@ -13,10 +13,10 @@ let archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz"; sha256 = { - x86_64-linux = "1sh2f7hwhilwmlgy11kl0s2n3phpcir15wyl2fkyhsr2kdj4jz9r"; - x86_64-darwin = "1s04d91f08982wi8hb4dw0j57d6zqrdgns16ihrgsvahrzksgq4b"; - aarch64-linux = "1a97lk1qz2lz0lk5lpja32zy07iwdbskp6baf429iz7fz232rshm"; - armv7l-linux = "0vjqxqcr7fq3ncx1nl6ny7qcqm4vlsn33c074hhcg5292blg2a0p"; + x86_64-linux = "0dv28i8mxf45n7xj4gzgh4gsx76875nxs4yfqswxij8kzz72vqfn"; + x86_64-darwin = "0xs4f1ffqcbvzw1v64f9l8i7rflz7h1j5xgjxdz6l0hw0j4aalb2"; + aarch64-linux = "1fa7g531apigp8k7fxkp2ijmhz5axx7ixzdhlwgbsb80rb2mqhi0"; + armv7l-linux = "1ry9qm6rk46s0jn7hl30jbjdhi3fshzcs0x9krd9qin7by18hhz3"; }.${system}; sourceRoot = { @@ -31,7 +31,7 @@ in # Please backport all compatible updates to the stable release. # This is important for the extension ecosystem. - version = "1.65.2"; + version = "1.66.0"; pname = "vscodium"; executableName = "codium"; diff --git a/pkgs/applications/networking/mullvad/default.nix b/pkgs/applications/networking/mullvad/default.nix new file mode 100644 index 000000000000..7b4bcf9d61b2 --- /dev/null +++ b/pkgs/applications/networking/mullvad/default.nix @@ -0,0 +1,8 @@ +{ lib +, newScope +}: +lib.makeScope newScope (self: { + libwg = self.callPackage ./libwg.nix { }; + mullvad = self.callPackage ./mullvad.nix { }; + openvpn-mullvad = self.callPackage ./openvpn.nix { }; +}) diff --git a/pkgs/applications/networking/mullvad/libwg.nix b/pkgs/applications/networking/mullvad/libwg.nix new file mode 100644 index 000000000000..d54a2cafe8c0 --- /dev/null +++ b/pkgs/applications/networking/mullvad/libwg.nix @@ -0,0 +1,35 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, mullvad +}: +buildGoModule { + pname = "libwg"; + + inherit (mullvad) + version + src + ; + + sourceRoot = "source/wireguard/libwg"; + + vendorSha256 = "qvymWCdJ+GY90W/Fpdp+r1+mTq6O4LyN2Yw/PjKdFm0="; + + # XXX: hack to make the ar archive go to the correct place + # This is necessary because passing `-o ...` to `ldflags` does not work + # (this doesn't get communicated everywhere in the chain, apparently, so + # `go` complains that it can't find an `a.out` file). + GOBIN = "${placeholder "out"}/lib"; + ldflags = [ "-s" "-w" "-buildmode=c-archive" ]; + + postInstall = '' + mv $out/lib/libwg{,.a} + ''; + + meta = with lib; { + description = "A tiny wrapper around wireguard-go"; + homepage = "https://github.com/mullvad/mullvadvpn-app/tree/master/wireguard/libwg"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ cole-h ]; + }; +} diff --git a/pkgs/applications/networking/mullvad/mullvad.nix b/pkgs/applications/networking/mullvad/mullvad.nix new file mode 100644 index 000000000000..801e8602cc95 --- /dev/null +++ b/pkgs/applications/networking/mullvad/mullvad.nix @@ -0,0 +1,107 @@ +{ lib +, stdenv +, writeText +, rustPlatform +, fetchFromGitHub +, pkg-config +, protobuf +, makeWrapper +, dbus +, libnftnl +, libmnl +, libwg +, openvpn-mullvad +, shadowsocks-rust +}: +let + # result of running address_cache as of 02 Mar 2022 + bootstrap-address-cache = writeText "api-ip-address.txt" '' + 193.138.218.78:443 + 193.138.218.71:444 + 185.65.134.66:444 + 185.65.135.117:444 + 217.138.254.130:444 + 91.90.44.10:444 + ''; +in +rustPlatform.buildRustPackage rec { + pname = "mullvad"; + version = "2022.1"; + + src = fetchFromGitHub { + owner = "mullvad"; + repo = "mullvadvpn-app"; + rev = version; + hash = "sha256-bLwuM3Qy2iStbXIvDEWp31vuiihSQThOej297XKo5Xc="; + }; + + cargoHash = "sha256-CBbm8cJHTjyvvzCFQfKmsE5d9N7azEm8nI6KeWLVaa8="; + + nativeBuildInputs = [ + pkg-config + protobuf + makeWrapper + ]; + + buildInputs = [ + dbus.dev + libnftnl + libmnl + ]; + + # talpid-core wants libwg.a in build/lib/{triple} + preBuild = '' + dest=build/lib/${stdenv.targetPlatform.config} + mkdir -p $dest + ln -s ${libwg}/lib/libwg.a $dest + ''; + + postFixup = + # Place all binaries in the 'mullvad-' namespace, even though these + # specific binaries aren't used in the lifetime of the program. + # `address_cache` is used to generate the `api-ip-address.txt` file, which + # contains list of Mullvad API servers -- though we provide a "backup" of + # the output of this command, it could change at any time, so we want + # users to be able to regenerate the list at any time. (The daemon will + # refuse to start without this file.) + '' + for bin in address_cache relay_list translations-converter; do + mv "$out/bin/$bin" "$out/bin/mullvad-$bin" + done + '' + + # Put distributed assets in-place -- specifically, the + # bootstrap-address-cache is necessary; otherwise, the user will have to run + # the `address_cache` binary and move the contents into place at + # `/var/cache/mullvad-vpn/api-ip-address.txt` manually. + '' + mkdir -p $out/share/mullvad + ln -s ${bootstrap-address-cache} $out/share/mullvad/api-ip-address.txt + '' + + # Files necessary for OpenVPN tunnels to work. + '' + cp dist-assets/ca.crt $out/share/mullvad + ln -s ${openvpn-mullvad}/bin/openvpn $out/share/mullvad + ln -s ${shadowsocks-rust}/bin/sslocal $out/share/mullvad + ln -s $out/lib/libtalpid_openvpn_plugin.so $out/share/mullvad + '' + + # Set the directory where Mullvad will look for its resources by default to + # `$out/share`, so that we can avoid putting the files in `$out/bin` -- + # Mullvad defaults to looking inside the directory its binary is located in + # for its resources. + '' + wrapProgram $out/bin/mullvad-daemon \ + --set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad" + ''; + + passthru = { + inherit libwg; + inherit openvpn-mullvad; + }; + + meta = with lib; { + description = "Mullvad VPN command-line client tools"; + homepage = "https://github.com/mullvad/mullvadvpn-app"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ cole-h ]; + }; +} diff --git a/pkgs/applications/networking/mullvad/openvpn.nix b/pkgs/applications/networking/mullvad/openvpn.nix new file mode 100644 index 000000000000..b191c31d39ac --- /dev/null +++ b/pkgs/applications/networking/mullvad/openvpn.nix @@ -0,0 +1,87 @@ +{ lib +, openvpn +, fetchpatch +, fetchurl +, iproute2 +, autoconf +, automake +}: + +openvpn.overrideAttrs (oldAttrs: + let + fetchMullvadPatch = { commit, sha256 }: fetchpatch { + url = "https://github.com/mullvad/openvpn/commit/${commit}.patch"; + inherit sha256; + }; + in + rec { + pname = "openvpn-mullvad"; + version = "2.5.3"; + + src = fetchurl { + url = "https://swupdate.openvpn.net/community/releases/openvpn-${version}.tar.gz"; + sha256 = "sha256-dfAETfRJQwVVynuZWit3qyTylG/cNmgwG47cI5hqX34="; + }; + + buildInputs = oldAttrs.buildInputs or [ ] ++ [ + iproute2 + ]; + + configureFlags = oldAttrs.configureFlags or [ ] ++ [ + "--enable-iproute2" + "IPROUTE=${iproute2}/sbin/ip" + ]; + + nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [ + autoconf + automake + ]; + + patches = oldAttrs.patches or [ ] ++ [ + # look at compare to find the relevant commits + # https://github.com/OpenVPN/openvpn/compare/release/2.5...mullvad:mullvad-patches + # used openvpn version is the latest tag ending with -mullvad + # https://github.com/mullvad/openvpn/tags + (fetchMullvadPatch { + # "Reduce PUSH_REQUEST_INTERVAL to one second" + commit = "41e44158fc71bb6cc8cc6edb6ada3307765a12e8"; + sha256 = "sha256-UoH0V6gTPdEuybFkWxdaB4zomt7rZeEUyXs9hVPbLb4="; + }) + (fetchMullvadPatch { + # "Allow auth plugins to set a failure reason" + commit = "f51781c601e8c72ae107deaf25bf66f7c193e9cd"; + sha256 = "sha256-+kwG0YElL16T0e+avHlI8gNQdAxneRS6fylv7QXvC1s="; + }) + (fetchMullvadPatch { + # "Send an event to any plugins when authentication fails" + commit = "c2f810f966f2ffd68564d940b5b8946ea6007d5a"; + sha256 = "sha256-PsKIxYwpLD66YaIpntXJM8OGcObyWBSAJsQ60ojvj30="; + }) + (fetchMullvadPatch { + # "Shutdown when STDIN is closed" + commit = "879d6a3c0288b5443bbe1b94261655c329fc2e0e"; + sha256 = "sha256-pRFY4r+b91/xAKXx6u5GLzouQySXuO5gH0kMGm77a3c="; + }) + (fetchMullvadPatch { + # "Update TAP hardware ID" + commit = "7f71b37a3b25bec0b33a0e29780c222aef869e9d"; + sha256 = "sha256-RF/GvD/ZvhLdt34wDdUT/yxa+IVWx0eY6WRdNWXxXeQ="; + }) + (fetchMullvadPatch { + # "Undo dependency on Python docutils" + commit = "abd3c6214529d9f4143cc92dd874d8743abea17c"; + sha256 = "sha256-SC2RlpWHUDMAEKap1t60dC4hmalk3vok6xY+/xhC2U0="; + }) + (fetchMullvadPatch { + # "Prevent signal when stdin is closed from being cleared (#10)" + commit = "b45b090c81e7b4f2dc938642af7a1e12f699f5c5"; + sha256 = "sha256-KPTFmbuJhMI+AvaRuu30CPPLQAXiE/VApxlUCqbZFls="; + }) + ]; + + meta = oldAttrs.meta or { } // { + description = "OpenVPN with Mullvad-specific patches applied"; + homepage = "https://github.com/mullvad/openvpn"; + maintainers = with lib; [ maintainers.cole-h ]; + }; + }) diff --git a/pkgs/tools/bluetooth/blueberry/gnome-bluetooth.nix b/pkgs/desktops/gnome/core/gnome-bluetooth/1.0/default.nix similarity index 92% rename from pkgs/tools/bluetooth/blueberry/gnome-bluetooth.nix rename to pkgs/desktops/gnome/core/gnome-bluetooth/1.0/default.nix index cf0028cf833d..38bb96980dca 100644 --- a/pkgs/tools/bluetooth/blueberry/gnome-bluetooth.nix +++ b/pkgs/desktops/gnome/core/gnome-bluetooth/1.0/default.nix @@ -1,5 +1,5 @@ -{ lib -, stdenv +{ stdenv +, lib , fetchurl , fetchpatch , gnome @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "1a9ynlwwkb3wpg293ym517vmrkk63y809mmcv9a21k5yr199x53c"; + sha256 = "bJSeUsi+zCBU2qzWBJAfZs5c9wml+pHEu3ysyTm1Pqk="; }; patches = [ @@ -82,7 +82,8 @@ stdenv.mkDerivation rec { passthru = { updateScript = gnome.updateScript { packageName = pname; - attrPath = "gnome.${pname}"; + attrPath = "gnome.gnome-bluetooth_1_0"; + freeze = true; }; }; diff --git a/pkgs/desktops/gnome/default.nix b/pkgs/desktops/gnome/default.nix index 729a6bd16ca8..1fc15fc6406f 100644 --- a/pkgs/desktops/gnome/default.nix +++ b/pkgs/desktops/gnome/default.nix @@ -48,6 +48,8 @@ lib.makeScope pkgs.newScope (self: with self; { gnome-bluetooth = callPackage ./core/gnome-bluetooth { }; + gnome-bluetooth_1_0 = callPackage ./core/gnome-bluetooth/1.0 { }; + gnome-color-manager = callPackage ./core/gnome-color-manager { }; gnome-contacts = callPackage ./core/gnome-contacts { }; diff --git a/pkgs/desktops/gnome/misc/gnome-flashback/default.nix b/pkgs/desktops/gnome/misc/gnome-flashback/default.nix index 34d2b6eea3c2..4401915d40ba 100644 --- a/pkgs/desktops/gnome/misc/gnome-flashback/default.nix +++ b/pkgs/desktops/gnome/misc/gnome-flashback/default.nix @@ -1,9 +1,10 @@ -{ lib, stdenv +{ stdenv +, lib , autoreconfHook , fetchurl , gettext , glib -, gnome-bluetooth +, gnome-bluetooth_1_0 , gnome-desktop , gnome-panel , gnome-session @@ -94,7 +95,7 @@ let buildInputs = [ glib - gnome-bluetooth + gnome-bluetooth_1_0 gnome-desktop gsettings-desktop-schemas gtk3 diff --git a/pkgs/desktops/gnome/misc/gnome-panel/default.nix b/pkgs/desktops/gnome/misc/gnome-panel/default.nix index 139e161352a1..0b107f23d78d 100644 --- a/pkgs/desktops/gnome/misc/gnome-panel/default.nix +++ b/pkgs/desktops/gnome/misc/gnome-panel/default.nix @@ -1,9 +1,12 @@ -{ lib, stdenv +{ stdenv +, lib , fetchurl +, fetchpatch , autoreconfHook , dconf , evolution-data-server , gdm +, geocode-glib , gettext , glib , gnome-desktop @@ -37,6 +40,13 @@ stdenv.mkDerivation rec { # instead of gnome-panel’s libdir so that the NixOS module can make gnome-panel # load modules from other packages as well. ./modulesdir-env-var.patch + + # Add missing geocode-glib-1.0 dependency + # https://gitlab.gnome.org/GNOME/gnome-panel/-/merge_requests/49 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gnome-panel/-/commit/f58a43ec4649a25f1a762b36e1401b81cd2b214b.patch"; + sha256 = "sha256-DFqaNUjkLh4xd81qgQpl+568eUZeWyF8LxdZoTgMfCQ="; + }) ]; # make .desktop Exec absolute @@ -69,6 +79,7 @@ stdenv.mkDerivation rec { dconf evolution-data-server gdm + geocode-glib glib gnome-desktop gnome-menus diff --git a/pkgs/desktops/pantheon/apps/elementary-dock/default.nix b/pkgs/desktops/pantheon/apps/elementary-dock/default.nix index 5aa61062a8f6..d9cd7f184943 100644 --- a/pkgs/desktops/pantheon/apps/elementary-dock/default.nix +++ b/pkgs/desktops/pantheon/apps/elementary-dock/default.nix @@ -68,6 +68,14 @@ stdenv.mkDerivation rec { pango ]; + postInstall = '' + # elementary/dock/master is missing a Meson post + # install script that does this. This has been + # resolved after the dock rewrite (the `main` branch). + # https://github.com/elementary/default-settings/issues/267 + glib-compile-schemas $out/share/glib-2.0/schemas + ''; + meta = with lib; { description = "Elegant, simple, clean dock"; homepage = "https://github.com/elementary/dock"; diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index a3d5f873cbcb..7f28109ad101 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -108,7 +108,7 @@ lib.makeScope pkgs.newScope (self: with self; { gala = callPackage ./desktop/gala { }; gnome-bluetooth-contract = callPackage ./desktop/gnome-bluetooth-contract { - inherit (gnome) gnome-bluetooth; + inherit (gnome) gnome-bluetooth_1_0; }; wingpanel = callPackage ./desktop/wingpanel { }; diff --git a/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix b/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix index 190514392098..6df583c2ce6a 100644 --- a/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix +++ b/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , unstableGitUpdater , substituteAll -, gnome-bluetooth +, gnome-bluetooth_1_0 }: stdenv.mkDerivation rec { @@ -20,7 +20,9 @@ stdenv.mkDerivation rec { patches = [ (substituteAll { src = ./exec-path.patch; - gnome_bluetooth = gnome-bluetooth; + # sendto device selection is removed in gnome-bluetooth 42 + # https://github.com/elementary/gnome-bluetooth-contract/issues/1 + gnome_bluetooth = gnome-bluetooth_1_0; }) ]; @@ -49,8 +51,5 @@ stdenv.mkDerivation rec { license = licenses.gpl3Plus; maintainers = teams.pantheon.members; platforms = platforms.linux; - # sendto device selection is removed in gnome-bluetooth 42 - # https://github.com/elementary/gnome-bluetooth-contract/issues/1 - broken = true; }; } diff --git a/pkgs/development/python-modules/aioairzone/default.nix b/pkgs/development/python-modules/aioairzone/default.nix index cda625d49533..5983c46b3ab8 100644 --- a/pkgs/development/python-modules/aioairzone/default.nix +++ b/pkgs/development/python-modules/aioairzone/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "aioairzone"; - version = "0.2.1"; + version = "0.3.1"; format = "setuptools"; disabled = pythonOlder "3.8"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "Noltari"; repo = pname; rev = version; - hash = "sha256-R5OK/B7fq15lpt8nKECiHMmfK9xmiLPtoKC65C7H/7c="; + hash = "sha256-iu0pX12GmP5u6G8uY+6FODj732dD6JPxkrpWXw41/6Q="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/ansible-later/default.nix b/pkgs/development/python-modules/ansible-later/default.nix index 9ed54dee25e8..43f24bfbf0a4 100644 --- a/pkgs/development/python-modules/ansible-later/default.nix +++ b/pkgs/development/python-modules/ansible-later/default.nix @@ -21,7 +21,7 @@ buildPythonPackage rec { pname = "ansible-later"; - version = "2.0.8"; + version = "2.0.9"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -30,7 +30,7 @@ buildPythonPackage rec { owner = "thegeeklab"; repo = pname; rev = "v${version}"; - hash = "sha256-oPlm9uxyN3hyf4gFv37YWEn/HOkg0QQ1Ya3tjLd53rQ="; + hash = "sha256-g7/RClQB+6HsDbe/VjjKka97LcwRTKO0OD0RlCG9lWY="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/fastcore/default.nix b/pkgs/development/python-modules/fastcore/default.nix index 2e43ab9a15d2..b7fc364958dd 100644 --- a/pkgs/development/python-modules/fastcore/default.nix +++ b/pkgs/development/python-modules/fastcore/default.nix @@ -8,7 +8,7 @@ buildPythonPackage rec { pname = "fastcore"; - version = "1.4.0"; + version = "1.4.1"; format = "setuptools"; disabled = pythonOlder "3.8"; @@ -17,7 +17,7 @@ buildPythonPackage rec { owner = "fastai"; repo = pname; rev = version; - sha256 = "sha256-U7tZkqfBbl5IVZlC2/JBIx7Bm5iIiXTMSm0QHmzNiys="; + sha256 = "sha256-qZsCsMwZxJsnznQ/C1SUPexkquv0tIyCkNYL5f2k0FU="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/glean-parser/default.nix b/pkgs/development/python-modules/glean-parser/default.nix index 953e3faa67bb..afcdd3d66b97 100644 --- a/pkgs/development/python-modules/glean-parser/default.nix +++ b/pkgs/development/python-modules/glean-parser/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "glean-parser"; - version = "5.1.0"; + version = "5.1.1"; format = "setuptools"; disabled = pythonOlder "3.6"; @@ -23,7 +23,7 @@ buildPythonPackage rec { src = fetchPypi { pname = "glean_parser"; inherit version; - hash = "sha256-8oMbaGsW5Lkw9OluNsXXe2IBNbjeoIb9vDjVOt+uHR0="; + hash = "sha256-zUiF0buHBe0BaaeIRJcRoT/g+NhWv6XTuhCZ6WPrris="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/hahomematic/default.nix b/pkgs/development/python-modules/hahomematic/default.nix index 7d1a3d8425fe..b70c80819754 100644 --- a/pkgs/development/python-modules/hahomematic/default.nix +++ b/pkgs/development/python-modules/hahomematic/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "hahomematic"; - version = "1.0.3"; + version = "1.0.4"; format = "setuptools"; disabled = pythonOlder "3.9"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "danielperna84"; repo = pname; rev = version; - sha256 = "sha256-WteSLhO/Ei+467tXT7Y1S6bYNNFUILbP5Pm4ZhBYaeg="; + sha256 = "sha256-YpsZKhuK3IzUZFNmBToBOuUacaDgbMC/N7pZDjuSzbE="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/meilisearch/default.nix b/pkgs/development/python-modules/meilisearch/default.nix index 9671c43df081..73f1c75a5192 100644 --- a/pkgs/development/python-modules/meilisearch/default.nix +++ b/pkgs/development/python-modules/meilisearch/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "meilisearch"; - version = "0.18.1"; + version = "0.18.2"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "meilisearch"; repo = "meilisearch-python"; rev = "v${version}"; - hash = "sha256-Rd2GmomNzW0+oI2QEGcPY4g8H+4FN7eLKY1ljcibsLw="; + hash = "sha256-U9fdMcxPdtLiUStgTez99SPRh93WLZNVn8uIj4lNWh4="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/mypy-boto3-builder/default.nix b/pkgs/development/python-modules/mypy-boto3-builder/default.nix index a9e4a3eed5cd..e46d8eab2bce 100644 --- a/pkgs/development/python-modules/mypy-boto3-builder/default.nix +++ b/pkgs/development/python-modules/mypy-boto3-builder/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { pname = "mypy-boto3-builder"; - version = "7.5.4"; + version = "7.5.5"; format = "pyproject"; disabled = pythonOlder "3.10"; @@ -25,7 +25,7 @@ buildPythonPackage rec { owner = "vemel"; repo = "mypy_boto3_builder"; rev = version; - hash = "sha256-NS8lFetL/8hcvCnIHw+GDtdEKFsN81MPybEA4PGaP/Q="; + hash = "sha256-rv0c0QoXOd7aSOLhGDGfq4v0bnGBOJhGhZVNhS5hgOs="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/pontos/default.nix b/pkgs/development/python-modules/pontos/default.nix index d36c5d7e7ae3..0ea1be9c21f0 100644 --- a/pkgs/development/python-modules/pontos/default.nix +++ b/pkgs/development/python-modules/pontos/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { pname = "pontos"; - version = "22.2.4"; + version = "22.4.0"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -22,7 +22,7 @@ buildPythonPackage rec { owner = "greenbone"; repo = pname; rev = "v${version}"; - hash = "sha256-RmMlwnAJlCTDnTyim0MdAeW3NA8r2IiqrE0YeWgxUk4="; + hash = "sha256-W+l5QIpum1uTsx/mxZGkRoJAZaC1viURVYg4Kvjv32Y="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/pynetgear/default.nix b/pkgs/development/python-modules/pynetgear/default.nix index e1d87cdcae33..2030507e07f3 100644 --- a/pkgs/development/python-modules/pynetgear/default.nix +++ b/pkgs/development/python-modules/pynetgear/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "pynetgear"; - version = "0.9.1"; + version = "0.9.2"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "MatMaul"; repo = pname; rev = version; - sha256 = "sha256-sLGr8I0LcLPrmQZ6dI+hwRAiNCrnLtr2WU04rPoG4x4="; + sha256 = "sha256-/aPyx+jNOCW6bzeYAEBP1yfIJfQwJjo1i6WaRvAz0oU="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/tools/buildah/default.nix b/pkgs/development/tools/buildah/default.nix index ea6f866a48b1..1855ed966d51 100644 --- a/pkgs/development/tools/buildah/default.nix +++ b/pkgs/development/tools/buildah/default.nix @@ -14,13 +14,13 @@ buildGoModule rec { pname = "buildah"; - version = "1.24.2"; + version = "1.25.1"; src = fetchFromGitHub { owner = "containers"; repo = "buildah"; rev = "v${version}"; - sha256 = "sha256-gBO+H26YGmOtP3CUHZjynAaOb0h+MJbJnWqxOZdif6w="; + sha256 = "sha256-NQ+Tv3KUrvX+MWM1ZFmsJ4JKoSIpSBjGNiruJkRd6rE="; }; outputs = [ "out" "man" ]; diff --git a/pkgs/development/tools/electron/generic.nix b/pkgs/development/tools/electron/generic.nix index 08edf8a30927..7fefe186c108 100644 --- a/pkgs/development/tools/electron/generic.nix +++ b/pkgs/development/tools/electron/generic.nix @@ -29,7 +29,7 @@ let maintainers = with maintainers; [ travisbhartwell manveru prusnak ]; platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ] ++ optionals (versionAtLeast version "11.0.0") [ "aarch64-darwin" ]; - knownVulnerabilities = optional (versionOlder version "14.0.0") "Electron version ${version} is EOL"; + knownVulnerabilities = optional (versionOlder version "15.0.0") "Electron version ${version} is EOL"; }; fetcher = vers: tag: hash: fetchurl { diff --git a/pkgs/development/tools/misc/clojure-lsp/default.nix b/pkgs/development/tools/misc/clojure-lsp/default.nix index 4d39387991b1..307bcd273a40 100644 --- a/pkgs/development/tools/misc/clojure-lsp/default.nix +++ b/pkgs/development/tools/misc/clojure-lsp/default.nix @@ -2,18 +2,18 @@ buildGraalvmNativeImage rec { pname = "clojure-lsp"; - version = "2022.03.26-18.47.08"; + version = "2022.03.31-20.00.20"; src = fetchFromGitHub { owner = pname; repo = pname; rev = version; - sha256 = "sha256-tlI4h9/DTc3JwqCM58YC5x4FDpuPm7Qeik3PJe64nVA="; + sha256 = "sha256-UQA/BXf6hTTxZ504e1faPdS8mKYS8WrY5L/zgaGCxpU="; }; jar = fetchurl { url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp-standalone.jar"; - sha256 = "4973f5cf45f0b8120206d057d88d6a7fca03e071c8ad1ecd7229db46a0604ed2"; + sha256 = "e66689326c39ae74f0e8d9f5a8229c7ebebe010849870a47faf88e81cbaa37e0"; }; extraNativeImageBuildArgs = [ diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/default.nix b/pkgs/development/tools/poetry2nix/poetry2nix/default.nix index c9b70c83bfee..6489a23c37d8 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/default.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/default.nix @@ -5,17 +5,10 @@ }: let # Poetry2nix version - version = "1.26.0"; + version = "1.27.1"; inherit (poetryLib) isCompatible readTOML moduleName; - /* The default list of poetry2nix override overlays */ - mkEvalPep508 = import ./pep508.nix { - inherit lib poetryLib; - stdenv = pkgs.stdenv; - }; - getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn; - # Map SPDX identifiers to license names spdxLicenses = lib.listToAttrs (lib.filter (pair: pair.name != null) (builtins.map (v: { name = if lib.hasAttr "spdxId" v then v.spdxId else null; value = v; }) (lib.attrValues lib.licenses))); # Get license by id falling back to input string @@ -121,10 +114,16 @@ lib.makeScope pkgs.newScope (self: { , preferWheels ? false # Example: { my-app = ./src; } , editablePackageSources ? { } - , __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping , pyProject ? readTOML pyproject }@attrs: let + /* The default list of poetry2nix override overlays */ + mkEvalPep508 = import ./pep508.nix { + inherit lib poetryLib; + inherit (python) stdenv; + }; + getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn; + poetryPkg = poetry.override { inherit python; }; scripts = pyProject.tool.poetry.scripts or { }; @@ -180,7 +179,6 @@ lib.makeScope pkgs.newScope (self: { value = self.mkPoetryDep ( pkgMeta // { inherit pwd preferWheels; - inherit __isBootstrap; source = pkgMeta.source or null; files = lockFiles.${name}; pythonPackages = self; @@ -207,12 +205,12 @@ lib.makeScope pkgs.newScope (self: { in { mkPoetryDep = self.callPackage ./mk-poetry-dep.nix { - inherit pkgs lib python poetryLib evalPep508; + inherit lib python poetryLib evalPep508; }; - # Use poetry-core from the poetry build (pep517/518 build-system) - poetry-core = if __isBootstrap then null else poetryPkg.passthru.python.pkgs.poetry-core; - poetry = if __isBootstrap then null else poetryPkg; + # # Use poetry-core from the poetry build (pep517/518 build-system) + poetry-core = poetryPkg.passthru.python.pkgs.poetry-core; + poetry = poetryPkg; __toPluginAble = toPluginAble self; @@ -222,10 +220,21 @@ lib.makeScope pkgs.newScope (self: { setuptools-scm = super.setuptools_scm; } ) + + # Fix infinite recursion in a lot of packages because of checkInputs + (self: super: lib.mapAttrs + (name: value: ( + if lib.isDerivation value && lib.hasAttr "overridePythonAttrs" value + then value.overridePythonAttrs (_: { doCheck = false; }) + else value + )) + super) + # Null out any filtered packages, we don't want python.pkgs from nixpkgs (self: super: builtins.listToAttrs (builtins.map (x: { name = moduleName x.name; value = null; }) incompatible)) # Create poetry2nix layer baseOverlay + ] ++ # User provided overrides (if builtins.typeOf overrides == "list" then overrides else [ overrides ]) ); @@ -318,12 +327,11 @@ lib.makeScope pkgs.newScope (self: { , python ? pkgs.python3 , pwd ? projectDir , preferWheels ? false - , __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping , ... }@attrs: let poetryPython = self.mkPoetryPackages { - inherit pyproject poetrylock overrides python pwd preferWheels __isBootstrap; + inherit pyproject poetrylock overrides python pwd preferWheels; }; py = poetryPython.python; @@ -429,7 +437,7 @@ lib.makeScope pkgs.newScope (self: { Can be overriden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function */ - defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides.nix { inherit pkgs lib; }); + defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides { inherit pkgs lib; }); /* Convenience functions for specifying overlays with or without the poerty2nix default overrides diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/hooks/default.nix b/pkgs/development/tools/poetry2nix/poetry2nix/hooks/default.nix index 0abbe2459927..5d562017b8fb 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/hooks/default.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/hooks/default.nix @@ -67,6 +67,13 @@ in { name = "fixup-hook.sh"; deps = [ ]; + substitutions = { + inherit pythonSitePackages; + filenames = builtins.concatStringsSep " " [ + "pyproject.toml" + "README.md" + ]; + }; } ./fixup-hook.sh ) { }; diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/hooks/fixup-hook.sh b/pkgs/development/tools/poetry2nix/poetry2nix/hooks/fixup-hook.sh index fc539e4298c6..8cbe2b178c7a 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/hooks/fixup-hook.sh +++ b/pkgs/development/tools/poetry2nix/poetry2nix/hooks/fixup-hook.sh @@ -1,8 +1,20 @@ poetry2nix-fixup-hook() { + # Including tests in the output is a common mistake if [ -z "${dontFixupTests-}" ]; then - rm -rf $out/lib/python3.7/site-packages/tests + rm -rf $out/@pythonSitePackages@/tests fi + + # Including files in site-packages is a common packaging mistake + # + # While we cannot remove all normal files dumped in site-packages + # we can clean up some common mistakes + if [ -z "${dontFixupSitePackages-}" ]; then + for f in @filenames@; do + rm -f $out/@pythonSitePackages@/$f + done + fi + } postFixupHooks+=(poetry2nix-fixup-hook) diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/hooks/pip-build-hook.sh b/pkgs/development/tools/poetry2nix/poetry2nix/hooks/pip-build-hook.sh index a3ebe311d591..31e06909b3b6 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/hooks/pip-build-hook.sh +++ b/pkgs/development/tools/poetry2nix/poetry2nix/hooks/pip-build-hook.sh @@ -5,14 +5,6 @@ pipBuildPhase() { echo "Executing pipBuildPhase" runHook preBuild - # Prefer using setup.py to avoid build-system dependencies if we have a setup.py - if [ -z "${dontPreferSetupPy-}" ]; then - if test -e setup.py && test -e pyproject.toml; then - echo "Removing pyproject.toml..." - rm -f pyproject.toml - fi - fi - mkdir -p dist echo "Creating a wheel..." @pythonInterpreter@ -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist . diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix index 8e9dee865a54..a905d302d2a9 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix @@ -79,6 +79,7 @@ let if lib.strings.hasInfix "manylinux1" f then { pkg = [ ml.manylinux1 ]; str = "1"; } else if lib.strings.hasInfix "manylinux2010" f then { pkg = [ ml.manylinux2010 ]; str = "2010"; } else if lib.strings.hasInfix "manylinux2014" f then { pkg = [ ml.manylinux2014 ]; str = "2014"; } + else if lib.strings.hasInfix "manylinux_" f then { pkg = [ ml.manylinux2014 ]; str = "pep600"; } else { pkg = [ ]; str = null; }; # Predict URL from the PyPI index. @@ -110,8 +111,8 @@ let (pkgs.stdenvNoCC.mkDerivation { name = file; nativeBuildInputs = [ - pkgs.curl - pkgs.jq + pkgs.buildPackages.curl + pkgs.buildPackages.jq ]; isWheel = lib.strings.hasSuffix "whl" file; system = "builtin"; @@ -219,7 +220,8 @@ let }; # Machine tag for our target platform (if available) - targetMachine = manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null; + getTargetMachine = stdenv: manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null; + in { inherit @@ -233,6 +235,6 @@ in cleanPythonSources moduleName getPythonVersion - targetMachine + getTargetMachine ; } diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix b/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix index 5735e320c03f..a5c19f873616 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix @@ -1,5 +1,4 @@ { autoPatchelfHook -, pkgs , lib , python , buildPythonPackage @@ -17,7 +16,6 @@ , sourceSpec , supportedExtensions ? lib.importJSON ./extensions.json , preferWheels ? false -, __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping , ... }: @@ -27,12 +25,11 @@ pythonPackages.callPackage , ... }@args: let - inherit (pkgs) stdenv; + inherit (python) stdenv; inherit (poetryLib) isCompatible getManyLinuxDeps fetchFromLegacy fetchFromPypi moduleName; inherit (import ./pep425.nix { - inherit lib poetryLib python; - inherit (pkgs) stdenv; + inherit lib poetryLib python stdenv; }) selectWheel ; fileCandidates = @@ -97,6 +94,7 @@ pythonPackages.callPackage "setuptools-scm" "toml" # Toml is an extra for setuptools-scm "tomli" # tomli is an extra for later versions of setuptools-scm + "flit-core" "packaging" "six" "pyparsing" @@ -129,7 +127,6 @@ pythonPackages.callPackage ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pythonPackages.setuptools ++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg ++ lib.optional isDirectory buildSystemPkgs - ++ lib.optional (!__isBootstrap) pythonPackages.poetry ); propagatedBuildInputs = @@ -169,11 +166,18 @@ pythonPackages.callPackage src = if isGit then ( - builtins.fetchGit { + builtins.fetchGit ({ inherit (source) url; rev = source.resolved_reference or source.reference; - ref = sourceSpec.branch or sourceSpec.rev or (if sourceSpec?tag then "refs/tags/${sourceSpec.tag}" else "HEAD"); - } + ref = sourceSpec.branch or (if sourceSpec ? tag then "refs/tags/${sourceSpec.tag}" else "HEAD"); + } // ( + let + nixVersion = builtins.substring 0 3 builtins.nixVersion; + in + lib.optionalAttrs ((sourceSpec ? rev) && (lib.versionAtLeast nixVersion "2.4")) { + allRefs = true; + } + )) ) else if isUrl then builtins.fetchTarball diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix deleted file mode 100644 index 6e35069a817c..000000000000 --- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix +++ /dev/null @@ -1,2271 +0,0 @@ -{ pkgs ? import { } -, lib ? pkgs.lib -, stdenv ? pkgs.stdenv -}: - -self: super: - -{ - automat = super.automat.overridePythonAttrs ( - old: rec { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.m2r ]; - } - ); - - aiohttp-swagger3 = super.aiohttp-swagger3.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - ansible = super.ansible.overridePythonAttrs ( - old: { - # Inputs copied from nixpkgs as ansible doesn't specify it's dependencies - # in a correct manner. - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - self.pycrypto - self.paramiko - self.jinja2 - self.pyyaml - self.httplib2 - self.six - self.netaddr - self.dnspython - self.jmespath - self.dopy - self.ncclient - ]; - } // lib.optionalAttrs (lib.versionOlder old.version "5.0") { - prePatch = pkgs.python.pkgs.ansible.prePatch or ""; - postInstall = pkgs.python.pkgs.ansible.postInstall or ""; - } - ); - - ansible-lint = super.ansible-lint.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; - preBuild = '' - export HOME=$(mktemp -d) - ''; - } - ); - - anyio = super.anyio.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py --replace 'setup()' 'setup(version="${old.version}")' - ''; - }); - - argcomplete = super.argcomplete.overridePythonAttrs ( - old: rec { - buildInputs = (old.buildInputs or [ ]) ++ [ self.importlib-metadata ]; - } - ); - - arpeggio = super.arpeggio.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - astroid = super.astroid.overridePythonAttrs ( - old: rec { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - av = super.av.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - pkgs.pkg-config - ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.ffmpeg_4 ]; - } - ); - - argon2-cffi = super.argon2-cffi.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ - lib.optional (lib.versionAtLeast old.version "21.2.0") [ self.flit-core ]; - } - ); - - backports-entry-points-selectable = super.backports-entry-points-selectable.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py --replace \ - 'setuptools.setup()' \ - 'setuptools.setup(version="${old.version}")' - ''; - }); - - backports-functools-lru-cache = super.backports-functools-lru-cache.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py --replace \ - 'setuptools.setup()' \ - 'setuptools.setup(version="${old.version}")' - ''; - }); - - bcrypt = super.bcrypt.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libffi ]; - } - ); - - bjoern = super.bjoern.overridePythonAttrs ( - old: { - buildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.libev ]; - } - ); - - black = super.black.overridePythonAttrs ( - old: { - dontPreferSetupPy = true; - } - ); - - borgbackup = super.borgbackup.overridePythonAttrs ( - old: { - BORG_OPENSSL_PREFIX = pkgs.openssl.dev; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl pkgs.acl ]; - } - ); - - cairocffi = super.cairocffi.overridePythonAttrs ( - old: { - inherit (pkgs.python3.pkgs.cairocffi) patches; - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - cairosvg = super.cairosvg.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - celery = super.celery.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; - }); - - cssselect2 = super.cssselect2.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - cffi = - # cffi is bundled with pypy - if self.python.implementation == "pypy" then null else - ( - super.cffi.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libffi ]; - } - ) - ); - - cftime = super.cftime.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.cython - ]; - } - ); - - cheroot = super.cheroot.overridePythonAttrs ( - old: { - dontPreferSetupPy = true; - } - ); - - cloudflare = super.cloudflare.overridePythonAttrs ( - old: { - postPatch = '' - rm -rf examples/* - ''; - } - ); - - colour = super.colour.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.d2to1 ]; - } - ); - - configparser = super.configparser.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.toml - ]; - - postPatch = '' - substituteInPlace setup.py --replace 'setuptools.setup()' 'setuptools.setup(version="${old.version}")' - ''; - } - ); - - cryptography = super.cryptography.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) - ++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) self.python.pythonForBuild.pkgs.cffi - ++ lib.optional (lib.versionAtLeast old.version "3.5") - (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]); - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ]; - } // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") { - CRYPTOGRAPHY_DONT_BUILD_RUST = "1"; - } // lib.optionalAttrs (lib.versionAtLeast old.version "35") rec { - cargoDeps = - let - getCargoHash = version: - if lib.versionOlder version "36.0.0" then "sha256-tQoQfo+TAoqAea86YFxyj/LNQCiViu5ij/3wj7ZnYLI=" - else if lib.versionOlder version "36.0.1" then "sha256-Y6TuW7AryVgSvZ6G8WNoDIvi+0tvx8ZlEYF5qB0jfNk=" - # This hash could no longer be valid for cryptography versions - # different from 36.0.1 - else "sha256-kozYXkqt1Wpqyo9GYCwN08J+zV92ZWFJY/f+rulxmeQ="; - in - pkgs.rustPlatform.fetchCargoTarball { - src = old.src; - sourceRoot = "${old.pname}-${old.version}/${cargoRoot}"; - name = "${old.pname}-${old.version}"; - sha256 = getCargoHash old.version; - }; - cargoRoot = "src/rust"; - } - ); - - cwcwidth = super.cwcwidth.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) - ++ [ self.cython ]; - }); - - cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; - postPatch = '' - substituteInPlace setup.py --replace 'setuptools>=50.3.2,<51.0.0' 'setuptools' - ''; - }); - - daphne = super.daphne.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py --replace 'setup_requires=["pytest-runner"],' "" - ''; - }); - - datadog-lambda = super.datadog-lambda.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py --replace "setuptools==" "setuptools>=" - ''; - buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ]; - }); - - dbus-python = super.dbus-python.overridePythonAttrs (old: { - outputs = [ "out" "dev" ]; - - postPatch = old.postPatch or "" + '' - substituteInPlace ./configure --replace /usr/bin/file ${pkgs.file}/bin/file - substituteInPlace ./dbus-python.pc.in --replace 'Cflags: -I''${includedir}' 'Cflags: -I''${includedir}/dbus-1.0' - ''; - - configureFlags = (old.configureFlags or [ ]) ++ [ - "PYTHON_VERSION=${lib.versions.major self.python.version}" - ]; - - preConfigure = lib.concatStringsSep "\n" [ - (old.preConfigure or "") - (if (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) then '' - MACOSX_DEPLOYMENT_TARGET=10.16 - '' else "") - ]; - - preBuild = old.preBuild or "" + '' - make distclean - ''; - - nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.pkg-config ]; - buildInputs = old.buildInputs or [ ] ++ [ pkgs.dbus pkgs.dbus-glib ] - # My guess why it's sometimes trying to -lncurses. - # It seems not to retain the dependency anyway. - ++ lib.optional (! self.python ? modules) pkgs.ncurses; - }); - - dcli = super.dcli.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; - }); - - ddtrace = super.ddtrace.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ - (pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.IOKit ]) ++ [ self.cython ]; - }); - - dictdiffer = super.dictdiffer.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; - } - ); - - django = ( - super.django.overridePythonAttrs ( - old: { - propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ]) - ++ [ pkgs.gettext self.pytest-runner ]; - } - ) - ); - - django-bakery = super.django-bakery.overridePythonAttrs ( - old: { - configurePhase = '' - if ! test -e LICENSE; then - touch LICENSE - fi - '' + (old.configurePhase or ""); - } - ); - - django-cors-headers = super.django-cors-headers.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - django-hijack = super.django-hijack.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - django-prometheus = super.django-prometheus.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - django-rosetta = super.django-rosetta.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - django-stubs-ext = super.django-stubs-ext.overridePythonAttrs ( - old: { - prePatch = (old.prePatch or "") + "touch ../LICENSE.txt"; - } - ); - - dlib = super.dlib.overridePythonAttrs ( - old: { - # Parallel building enabled - inherit (pkgs.python.pkgs.dlib) patches; - - enableParallelBuilding = true; - dontUseCmakeConfigure = true; - - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ pkgs.dlib.nativeBuildInputs; - buildInputs = (old.buildInputs or [ ]) ++ 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; - - eth-hash = super.eth-hash.overridePythonAttrs { - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - ''; - }; - - eth-keyfile = super.eth-keyfile.overridePythonAttrs { - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - ''; - }; - - eth-keys = super.eth-keys.overridePythonAttrs { - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - ''; - }; - - # remove eth-hash dependency because eth-hash also depends on eth-utils causing a cycle. - eth-utils = super.eth-utils.overridePythonAttrs (old: { - propagatedBuildInputs = - builtins.filter (i: i.pname != "eth-hash") old.propagatedBuildInputs; - preConfigure = '' - ${old.preConfigure or ""} - sed -i '/eth-hash/d' setup.py - ''; - }); - - faker = super.faker.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - doCheck = false; - } - ); - - fancycompleter = super.fancycompleter.overridePythonAttrs ( - old: { - postPatch = '' - substituteInPlace setup.py \ - --replace 'setup_requires="setupmeta"' 'setup_requires=[]' \ - --replace 'versioning="devcommit"' 'version="${old.version}"' - ''; - } - ); - - fastapi = super.fastapi.overridePythonAttrs ( - old: { - # Note: requires full flit, not just flit-core - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.flit ]; - } - ); - - fastecdsa = super.fastecdsa.overridePythonAttrs (old: { - buildInputs = old.buildInputs ++ [ pkgs.gmp.dev ]; - }); - - fastparquet = super.fastparquet.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - filelock = super.filelock.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py --replace 'setup()' 'setup(version="${old.version}")' - ''; - }); - - fiona = super.fiona.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.gdal_2 ]; - nativeBuildInputs = [ - pkgs.gdal_2 # for gdal-config - ]; - } - ); - - gdal = super.gdal.overridePythonAttrs ( - old: { - preBuild = (old.preBuild or "") + '' - substituteInPlace setup.cfg \ - --replace "../../apps/gdal-config" '${pkgs.gdal}/bin/gdal-config' - ''; - } - ); - - grandalf = super.grandalf.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - doCheck = false; - } - ); - - gitpython = super.gitpython.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.typing-extensions ]; - } - ); - - grpcio = super.grpcio.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.cython pkgs.pkg-config ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.c-ares pkgs.openssl pkgs.zlib ]; - - outputs = [ "out" "dev" ]; - - GRPC_BUILD_WITH_BORING_SSL_ASM = ""; - GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1; - GRPC_PYTHON_BUILD_SYSTEM_ZLIB = 1; - GRPC_PYTHON_BUILD_SYSTEM_CARES = 1; - DISABLE_LIBC_COMPATIBILITY = 1; - }); - - grpcio-tools = super.grpcio-tools.overridePythonAttrs (old: { - outputs = [ "out" "dev" ]; - }); - - h3 = super.h3.overridePythonAttrs ( - old: { - preBuild = (old.preBuild or "") + '' - substituteInPlace h3/h3.py \ - --replace "'{}/{}'.format(_dirname, libh3_path)" '"${pkgs.h3}/lib/libh3${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}"' - ''; - } - ); - - h5py = super.h5py.overridePythonAttrs ( - old: - if old.format != "wheel" then - ( - let - mpi = pkgs.hdf5.mpi; - mpiSupport = pkgs.hdf5.mpiSupport; - in - { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; - buildInputs = - (old.buildInputs or [ ]) - ++ [ pkgs.hdf5 self.pkgconfig self.cython ] - ++ lib.optional mpiSupport mpi - ; - propagatedBuildInputs = - (old.propagatedBuildInputs or [ ]) - ++ lib.optionals mpiSupport [ self.mpi4py self.openssh ] - ; - preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else ""; - HDF5_DIR = "${pkgs.hdf5}"; - HDF5_MPI = if mpiSupport then "ON" else "OFF"; - # avoid strict pinning of numpy - postPatch = '' - substituteInPlace setup.py \ - --replace "numpy ==" "numpy >=" - ''; - pythonImportsCheck = [ "h5py" ]; - } - ) else old - ); - - hid = super.hid.overridePythonAttrs ( - old: { - postPatch = '' - found= - for name in libhidapi-hidraw libhidapi-libusb libhidapi-iohidmanager libhidapi; do - full_path=${pkgs.hidapi.out}/lib/$name${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} - if test -f $full_path; then - found=t - sed -i -e "s|'$name\..*'|'$full_path'|" hid/__init__.py - fi - done - test -n "$found" || { echo "ERROR: No known libraries found in ${pkgs.hidapi.out}/lib, please update/fix this build expression."; exit 1; } - ''; - } - ); - - horovod = super.horovod.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.mpi ]; - } - ); - - httplib2 = super.httplib2.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pyparsing ]; - }); - - icecream = super.icecream.overridePythonAttrs (old: { - # # ERROR: Could not find a version that satisfies the requirement executing>=0.3.1 (from icecream) (from versions: none) - postPatch = '' - substituteInPlace setup.py --replace 'executing>=0.3.1' 'executing' - ''; - }); - - imagecodecs = super.imagecodecs.overridePythonAttrs ( - old: { - patchPhase = '' - substituteInPlace setup.py \ - --replace "/usr/include/openjpeg-2.3" \ - "${pkgs.openjpeg.dev}/include/${pkgs.openjpeg.dev.incDir} - substituteInPlace setup.py \ - --replace "/usr/include/jxrlib" \ - "$out/include/libjxr" - substituteInPlace imagecodecs/_zopfli.c \ - --replace '"zopfli/zopfli.h"' \ - '' - substituteInPlace imagecodecs/_zopfli.c \ - --replace '"zopfli/zlib_container.h"' \ - '' - substituteInPlace imagecodecs/_zopfli.c \ - --replace '"zopfli/gzip_container.h"' \ - '' - ''; - - preBuild = '' - mkdir -p $out/include/libjxr - ln -s ${pkgs.jxrlib}/include/libjxr/**/* $out/include/libjxr - - ''; - - buildInputs = (old.buildInputs or [ ]) ++ [ - # Commented out packages are declared required, but not actually - # needed to build. They are not yet packaged for nixpkgs. - # bitshuffle - pkgs.brotli - # brunsli - pkgs.bzip2 - pkgs.c-blosc - # charls - pkgs.giflib - pkgs.jxrlib - pkgs.lcms - pkgs.libaec - pkgs.libaec - pkgs.libjpeg_turbo - # liblzf - # liblzma - pkgs.libpng - pkgs.libtiff - pkgs.libwebp - pkgs.lz4 - pkgs.openjpeg - pkgs.snappy - # zfp - pkgs.zopfli - pkgs.zstd - pkgs.zlib - ]; - } - ); - - # importlib-metadata has an incomplete dependency specification - importlib-metadata = super.importlib-metadata.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ lib.optional self.python.isPy2 self.pathlib2; - - # disable the removal of pyproject.toml, required because of setuptools_scm - dontPreferSetupPy = true; - - postPatch = old.postPatch or "" + (lib.optionalString ((old.format or "") != "wheel") '' - substituteInPlace setup.py --replace 'setuptools.setup()' 'setuptools.setup(version="${old.version}")' - ''); - } - ); - - importlib-resources = super.importlib-resources.overridePythonAttrs ( - old: { - # disable the removal of pyproject.toml, required because of setuptools_scm - dontPreferSetupPy = true; - } - ); - - intreehooks = super.intreehooks.overridePythonAttrs ( - old: { - doCheck = false; - } - ); - - isort = super.isort.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; - } - ); - - jaraco-functools = super.jaraco-functools.overridePythonAttrs ( - old: { - # required for the extra "toml" dependency in setuptools_scm[toml] - buildInputs = (old.buildInputs or [ ]) ++ [ - self.toml - ]; - # disable the removal of pyproject.toml, required because of setuptools_scm - dontPreferSetupPy = true; - } - ); - - jira = super.jira.overridePythonAttrs ( - old: { - inherit (pkgs.python3Packages.jira) patches; - buildInputs = (old.buildInputs or [ ]) ++ [ - self.pytestrunner - self.cryptography - self.pyjwt - self.setuptools-scm-git-archive - ]; - } - ); - - jq = super.jq.overridePythonAttrs (attrs: { - buildInputs = [ pkgs.jq ]; - patches = [ - (pkgs.fetchpatch { - url = "https://raw.githubusercontent.com/NixOS/nixpkgs/088da8735f6620b60d724aa7db742607ea216087/pkgs/development/python-modules/jq/jq-py-setup.patch"; - sha256 = "sha256-MYvX3S1YGe0QsUtExtOtULvp++AdVrv+Fid4Jh1xewQ="; - }) - ]; - }); - - jsondiff = super.jsondiff.overridePythonAttrs ( - old: { - preBuild = (old.preBuild or "") + '' - substituteInPlace setup.py \ - --replace "'jsondiff=jsondiff.cli:main_deprecated'," "" - ''; - } - ); - - jsonpickle = super.jsonpickle.overridePythonAttrs ( - old: { - dontPreferSetupPy = true; - } - ); - - jsonslicer = super.jsonslicer.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.yajl ]; - }); - - jupyter = super.jupyter.overridePythonAttrs ( - old: rec { - # jupyter is a meta-package. Everything relevant comes from the - # dependencies. It does however have a jupyter.py file that conflicts - # with jupyter-core so this meta solves this conflict. - meta.priority = 100; - } - ); - - jupyterlab-widgets = super.jupyterlab-widgets.overridePythonAttrs ( - old: rec { - buildInputs = (old.buildInputs or [ ]) ++ [ self.jupyter-packaging ]; - } - ); - - kerberos = super.kerberos.overrideAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.libkrb5 ]; - }); - - keyring = super.keyring.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.toml - ]; - postPatch = '' - substituteInPlace setup.py --replace 'setuptools.setup()' 'setuptools.setup(version="${old.version}")' - ''; - } - ); - - kiwisolver = super.kiwisolver.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.cppy - ]; - } - ); - - lap = super.lap.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - self.numpy - ]; - } - ); - - libvirt-python = super.libvirt-python.overridePythonAttrs ({ nativeBuildInputs ? [ ], ... }: { - nativeBuildInputs = nativeBuildInputs ++ [ pkgs.pkg-config ]; - propagatedBuildInputs = [ pkgs.libvirt ]; - }); - - licensecheck = super.licensecheck.overridePythonAttrs (old: { - dontPreferSetupPy = true; - }); - - llvmlite = super.llvmlite.overridePythonAttrs ( - old: - let - llvm = - if lib.versionAtLeast old.version "0.37.0" then - pkgs.llvmPackages_11.llvm - else if (lib.versionOlder old.version "0.37.0" && lib.versionAtLeast old.version "0.34.0") then - pkgs.llvmPackages_10.llvm - else if (lib.versionOlder old.version "0.34.0" && lib.versionAtLeast old.version "0.33.0") then - pkgs.llvmPackages_9.llvm - else if (lib.versionOlder old.version "0.33.0" && lib.versionAtLeast old.version "0.29.0") then - pkgs.llvmPackages_8.llvm - else if (lib.versionOlder old.version "0.28.0" && lib.versionAtLeast old.version "0.27.0") then - pkgs.llvmPackages_7.llvm - else if (lib.versionOlder old.version "0.27.0" && lib.versionAtLeast old.version "0.23.0") then - pkgs.llvmPackages_6.llvm - else if (lib.versionOlder old.version "0.23.0" && lib.versionAtLeast old.version "0.21.0") then - pkgs.llvmPackages_5.llvm - else - pkgs.llvm; # Likely to fail. - in - { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.llvm ]; - - # Disable static linking - # https://github.com/numba/llvmlite/issues/93 - postPatch = '' - substituteInPlace ffi/Makefile.linux --replace "-static-libstdc++" "" - - substituteInPlace llvmlite/tests/test_binding.py --replace "test_linux" "nope" - ''; - - # Set directory containing llvm-config binary - preConfigure = '' - export LLVM_CONFIG=${llvm.dev}/bin/llvm-config - ''; - - __impureHostDeps = lib.optionals pkgs.stdenv.isDarwin [ "/usr/lib/libm.dylib" ]; - - passthru = old.passthru // { llvm = llvm; }; - } - ); - - lockfile = super.lockfile.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pbr ]; - } - ); - - lxml = super.lxml.overridePythonAttrs ( - old: { - nativeBuildInputs = with pkgs; (old.nativeBuildInputs or [ ]) ++ [ pkg-config libxml2.dev libxslt.dev ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ]; - buildInputs = with pkgs; (old.buildInputs or [ ]) ++ [ libxml2 libxslt ]; - } - ); - - markupsafe = super.markupsafe.overridePythonAttrs ( - old: { - src = old.src.override { pname = builtins.replaceStrings [ "markupsafe" ] [ "MarkupSafe" ] old.pname; }; - } - ); - - matplotlib = super.matplotlib.overridePythonAttrs ( - 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; - - inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa; - in - { - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${pkgs.libcxx}/include/c++/v1"; - - XDG_RUNTIME_DIR = "/tmp"; - - buildInputs = (old.buildInputs or [ ]) - ++ lib.optional enableGhostscript pkgs.ghostscript - ++ lib.optional stdenv.isDarwin [ Cocoa ] - ++ [ self.certifi ]; - - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - pkgs.pkg-config - ] ++ lib.optional (lib.versionAtLeast super.matplotlib.version "3.5.0") [ - self.setuptools-scm - self.setuptools-scm-git-archive - ]; - - MPLSETUPCFG = pkgs.writeText "mplsetup.cfg" '' - [libs] - system_freetype = True - system_qhull = True - '' + lib.optionalString stdenv.isDarwin '' - # LTO not working in darwin stdenv, see NixOS/nixpkgs/pull/19312 - enable_lto = false - ''; - - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - pkgs.libpng - pkgs.freetype - pkgs.qhull - ] - ++ lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ] - ++ lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ] - ++ lib.optionals enableQt [ self.pyqt5 ] - ; - - preBuild = '' - cp -r ${pkgs.qhull} . - ''; - - inherit (super.matplotlib) patches; - } - ); - - # Calls Cargo at build time for source builds and is really tricky to package - maturin = super.maturin.override { - preferWheel = true; - }; - - mccabe = super.mccabe.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - doCheck = false; - } - ); - - mip = super.mip.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.autoPatchelfHook ]; - - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.zlib self.cppy ]; - } - ); - - mmdet = super.mmdet.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytorch ]; - } - ); - - molecule = - if lib.versionOlder super.molecule.version "3.0.0" then - (super.molecule.overridePythonAttrs ( - old: { - patches = (old.patches or [ ]) ++ [ - # Fix build with more recent setuptools versions - (pkgs.fetchpatch { - url = "https://github.com/ansible-community/molecule/commit/c9fee498646a702c77b5aecf6497cff324acd056.patch"; - sha256 = "1g1n45izdz0a3c9akgxx14zhdw6c3dkb48j8pq64n82fa6ndl1b7"; - excludes = [ "pyproject.toml" ]; - }) - ]; - buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; - } - )) else - super.molecule.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; - }); - - mongomock = super.mongomock.overridePythonAttrs (oa: { - buildInputs = oa.buildInputs ++ [ self.pbr ]; - }); - - mpi4py = super.mpi4py.overridePythonAttrs ( - old: - let - cfg = pkgs.writeTextFile { - name = "mpi.cfg"; - text = ( - lib.generators.toINI - { } - { - mpi = { - mpicc = "${pkgs.mpi.outPath}/bin/mpicc"; - }; - } - ); - }; - in - { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.mpi ]; - enableParallelBuilding = true; - preBuild = '' - ln -sf ${cfg} mpi.cfg - ''; - } - ); - - multiaddr = super.multiaddr.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - munch = super.munch.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ]; - } - ); - - mypy = super.mypy.overridePythonAttrs ( - old: { - MYPY_USE_MYPYC = - # is64bit: unfortunately the build would exhaust all possible memory on i686-linux. - stdenv.buildPlatform.is64bit - # Derivation fails to build since v0.900 if mypyc is enabled. - && lib.strings.versionOlder old.version "0.900"; - } - ); - - mysqlclient = super.mysqlclient.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.libmysqlclient ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libmysqlclient ]; - } - ); - - netcdf4 = super.netcdf4.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.cython - ]; - - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - pkgs.zlib - pkgs.netcdf - pkgs.hdf5 - pkgs.curl - pkgs.libjpeg - ]; - - # Variables used to configure the build process - USE_NCCONFIG = "0"; - HDF5_DIR = lib.getDev pkgs.hdf5; - NETCDF4_DIR = pkgs.netcdf; - CURL_DIR = pkgs.curl.dev; - JPEG_DIR = pkgs.libjpeg.dev; - } - ); - - numpy = super.numpy.overridePythonAttrs ( - old: - let - blas = old.passthru.args.blas or pkgs.openblasCompat; - blasImplementation = lib.nameFromURL blas.name "-"; - cfg = pkgs.writeTextFile { - name = "site.cfg"; - text = ( - lib.generators.toINI - { } - { - ${blasImplementation} = { - include_dirs = "${blas}/include"; - library_dirs = "${blas}/lib"; - } // lib.optionalAttrs (blasImplementation == "mkl") { - mkl_libs = "mkl_rt"; - lapack_libs = ""; - }; - } - ); - }; - in - { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.gfortran ]; - buildInputs = (old.buildInputs or [ ]) ++ [ blas self.cython ]; - enableParallelBuilding = true; - preBuild = '' - ln -s ${cfg} site.cfg - ''; - passthru = old.passthru // { - blas = blas; - inherit blasImplementation cfg; - }; - } - ); - - opencv-python = super.opencv-python.overridePythonAttrs ( - old: { - nativeBuildInputs = [ pkgs.cmake ] ++ old.nativeBuildInputs; - buildInputs = [ self.scikit-build ] ++ (old.buildInputs or [ ]); - dontUseCmakeConfigure = true; - } - ); - - opencv-contrib-python = super.opencv-contrib-python.overridePythonAttrs ( - old: { - nativeBuildInputs = [ pkgs.cmake ] ++ old.nativeBuildInputs; - buildInputs = [ self.scikit-build ] ++ (old.buildInputs or [ ]); - dontUseCmakeConfigure = true; - } - ); - - openexr = super.openexr.overridePythonAttrs ( - old: rec { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openexr pkgs.ilmbase ]; - NIX_CFLAGS_COMPILE = [ "-I${pkgs.openexr.dev}/include/OpenEXR" "-I${pkgs.ilmbase.dev}/include/OpenEXR" ]; - } - ); - - osqp = super.osqp.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.cmake ]; - dontUseCmakeConfigure = true; - } - ); - - pantalaimon = super.pantalaimon.overridePythonAttrs (old: { - nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.installShellFiles ]; - postInstall = old.postInstall or "" + '' - installManPage docs/man/*.[1-9] - ''; - }); - - paramiko = super.paramiko.overridePythonAttrs (old: { - doCheck = false; # requires networking - }); - - parsel = super.parsel.overridePythonAttrs ( - old: rec { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - pdal = super.pdal.overridePythonAttrs ( - old: { - PDAL_CONFIG = "${pkgs.pdal}/bin/pdal-config"; - } - ); - - peewee = super.peewee.overridePythonAttrs ( - old: - let - withPostgres = old.passthru.withPostgres or false; - withMysql = old.passthru.withMysql or false; - in - { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ]; - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) - ++ lib.optional withPostgres self.psycopg2 - ++ lib.optional withMysql self.mysql-connector; - } - ); - - pillow = super.pillow.overridePythonAttrs ( - old: { - nativeBuildInputs = [ pkgs.pkg-config self.pytest-runner ] ++ (old.nativeBuildInputs or [ ]); - buildInputs = with pkgs; [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ] ++ (old.buildInputs or [ ]); - } - ); - - platformdirs = super.platformdirs.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py --replace 'setup()' 'setup(version="${old.version}")' - ''; - }); - - poetry-core = super.poetry-core.overridePythonAttrs (old: { - # "Vendor" dependencies (for build-system support) - postPatch = '' - echo "import sys" >> poetry/__init__.py - for path in $propagatedBuildInputs; do - echo "sys.path.insert(0, \"$path\")" >> poetry/__init__.py - done - ''; - - # Propagating dependencies leads to issues downstream - # We've already patched poetry to prefer "vendored" dependencies - postFixup = '' - rm $out/nix-support/propagated-build-inputs - ''; - }); - - portend = super.portend.overridePythonAttrs ( - old: { - # required for the extra "toml" dependency in setuptools_scm[toml] - buildInputs = (old.buildInputs or [ ]) ++ [ - self.toml - ]; - # disable the removal of pyproject.toml, required because of setuptools_scm - dontPreferSetupPy = true; - } - ); - - prettytable = super.prettytable.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; - }); - - psycopg2 = super.psycopg2.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) - ++ lib.optional stdenv.isDarwin pkgs.openssl; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ]; - } - ); - - psycopg2-binary = super.psycopg2-binary.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) - ++ lib.optional stdenv.isDarwin pkgs.openssl; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ]; - } - ); - - pyarrow = - if lib.versionAtLeast super.pyarrow.version "0.16.0" then - super.pyarrow.overridePythonAttrs - ( - old: - let - parseMinor = drv: lib.concatStringsSep "." (lib.take 2 (lib.splitVersion drv.version)); - - # Starting with nixpkgs revision f149c7030a7, pyarrow takes "python3" as an argument - # instead of "python". Below we inspect function arguments to maintain compatibilitiy. - _arrow-cpp = pkgs.arrow-cpp.override ( - builtins.intersectAttrs - (lib.functionArgs pkgs.arrow-cpp.override) - { python = self.python; python3 = self.python; } - ); - - ARROW_HOME = _arrow-cpp; - arrowCppVersion = parseMinor _arrow-cpp; - pyArrowVersion = parseMinor super.pyarrow; - errorMessage = "arrow-cpp version (${arrowCppVersion}) mismatches pyarrow version (${pyArrowVersion})"; - in - if arrowCppVersion != pyArrowVersion then throw errorMessage else { - - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.cython - pkgs.pkg-config - pkgs.cmake - ]; - - preBuild = '' - export PYARROW_PARALLEL=$NIX_BUILD_CORES - ''; - - PARQUET_HOME = _arrow-cpp; - inherit ARROW_HOME; - - PYARROW_BUILD_TYPE = "release"; - PYARROW_WITH_FLIGHT = if _arrow-cpp.enableFlight then 1 else 0; - PYARROW_WITH_DATASET = 1; - PYARROW_WITH_PARQUET = 1; - PYARROW_CMAKE_OPTIONS = [ - "-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib" - - # This doesn't use setup hook to call cmake so we need to workaround #54606 - # ourselves - "-DCMAKE_POLICY_DEFAULT_CMP0025=NEW" - ]; - - dontUseCmakeConfigure = true; - } - ) else - super.pyarrow.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.cython - ]; - } - ); - - pycairo = ( - drv: ( - drv.overridePythonAttrs ( - _: { - format = "other"; - } - ) - ).overridePythonAttrs ( - old: { - - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - pkgs.meson - pkgs.ninja - pkgs.pkg-config - ]; - - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - pkgs.cairo - pkgs.xlibsWrapper - ]; - - mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ]; - } - ) - ) - super.pycairo; - - pycocotools = super.pycocotools.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.cython - self.numpy - ]; - } - ); - - pyfuse3 = super.pyfuse3.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.fuse3 ]; - }); - - 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 - ''; - } - ); - - pygeos = super.pygeos.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.geos ]; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.geos ]; - } - ); - - pygobject = super.pygobject.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.glib pkgs.gobject-introspection ]; - } - ); - - pylint = super.pylint.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - pyopenssl = super.pyopenssl.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ]; - } - ); - - pyproj = super.pyproj.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ - [ self.cython ]; - PROJ_DIR = "${pkgs.proj}"; - PROJ_LIBDIR = "${pkgs.proj}/lib"; - PROJ_INCDIR = "${pkgs.proj.dev}/include"; - } - ); - - pyproject-flake8 = super.pyproject-flake8.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ]; - } - ); - - pytaglib = super.pytaglib.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.taglib ]; - }); - - pytezos = super.pytezos.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libsodium ]; - }); - - python-bugzilla = super.python-bugzilla.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.docutils - ]; - } - ); - - python-ldap = super.python-ldap.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openldap pkgs.cyrus_sasl ]; - } - ); - - pytoml = super.pytoml.overridePythonAttrs ( - old: { - doCheck = false; - } - ); - - 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"; - - dontWrapQtApps = true; - - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - pkgs.pkg-config - pkgs.qt5.qmake - pkgs.xorg.lndir - pkgs.qt5.qtbase - pkgs.qt5.qtsvg - pkgs.qt5.qtdeclarative - pkgs.qt5.qtwebchannel - pkgs.qt5.qt3d - # 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 or [ ]) ++ [ - 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 - ''; - - 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 - ''; - - 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; - } - ); - - pytest-datadir = super.pytest-datadir.overridePythonAttrs ( - old: { - postInstall = '' - rm -f $out/LICENSE - ''; - } - ); - - pytest = super.pytest.overridePythonAttrs ( - old: { - # Fixes https://github.com/pytest-dev/pytest/issues/7891 - postPatch = old.postPatch or "" + '' - sed -i '/\[metadata\]/aversion = ${old.version}' setup.cfg - ''; - } - ); - - pytest-django = super.pytest-django.overridePythonAttrs ( - old: { - postPatch = '' - substituteInPlace setup.py --replace "'pytest>=3.6'," "" - substituteInPlace setup.py --replace "'pytest>=3.6'" "" - ''; - } - ); - - pytest-randomly = super.pytest-randomly.overrideAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - self.importlib-metadata - ]; - }); - - pytest-runner = super.pytest-runner or super.pytestrunner; - - pytest-pylint = super.pytest-pylint.overridePythonAttrs ( - old: { - buildInputs = [ self.pytest-runner ]; - } - ); - - # pytest-splinter seems to put a .marker file in an empty directory - # presumably so it's tracked by and can be installed with MANIFEST.in, see - # https://github.com/pytest-dev/pytest-splinter/commit/a48eeef662f66ff9d3772af618748e73211a186b - # - # This directory then gets used as an empty initial profile directory and is - # zipped up. But if the .marker file is in the Nix store, it has the - # creation date of 1970, and Zip doesn't work with such old files, so it - # fails at runtime! - # - # We fix this here by just removing the file after the installation - # - # The error you get without this is: - # - # E ValueError: ZIP does not support timestamps before 1980 - # /nix/store/55b9ip7xkpimaccw9pa0vacy5q94f5xa-python3-3.7.6/lib/python3.7/zipfile.py:357: ValueError - pytest-splinter = super.pytest-splinter.overrideAttrs (old: { - postInstall = old.postInstall or "" + '' - rm $out/${super.python.sitePackages}/pytest_splinter/profiles/firefox/.marker - ''; - }); - - python-jose = super.python-jose.overridePythonAttrs ( - old: { - buildInputs = [ self.pytest-runner ]; - } - ); - - python-olm = super.python-olm.overridePythonAttrs ( - old: { - buildInputs = old.buildInputs or [ ] ++ [ pkgs.olm ]; - } - ); - - python-snappy = super.python-snappy.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.snappy ]; - } - ); - - pythran = super.pythran.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - }); - - ffmpeg-python = super.ffmpeg-python.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - python-prctl = super.python-prctl.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - pkgs.libcap - ]; - } - ); - - pyudev = super.pyudev.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace src/pyudev/_ctypeslib/utils.py \ - --replace "find_library(name)" "'${pkgs.lib.getLib pkgs.systemd}/lib/libudev.so'" - ''; - }); - - pyusb = super.pyusb.overridePythonAttrs ( - old: { - postPatch = '' - libusb=${pkgs.libusb1.out}/lib/libusb-1.0${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} - test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; } - sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py - ''; - } - ); - - pywavelets = super.pywavelets.overridePythonAttrs ( - old: { - HDF5_DIR = "${pkgs.hdf5}"; - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.hdf5 ]; - } - ); - - pyzmq = super.pyzmq.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.zeromq ]; - } - ); - - rockset = super.rockset.overridePythonAttrs ( - old: rec { - postPatch = '' - cp ./setup_rockset.py ./setup.py - ''; - } - ); - - scaleapi = super.scaleapi.overridePythonAttrs ( - old: { - postPatch = '' - substituteInPlace setup.py --replace "install_requires = ['requests>=2.4.2', 'enum34']" "install_requires = ['requests>=2.4.2']" || true - ''; - } - ); - - pandas = super.pandas.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.cython ]; - } - ); - - panel = super.panel.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.nodejs ]; - } - ); - - # 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 - } - ); - - requests-mock = super.requests-mock.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ super.pbr ]; - } - ); - - requests-unixsocket = super.requests-unixsocket.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pbr ]; - } - ); - - requestsexceptions = super.requestsexceptions.overridePythonAttrs (old: { - nativeBuildInputs = old.nativeBuildInputs ++ [ self.pbr ]; - }); - - rlp = super.rlp.overridePythonAttrs { - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - ''; - }; - - - rmfuse = super.rmfuse.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; - }); - - rtree = super.rtree.overridePythonAttrs (old: { - propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ]) ++ [ pkgs.libspatialindex ]; - postPatch = '' - substituteInPlace rtree/finder.py --replace \ - "find_library('spatialindex_c')" \ - "'${pkgs.libspatialindex}/lib/libspatialindex_c${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}'" - ''; - }); - - ruamel-yaml = super.ruamel-yaml.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) - ++ [ self.ruamel-yaml-clib ]; - } - ); - - scipy = super.scipy.overridePythonAttrs ( - old: - if old.format != "wheel" then { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ - [ pkgs.gfortran ] ++ - lib.optional (lib.versionAtLeast super.scipy.version "1.7.0") [ self.cython self.pythran ]; - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ]; - setupPyBuildFlags = [ "--fcompiler='gnu95'" ]; - enableParallelBuilding = true; - buildInputs = (old.buildInputs or [ ]) ++ [ self.numpy.blas ]; - preConfigure = '' - sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py - export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES - ''; - preBuild = '' - ln -s ${self.numpy.cfg} site.cfg - ''; - } else old - ); - - scikit-image = super.scikit-image.overridePythonAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.cython - self.pythran - self.packaging - self.wheel - self.numpy - ]; - } - ); - - scikit-learn = super.scikit-learn.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - pkgs.gfortran - pkgs.glibcLocales - ] ++ lib.optionals stdenv.cc.isClang [ - pkgs.llvmPackages.openmp - ]; - - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.cython - ]; - - enableParallelBuilding = true; - } - ); - - secp256k1 = super.secp256k1.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig pkgs.autoconf pkgs.automake pkgs.libtool ]; - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - doCheck = false; - # Local setuptools versions like "x.y.post0" confuse an internal check - postPatch = '' - substituteInPlace setup.py \ - --replace 'setuptools_version.' '"${self.setuptools.version}".' - ''; - }); - - shapely = super.shapely.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.geos self.cython ]; - inherit (pkgs.python3.pkgs.shapely) patches GEOS_LIBRARY_PATH; - } - ); - - shellcheck-py = super.shellcheck-py.overridePythonAttrs (old: { - - # Make fetching/installing external binaries no-ops - preConfigure = - let - fakeCommand = "type('FakeCommand', (Command,), {'initialize_options': lambda self: None, 'finalize_options': lambda self: None, 'run': lambda self: None})"; - in - '' - substituteInPlace setup.py \ - --replace "'fetch_binaries': fetch_binaries," "'fetch_binaries': ${fakeCommand}," \ - --replace "'install_shellcheck': install_shellcheck," "'install_shellcheck': ${fakeCommand}," - ''; - - propagatedUserEnvPkgs = (old.propagatedUserEnvPkgs or [ ]) ++ [ - pkgs.shellcheck - ]; - - }); - - tables = super.tables.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pywavelets ]; - HDF5_DIR = lib.getDev pkgs.hdf5; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; - propagatedBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.hdf5 self.numpy self.numexpr ]; - } - ); - - tempora = super.tempora.overridePythonAttrs ( - old: { - # required for the extra "toml" dependency in setuptools_scm[toml] - buildInputs = (old.buildInputs or [ ]) ++ [ - self.toml - ]; - # disable the removal of pyproject.toml, required because of setuptools_scm - dontPreferSetupPy = true; - } - ); - - tensorboard = super.tensorboard.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.wheel - self.absl-py - ]; - HDF5_DIR = "${pkgs.hdf5}"; - propagatedBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - pkgs.hdf5 - self.google-auth-oauthlib - self.tensorboard-plugin-wit - self.numpy - self.markdown - self.tensorboard-data-server - self.grpcio - self.protobuf - self.werkzeug - self.absl-py - ]; - } - ); - - tensorflow = super.tensorflow.overridePythonAttrs ( - old: { - postInstall = '' - rm $out/bin/tensorboard - ''; - } - ); - - tensorpack = super.tensorpack.overridePythonAttrs ( - old: { - postPatch = '' - substituteInPlace setup.cfg --replace "# will call find_packages()" "" - ''; - } - ); - - tinycss2 = super.tinycss2.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - # The tokenizers build requires a complex rust setup (cf. nixpkgs override) - # - # Instead of providing a full source build, we use a wheel to keep - # the complexity manageable for now. - tokenizers = super.tokenizers.override { - preferWheel = true; - }; - - torch = lib.makeOverridable - ({ enableCuda ? false - , cudatoolkit ? pkgs.cudatoolkit_10_1 - , pkg ? super.torch - }: pkg.overrideAttrs (old: - { - preConfigure = - if (!enableCuda) then '' - export USE_CUDA=0 - '' else '' - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${cudatoolkit}/targets/x86_64-linux/lib" - ''; - preFixup = lib.optionalString (!enableCuda) '' - # For some reason pytorch retains a reference to libcuda even if it - # is explicitly disabled with USE_CUDA=0. - find $out -name "*.so" -exec ${pkgs.patchelf}/bin/patchelf --remove-needed libcuda.so.1 {} \; - ''; - buildInputs = - (old.buildInputs or [ ]) - ++ [ self.typing-extensions ] - ++ lib.optionals enableCuda [ - pkgs.linuxPackages.nvidia_x11 - pkgs.nccl.dev - pkgs.nccl.out - ]; - propagatedBuildInputs = [ - self.numpy - self.future - self.typing-extensions - ]; - }) - ) - { }; - - torchvision = lib.makeOverridable - ({ enableCuda ? false - , cudatoolkit ? pkgs.cudatoolkit_10_1 - , pkg ? super.torchvision - }: pkg.overrideAttrs (old: { - - # without that autoPatchelfHook will fail because cudatoolkit is not in LD_LIBRARY_PATH - autoPatchelfIgnoreMissingDeps = true; - buildInputs = (old.buildInputs or [ ]) - ++ [ self.torch ] - ++ lib.optionals enableCuda [ - cudatoolkit - ]; - preConfigure = - if (enableCuda) then '' - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib:${lib.makeLibraryPath [ cudatoolkit "${cudatoolkit}" ]}" - '' else '' - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib" - ''; - })) - { }; - - typeguard = super.typeguard.overridePythonAttrs (old: { - postPatch = '' - substituteInPlace setup.py \ - --replace 'setup()' 'setup(version="${old.version}")' - ''; - }); - - typed_ast = super.typed-ast.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.pytest-runner - ]; - }); - - # nix uses a dash, poetry uses an underscore - typing-extensions = (super.typing_extensions or super.typing-extensions).overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ - lib.optional (lib.versionAtLeast old.version "4.0.0") [ self.flit-core ]; - } - ); - - urwidtrees = super.urwidtrees.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - self.urwid - ]; - } - ); - - vose-alias-method = super.vose-alias-method.overridePythonAttrs ( - old: { - postInstall = '' - rm -f $out/LICENSE - ''; - } - ); - - vispy = super.vispy.overrideAttrs ( - old: { - inherit (pkgs.python3.pkgs.vispy) patches; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.cython - self.setuptools-scm-git-archive - ]; - } - ); - - uvloop = super.uvloop.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ 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 - bootstrapped-pip = super.bootstrapped-pip.override { - wheel = (pkgs.python3.pkgs.override { - python = self.python; - }).wheel; - }; - - weasyprint = super.weasyprint.overridePythonAttrs ( - old: { - inherit (pkgs.python3.pkgs.weasyprint) patches; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - web3 = super.web3.overridePythonAttrs { - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - ''; - }; - - weblate-language-data = super.weblate-language-data.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ - self.translate-toolkit - ]; - } - ); - - wheel = - let - isWheel = super.wheel.src.isWheel or false; - # If "wheel" is a pre-built binary wheel - wheelPackage = super.buildPythonPackage { - inherit (super.wheel) pname name version src; - inherit (pkgs.python3.pkgs.wheel) meta; - format = "wheel"; - }; - # If "wheel" is built from source - sourcePackage = (( - pkgs.python3.pkgs.override { - python = self.python; - } - ).wheel.override { - inherit (self) buildPythonPackage bootstrapped-pip setuptools; - }).overrideAttrs (old: { - inherit (super.wheel) pname name version src; - }); - in - if isWheel then wheelPackage else sourcePackage; - - zipp = if super.zipp == null then null else - ( - if lib.versionAtLeast super.zipp.version "2.0.0" then - ( - super.zipp.overridePythonAttrs ( - old: - if (old.format or "pyproject") != "wheel" then { - prePatch = '' - substituteInPlace setup.py --replace \ - 'setuptools.setup()' \ - 'setuptools.setup(version="${super.zipp.version}")' - ''; - } else old - ) - ) else super.zipp - ).overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - self.toml - ]; - } - ); - - credis = super.credis.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.cython ]; - } - ); - - hashids = super.hashids.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ]; - } - ); - - packaging = super.packaging.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ - # From 20.5 until 20.7, packaging used flit for packaging (heh) - # See https://github.com/pypa/packaging/pull/352 and https://github.com/pypa/packaging/pull/367 - lib.optional (lib.versionAtLeast old.version "20.5" && lib.versionOlder old.version "20.8") [ self.flit-core ]; - } - ); - - psutil = super.psutil.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ - lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.IOKit; - } - ); - - sentencepiece = super.sentencepiece.overridePythonAttrs ( - old: { - dontUseCmakeConfigure = true; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - pkgs.pkg-config - pkgs.cmake - pkgs.gperftools - ]; - buildInputs = (old.buildInputs or [ ]) ++ [ - pkgs.sentencepiece - ]; - } - ); - - sentence-transformers = super.sentence-transformers.overridePythonAttrs ( - old: { - buildInputs = - (old.buildInputs or [ ]) - ++ [ self.typing-extensions ]; - } - ); - - supervisor = super.supervisor.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - self.meld3 - self.setuptools - ]; - } - ); - - cytoolz = super.cytoolz.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.toolz ]; - } - ); - - # For some reason the toml dependency of tqdm declared here: - # https://github.com/tqdm/tqdm/blob/67130a23646ae672836b971e1086b6ae4c77d930/pyproject.toml#L2 - # is not translated correctly to a nix dependency. - tqdm = super.tqdm.overrideAttrs ( - old: { - buildInputs = [ super.toml ] ++ (old.buildInputs or [ ]); - } - ); - - watchdog = super.watchdog.overrideAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) - ++ pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreServices; - } - ); - - # pyee cannot find `vcversioner` and other "setup requirements", so it tries to - # download them from the internet, which only works when nix sandboxing is disabled. - # Additionally, since pyee uses vcversioner to specify its version, we need to do this - # manually specify its version. - pyee = super.pyee.overrideAttrs ( - old: { - postPatch = old.postPatch or "" + '' - sed -i setup.py \ - -e '/setup_requires/,/],/d' \ - -e 's/vcversioner={},/version="${old.version}",/' - ''; - } - ); - - # nixpkgs has setuptools_scm 4.1.2 - # but newrelic has a seemingly unnecessary version constraint for <4 - # So we patch that out - newrelic = super.newrelic.overridePythonAttrs ( - old: { - postPatch = old.postPatch or "" + '' - substituteInPlace setup.py --replace '"setuptools_scm>=3.2,<4"' '"setuptools_scm"' - ''; - } - ); - - wxpython = super.wxpython.overridePythonAttrs (old: - let - localPython = self.python.withPackages (ps: with ps; [ - setuptools - numpy - six - ]); - in - { - DOXYGEN = "${pkgs.doxygen}/bin/doxygen"; - - nativeBuildInputs = with pkgs; [ - which - doxygen - gtk3 - pkg-config - autoPatchelfHook - ] ++ (old.nativeBuildInputs or [ ]); - - buildInputs = with pkgs; [ - gtk3 - webkitgtk - ncurses - SDL2 - xorg.libXinerama - xorg.libSM - xorg.libXxf86vm - xorg.libXtst - xorg.xorgproto - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - libGLU - libGL - libglvnd - mesa - ] ++ old.buildInputs; - - buildPhase = '' - ${localPython.interpreter} build.py -v build_wx - ${localPython.interpreter} build.py -v dox etg --nodoc sip - ${localPython.interpreter} build.py -v build_py - ''; - - installPhase = '' - ${localPython.interpreter} setup.py install --skip-build --prefix=$out - ''; - }); - - marisa-trie = super.marisa-trie.overridePythonAttrs ( - old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; - } - ); - - ua-parser = super.ua-parser.overridePythonAttrs ( - old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pyyaml ]; - } - ); - - lazy-object-proxy = super.lazy-object-proxy.overridePythonAttrs ( - old: { - # disable the removal of pyproject.toml, required because of setuptools_scm - dontPreferSetupPy = true; - } - ); - - pendulum = super.pendulum.overridePythonAttrs (old: { - # Technically incorrect, but fixes the build error.. - preInstall = lib.optionalString stdenv.isLinux '' - mv --no-clobber ./dist/*.whl $(echo ./dist/*.whl | sed s/'manylinux_[0-9]*_[0-9]*'/'manylinux1'/) - ''; - }); - - pygraphviz = super.pygraphviz.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.graphviz ]; - }); - - pyjsg = super.pyjsg.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ]; - }); - - pyshex = super.pyshex.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ]; - }); - - pyshexc = super.pyshexc.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ]; - }); - - pysqlite = super.pysqlite.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ]; - }); - - selinux = super.selinux.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; - }); - - shexjsg = super.shexjsg.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ]; - }); - - sparqlslurper = super.sparqlslurper.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ]; - }); - - tomli = super.tomli.overridePythonAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.flit-core ]; - }); - - uwsgi = super.uwsgi.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.ncurses ]; - sourceRoot = "."; - }); - - wcwidth = super.wcwidth.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ - lib.optional self.isPy27 (self.backports-functools-lru-cache or self.backports_functools_lru_cache) - ; - }); - - wtforms = super.wtforms.overridePythonAttrs (old: { - buildInputs = (old.buildInputs or [ ]) ++ [ self.Babel ]; - }); -} diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides/build-systems.json b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/build-systems.json new file mode 100644 index 000000000000..e3c74473b8cc --- /dev/null +++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/build-systems.json @@ -0,0 +1,1557 @@ +{ + "HTSeq": [ + "cython" + ], + "PyStemmer": [ + "cython" + ], + "adguardhome": [ + "poetry-core" + ], + "aesara": [ + "cython" + ], + "aioambient": [ + "poetry-core" + ], + "aioboto3": [ + "poetry" + ], + "aiocurrencylayer": [ + "poetry-core" + ], + "aioeafm": [ + "poetry" + ], + "aiofiles": [ + "poetry-core" + ], + "aioflo": [ + "poetry-core" + ], + "aioguardian": [ + "poetry-core" + ], + "aiohomekit": [ + "poetry-core" + ], + "aiohttp-remotes": [ + "flitBuildHook" + ], + "aioitertools": [ + "flit-core" + ], + "aiojobs": [ + "flitBuildHook" + ], + "aiokafka": [ + "cython" + ], + "aiomultiprocess": [ + "flit-core" + ], + "aiomusiccast": [ + "poetry-core" + ], + "aionotion": [ + "poetry-core" + ], + "aiopvpc": [ + "poetry-core" + ], + "aiorecollect": [ + "poetry-core" + ], + "aioresponses": [ + "pbr" + ], + "aioridwell": [ + "poetry-core" + ], + "aiorun": [ + "flitBuildHook" + ], + "aiosqlite": [ + "flit-core" + ], + "aiosteamist": [ + "poetry-core" + ], + "aioswitcher": [ + "poetry-core" + ], + "aiowatttime": [ + "poetry-core" + ], + "ambee": [ + "poetry-core" + ], + "amqtt": [ + "poetry-core" + ], + "apache-beam": [ + "cython" + ], + "argon2_cffi": [ + "flitBuildHook" + ], + "aria2p": [ + "poetry" + ], + "astropy": [ + "cython" + ], + "async-dns": [ + "poetry-core" + ], + "asyncmy": [ + "cython", + "poetry-core" + ], + "asyncstdlib": [ + "flitBuildHook" + ], + "atomman": [ + "cython" + ], + "autarco": [ + "poetry-core" + ], + "authcaptureproxy": [ + "poetry-core" + ], + "awesomeversion": [ + "poetry-core" + ], + "aws-error-utils": [ + "poetry" + ], + "backcall": [ + "flit-core" + ], + "backoff": [ + "poetry" + ], + "bandit": [ + "pbr" + ], + "bash_kernel": [ + "flitBuildHook" + ], + "bimmer-connected": [ + "pbr" + ], + "blis": [ + "cython" + ], + "boltztrap2": [ + "cython" + ], + "build": [ + "flit-core" + ], + "bx-python": [ + "cython" + ], + "cartopy": [ + "cython" + ], + "cassandra-driver": [ + "cython" + ], + "cattrs": [ + "poetry-core" + ], + "censys": [ + "poetry-core" + ], + "cftime": [ + "cython" + ], + "chispa": [ + "poetry-core" + ], + "ciscoconfparse": [ + "poetry-core" + ], + "cleo": [ + "poetry-core" + ], + "cliff": [ + "pbr" + ], + "clikit": [ + "poetry-core" + ], + "collections-extended": [ + "poetry-core" + ], + "colorclass": [ + "poetry" + ], + "colorhash": [ + "poetry" + ], + "commitizen": [ + "poetry-core" + ], + "confuse": [ + "flit-core", + "flitBuildHook" + ], + "cpyparsing": [ + "cython" + ], + "crashtest": [ + "poetry-core" + ], + "credis": [ + "cython", + "poetry-core" + ], + "cssselect2": [ + "flit" + ], + "cwcwidth": [ + "cython" + ], + "cyclonedx-python-lib": [ + "poetry-core" + ], + "cymem": [ + "cython" + ], + "cypari2": [ + "cython" + ], + "cysignals": [ + "cython" + ], + "datrie": [ + "cython" + ], + "ddtrace": [ + "cython" + ], + "debtcollector": [ + "pbr" + ], + "deezer-python": [ + "poetry-core" + ], + "diagrams": [ + "poetry-core" + ], + "dipy": [ + "cython" + ], + "discovery30303": [ + "poetry-core" + ], + "django-graphiql-debug-toolbar": [ + "poetry-core" + ], + "django-timezone-field": [ + "poetry-core" + ], + "dnspython": [ + "poetry-core" + ], + "doc8": [ + "pbr" + ], + "dtlssocket": [ + "cython" + ], + "duckdb": [ + "pybind11" + ], + "duckdb-engine": [ + "poetry-core" + ], + "dunamai": [ + "poetry-core" + ], + "dynd": [ + "cython" + ], + "ecs-logging": [ + "flit-core", + "flitBuildHook" + ], + "editdistance": [ + "cython" + ], + "eebrightbox": [ + "pbr" + ], + "eiswarnung": [ + "poetry-core" + ], + "elegy": [ + "poetry" + ], + "elgato": [ + "poetry-core" + ], + "elkm1-lib": [ + "poetry-core" + ], + "elmax": [ + "poetry-core" + ], + "entrypoints": [ + "flit" + ], + "enturclient": [ + "poetry-core" + ], + "enumatch": [ + "poetry" + ], + "fastapi": [ + "flitBuildHook" + ], + "fastapi-restful": [ + "poetry" + ], + "fastavro": [ + "cython" + ], + "fastdtw": [ + "cython" + ], + "fhconfparser": [ + "poetry-core" + ], + "finalfusion": [ + "cython" + ], + "fixtures": [ + "pbr" + ], + "flake8-debugger": [ + "poetry-core" + ], + "flake8-print": [ + "poetry-core" + ], + "flatten-dict": [ + "poetry-core" + ], + "flipr-api": [ + "poetry-core" + ], + "flit": [ + "flit-core" + ], + "formbox": [ + "flitBuildHook" + ], + "fpylll": [ + "cython" + ], + "freebox-api": [ + "poetry-core" + ], + "frozenlist": [ + "cython" + ], + "funcparserlib": [ + "poetry-core" + ], + "furo": [ + "flitBuildHook" + ], + "galario": [ + "cython" + ], + "gaphas": [ + "poetry-core" + ], + "garages-amsterdam": [ + "poetry-core" + ], + "gbinder-python": [ + "cython" + ], + "generic": [ + "poetry-core" + ], + "glances-api": [ + "poetry-core" + ], + "gpy": [ + "cython" + ], + "gpyopt": [ + "cython" + ], + "gradient-utils": [ + "poetry-core" + ], + "graphql-core": [ + "poetry-core" + ], + "graphql-relay": [ + "poetry-core" + ], + "gridnet": [ + "poetry-core" + ], + "grpcio": [ + "cython" + ], + "gsd": [ + "cython" + ], + "gssapi": [ + "cython" + ], + "gudhi": [ + "cython" + ], + "gvm-tools": [ + "poetry-core" + ], + "h3": [ + "cython" + ], + "h5py": [ + "cython" + ], + "h5py-mpi": [ + "cython" + ], + "hacking": [ + "pbr" + ], + "hashids": [ + "flit-core" + ], + "hdate": [ + "poetry-core" + ], + "hdbscan": [ + "cython" + ], + "hdmedians": [ + "cython" + ], + "hidapi": [ + "cython" + ], + "hmmlearn": [ + "cython" + ], + "homeassistant-pyozw": [ + "cython" + ], + "html5lib": [ + "flit-core" + ], + "hypercorn": [ + "poetry-core" + ], + "hyperion-py": [ + "poetry-core" + ], + "hypothesis-auto": [ + "poetry" + ], + "hypothesis-graphql": [ + "poetry" + ], + "ibis-framework": [ + "poetry-core" + ], + "icmplib": [ + "pbr" + ], + "idasen": [ + "poetry-core" + ], + "imagecodecs-lite": [ + "cython" + ], + "immutabledict": [ + "poetry-core" + ], + "inquirer": [ + "poetry-core" + ], + "installer": [ + "flit-core" + ], + "iodata": [ + "cython" + ], + "ipfshttpclient": [ + "flitBuildHook" + ], + "ipwhl": [ + "flitBuildHook" + ], + "isort": [ + "poetry-core" + ], + "jedi-language-server": [ + "poetry" + ], + "jeepney": [ + "flit-core" + ], + "jenkins-job-builder": [ + "pbr" + ], + "jinja2-git": [ + "poetry-core" + ], + "jschema-to-python": [ + "pbr" + ], + "json-schema-for-humans": [ + "poetry-core" + ], + "jupyter-server": [ + "jupyter-packaging" + ], + "jupyterlab": [ + "jupyter-packaging" + ], + "keystoneauth1": [ + "pbr" + ], + "kivy": [ + "cython" + ], + "langcodes": [ + "poetry-core" + ], + "language-data": [ + "poetry-core" + ], + "lc7001": [ + "poetry-core" + ], + "ldappool": [ + "pbr" + ], + "libgpuarray": [ + "cython" + ], + "libmr": [ + "cython" + ], + "libtmux": [ + "poetry-core" + ], + "licensecheck": [ + "poetry-core" + ], + "line_profiler": [ + "cython" + ], + "linecache2": [ + "pbr" + ], + "llfuse": [ + "cython" + ], + "loca": [ + "flitBuildHook" + ], + "lockfile": [ + "pbr" + ], + "luftdaten": [ + "poetry-core" + ], + "lupa": [ + "cython" + ], + "lxml": [ + "cython" + ], + "lz4": [ + "pkgconfig" + ], + "maestral": [ + "pbr" + ], + "manimpango": [ + "cython" + ], + "marisa-trie": [ + "cython" + ], + "mask-rcnn": [ + "cython" + ], + "matrix-nio": [ + "poetry-core" + ], + "mcstatus": [ + "poetry-core" + ], + "mdformat": [ + "poetry-core" + ], + "mdurl": [ + "flit-core" + ], + "mediafile": [ + "flit-core", + "flitBuildHook" + ], + "memory-allocator": [ + "cython" + ], + "metprint": [ + "poetry-core" + ], + "mkdocs-autorefs": [ + "pdm-pep517", + "poetry" + ], + "mkdocs-gen-files": [ + "poetry" + ], + "mkdocs-jupyter": [ + "poetry-core" + ], + "mkdocs-literate-nav": [ + "poetry" + ], + "mkdocstrings": [ + "pdm-pep517" + ], + "mock": [ + "pbr" + ], + "mongomock": [ + "pbr" + ], + "monosat": [ + "cython" + ], + "motioneye-client": [ + "poetry-core" + ], + "mox3": [ + "pbr" + ], + "msgpack-numpy": [ + "cython" + ], + "msoffcrypto-tool": [ + "poetry-core" + ], + "munch": [ + "pbr" + ], + "murmurhash": [ + "cython" + ], + "myhome": [ + "poetry-core" + ], + "mypy-boto3-builder": [ + "poetry-core" + ], + "nats-python": [ + "poetry-core" + ], + "nbclassic": [ + "jupyter-packaging" + ], + "net2grid": [ + "poetry-core" + ], + "netcdf4": [ + "cython" + ], + "netdata": [ + "poetry-core" + ], + "newversion": [ + "poetry-core" + ], + "nghttp2": [ + "cython" + ], + "nitime": [ + "cython" + ], + "nixpkgs": [ + "pbr" + ], + "nkdfu": [ + "flitBuildHook" + ], + "notus-scanner": [ + "poetry-core" + ], + "ntc-templates": [ + "poetry-core" + ], + "numcodecs": [ + "cython" + ], + "numpy": [ + "cython" + ], + "numpy-stl": [ + "cython" + ], + "omnikinverter": [ + "poetry-core" + ], + "open-meteo": [ + "poetry-core" + ], + "openapi-schema-validator": [ + "poetry-core" + ], + "openapi-spec-validator": [ + "poetry-core" + ], + "openevsewifi": [ + "poetry-core" + ], + "openstackdocstheme": [ + "pbr" + ], + "openstacksdk": [ + "pbr" + ], + "openvino": [ + "cython" + ], + "ormar": [ + "poetry-core" + ], + "os-service-types": [ + "pbr" + ], + "osc-lib": [ + "pbr" + ], + "oslo-concurrency": [ + "pbr" + ], + "oslo-config": [ + "pbr" + ], + "oslo-context": [ + "pbr" + ], + "oslo-db": [ + "pbr" + ], + "oslo-i18n": [ + "pbr" + ], + "oslo-log": [ + "pbr" + ], + "oslo-serialization": [ + "pbr" + ], + "oslo-utils": [ + "pbr" + ], + "oslotest": [ + "pbr" + ], + "p1monitor": [ + "poetry-core" + ], + "paddle-client": [ + "poetry" + ], + "palace": [ + "cython" + ], + "pandas": [ + "cython" + ], + "pastel": [ + "poetry-core" + ], + "pathable": [ + "poetry-core" + ], + "peewee": [ + "cython" + ], + "pendulum": [ + "poetry-core" + ], + "pep440-version-utils": [ + "poetry" + ], + "pep517": [ + "flit-core" + ], + "pex": [ + "flit-core", + "flitBuildHook" + ], + "pipenv-poetry-migrate": [ + "poetry" + ], + "pixelmatch": [ + "poetry-core" + ], + "poetry": [ + "poetry-core" + ], + "poetry2conda": [ + "poetry" + ], + "pomegranate": [ + "cython" + ], + "pontos": [ + "poetry-core" + ], + "pot": [ + "cython" + ], + "pplpy": [ + "cython" + ], + "preprocess-cancellation": [ + "poetry-core" + ], + "preshed": [ + "cython" + ], + "primecountpy": [ + "cython" + ], + "primer3": [ + "cython" + ], + "prometheus-fastapi-instrumentator": [ + "poetry" + ], + "ptyprocess": [ + "flit-core" + ], + "publication": [ + "flit" + ], + "purepng": [ + "cython" + ], + "pvo": [ + "poetry-core" + ], + "py-synologydsm-api": [ + "poetry-core" + ], + "py17track": [ + "poetry-core" + ], + "pyairnow": [ + "poetry" + ], + "pyairvisual": [ + "poetry-core" + ], + "pyarrow": [ + "cython" + ], + "pyaussiebb": [ + "poetry-core" + ], + "pycangjie": [ + "cython" + ], + "pycapnp": [ + "cython" + ], + "pycep-parser": [ + "poetry-core" + ], + "pyclipper": [ + "cython" + ], + "pycocotools": [ + "cython" + ], + "pydantic": [ + "cython" + ], + "pydy": [ + "cython" + ], + "pyebus": [ + "poetry-core" + ], + "pyemd": [ + "cython" + ], + "pyfftw": [ + "cython" + ], + "pyflunearyou": [ + "poetry-core" + ], + "pygame_sdl2": [ + "cython" + ], + "pygeos": [ + "cython" + ], + "pyhumps": [ + "poetry-core" + ], + "pyiqvia": [ + "poetry-core" + ], + "pyjet": [ + "cython" + ], + "pyjsg": [ + "pbr" + ], + "pykka": [ + "poetry-core" + ], + "pyliblo": [ + "cython" + ], + "pymatgen": [ + "cython" + ], + "pymaven-patch": [ + "pbr" + ], + "pymfy": [ + "poetry-core" + ], + "pymssql": [ + "cython" + ], + "pynixutil": [ + "poetry" + ], + "pynuki": [ + "poetry-core" + ], + "pyopencl": [ + "pybind11" + ], + "pyopenuv": [ + "poetry-core" + ], + "pyopnsense": [ + "pbr" + ], + "pyoverkiz": [ + "poetry-core" + ], + "pypass": [ + "pbr" + ], + "pyphen": [ + "flit" + ], + "pypika-tortoise": [ + "poetry-core" + ], + "pypoolstation": [ + "poetry-core" + ], + "pyppeteer": [ + "poetry-core" + ], + "pyprecice": [ + "cython" + ], + "pyproj": [ + "cython" + ], + "pyproject-flake8": [ + "flit-core" + ], + "pyquil": [ + "poetry-core" + ], + "pyregion": [ + "cython" + ], + "pyrmvtransport": [ + "flit" + ], + "pysam": [ + "cython" + ], + "pyshex": [ + "pbr" + ], + "pyshexc": [ + "pbr" + ], + "pysigma": [ + "poetry-core" + ], + "pysigma-backend-splunk": [ + "poetry-core" + ], + "pysigma-pipeline-crowdstrike": [ + "poetry-core" + ], + "pysigma-pipeline-sysmon": [ + "poetry-core" + ], + "pysmf": [ + "cython" + ], + "pysml": [ + "poetry-core" + ], + "pysnow": [ + "poetry" + ], + "pysptk": [ + "cython" + ], + "pytaglib": [ + "cython" + ], + "pytest-celery": [ + "flitBuildHook" + ], + "pytest-check": [ + "flitBuildHook" + ], + "pytest-cid": [ + "flitBuildHook" + ], + "pytest-httpserver": [ + "poetry-core" + ], + "pytest-mockservers": [ + "poetry-core" + ], + "pytest-profiling": [ + "setuptools-git" + ], + "pytest-raisin": [ + "flit-core", + "flitBuildHook" + ], + "pytest-socket": [ + "poetry-core" + ], + "python-awair": [ + "poetry-core" + ], + "python-cinderclient": [ + "pbr" + ], + "python-csxcad": [ + "cython" + ], + "python-fontconfig": [ + "cython" + ], + "python-glanceclient": [ + "pbr" + ], + "python-gvm": [ + "poetry-core" + ], + "python-heatclient": [ + "pbr" + ], + "python-ironicclient": [ + "pbr" + ], + "python-jenkins": [ + "pbr" + ], + "python-kasa": [ + "poetry-core" + ], + "python-keystoneclient": [ + "pbr" + ], + "python-manilaclient": [ + "pbr" + ], + "python-miio": [ + "poetry", + "poetry-core" + ], + "python-novaclient": [ + "pbr" + ], + "python-openems": [ + "cython" + ], + "python-openstackclient": [ + "pbr" + ], + "python-pkcs11": [ + "cython" + ], + "python-songpal": [ + "poetry-core" + ], + "python-swiftclient": [ + "pbr" + ], + "python_openzwave": [ + "cython" + ], + "pytile": [ + "poetry-core" + ], + "pytkdocs": [ + "pdm-pep517" + ], + "pytzdata": [ + "poetry" + ], + "pyvera": [ + "poetry-core" + ], + "pywavelets": [ + "cython" + ], + "pywbem": [ + "pbr" + ], + "pywemo": [ + "poetry-core" + ], + "pyworld": [ + "cython" + ], + "pyyaml": [ + "cython" + ], + "pyyaml-env-tag": [ + "flit-core" + ], + "qcs-api-client": [ + "poetry-core" + ], + "qiskit-aer": [ + "cython" + ], + "qiskit-terra": [ + "cython" + ], + "questionary": [ + "poetry-core" + ], + "qutip": [ + "cython" + ], + "radios": [ + "poetry-core" + ], + "rasterio": [ + "cython" + ], + "reedsolo": [ + "cython" + ], + "regenmaschine": [ + "poetry-core" + ], + "remarshal": [ + "poetry-core" + ], + "renault-api": [ + "poetry-core" + ], + "rencode": [ + "cython" + ], + "reproject": [ + "cython" + ], + "requests-cache": [ + "poetry-core" + ], + "requests-mock": [ + "pbr" + ], + "requests-unixsocket": [ + "pbr" + ], + "requestsexceptions": [ + "pbr" + ], + "requirements-parser": [ + "poetry-core" + ], + "resampy": [ + "cython" + ], + "retry": [ + "pbr" + ], + "rich": [ + "poetry-core" + ], + "ripser": [ + "cython" + ], + "rmcl": [ + "poetry-core" + ], + "rmfuse": [ + "poetry-core" + ], + "rmrl": [ + "poetry-core" + ], + "rokuecp": [ + "poetry" + ], + "roombapy": [ + "poetry-core" + ], + "roonapi": [ + "poetry-core" + ], + "rsa": [ + "poetry-core" + ], + "rtmidi-python": [ + "cython" + ], + "rtmixer": [ + "cython" + ], + "sanic": [ + "poetry-core" + ], + "sarif-om": [ + "pbr" + ], + "scikit-bio": [ + "cython" + ], + "scikit-build": [ + "cython" + ], + "scikit-image": [ + "cython" + ], + "scikit-learn": [ + "cython" + ], + "scikit-learn-extra": [ + "cython" + ], + "scikit-survival": [ + "cython" + ], + "scikit-tda": [ + "cython" + ], + "scikitimage": [ + "cython" + ], + "scikitlearn": [ + "cython" + ], + "scikits-odes": [ + "cython" + ], + "scipy": [ + "cython" + ], + "seabreeze": [ + "cython" + ], + "seccomp": [ + "cython" + ], + "sentinel": [ + "poetry-core" + ], + "sfepy": [ + "cython" + ], + "shapely": [ + "cython" + ], + "shexjsg": [ + "pbr" + ], + "simplisafe-python": [ + "poetry-core" + ], + "single-source": [ + "poetry-core" + ], + "single-version": [ + "poetry-core" + ], + "slowapi": [ + "poetry-core" + ], + "solo-python": [ + "flitBuildHook" + ], + "spacy-pkuseg": [ + "cython" + ], + "sparqlslurper": [ + "pbr" + ], + "sphinx-inline-tabs": [ + "flitBuildHook" + ], + "sphinx-jinja": [ + "pbr" + ], + "sphinxcontrib-apidoc": [ + "pbr" + ], + "sphinxcontrib-fulltoc": [ + "pbr" + ], + "sphinxcontrib-spelling": [ + "pbr" + ], + "spiderpy": [ + "poetry-core" + ], + "sqlalchemy-migrate": [ + "pbr" + ], + "sqlalchemy_migrate": [ + "pbr" + ], + "srsly": [ + "cython" + ], + "ssdp": [ + "pbr" + ], + "stack-data": [ + "cython" + ], + "staticjinja": [ + "poetry-core" + ], + "statmake": [ + "poetry-core" + ], + "statsmodels": [ + "cython" + ], + "stestr": [ + "pbr" + ], + "stevedore": [ + "pbr" + ], + "strawberry-graphql": [ + "poetry" + ], + "streaming-form-data": [ + "cython" + ], + "structlog": [ + "flitBuildHook" + ], + "structlog-sentry": [ + "poetry-core" + ], + "subunit2sql": [ + "pbr" + ], + "sumo": [ + "cython" + ], + "surepy": [ + "poetry-core" + ], + "swift": [ + "pbr" + ], + "swspotify": [ + "poetry-core" + ], + "symengine": [ + "cython" + ], + "synologydsm-api": [ + "poetry-core" + ], + "tables": [ + "cython" + ], + "tailscale": [ + "poetry-core" + ], + "tarsafe": [ + "poetry" + ], + "tempest": [ + "pbr" + ], + "tenacity": [ + "pbr" + ], + "terminaltables": [ + "poetry" + ], + "tern": [ + "pbr" + ], + "tesla-wall-connector": [ + "poetry-core" + ], + "teslajsonpy": [ + "poetry-core" + ], + "tess": [ + "cython" + ], + "tesserocr": [ + "cython" + ], + "testpath": [ + "flit" + ], + "testrepository": [ + "pbr" + ], + "testresources": [ + "pbr" + ], + "testtools": [ + "pbr" + ], + "textual": [ + "poetry-core" + ], + "thinc": [ + "cython" + ], + "threadpoolctl": [ + "flitBuildHook" + ], + "thriftpy2": [ + "cython" + ], + "tikzplotlib": [ + "flit-core" + ], + "tinycss": [ + "cython" + ], + "tinycss2": [ + "flitBuildHook" + ], + "tinydb": [ + "poetry-core" + ], + "toggl-cli": [ + "pbr" + ], + "toml-sort": [ + "poetry" + ], + "tomli": [ + "flit-core" + ], + "tomli-w": [ + "flit-core" + ], + "tomlkit": [ + "poetry-core" + ], + "tortoise-orm": [ + "poetry-core" + ], + "traceback2": [ + "pbr" + ], + "transmission-rpc": [ + "poetry-core" + ], + "treeo": [ + "poetry-core" + ], + "treex": [ + "poetry-core" + ], + "ttls": [ + "poetry-core" + ], + "twentemilieu": [ + "poetry-core" + ], + "typer": [ + "flit-core" + ], + "typical": [ + "poetry-core" + ], + "typing-extensions": [ + "flit-core" + ], + "unpaddedbase64": [ + "poetry-core" + ], + "url-normalize": [ + "poetry-core" + ], + "vehicle": [ + "poetry-core" + ], + "virtualenv": [ + "cython" + ], + "virtualenvwrapper": [ + "pbr" + ], + "vispy": [ + "cython" + ], + "wakeonlan": [ + "poetry-core" + ], + "weasyprint": [ + "flit-core" + ], + "wled": [ + "poetry-core" + ], + "word2vec": [ + "cython" + ], + "wordcloud": [ + "cython" + ], + "xdg": [ + "poetry-core" + ], + "xpath-expressions": [ + "poetry-core" + ], + "yaspin": [ + "poetry-core" + ], + "yoda": [ + "cython" + ], + "zeversolarlocal": [ + "flit-core", + "flitBuildHook" + ] +} diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix new file mode 100644 index 000000000000..5439f1814dc5 --- /dev/null +++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix @@ -0,0 +1,2294 @@ +{ pkgs ? import { } +, lib ? pkgs.lib +, stdenv ? pkgs.stdenv +}: + +let + addBuildSystem = + { self + , drv + , attr + }: + let + buildSystem = if attr == "cython" then self.python.pythonForBuild.pkgs.cython else self.${attr}; + in + ( + # Flit only works on Python3 + if (attr == "flit-core" || attr == "flit") && !self.isPy3k then drv + else + drv.overridePythonAttrs ( + old: + # We do not need the build system for wheels. + if old ? format && old.format == "wheel" then + { } + else + { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.${attr} ]; + } + ) + ); + + +in +lib.composeManyExtensions [ + + # NixOps + (self: super: + lib.mapAttrs (_: v: addBuildSystem { inherit self; drv = v; attr = "poetry"; }) (lib.filterAttrs (n: _: lib.strings.hasPrefix "nixops" n) super) + // { + # NixOps >=2 dependency + nixos-modules-contrib = addBuildSystem { inherit self; drv = super.nixos-modules-contrib; attr = "poetry"; }; + } + ) + + # Add build systems + (self: super: + let + buildSystems = lib.importJSON ./build-systems.json; + in + lib.mapAttrs + (attr: systems: builtins.foldl' + (drv: attr: addBuildSystem { + inherit drv self attr; + }) + super.${attr} + systems) + buildSystems) + + # Build fixes + (self: super: + let + inherit (self.python) stdenv; + inherit (pkgs.buildPackages) pkg-config; + inherit (pkgs) buildPackages; + pyBuildPackages = self.python.pythonForBuild.pkgs; + + in + + { + automat = super.automat.overridePythonAttrs ( + old: rec { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.m2r ]; + } + ); + + aiohttp-swagger3 = super.aiohttp-swagger3.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + ansible = super.ansible.overridePythonAttrs ( + old: { + # Inputs copied from nixpkgs as ansible doesn't specify it's dependencies + # in a correct manner. + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + self.pycrypto + self.paramiko + self.jinja2 + self.pyyaml + self.httplib2 + self.six + self.netaddr + self.dnspython + self.jmespath + self.dopy + self.ncclient + ]; + } // lib.optionalAttrs (lib.versionOlder old.version "5.0") { + prePatch = pkgs.python.pkgs.ansible.prePatch or ""; + postInstall = pkgs.python.pkgs.ansible.postInstall or ""; + } + ); + + ansible-lint = super.ansible-lint.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; + preBuild = '' + export HOME=$(mktemp -d) + ''; + } + ); + + argcomplete = super.argcomplete.overridePythonAttrs ( + old: rec { + buildInputs = (old.buildInputs or [ ]) ++ [ self.importlib-metadata ]; + } + ); + + arpeggio = super.arpeggio.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + astroid = super.astroid.overridePythonAttrs ( + old: rec { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + av = super.av.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + pkg-config + ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.ffmpeg_4 ]; + } + ); + + argon2-cffi = + if (lib.versionAtLeast super.argon2-cffi.version "21.2.0") then + addBuildSystem + { + inherit self; + drv = super.argon2-cffi; + attr = "flit-core"; + } else super.argon2-cffi; + + bcrypt = super.bcrypt.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libffi ]; + } + ); + + bjoern = super.bjoern.overridePythonAttrs ( + old: { + buildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.libev ]; + } + ); + + borgbackup = super.borgbackup.overridePythonAttrs ( + old: { + BORG_OPENSSL_PREFIX = pkgs.openssl.dev; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl pkgs.acl ]; + } + ); + + cairocffi = super.cairocffi.overridePythonAttrs ( + old: { + inherit (pkgs.python3.pkgs.cairocffi) patches; + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + cairosvg = super.cairosvg.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + cattrs = + let + drv = super.cattrs; + in + if drv.version == "1.10.0" then + drv.overridePythonAttrs + (old: { + # 1.10.0 contains a pyproject.toml that requires a pre-release Poetry + # We can avoid using Poetry and use the generated setup.py + preConfigure = old.preConfigure or "" + '' + rm pyproject.toml + ''; + }) else drv; + + ccxt = super.ccxt.overridePythonAttrs (old: { + preBuild = '' + ln -s README.{rst,md} + ''; + }); + + celery = super.celery.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; + }); + + cssselect2 = super.cssselect2.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + cffi = + # cffi is bundled with pypy + if self.python.implementation == "pypy" then null else + ( + super.cffi.overridePythonAttrs ( + old: { + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ]; + buildInputs = old.buildInputs or [ ] ++ [ pkgs.libffi ]; + prePatch = (old.prePatch or "") + lib.optionalString stdenv.isDarwin '' + # Remove setup.py impurities + substituteInPlace setup.py --replace "'-iwithsysroot/usr/include/ffi'" "" + substituteInPlace setup.py --replace "'/usr/include/ffi'," "" + substituteInPlace setup.py --replace '/usr/include/libffi' '${lib.getDev pkgs.libffi}/include' + ''; + + } + ) + ); + + cloudflare = super.cloudflare.overridePythonAttrs ( + old: { + postPatch = '' + rm -rf examples/* + ''; + } + ); + + colour = super.colour.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.d2to1 ]; + } + ); + + coincurve = super.coincurve.overridePythonAttrs ( + old: { + # package setup logic + LIB_DIR = "${lib.getLib pkgs.secp256k1}/lib"; + + # for actual C toolchain build + NIX_CFLAGS_COMPILE = "-I ${lib.getDev pkgs.secp256k1}/include"; + NIX_LDFLAGS = "-L ${lib.getLib pkgs.secp256k1}/lib"; + } + ); + + configparser = super.configparser.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + self.toml + ]; + } + ); + + confluent-kafka = super.confluent-kafka.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + pkgs.rdkafka + ]; + } + ); + + cryptography = + let + getCargoHash = version: { + "35.0.0" = "sha256-tQoQfo+TAoqAea86YFxyj/LNQCiViu5ij/3wj7ZnYLI="; + "36.0.0" = "sha256-Y6TuW7AryVgSvZ6G8WNoDIvi+0tvx8ZlEYF5qB0jfNk="; + "36.0.1" = "sha256-kozYXkqt1Wpqyo9GYCwN08J+zV92ZWFJY/f+rulxmeQ="; + "36.0.2" = "1a0ni1a3dbv2dvh6gx2i54z8v5j9m6asqg97kkv7gqb1ivihsbp8"; + }.${version} or null; + sha256 = getCargoHash super.cryptography.version; + scrypto = + if lib.versionAtLeast super.cryptography.version "35" && sha256 == null then + ( + super.cryptography.override { preferWheel = true; } + ) else super.cryptography; + in + scrypto.overridePythonAttrs + ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) + ++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] + ++ lib.optional (!self.isPyPy) pyBuildPackages.cffi + ++ lib.optional (lib.versionAtLeast old.version "3.5") + (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]); + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ] + ++ lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security pkgs.libiconv ]; + propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.cffi ]; + } // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") { + CRYPTOGRAPHY_DONT_BUILD_RUST = "1"; + } // lib.optionalAttrs (lib.versionAtLeast old.version "35" && sha256 != null) rec { + cargoDeps = + pkgs.rustPlatform.fetchCargoTarball { + src = old.src; + sourceRoot = "${old.pname}-${old.version}/${cargoRoot}"; + name = "${old.pname}-${old.version}"; + inherit sha256; + }; + cargoRoot = "src/rust"; + } + ); + + cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; + postPatch = '' + substituteInPlace setup.py --replace 'setuptools>=50.3.2,<51.0.0' 'setuptools' + ''; + }); + + daphne = super.daphne.overridePythonAttrs (old: { + postPatch = '' + substituteInPlace setup.py --replace 'setup_requires=["pytest-runner"],' "" + ''; + }); + + datadog-lambda = super.datadog-lambda.overridePythonAttrs (old: { + postPatch = '' + substituteInPlace setup.py --replace "setuptools==" "setuptools>=" + ''; + buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ]; + }); + + dbus-python = super.dbus-python.overridePythonAttrs (old: { + outputs = [ "out" "dev" ]; + + postPatch = old.postPatch or "" + '' + substituteInPlace ./configure --replace /usr/bin/file ${pkgs.file}/bin/file + substituteInPlace ./dbus-python.pc.in --replace 'Cflags: -I''${includedir}' 'Cflags: -I''${includedir}/dbus-1.0' + ''; + + configureFlags = (old.configureFlags or [ ]) ++ [ + "PYTHON_VERSION=${lib.versions.major self.python.version}" + ]; + + preConfigure = lib.concatStringsSep "\n" [ + (old.preConfigure or "") + (if (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) then '' + MACOSX_DEPLOYMENT_TARGET=10.16 + '' else "") + ]; + + preBuild = old.preBuild or "" + '' + make distclean + ''; + + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ]; + buildInputs = old.buildInputs or [ ] ++ [ pkgs.dbus pkgs.dbus-glib ] + # My guess why it's sometimes trying to -lncurses. + # It seems not to retain the dependency anyway. + ++ lib.optional (! self.python ? modules) pkgs.ncurses; + }); + + dcli = super.dcli.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; + }); + + ddtrace = super.ddtrace.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ + (lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.IOKit ]); + }); + + dictdiffer = super.dictdiffer.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; + } + ); + + django = ( + super.django.overridePythonAttrs ( + old: { + propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ]) + ++ [ pkgs.gettext self.pytest-runner ]; + } + ) + ); + + django-bakery = super.django-bakery.overridePythonAttrs ( + old: { + configurePhase = '' + if ! test -e LICENSE; then + touch LICENSE + fi + '' + (old.configurePhase or ""); + } + ); + + django-cors-headers = super.django-cors-headers.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + django-hijack = super.django-hijack.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + django-prometheus = super.django-prometheus.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + django-rosetta = super.django-rosetta.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + django-stubs-ext = super.django-stubs-ext.overridePythonAttrs ( + old: { + prePatch = (old.prePatch or "") + "touch ../LICENSE.txt"; + } + ); + + dlib = super.dlib.overridePythonAttrs ( + old: { + # Parallel building enabled + inherit (pkgs.python.pkgs.dlib) patches; + + enableParallelBuilding = true; + dontUseCmakeConfigure = true; + + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ pkgs.dlib.nativeBuildInputs; + buildInputs = (old.buildInputs or [ ]) ++ 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; + + eth-hash = super.eth-hash.overridePythonAttrs { + preConfigure = '' + substituteInPlace setup.py --replace \'setuptools-markdown\' "" + ''; + }; + + eth-keyfile = super.eth-keyfile.overridePythonAttrs { + preConfigure = '' + substituteInPlace setup.py --replace \'setuptools-markdown\' "" + ''; + }; + + eth-keys = super.eth-keys.overridePythonAttrs { + preConfigure = '' + substituteInPlace setup.py --replace \'setuptools-markdown\' "" + ''; + }; + + # remove eth-hash dependency because eth-hash also depends on eth-utils causing a cycle. + eth-utils = super.eth-utils.overridePythonAttrs (old: { + propagatedBuildInputs = + builtins.filter (i: i.pname != "eth-hash") old.propagatedBuildInputs; + preConfigure = '' + ${old.preConfigure or ""} + sed -i '/eth-hash/d' setup.py + ''; + }); + + faker = super.faker.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + doCheck = false; + } + ); + + fancycompleter = super.fancycompleter.overridePythonAttrs ( + old: { + postPatch = '' + substituteInPlace setup.py \ + --replace 'setup_requires="setupmeta"' 'setup_requires=[]' \ + --replace 'versioning="devcommit"' 'version="${old.version}"' + ''; + } + ); + + fastecdsa = super.fastecdsa.overridePythonAttrs (old: { + buildInputs = old.buildInputs ++ [ pkgs.gmp.dev ]; + }); + + fastparquet = super.fastparquet.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + fiona = super.fiona.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.gdal_2 ]; + nativeBuildInputs = [ + pkgs.gdal_2 # for gdal-config + ]; + } + ); + + flatbuffers = super.flatbuffers.overrideAttrs (old: { + VERSION = old.version; + }); + + gdal = super.gdal.overridePythonAttrs ( + old: { + preBuild = (old.preBuild or "") + '' + substituteInPlace setup.cfg \ + --replace "../../apps/gdal-config" '${pkgs.gdal}/bin/gdal-config' + ''; + } + ); + + grandalf = super.grandalf.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + doCheck = false; + } + ); + + gitpython = super.gitpython.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.typing-extensions ]; + } + ); + + grpcio = super.grpcio.overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.c-ares pkgs.openssl pkgs.zlib ]; + + outputs = [ "out" "dev" ]; + + GRPC_BUILD_WITH_BORING_SSL_ASM = ""; + GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1; + GRPC_PYTHON_BUILD_SYSTEM_ZLIB = 1; + GRPC_PYTHON_BUILD_SYSTEM_CARES = 1; + DISABLE_LIBC_COMPATIBILITY = 1; + }); + + grpcio-tools = super.grpcio-tools.overridePythonAttrs (old: { + outputs = [ "out" "dev" ]; + }); + + h3 = super.h3.overridePythonAttrs ( + old: { + preBuild = (old.preBuild or "") + '' + substituteInPlace h3/h3.py \ + --replace "'{}/{}'.format(_dirname, libh3_path)" '"${pkgs.h3}/lib/libh3${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}"' + ''; + } + ); + + h5py = super.h5py.overridePythonAttrs ( + old: + if old.format != "wheel" then + ( + let + mpi = pkgs.hdf5.mpi; + mpiSupport = pkgs.hdf5.mpiSupport; + in + { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + buildInputs = + (old.buildInputs or [ ]) + ++ [ pkgs.hdf5 self.pkgconfig ] + ++ lib.optional mpiSupport mpi + ; + propagatedBuildInputs = + (old.propagatedBuildInputs or [ ]) + ++ lib.optionals mpiSupport [ self.mpi4py self.openssh ] + ; + preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else ""; + HDF5_DIR = "${pkgs.hdf5}"; + HDF5_MPI = if mpiSupport then "ON" else "OFF"; + # avoid strict pinning of numpy + postPatch = '' + substituteInPlace setup.py \ + --replace "numpy ==" "numpy >=" + ''; + pythonImportsCheck = [ "h5py" ]; + } + ) else old + ); + + hid = super.hid.overridePythonAttrs ( + old: { + postPatch = '' + found= + for name in libhidapi-hidraw libhidapi-libusb libhidapi-iohidmanager libhidapi; do + full_path=${pkgs.hidapi.out}/lib/$name${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} + if test -f $full_path; then + found=t + sed -i -e "s|'$name\..*'|'$full_path'|" hid/__init__.py + fi + done + test -n "$found" || { echo "ERROR: No known libraries found in ${pkgs.hidapi.out}/lib, please update/fix this build expression."; exit 1; } + ''; + } + ); + + horovod = super.horovod.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.mpi ]; + } + ); + + httplib2 = super.httplib2.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pyparsing ]; + }); + + icecream = super.icecream.overridePythonAttrs (old: { + # # ERROR: Could not find a version that satisfies the requirement executing>=0.3.1 (from icecream) (from versions: none) + postPatch = '' + substituteInPlace setup.py --replace 'executing>=0.3.1' 'executing' + ''; + }); + + igraph = super.igraph.overridePythonAttrs ( + old: { + nativeBuildInputs = [ pkgs.cmake ] ++ old.nativeBuildInputs; + dontUseCmakeConfigure = true; + } + ); + + imagecodecs = super.imagecodecs.overridePythonAttrs ( + old: { + patchPhase = '' + substituteInPlace setup.py \ + --replace "/usr/include/openjpeg-2.3" \ + "${pkgs.openjpeg.dev}/include/${pkgs.openjpeg.dev.incDir} + substituteInPlace setup.py \ + --replace "/usr/include/jxrlib" \ + "$out/include/libjxr" + substituteInPlace imagecodecs/_zopfli.c \ + --replace '"zopfli/zopfli.h"' \ + '' + substituteInPlace imagecodecs/_zopfli.c \ + --replace '"zopfli/zlib_container.h"' \ + '' + substituteInPlace imagecodecs/_zopfli.c \ + --replace '"zopfli/gzip_container.h"' \ + '' + ''; + + preBuild = '' + mkdir -p $out/include/libjxr + ln -s ${pkgs.jxrlib}/include/libjxr/**/* $out/include/libjxr + + ''; + + buildInputs = (old.buildInputs or [ ]) ++ [ + # Commented out packages are declared required, but not actually + # needed to build. They are not yet packaged for nixpkgs. + # bitshuffle + pkgs.brotli + # brunsli + pkgs.bzip2 + pkgs.c-blosc + # charls + pkgs.giflib + pkgs.jxrlib + pkgs.lcms + pkgs.libaec + pkgs.libaec + pkgs.libjpeg_turbo + # liblzf + # liblzma + pkgs.libpng + pkgs.libtiff + pkgs.libwebp + pkgs.lz4 + pkgs.openjpeg + pkgs.snappy + # zfp + pkgs.zopfli + pkgs.zstd + pkgs.zlib + ]; + } + ); + + # importlib-metadata has an incomplete dependency specification + importlib-metadata = super.importlib-metadata.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ lib.optional self.python.isPy2 self.pathlib2; + } + ); + + intreehooks = super.intreehooks.overridePythonAttrs ( + old: { + doCheck = false; + } + ); + + isort = super.isort.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; + } + ); + + jaraco-functools = super.jaraco-functools.overridePythonAttrs ( + old: { + # required for the extra "toml" dependency in setuptools_scm[toml] + buildInputs = (old.buildInputs or [ ]) ++ [ + self.toml + ]; + } + ); + + jira = super.jira.overridePythonAttrs ( + old: { + inherit (pkgs.python3Packages.jira) patches; + buildInputs = (old.buildInputs or [ ]) ++ [ + self.pytestrunner + self.cryptography + self.pyjwt + self.setuptools-scm-git-archive + ]; + } + ); + + jq = super.jq.overridePythonAttrs (attrs: { + buildInputs = [ pkgs.jq ]; + patches = [ + (pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/NixOS/nixpkgs/088da8735f6620b60d724aa7db742607ea216087/pkgs/development/python-modules/jq/jq-py-setup.patch"; + sha256 = "sha256-MYvX3S1YGe0QsUtExtOtULvp++AdVrv+Fid4Jh1xewQ="; + }) + ]; + }); + + jsondiff = super.jsondiff.overridePythonAttrs ( + old: { + preBuild = (old.preBuild or "") + '' + substituteInPlace setup.py \ + --replace "'jsondiff=jsondiff.cli:main_deprecated'," "" + ''; + } + ); + + jsonslicer = super.jsonslicer.overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.yajl ]; + }); + + jupyter = super.jupyter.overridePythonAttrs ( + old: rec { + # jupyter is a meta-package. Everything relevant comes from the + # dependencies. It does however have a jupyter.py file that conflicts + # with jupyter-core so this meta solves this conflict. + meta.priority = 100; + } + ); + + jupyter-packaging = super.jupyter-packaging.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.wheel ]; + }); + + jupyterlab-widgets = super.jupyterlab-widgets.overridePythonAttrs ( + old: rec { + buildInputs = (old.buildInputs or [ ]) ++ [ self.jupyter-packaging ]; + } + ); + + kerberos = super.kerberos.overrideAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.libkrb5 ]; + }); + + keyring = super.keyring.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + self.toml + ]; + } + ); + + kiwisolver = super.kiwisolver.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + self.cppy + ]; + } + ); + + lap = super.lap.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + self.numpy + ]; + } + ); + + libvirt-python = super.libvirt-python.overridePythonAttrs ({ nativeBuildInputs ? [ ], ... }: { + nativeBuildInputs = nativeBuildInputs ++ [ pkg-config ]; + propagatedBuildInputs = [ pkgs.libvirt ]; + }); + + llvmlite = super.llvmlite.overridePythonAttrs ( + old: + let + llvm = + if lib.versionAtLeast old.version "0.37.0" then + pkgs.llvmPackages_11.llvm + else if (lib.versionOlder old.version "0.37.0" && lib.versionAtLeast old.version "0.34.0") then + pkgs.llvmPackages_10.llvm + else if (lib.versionOlder old.version "0.34.0" && lib.versionAtLeast old.version "0.33.0") then + pkgs.llvmPackages_9.llvm + else if (lib.versionOlder old.version "0.33.0" && lib.versionAtLeast old.version "0.29.0") then + pkgs.llvmPackages_8.llvm + else if (lib.versionOlder old.version "0.28.0" && lib.versionAtLeast old.version "0.27.0") then + pkgs.llvmPackages_7.llvm + else if (lib.versionOlder old.version "0.27.0" && lib.versionAtLeast old.version "0.23.0") then + pkgs.llvmPackages_6.llvm + else if (lib.versionOlder old.version "0.23.0" && lib.versionAtLeast old.version "0.21.0") then + pkgs.llvmPackages_5.llvm + else + pkgs.llvm; # Likely to fail. + in + { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.llvm ]; + + # Disable static linking + # https://github.com/numba/llvmlite/issues/93 + postPatch = '' + substituteInPlace ffi/Makefile.linux --replace "-static-libstdc++" "" + + substituteInPlace llvmlite/tests/test_binding.py --replace "test_linux" "nope" + ''; + + # Set directory containing llvm-config binary + preConfigure = '' + export LLVM_CONFIG=${llvm.dev}/bin/llvm-config + ''; + + __impureHostDeps = lib.optionals pkgs.stdenv.isDarwin [ "/usr/lib/libm.dylib" ]; + + passthru = old.passthru // { llvm = llvm; }; + } + ); + + lxml = super.lxml.overridePythonAttrs ( + old: { + nativeBuildInputs = with pkgs.buildPackages; (old.nativeBuildInputs or [ ]) ++ [ pkg-config libxml2.dev libxslt.dev ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ]; + buildInputs = with pkgs; (old.buildInputs or [ ]) ++ [ libxml2 libxslt ]; + } + ); + + markupsafe = super.markupsafe.overridePythonAttrs ( + old: { + src = old.src.override { pname = builtins.replaceStrings [ "markupsafe" ] [ "MarkupSafe" ] old.pname; }; + } + ); + + matplotlib = super.matplotlib.overridePythonAttrs ( + old: + let + enableGhostscript = old.passthru.args.enableGhostscript or false; + enableGtk3 = old.passthru.args.enableGtk3 or false; + enableQt = old.passthru.args.enableQt or false; + enableTk = old.passthru.args.enableTk or false; + + interactive = enableTk || enableGtk3 || enableQt; + + passthru = { + config = { + directories = { basedirlist = "."; }; + libs = { + system_freetype = true; + system_qhull = true; + } // lib.optionalAttrs stdenv.isDarwin { + # LTO not working in darwin stdenv, see Nixpkgs #19312 + enable_lto = false; + }; + }; + }; + + inherit (pkgs) tk tcl wayland qhull; + inherit (pkgs.xorg) libX11; + inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa; + in + { + XDG_RUNTIME_DIR = "/tmp"; + + buildInputs = old.buildInputs or [ ] ++ [ + pkgs.which + ] ++ lib.optional enableGhostscript [ + pkgs.ghostscript + ] ++ lib.optional stdenv.isDarwin [ + Cocoa + ]; + + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + self.certifi + pkgs.libpng + pkgs.freetype + qhull + ] + ++ lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ] + ++ lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ] + ++ lib.optionals enableQt [ self.pyqt5 ] + ; + + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + pkg-config + ] ++ lib.optional (lib.versionAtLeast super.matplotlib.version "3.5.0") [ + self.setuptools-scm + self.setuptools-scm-git-archive + ]; + + passthru = old.passthru or { } // passthru; + + MPLSETUPCFG = pkgs.writeText "mplsetup.cfg" (lib.generators.toINI { } passthru.config); + + # Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the + # corresponding interpreter object for its library paths. This fails if + # `$DISPLAY` is not set. The fallback option assumes that Tcl/Tk are both + # installed under the same path which is not true in Nix. + # With the following patch we just hard-code these paths into the install + # script. + postPatch = + let + tcl_tk_cache = ''"${tk}/lib", "${tcl}/lib", "${lib.strings.substring 0 3 tk.version}"''; + in + lib.optionalString enableTk '' + sed -i '/self.tcl_tk_cache = None/s|None|${tcl_tk_cache}|' setupext.py + '' + lib.optionalString (stdenv.isLinux && interactive) '' + # fix paths to libraries in dlopen calls (headless detection) + substituteInPlace src/_c_internal_utils.c \ + --replace libX11.so.6 ${libX11}/lib/libX11.so.6 \ + --replace libwayland-client.so.0 ${wayland}/lib/libwayland-client.so.0 + '' + + # avoid matplotlib trying to download dependencies + '' + echo "[libs] + system_freetype=true + system_qhull=true" > mplsetup.cfg + ''; + + } + ); + + # Calls Cargo at build time for source builds and is really tricky to package + maturin = super.maturin.override { + preferWheel = true; + }; + + mccabe = super.mccabe.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + doCheck = false; + } + ); + + mip = super.mip.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.autoPatchelfHook ]; + + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.zlib self.cppy ]; + } + ); + + mmdet = super.mmdet.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytorch ]; + } + ); + + molecule = + if lib.versionOlder super.molecule.version "3.0.0" then + (super.molecule.overridePythonAttrs ( + old: { + patches = (old.patches or [ ]) ++ [ + # Fix build with more recent setuptools versions + (pkgs.fetchpatch { + url = "https://github.com/ansible-community/molecule/commit/c9fee498646a702c77b5aecf6497cff324acd056.patch"; + sha256 = "1g1n45izdz0a3c9akgxx14zhdw6c3dkb48j8pq64n82fa6ndl1b7"; + excludes = [ "pyproject.toml" ]; + }) + ]; + buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; + } + )) else + super.molecule.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; + }); + + mpi4py = super.mpi4py.overridePythonAttrs ( + old: + let + cfg = pkgs.writeTextFile { + name = "mpi.cfg"; + text = ( + lib.generators.toINI + { } + { + mpi = { + mpicc = "${pkgs.mpi.outPath}/bin/mpicc"; + }; + } + ); + }; + in + { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.mpi ]; + enableParallelBuilding = true; + preBuild = '' + ln -sf ${cfg} mpi.cfg + ''; + } + ); + + multiaddr = super.multiaddr.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + mypy = super.mypy.overridePythonAttrs ( + old: { + # FIXME: Remove patch after upstream has decided the proper solution. + # https://github.com/python/mypy/pull/11143 + patches = (old.patches or [ ]) ++ lib.optionals ((lib.strings.versionAtLeast old.version "0.900") && lib.strings.versionOlder old.version "0.940") [ + (pkgs.fetchpatch { + url = "https://github.com/python/mypy/commit/f1755259d54330cd087cae763cd5bbbff26e3e8a.patch"; + sha256 = "sha256-5gPahX2X6+/qUaqDQIGJGvh9lQ2EDtks2cpQutgbOHk="; + }) + ] ++ lib.optionals (lib.strings.versionAtLeast old.version "0.940") [ + (pkgs.fetchpatch { + url = "https://github.com/python/mypy/commit/e7869f05751561958b946b562093397027f6d5fa.patch"; + sha256 = "sha256-waIZ+m3tfvYE4HJ8kL6rN/C4fMjvLEe9UoPbt9mHWIM="; + }) + ]; + buildInputs = (old.buildInputs or [ ]) ++ [ + self.types-typed-ast + ]; + # Compile mypy with mypyc, which makes mypy about 4 times faster. The compiled + # version is also the default in the wheels on Pypi that include binaries. + # is64bit: unfortunately the build would exhaust all possible memory on i686-linux. + MYPY_USE_MYPYC = stdenv.buildPlatform.is64bit; + + # when testing reduce optimisation level to drastically reduce build time + # (default is 3) + # MYPYC_OPT_LEVEL = 1; + } + ); + + mysqlclient = super.mysqlclient.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.libmysqlclient ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libmysqlclient ]; + } + ); + + netcdf4 = super.netcdf4.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + pkgs.zlib + pkgs.netcdf + pkgs.hdf5 + pkgs.curl + pkgs.libjpeg + ]; + + # Variables used to configure the build process + USE_NCCONFIG = "0"; + HDF5_DIR = lib.getDev pkgs.hdf5; + NETCDF4_DIR = pkgs.netcdf; + CURL_DIR = pkgs.curl.dev; + JPEG_DIR = pkgs.libjpeg.dev; + } + ); + + numpy = super.numpy.overridePythonAttrs ( + old: + let + blas = old.passthru.args.blas or pkgs.openblasCompat; + blasImplementation = lib.nameFromURL blas.name "-"; + cfg = pkgs.writeTextFile { + name = "site.cfg"; + text = ( + lib.generators.toINI + { } + { + ${blasImplementation} = { + include_dirs = "${blas}/include"; + library_dirs = "${blas}/lib"; + } // lib.optionalAttrs (blasImplementation == "mkl") { + mkl_libs = "mkl_rt"; + lapack_libs = ""; + }; + } + ); + }; + in + { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.gfortran ]; + buildInputs = (old.buildInputs or [ ]) ++ [ blas ]; + enableParallelBuilding = true; + preBuild = '' + ln -s ${cfg} site.cfg + ''; + passthru = old.passthru // { + blas = blas; + inherit blasImplementation cfg; + }; + } + ); + + open3d = super.open3d.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ (with pkgs; [ + udev + ]); + # TODO(Sem Mulder): Add overridable flags for CUDA/PyTorch/Tensorflow support. + autoPatchelfIgnoreMissingDeps = true; + }); + + opencv-python = super.opencv-python.overridePythonAttrs ( + old: { + nativeBuildInputs = [ pkgs.cmake ] ++ old.nativeBuildInputs; + buildInputs = [ self.scikit-build ] ++ (old.buildInputs or [ ]); + dontUseCmakeConfigure = true; + } + ); + + opencv-contrib-python = super.opencv-contrib-python.overridePythonAttrs ( + old: { + nativeBuildInputs = [ pkgs.cmake ] ++ old.nativeBuildInputs; + buildInputs = [ self.scikit-build ] ++ (old.buildInputs or [ ]); + dontUseCmakeConfigure = true; + } + ); + + openexr = super.openexr.overridePythonAttrs ( + old: rec { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openexr pkgs.ilmbase ]; + NIX_CFLAGS_COMPILE = [ "-I${pkgs.openexr.dev}/include/OpenEXR" "-I${pkgs.ilmbase.dev}/include/OpenEXR" ]; + } + ); + + osqp = super.osqp.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.cmake ]; + dontUseCmakeConfigure = true; + } + ); + + pantalaimon = super.pantalaimon.overridePythonAttrs (old: { + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.installShellFiles ]; + postInstall = old.postInstall or "" + '' + installManPage docs/man/*.[1-9] + ''; + }); + + paramiko = super.paramiko.overridePythonAttrs (old: { + doCheck = false; # requires networking + }); + + parsel = super.parsel.overridePythonAttrs ( + old: rec { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + pdal = super.pdal.overridePythonAttrs ( + old: { + PDAL_CONFIG = "${pkgs.pdal}/bin/pdal-config"; + } + ); + + peewee = super.peewee.overridePythonAttrs ( + old: + let + withPostgres = old.passthru.withPostgres or false; + withMysql = old.passthru.withMysql or false; + in + { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ]; + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) + ++ lib.optional withPostgres self.psycopg2 + ++ lib.optional withMysql self.mysql-connector; + } + ); + + pikepdf = super.pikepdf.overridePythonAttrs ( + old: { + buildInputs = old.buildInputs or [ ] ++ [ pkgs.qpdf self.pybind11 ]; + pythonImportsCheck = old.pythonImportsCheck or [ ] ++ [ "pikepdf" ]; + } + ); + + pillow = super.pillow.overridePythonAttrs ( + old: { + nativeBuildInputs = [ pkg-config self.pytest-runner ] ++ (old.nativeBuildInputs or [ ]); + buildInputs = with pkgs; [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ] ++ (old.buildInputs or [ ]); + } + ); + + poetry-core = super.poetry-core.overridePythonAttrs (old: { + # "Vendor" dependencies (for build-system support) + postPatch = '' + echo "import sys" >> poetry/__init__.py + for path in $propagatedBuildInputs; do + echo "sys.path.insert(0, \"$path\")" >> poetry/__init__.py + done + ''; + + # Propagating dependencies leads to issues downstream + # We've already patched poetry to prefer "vendored" dependencies + postFixup = '' + rm $out/nix-support/propagated-build-inputs + ''; + }); + + portend = super.portend.overridePythonAttrs ( + old: { + # required for the extra "toml" dependency in setuptools_scm[toml] + buildInputs = (old.buildInputs or [ ]) ++ [ + self.toml + ]; + } + ); + + prettytable = super.prettytable.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; + }); + + psycopg2 = super.psycopg2.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) + ++ lib.optional stdenv.isDarwin pkgs.openssl; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ]; + } + ); + + psycopg2-binary = super.psycopg2-binary.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) + ++ lib.optional stdenv.isDarwin pkgs.openssl; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ]; + } + ); + + py-solc-x = super.py-solc-x.overridePythonAttrs ( + old: { + preConfigure = '' + substituteInPlace setup.py --replace \'setuptools-markdown\' "" + ''; + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.requests self.semantic-version ]; + } + ); + + pyarrow = + if lib.versionAtLeast super.pyarrow.version "0.16.0" then + super.pyarrow.overridePythonAttrs + ( + old: + let + parseMinor = drv: lib.concatStringsSep "." (lib.take 2 (lib.splitVersion drv.version)); + + # Starting with nixpkgs revision f149c7030a7, pyarrow takes "python3" as an argument + # instead of "python". Below we inspect function arguments to maintain compatibilitiy. + _arrow-cpp = pkgs.arrow-cpp.override ( + builtins.intersectAttrs + (lib.functionArgs pkgs.arrow-cpp.override) + { python = self.python; python3 = self.python; } + ); + + ARROW_HOME = _arrow-cpp; + arrowCppVersion = parseMinor _arrow-cpp; + pyArrowVersion = parseMinor super.pyarrow; + errorMessage = "arrow-cpp version (${arrowCppVersion}) mismatches pyarrow version (${pyArrowVersion})"; + in + if arrowCppVersion != pyArrowVersion then throw errorMessage else { + + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + pkg-config + pkgs.cmake + ]; + + preBuild = '' + export PYARROW_PARALLEL=$NIX_BUILD_CORES + ''; + + PARQUET_HOME = _arrow-cpp; + inherit ARROW_HOME; + + PYARROW_BUILD_TYPE = "release"; + PYARROW_WITH_FLIGHT = if _arrow-cpp.enableFlight then 1 else 0; + PYARROW_WITH_DATASET = 1; + PYARROW_WITH_PARQUET = 1; + PYARROW_CMAKE_OPTIONS = [ + "-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib" + + # This doesn't use setup hook to call cmake so we need to workaround #54606 + # ourselves + "-DCMAKE_POLICY_DEFAULT_CMP0025=NEW" + ]; + + dontUseCmakeConfigure = true; + } + ) else + super.pyarrow; + + pycairo = ( + drv: ( + drv.overridePythonAttrs ( + _: { + format = "other"; + } + ) + ).overridePythonAttrs ( + old: { + + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + pkgs.meson + pkgs.ninja + pkg-config + ]; + + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + pkgs.cairo + pkgs.xlibsWrapper + ]; + + mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ]; + } + ) + ) + super.pycairo; + + pycocotools = super.pycocotools.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + self.numpy + ]; + } + ); + + pyfuse3 = super.pyfuse3.overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.fuse3 ]; + }); + + pygame = super.pygame.overridePythonAttrs ( + old: rec { + nativeBuildInputs = [ + 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 + ''; + } + ); + + pygeos = super.pygeos.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.geos ]; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.geos ]; + } + ); + + pygobject = super.pygobject.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.glib pkgs.gobject-introspection ]; + } + ); + + pylint = super.pylint.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + pymediainfo = super.pymediainfo.overridePythonAttrs ( + old: { + postPatch = (old.postPatch or "") + '' + substituteInPlace pymediainfo/__init__.py \ + --replace "libmediainfo.0.dylib" \ + "${pkgs.libmediainfo}/lib/libmediainfo.0${stdenv.hostPlatform.extensions.sharedLibrary}" \ + --replace "libmediainfo.dylib" \ + "${pkgs.libmediainfo}/lib/libmediainfo${stdenv.hostPlatform.extensions.sharedLibrary}" \ + --replace "libmediainfo.so.0" \ + "${pkgs.libmediainfo}/lib/libmediainfo${stdenv.hostPlatform.extensions.sharedLibrary}.0" + ''; + } + ); + + pymssql = super.pymssql.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) + ++ [ pkgs.openssl ]; + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) + ++ [ pkgs.freetds ]; + }); + + pyopenssl = super.pyopenssl.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ]; + } + ); + + pyproj = super.pyproj.overridePythonAttrs ( + old: { + PROJ_DIR = "${pkgs.proj}"; + PROJ_LIBDIR = "${pkgs.proj}/lib"; + PROJ_INCDIR = "${pkgs.proj.dev}/include"; + } + ); + + pyrfr = super.pyrfr.overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.swig ]; + }); + + pytaglib = super.pytaglib.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.taglib ]; + }); + + pytezos = super.pytezos.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libsodium ]; + }); + + python-bugzilla = super.python-bugzilla.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + self.docutils + ]; + } + ); + + python-ldap = super.python-ldap.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openldap pkgs.cyrus_sasl ]; + } + ); + + pytoml = super.pytoml.overridePythonAttrs ( + old: { + doCheck = false; + } + ); + + 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"; + + dontWrapQtApps = true; + + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + pkg-config + pkgs.qt5.qmake + pkgs.xorg.lndir + pkgs.qt5.qtbase + pkgs.qt5.qtsvg + pkgs.qt5.qtdeclarative + pkgs.qt5.qtwebchannel + pkgs.qt5.qt3d + # 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 or [ ]) ++ [ + 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 + ''; + + 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 + ''; + + 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; + } + ); + + pytest-datadir = super.pytest-datadir.overridePythonAttrs ( + old: { + postInstall = '' + rm -f $out/LICENSE + ''; + } + ); + + pytest = super.pytest.overridePythonAttrs ( + old: { + # Fixes https://github.com/pytest-dev/pytest/issues/7891 + postPatch = old.postPatch or "" + '' + sed -i '/\[metadata\]/aversion = ${old.version}' setup.cfg + ''; + } + ); + + pytest-django = super.pytest-django.overridePythonAttrs ( + old: { + postPatch = '' + substituteInPlace setup.py --replace "'pytest>=3.6'," "" + substituteInPlace setup.py --replace "'pytest>=3.6'" "" + ''; + } + ); + + pytest-randomly = super.pytest-randomly.overrideAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + self.importlib-metadata + ]; + }); + + pytest-runner = super.pytest-runner or super.pytestrunner; + + pytest-pylint = super.pytest-pylint.overridePythonAttrs ( + old: { + buildInputs = [ self.pytest-runner ]; + } + ); + + # pytest-splinter seems to put a .marker file in an empty directory + # presumably so it's tracked by and can be installed with MANIFEST.in, see + # https://github.com/pytest-dev/pytest-splinter/commit/a48eeef662f66ff9d3772af618748e73211a186b + # + # This directory then gets used as an empty initial profile directory and is + # zipped up. But if the .marker file is in the Nix store, it has the + # creation date of 1970, and Zip doesn't work with such old files, so it + # fails at runtime! + # + # We fix this here by just removing the file after the installation + # + # The error you get without this is: + # + # E ValueError: ZIP does not support timestamps before 1980 + # /nix/store/55b9ip7xkpimaccw9pa0vacy5q94f5xa-python3-3.7.6/lib/python3.7/zipfile.py:357: ValueError + pytest-splinter = super.pytest-splinter.overrideAttrs (old: { + postInstall = old.postInstall or "" + '' + rm $out/${super.python.sitePackages}/pytest_splinter/profiles/firefox/.marker + ''; + }); + + python-jose = super.python-jose.overridePythonAttrs ( + old: { + buildInputs = [ self.pytest-runner ]; + } + ); + + python-magic = super.python-magic.overridePythonAttrs ( + old: { + postPatch = '' + substituteInPlace magic/loader.py \ + --replace "'libmagic.so.1'" "'${lib.getLib pkgs.file}/lib/libmagic.so.1'" + ''; + pythonImportsCheck = old.pythonImportsCheck or [ ] ++ [ "magic" ]; + } + ); + + python-olm = super.python-olm.overridePythonAttrs ( + old: { + buildInputs = old.buildInputs or [ ] ++ [ pkgs.olm ]; + } + ); + + python-snappy = super.python-snappy.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.snappy ]; + } + ); + + pythran = super.pythran.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + }); + + ffmpeg-python = super.ffmpeg-python.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + python-prctl = super.python-prctl.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + pkgs.libcap + ]; + } + ); + + pyudev = super.pyudev.overridePythonAttrs (old: { + postPatch = '' + substituteInPlace src/pyudev/_ctypeslib/utils.py \ + --replace "find_library(name)" "'${lib.getLib pkgs.systemd}/lib/libudev.so'" + ''; + }); + + pyusb = super.pyusb.overridePythonAttrs ( + old: { + postPatch = '' + libusb=${pkgs.libusb1.out}/lib/libusb-1.0${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} + test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; } + sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py + ''; + } + ); + + pywavelets = super.pywavelets.overridePythonAttrs ( + old: { + HDF5_DIR = "${pkgs.hdf5}"; + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.hdf5 ]; + } + ); + + pyzmq = super.pyzmq.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.zeromq ]; + } + ); + + rockset = super.rockset.overridePythonAttrs ( + old: rec { + postPatch = '' + cp ./setup_rockset.py ./setup.py + ''; + } + ); + + scaleapi = super.scaleapi.overridePythonAttrs ( + old: { + postPatch = '' + substituteInPlace setup.py --replace "install_requires = ['requests>=2.4.2', 'enum34']" "install_requires = ['requests>=2.4.2']" || true + ''; + } + ); + + panel = super.panel.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.nodejs ]; + } + ); + + # 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 + } + ); + + rlp = super.rlp.overridePythonAttrs { + preConfigure = '' + substituteInPlace setup.py --replace \'setuptools-markdown\' "" + ''; + }; + + rmfuse = super.rmfuse.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; + }); + + rtree = super.rtree.overridePythonAttrs (old: { + propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ]) ++ [ pkgs.libspatialindex ]; + postPatch = '' + substituteInPlace rtree/finder.py --replace \ + "find_library('spatialindex_c')" \ + "'${pkgs.libspatialindex}/lib/libspatialindex_c${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}'" + ''; + }); + + ruamel-yaml = super.ruamel-yaml.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) + ++ [ self.ruamel-yaml-clib ]; + } + ); + + scipy = super.scipy.overridePythonAttrs ( + old: + if old.format != "wheel" then { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ + [ pkgs.gfortran ] ++ + lib.optional (lib.versionAtLeast super.scipy.version "1.7.0") [ self.pythran ]; + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ]; + setupPyBuildFlags = [ "--fcompiler='gnu95'" ]; + enableParallelBuilding = true; + buildInputs = (old.buildInputs or [ ]) ++ [ self.numpy.blas ]; + preConfigure = '' + sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py + export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES + ''; + preBuild = '' + ln -s ${self.numpy.cfg} site.cfg + ''; + } else old + ); + + scikit-image = super.scikit-image.overridePythonAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + self.pythran + self.packaging + self.wheel + self.numpy + ]; + } + ); + + scikit-learn = super.scikit-learn.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + pkgs.gfortran + ] ++ lib.optionals stdenv.cc.isClang [ + pkgs.llvmPackages.openmp + ] ++ lib.optionals stdenv.isLinux [ + pkgs.glibcLocales + ]; + + enableParallelBuilding = true; + } + ); + + secp256k1 = super.secp256k1.overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig pkgs.autoconf pkgs.automake pkgs.libtool ]; + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + doCheck = false; + # Local setuptools versions like "x.y.post0" confuse an internal check + postPatch = '' + substituteInPlace setup.py \ + --replace 'setuptools_version.' '"${self.setuptools.version}".' + ''; + }); + + shapely = super.shapely.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.geos ]; + inherit (pkgs.python3.pkgs.shapely) patches GEOS_LIBRARY_PATH; + } + ); + + shellcheck-py = super.shellcheck-py.overridePythonAttrs (old: { + + # Make fetching/installing external binaries no-ops + preConfigure = + let + fakeCommand = "type('FakeCommand', (Command,), {'initialize_options': lambda self: None, 'finalize_options': lambda self: None, 'run': lambda self: None})"; + in + '' + substituteInPlace setup.py \ + --replace "'fetch_binaries': fetch_binaries," "'fetch_binaries': ${fakeCommand}," \ + --replace "'install_shellcheck': install_shellcheck," "'install_shellcheck': ${fakeCommand}," + ''; + + propagatedUserEnvPkgs = (old.propagatedUserEnvPkgs or [ ]) ++ [ + pkgs.shellcheck + ]; + + }); + + systemd-python = super.systemd-python.overridePythonAttrs (old: { + buildInputs = old.buildInputs ++ [ pkgs.systemd ]; + nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkg-config ]; + }); + + tables = super.tables.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pywavelets ]; + HDF5_DIR = lib.getDev pkgs.hdf5; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + propagatedBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.hdf5 self.numpy self.numexpr ]; + } + ); + + tempora = super.tempora.overridePythonAttrs ( + old: { + # required for the extra "toml" dependency in setuptools_scm[toml] + buildInputs = (old.buildInputs or [ ]) ++ [ + self.toml + ]; + } + ); + + tensorboard = super.tensorboard.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + self.wheel + self.absl-py + ]; + HDF5_DIR = "${pkgs.hdf5}"; + propagatedBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + pkgs.hdf5 + self.google-auth-oauthlib + self.tensorboard-plugin-wit + self.numpy + self.markdown + self.tensorboard-data-server + self.grpcio + self.protobuf + self.werkzeug + self.absl-py + ]; + } + ); + + tensorflow = super.tensorflow.overridePythonAttrs ( + old: { + postInstall = '' + rm $out/bin/tensorboard + ''; + } + ); + + tensorpack = super.tensorpack.overridePythonAttrs ( + old: { + postPatch = '' + substituteInPlace setup.cfg --replace "# will call find_packages()" "" + ''; + } + ); + + tinycss2 = super.tinycss2.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + # The tokenizers build requires a complex rust setup (cf. nixpkgs override) + # + # Instead of providing a full source build, we use a wheel to keep + # the complexity manageable for now. + tokenizers = super.tokenizers.override { + preferWheel = true; + }; + + torch = lib.makeOverridable + ({ enableCuda ? false + , cudatoolkit ? pkgs.cudatoolkit_10_1 + , pkg ? super.torch + }: pkg.overrideAttrs (old: + { + preConfigure = + if (!enableCuda) then '' + export USE_CUDA=0 + '' else '' + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${cudatoolkit}/targets/x86_64-linux/lib" + ''; + preFixup = lib.optionalString (!enableCuda) '' + # For some reason pytorch retains a reference to libcuda even if it + # is explicitly disabled with USE_CUDA=0. + find $out -name "*.so" -exec ${pkgs.patchelf}/bin/patchelf --remove-needed libcuda.so.1 {} \; + ''; + buildInputs = + (old.buildInputs or [ ]) + ++ [ self.typing-extensions ] + ++ lib.optionals enableCuda [ + pkgs.linuxPackages.nvidia_x11 + pkgs.nccl.dev + pkgs.nccl.out + ]; + propagatedBuildInputs = [ + self.numpy + self.future + self.typing-extensions + ]; + }) + ) + { }; + + torchvision = lib.makeOverridable + ({ enableCuda ? false + , cudatoolkit ? pkgs.cudatoolkit_10_1 + , pkg ? super.torchvision + }: pkg.overrideAttrs (old: { + + # without that autoPatchelfHook will fail because cudatoolkit is not in LD_LIBRARY_PATH + autoPatchelfIgnoreMissingDeps = true; + buildInputs = (old.buildInputs or [ ]) + ++ [ self.torch ] + ++ lib.optionals enableCuda [ + cudatoolkit + ]; + preConfigure = + if (enableCuda) then '' + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib:${lib.makeLibraryPath [ cudatoolkit "${cudatoolkit}" ]}" + '' else '' + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib" + ''; + })) + { }; + + typed_ast = super.typed-ast.overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + self.pytest-runner + ]; + }); + + urwidtrees = super.urwidtrees.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + self.urwid + ]; + } + ); + + vose-alias-method = super.vose-alias-method.overridePythonAttrs ( + old: { + postInstall = '' + rm -f $out/LICENSE + ''; + } + ); + + vispy = super.vispy.overrideAttrs ( + old: { + inherit (pkgs.python3.pkgs.vispy) patches; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + self.setuptools-scm-git-archive + ]; + } + ); + + uvloop = super.uvloop.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ 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 + bootstrapped-pip = super.bootstrapped-pip.override { + wheel = (pkgs.python3.pkgs.override { + python = self.python; + }).wheel; + }; + + weasyprint = super.weasyprint.overridePythonAttrs ( + old: { + inherit (pkgs.python3.pkgs.weasyprint) patches; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pytest-runner ]; + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + web3 = super.web3.overridePythonAttrs { + preConfigure = '' + substituteInPlace setup.py --replace \'setuptools-markdown\' "" + ''; + }; + + weblate-language-data = super.weblate-language-data.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ + self.translate-toolkit + ]; + } + ); + + wheel = + let + isWheel = super.wheel.src.isWheel or false; + # If "wheel" is a pre-built binary wheel + wheelPackage = super.buildPythonPackage { + inherit (super.wheel) pname name version src; + inherit (pkgs.python3.pkgs.wheel) meta; + format = "wheel"; + }; + # If "wheel" is built from source + sourcePackage = (( + pkgs.python3.pkgs.override { + python = self.python; + } + ).wheel.override { + inherit (self) buildPythonPackage bootstrapped-pip setuptools; + }).overrideAttrs (old: { + inherit (super.wheel) pname name version src; + }); + in + if isWheel then wheelPackage else sourcePackage; + + zipp = if super.zipp == null then null else + super.zipp.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + self.toml + ]; + } + ); + + packaging = + let + old = super.packaging; + in + # From 20.5 until 20.7, packaging used flit for packaging (heh) + # See https://github.com/pypa/packaging/pull/352 and https://github.com/pypa/packaging/pull/367 + if (lib.versionAtLeast old.version "20.5" && lib.versionOlder old.version "20.8") then + addBuildSystem + { + inherit self; + drv = old; + attr = "flit-core"; + } else old; + + psutil = super.psutil.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ + lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.IOKit; + } + ); + + sentencepiece = super.sentencepiece.overridePythonAttrs ( + old: { + dontUseCmakeConfigure = true; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ + pkg-config + pkgs.cmake + pkgs.gperftools + ]; + buildInputs = (old.buildInputs or [ ]) ++ [ + pkgs.sentencepiece + ]; + } + ); + + sentence-transformers = super.sentence-transformers.overridePythonAttrs ( + old: { + buildInputs = + (old.buildInputs or [ ]) + ++ [ self.typing-extensions ]; + } + ); + + supervisor = super.supervisor.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + self.meld3 + self.setuptools + ]; + } + ); + + cytoolz = super.cytoolz.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.toolz ]; + } + ); + + # For some reason the toml dependency of tqdm declared here: + # https://github.com/tqdm/tqdm/blob/67130a23646ae672836b971e1086b6ae4c77d930/pyproject.toml#L2 + # is not translated correctly to a nix dependency. + tqdm = super.tqdm.overrideAttrs ( + old: { + buildInputs = [ super.toml ] ++ (old.buildInputs or [ ]); + } + ); + + watchdog = super.watchdog.overrideAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) + ++ lib.optional pkgs.stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreServices; + } + ); + + # pyee cannot find `vcversioner` and other "setup requirements", so it tries to + # download them from the internet, which only works when nix sandboxing is disabled. + # Additionally, since pyee uses vcversioner to specify its version, we need to do this + # manually specify its version. + pyee = super.pyee.overrideAttrs ( + old: { + postPatch = old.postPatch or "" + '' + sed -i setup.py \ + -e '/setup_requires/,/],/d' \ + -e 's/vcversioner={},/version="${old.version}",/' + ''; + } + ); + + # nixpkgs has setuptools_scm 4.1.2 + # but newrelic has a seemingly unnecessary version constraint for <4 + # So we patch that out + newrelic = super.newrelic.overridePythonAttrs ( + old: { + postPatch = old.postPatch or "" + '' + substituteInPlace setup.py --replace '"setuptools_scm>=3.2,<4"' '"setuptools_scm"' + ''; + } + ); + + wxpython = super.wxpython.overridePythonAttrs (old: + let + localPython = self.python.withPackages (ps: with ps; [ + setuptools + numpy + six + ]); + in + { + DOXYGEN = "${pkgs.doxygen}/bin/doxygen"; + + nativeBuildInputs = with pkgs; [ + which + doxygen + gtk3 + pkg-config + autoPatchelfHook + ] ++ (old.nativeBuildInputs or [ ]); + + buildInputs = with pkgs; [ + gtk3 + webkitgtk + ncurses + SDL2 + xorg.libXinerama + xorg.libSM + xorg.libXxf86vm + xorg.libXtst + xorg.xorgproto + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + libGLU + libGL + libglvnd + mesa + ] ++ old.buildInputs; + + buildPhase = '' + ${localPython.interpreter} build.py -v build_wx + ${localPython.interpreter} build.py -v dox etg --nodoc sip + ${localPython.interpreter} build.py -v build_py + ''; + + installPhase = '' + ${localPython.interpreter} setup.py install --skip-build --prefix=$out + ''; + }); + + marisa-trie = super.marisa-trie.overridePythonAttrs ( + old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; + } + ); + + ua-parser = super.ua-parser.overridePythonAttrs ( + old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pyyaml ]; + } + ); + + pygraphviz = super.pygraphviz.overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ]; + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.graphviz ]; + }); + + pysqlite = super.pysqlite.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.sqlite ]; + patchPhase = '' + substituteInPlace "setup.cfg" \ + --replace "/usr/local/include" "${pkgs.sqlite.dev}/include" \ + --replace "/usr/local/lib" "${pkgs.sqlite.out}/lib" + ${lib.optionalString (!stdenv.isDarwin) ''export LDSHARED="$CC -pthread -shared"''} + ''; + }); + + selinux = super.selinux.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; + }); + + uwsgi = super.uwsgi.overridePythonAttrs + (old: + { + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.ncurses ]; + } // lib.optionalAttrs (lib.versionAtLeast old.version "2.0.19" && lib.versionOlder old.version "2.0.20") { + sourceRoot = "."; + }); + + wcwidth = super.wcwidth.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ + lib.optional self.isPy27 (self.backports-functools-lru-cache or self.backports_functools_lru_cache) + ; + }); + + wtforms = super.wtforms.overridePythonAttrs (old: { + buildInputs = (old.buildInputs or [ ]) ++ [ self.Babel ]; + }); + + } + ) + +] diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix b/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix index 56f894c2e752..b16bd5f3cebc 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix @@ -1,7 +1,7 @@ { lib, stdenv, poetryLib, python, isLinux ? stdenv.isLinux }: let - inherit (lib.strings) hasSuffix hasInfix splitString removeSuffix; - inherit (poetryLib) targetMachine; + inherit (lib.strings) escapeRegex hasPrefix hasSuffix hasInfix splitString removePrefix removeSuffix; + targetMachine = poetryLib.getTargetMachine stdenv; # The 'cpxy" as determined by `python.version` # @@ -52,10 +52,10 @@ let # x = "cpXX" | "py2" | "py3" | "py2.py3" isPyVersionCompatible = pyver: x: let - normalize = y: ''cp${lib.strings.removePrefix "cp" (lib.strings.removePrefix "py" y)}''; - isCompat = p: x: lib.strings.hasPrefix (normalize x) p; + normalize = y: ''cp${removePrefix "cp" (removePrefix "py" y)}''; + isCompat = p: x: hasPrefix (normalize x) p; in - lib.lists.any (isCompat pyver) (lib.strings.splitString "." x); + lib.lists.any (isCompat pyver) (splitString "." x); # # Selects the best matching wheel file from a list of files @@ -63,7 +63,7 @@ let selectWheel = files: let filesWithoutSources = (builtins.filter (x: hasSuffix ".whl" x.file) files); - isPyAbiCompatible = pyabi: x: x == "none" || lib.hasPrefix pyabi x || lib.hasPrefix x pyabi || ( + isPyAbiCompatible = pyabi: x: x == "none" || hasPrefix pyabi x || hasPrefix x pyabi || ( # The CPython stable ABI is abi3 as in the shared library suffix. python.passthru.implementation == "cpython" && builtins.elemAt (lib.splitString "." python.version) 0 == "3" && @@ -75,32 +75,30 @@ let then if targetMachine != null then - ( - x: x.platform == "any" || lib.lists.any (e: hasInfix e x.platform) [ - "manylinux1_${targetMachine}" - "manylinux2010_${targetMachine}" - "manylinux2014_${targetMachine}" - ] + # See PEP 600 for details. + (p: + builtins.match "any|manylinux(1|2010|2014)_${escapeRegex targetMachine}|manylinux_[0-9]+_[0-9]+_${escapeRegex targetMachine}" p != null ) else - (x: x.platform == "any") + (p: p == "any") else if stdenv.isDarwin then if stdenv.targetPlatform.isAarch64 - then (x: x.platform == "any" || (hasInfix "macosx" x.platform && lib.lists.any (e: hasSuffix e x.platform) [ "arm64" "aarch64" ])) - else (x: x.platform == "any" || (hasInfix "macosx" x.platform && hasSuffix "x86_64" x.platform)) - else (x: x.platform == "any"); + then (p: p == "any" || (hasInfix "macosx" p && lib.lists.any (e: hasSuffix e p) [ "arm64" "aarch64" ])) + else (p: p == "any" || (hasInfix "macosx" p && hasSuffix "x86_64" p)) + else (p: p == "any"); + withPlatforms = x: lib.lists.any withPlatform (splitString "." x.platform); filterWheel = x: let f = toWheelAttrs x.file; in - (withPython pythonTag abiTag f) && (withPlatform f); + (withPython pythonTag abiTag f) && (withPlatforms f); filtered = builtins.filter filterWheel filesWithoutSources; choose = files: let osxMatches = [ "12_0" "11_0" "10_12" "10_11" "10_10" "10_9" "10_8" "10_7" "any" ]; - linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "any" ]; + linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "manylinux_" "any" ]; chooseLinux = x: lib.take 1 (findBestMatches linuxMatches x); chooseOSX = x: lib.take 1 (findBestMatches osxMatches x); in diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix b/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix index 5098c5c3a90c..c9cef28fe85e 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix @@ -1,6 +1,8 @@ { lib, stdenv, poetryLib }: python: let - inherit (poetryLib) ireplace targetMachine; + inherit (poetryLib) ireplace; + + targetMachine = poetryLib.getTargetMachine stdenv; # Like builtins.substring but with stop being offset instead of length substr = start: stop: s: builtins.substring start (stop - start) s; diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/default.nix b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/default.nix index 8e52d7387c40..868599bde689 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/default.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/default.nix @@ -14,9 +14,6 @@ poetry2nix.mkPoetryApplication { inherit projectDir pyproject poetrylock; - # Don't include poetry in inputs - __isBootstrap = true; - src = fetchFromGitHub (lib.importJSON ./src.json); # "Vendor" dependencies (for build-system support) diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/poetry.lock b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/poetry.lock index 2da1370add73..5f179e2415d7 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/poetry.lock +++ b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/poetry.lock @@ -8,32 +8,17 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "attrs" -version = "21.2.0" +version = "21.4.0" description = "Classes Without Boilerplate" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] - -[[package]] -name = "backports.entry-points-selectable" -version = "1.1.1" -description = "Compatibility shim providing selectable entry points for older implementations" -category = "main" -optional = false -python-versions = ">=2.7" - -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - -[package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -testing = ["pytest", "pytest-flake8", "pytest-cov", "pytest-black (>=0.3.7)", "pytest-mypy", "pytest-checkdocs (>=2.4)", "pytest-enabler (>=1.0.1)"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] [[package]] name = "backports.functools-lru-cache" @@ -245,7 +230,7 @@ test = ["pytest (>=3.6.0,!=3.9.0,!=3.9.1,!=3.9.2)", "pretend", "iso8601", "pytz" [[package]] name = "cryptography" -version = "36.0.1" +version = "36.0.2" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "main" optional = false @@ -364,7 +349,7 @@ six = "*" [[package]] name = "identify" -version = "2.4.0" +version = "2.4.4" description = "File identification library for Python" category = "dev" optional = false @@ -417,6 +402,14 @@ zipp = {version = ">=0.4", markers = "python_version < \"3.8\""} [package.extras] docs = ["sphinx", "rst.linker", "jaraco.packaging"] +[[package]] +name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "ipaddress" version = "1.0.23" @@ -484,7 +477,7 @@ testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake [[package]] name = "keyring" -version = "21.8.0" +version = "22.3.0" description = "Store and access your passwords safely." category = "main" optional = false @@ -498,7 +491,7 @@ SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""} [package.extras] docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "pytest-black (>=0.3.7)", "pytest-mypy"] +testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "pytest-enabler", "pytest-black (>=0.3.7)", "pytest-mypy"] [[package]] name = "lockfile" @@ -589,7 +582,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "pathlib2" -version = "2.3.6" +version = "2.3.7.post1" description = "Object-oriented filesystem paths" category = "main" optional = false @@ -598,6 +591,7 @@ python-versions = "*" [package.dependencies] scandir = {version = "*", markers = "python_version < \"3.5\""} six = "*" +typing = {version = "*", markers = "python_version < \"3.5\""} [[package]] name = "pexpect" @@ -645,7 +639,7 @@ dev = ["pre-commit", "tox"] [[package]] name = "poetry-core" -version = "1.0.7" +version = "1.0.8" description = "Poetry PEP 517 Build Backend" category = "main" optional = false @@ -660,7 +654,7 @@ typing = {version = ">=3.7.4.1,<4.0.0.0", markers = "python_version >= \"2.7\" a [[package]] name = "pre-commit" -version = "2.16.0" +version = "2.17.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false @@ -768,6 +762,28 @@ wcwidth = "*" checkqa-mypy = ["mypy (==v0.761)"] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] +[[package]] +name = "pytest" +version = "6.2.5" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +py = ">=1.8.2" +toml = "*" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + [[package]] name = "pytest-cov" version = "2.12.1" @@ -973,7 +989,7 @@ typing = {version = ">=3.6,<4.0", markers = "python_version >= \"2.7\" and pytho [[package]] name = "tox" -version = "3.24.4" +version = "3.24.5" description = "tox is a generic virtualenv management and test command line tool" category = "dev" optional = false @@ -992,7 +1008,7 @@ virtualenv = ">=16.0.0,<20.0.0 || >20.0.0,<20.0.1 || >20.0.1,<20.0.2 || >20.0.2, [package.extras] docs = ["pygments-github-lexers (>=0.0.5)", "sphinx (>=2.0.0)", "sphinxcontrib-autoprogram (>=0.1.5)", "towncrier (>=18.5.0)"] -testing = ["flaky (>=3.4.0)", "freezegun (>=0.3.11)", "psutil (>=5.6.1)", "pytest (>=4.0.0)", "pytest-cov (>=2.5.1)", "pytest-mock (>=1.10.0)", "pytest-randomly (>=1.0.0)", "pytest-xdist (>=1.22.2)", "pathlib2 (>=2.3.3)"] +testing = ["flaky (>=3.4.0)", "freezegun (>=0.3.11)", "pytest (>=4.0.0)", "pytest-cov (>=2.5.1)", "pytest-mock (>=1.10.0)", "pytest-randomly (>=1.0.0)", "psutil (>=5.6.1)", "pathlib2 (>=2.3.3)"] [[package]] name = "typing" @@ -1025,14 +1041,13 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.10.0" +version = "20.14.0" description = "Virtual Python Environment builder" category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" [package.dependencies] -"backports.entry-points-selectable" = ">=1.0.4" distlib = ">=0.3.1,<1" filelock = ">=3.2,<4" importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} @@ -1082,7 +1097,7 @@ testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"] [metadata] lock-version = "1.1" python-versions = "~2.7 || ^3.5" -content-hash = "290e530f0cdd81360dd6cb93f3182ac8e8b18a46238198d25de11c26f6b0c356" +content-hash = "3de9a28e5a2f53d26b75a9aa3eb333b360eb04470769675fb435183ab871798c" [metadata.files] atomicwrites = [ @@ -1090,12 +1105,8 @@ atomicwrites = [ {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, ] attrs = [ - {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, - {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, -] -"backports.entry-points-selectable" = [ - {file = "backports.entry_points_selectable-1.1.1-py2.py3-none-any.whl", hash = "sha256:7fceed9532a7aa2bd888654a7314f864a3c16a4e710b34a58cfc0f08114c663b"}, - {file = "backports.entry_points_selectable-1.1.1.tar.gz", hash = "sha256:914b21a479fde881635f7af5adc7f6e38d6b274be32269070c53b698c60d5386"}, + {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"}, + {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"}, ] "backports.functools-lru-cache" = [ {file = "backports.functools_lru_cache-1.6.4-py2.py3-none-any.whl", hash = "sha256:dbead04b9daa817909ec64e8d2855fb78feafe0b901d4568758e3a60559d8978"}, @@ -1290,26 +1301,26 @@ cryptography = [ {file = "cryptography-3.3.2-cp36-abi3-win32.whl", hash = "sha256:3c284fc1e504e88e51c428db9c9274f2da9f73fdf5d7e13a36b8ecb039af6e6c"}, {file = "cryptography-3.3.2-cp36-abi3-win_amd64.whl", hash = "sha256:7951a966613c4211b6612b0352f5bf29989955ee592c4a885d8c7d0f830d0433"}, {file = "cryptography-3.3.2.tar.gz", hash = "sha256:5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed"}, - {file = "cryptography-36.0.1-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:73bc2d3f2444bcfeac67dd130ff2ea598ea5f20b40e36d19821b4df8c9c5037b"}, - {file = "cryptography-36.0.1-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:2d87cdcb378d3cfed944dac30596da1968f88fb96d7fc34fdae30a99054b2e31"}, - {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:74d6c7e80609c0f4c2434b97b80c7f8fdfaa072ca4baab7e239a15d6d70ed73a"}, - {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:6c0c021f35b421ebf5976abf2daacc47e235f8b6082d3396a2fe3ccd537ab173"}, - {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d59a9d55027a8b88fd9fd2826c4392bd487d74bf628bb9d39beecc62a644c12"}, - {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a817b961b46894c5ca8a66b599c745b9a3d9f822725221f0e0fe49dc043a3a3"}, - {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:94ae132f0e40fe48f310bba63f477f14a43116f05ddb69d6fa31e93f05848ae2"}, - {file = "cryptography-36.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:7be0eec337359c155df191d6ae00a5e8bbb63933883f4f5dffc439dac5348c3f"}, - {file = "cryptography-36.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:e0344c14c9cb89e76eb6a060e67980c9e35b3f36691e15e1b7a9e58a0a6c6dc3"}, - {file = "cryptography-36.0.1-cp36-abi3-win32.whl", hash = "sha256:4caa4b893d8fad33cf1964d3e51842cd78ba87401ab1d2e44556826df849a8ca"}, - {file = "cryptography-36.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:391432971a66cfaf94b21c24ab465a4cc3e8bf4a939c1ca5c3e3a6e0abebdbcf"}, - {file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bb5829d027ff82aa872d76158919045a7c1e91fbf241aec32cb07956e9ebd3c9"}, - {file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ebc15b1c22e55c4d5566e3ca4db8689470a0ca2babef8e3a9ee057a8b82ce4b1"}, - {file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:596f3cd67e1b950bc372c33f1a28a0692080625592ea6392987dba7f09f17a94"}, - {file = "cryptography-36.0.1-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:30ee1eb3ebe1644d1c3f183d115a8c04e4e603ed6ce8e394ed39eea4a98469ac"}, - {file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ec63da4e7e4a5f924b90af42eddf20b698a70e58d86a72d943857c4c6045b3ee"}, - {file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca238ceb7ba0bdf6ce88c1b74a87bffcee5afbfa1e41e173b1ceb095b39add46"}, - {file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:ca28641954f767f9822c24e927ad894d45d5a1e501767599647259cbf030b903"}, - {file = "cryptography-36.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:39bdf8e70eee6b1c7b289ec6e5d84d49a6bfa11f8b8646b5b3dfe41219153316"}, - {file = "cryptography-36.0.1.tar.gz", hash = "sha256:53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638"}, + {file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:4e2dddd38a5ba733be6a025a1475a9f45e4e41139d1321f412c6b360b19070b6"}, + {file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:4881d09298cd0b669bb15b9cfe6166f16fc1277b4ed0d04a22f3d6430cb30f1d"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ea634401ca02367c1567f012317502ef3437522e2fc44a3ea1844de028fa4b84"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:7be666cc4599b415f320839e36367b273db8501127b38316f3b9f22f17a0b815"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8241cac0aae90b82d6b5c443b853723bcc66963970c67e56e71a2609dc4b5eaf"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b2d54e787a884ffc6e187262823b6feb06c338084bbe80d45166a1cb1c6c5bf"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:c2c5250ff0d36fd58550252f54915776940e4e866f38f3a7866d92b32a654b86"}, + {file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:ec6597aa85ce03f3e507566b8bcdf9da2227ec86c4266bd5e6ab4d9e0cc8dab2"}, + {file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ca9f686517ec2c4a4ce930207f75c00bf03d94e5063cbc00a1dc42531511b7eb"}, + {file = "cryptography-36.0.2-cp36-abi3-win32.whl", hash = "sha256:f64b232348ee82f13aac22856515ce0195837f6968aeaa94a3d0353ea2ec06a6"}, + {file = "cryptography-36.0.2-cp36-abi3-win_amd64.whl", hash = "sha256:53e0285b49fd0ab6e604f4c5d9c5ddd98de77018542e88366923f152dbeb3c29"}, + {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:32db5cc49c73f39aac27574522cecd0a4bb7384e71198bc65a0d23f901e89bb7"}, + {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b3d199647468d410994dbeb8cec5816fb74feb9368aedf300af709ef507e3e"}, + {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:da73d095f8590ad437cd5e9faf6628a218aa7c387e1fdf67b888b47ba56a17f0"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:0a3bf09bb0b7a2c93ce7b98cb107e9170a90c51a0162a20af1c61c765b90e60b"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8897b7b7ec077c819187a123174b645eb680c13df68354ed99f9b40a50898f77"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82740818f2f240a5da8dfb8943b360e4f24022b093207160c77cadade47d7c85"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:1f64a62b3b75e4005df19d3b5235abd43fa6358d5516cfc43d87aeba8d08dd51"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e167b6b710c7f7bc54e67ef593f8731e1f45aa35f8a8a7b72d6e42ec76afd4b3"}, + {file = "cryptography-36.0.2.tar.gz", hash = "sha256:70f8f4f7bb2ac9f340655cbac89d68c527af5bb4387522a8413e841e3e6628c9"}, ] distlib = [ {file = "distlib-0.3.4-py2.py3-none-any.whl", hash = "sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b"}, @@ -1351,8 +1362,8 @@ httpretty = [ {file = "httpretty-0.9.7.tar.gz", hash = "sha256:66216f26b9d2c52e81808f3e674a6fb65d4bf719721394a1a9be926177e55fbe"}, ] identify = [ - {file = "identify-2.4.0-py2.py3-none-any.whl", hash = "sha256:eba31ca80258de6bb51453084bff4a923187cd2193b9c13710f2516ab30732cc"}, - {file = "identify-2.4.0.tar.gz", hash = "sha256:a33ae873287e81651c7800ca309dc1f84679b763c9c8b30680e16fbfa82f0107"}, + {file = "identify-2.4.4-py2.py3-none-any.whl", hash = "sha256:aa68609c7454dbcaae60a01ff6b8df1de9b39fe6e50b1f6107ec81dcda624aa6"}, + {file = "identify-2.4.4.tar.gz", hash = "sha256:6b4b5031f69c48bf93a646b90de9b381c6b5f560df4cbe0ed3cf7650ae741e4d"}, ] idna = [ {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, @@ -1366,6 +1377,10 @@ importlib-resources = [ {file = "importlib_resources-3.2.1-py2.py3-none-any.whl", hash = "sha256:e2860cf0c4bc999947228d18be154fa3779c5dde0b882bd2d7b3f4d25e698bd6"}, {file = "importlib_resources-3.2.1.tar.gz", hash = "sha256:a9fe213ab6452708ec1b3f4ec6f2881b8ab3645cb4e5efb7fea2bbf05a91db3b"}, ] +iniconfig = [ + {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, + {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, +] ipaddress = [ {file = "ipaddress-1.0.23-py2.py3-none-any.whl", hash = "sha256:6e0f4a39e66cb5bb9a137b00276a2eff74f93b71dcbdad6f10ff7df9d3557fcc"}, {file = "ipaddress-1.0.23.tar.gz", hash = "sha256:b7f8e0369580bb4a24d5ba1d7cc29660a4a6987763faf1d8a8046830e020e7e2"}, @@ -1381,8 +1396,8 @@ keyring = [ {file = "keyring-18.0.1.tar.gz", hash = "sha256:67d6cc0132bd77922725fae9f18366bb314fd8f95ff4d323a4df41890a96a838"}, {file = "keyring-20.0.1-py2.py3-none-any.whl", hash = "sha256:c674f032424b4bffc62abeac5523ec49cc84aed07a480c3233e0baf618efc15c"}, {file = "keyring-20.0.1.tar.gz", hash = "sha256:963bfa7f090269d30bdc5e25589e5fd9dad2cf2a7c6f176a7f2386910e5d0d8d"}, - {file = "keyring-21.8.0-py3-none-any.whl", hash = "sha256:4be9cbaaaf83e61d6399f733d113ede7d1c73bc75cb6aeb64eee0f6ac39b30ea"}, - {file = "keyring-21.8.0.tar.gz", hash = "sha256:1746d3ac913d449a090caf11e9e4af00e26c3f7f7e81027872192b2398b98675"}, + {file = "keyring-22.3.0-py3-none-any.whl", hash = "sha256:2bc8363ebdd63886126a012057a85c8cb6e143877afa02619ac7dbc9f38a207b"}, + {file = "keyring-22.3.0.tar.gz", hash = "sha256:16927a444b2c73f983520a48dec79ddab49fe76429ea05b8d528d778c8339522"}, ] lockfile = [ {file = "lockfile-0.12.2-py2.py3-none-any.whl", hash = "sha256:6c3cb24f344923d30b2785d5ad75182c8ea7ac1b6171b08657258ec7429d50fa"}, @@ -1450,8 +1465,8 @@ pastel = [ {file = "pastel-0.2.1.tar.gz", hash = "sha256:e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d"}, ] pathlib2 = [ - {file = "pathlib2-2.3.6-py2.py3-none-any.whl", hash = "sha256:3a130b266b3a36134dcc79c17b3c7ac9634f083825ca6ea9d8f557ee6195c9c8"}, - {file = "pathlib2-2.3.6.tar.gz", hash = "sha256:7d8bcb5555003cdf4a8d2872c538faa3a0f5d20630cb360e518ca3b981795e5f"}, + {file = "pathlib2-2.3.7.post1-py2.py3-none-any.whl", hash = "sha256:5266a0fd000452f1b3467d782f079a4343c63aaa119221fbdc4e39577489ca5b"}, + {file = "pathlib2-2.3.7.post1.tar.gz", hash = "sha256:9fe0edad898b83c0c3e199c842b27ed216645d2e177757b2dd67384d4113c641"}, ] pexpect = [ {file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"}, @@ -1470,12 +1485,12 @@ pluggy = [ {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, ] poetry-core = [ - {file = "poetry-core-1.0.7.tar.gz", hash = "sha256:98c11c755a16ef6c5673c22ca94a3802a7df4746a0853a70b6fae8b9f5cac206"}, - {file = "poetry_core-1.0.7-py2.py3-none-any.whl", hash = "sha256:4f8a7f5390d772f42c4c4c3f188e6424b802cb4b57466c6633a1b9ac36f18a43"}, + {file = "poetry-core-1.0.8.tar.gz", hash = "sha256:951fc7c1f8d710a94cb49019ee3742125039fc659675912ea614ac2aa405b118"}, + {file = "poetry_core-1.0.8-py2.py3-none-any.whl", hash = "sha256:54b0fab6f7b313886e547a52f8bf52b8cf43e65b2633c65117f8755289061924"}, ] pre-commit = [ - {file = "pre_commit-2.16.0-py2.py3-none-any.whl", hash = "sha256:758d1dc9b62c2ed8881585c254976d66eae0889919ab9b859064fc2fe3c7743e"}, - {file = "pre_commit-2.16.0.tar.gz", hash = "sha256:fe9897cac830aa7164dbd02a4e7b90cae49630451ce88464bca73db486ba9f65"}, + {file = "pre_commit-2.17.0-py2.py3-none-any.whl", hash = "sha256:725fa7459782d7bec5ead072810e47351de01709be838c2ce1726b9591dad616"}, + {file = "pre_commit-2.17.0.tar.gz", hash = "sha256:c1a8040ff15ad3d648c70cc3e55b93e4d2d5b687320955505587fd79bbaed06a"}, ] ptyprocess = [ {file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"}, @@ -1502,6 +1517,8 @@ pytest = [ {file = "pytest-4.6.11.tar.gz", hash = "sha256:50fa82392f2120cc3ec2ca0a75ee615be4c479e66669789771f1758332be4353"}, {file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"}, {file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"}, + {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, + {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, ] pytest-cov = [ {file = "pytest-cov-2.12.1.tar.gz", hash = "sha256:261ceeb8c227b726249b376b8526b600f38667ee314f910353fa318caa01f4d7"}, @@ -1610,8 +1627,8 @@ tomlkit = [ {file = "tomlkit-0.7.2.tar.gz", hash = "sha256:d7a454f319a7e9bd2e249f239168729327e4dd2d27b17dc68be264ad1ce36754"}, ] tox = [ - {file = "tox-3.24.4-py2.py3-none-any.whl", hash = "sha256:5e274227a53dc9ef856767c21867377ba395992549f02ce55eb549f9fb9a8d10"}, - {file = "tox-3.24.4.tar.gz", hash = "sha256:c30b57fa2477f1fb7c36aa1d83292d5c2336cd0018119e1b1c17340e2c2708ca"}, + {file = "tox-3.24.5-py2.py3-none-any.whl", hash = "sha256:be3362472a33094bce26727f5f771ca0facf6dafa217f65875314e9a6600c95c"}, + {file = "tox-3.24.5.tar.gz", hash = "sha256:67e0e32c90e278251fea45b696d0fef3879089ccbe979b0c556d35d5a70e2993"}, ] typing = [ {file = "typing-3.10.0.0-py2-none-any.whl", hash = "sha256:c7219ef20c5fbf413b4567092adfc46fa6203cb8454eda33c3fc1afe1398a308"}, @@ -1628,8 +1645,8 @@ urllib3 = [ {file = "urllib3-1.25.11.tar.gz", hash = "sha256:8d7eaa5a82a1cac232164990f04874c594c9453ec55eef02eab885aa02fc17a2"}, ] virtualenv = [ - {file = "virtualenv-20.10.0-py2.py3-none-any.whl", hash = "sha256:4b02e52a624336eece99c96e3ab7111f469c24ba226a53ec474e8e787b365814"}, - {file = "virtualenv-20.10.0.tar.gz", hash = "sha256:576d05b46eace16a9c348085f7d0dc8ef28713a2cabaa1cf0aea41e8f12c9218"}, + {file = "virtualenv-20.14.0-py2.py3-none-any.whl", hash = "sha256:1e8588f35e8b42c6ec6841a13c5e88239de1e6e4e4cedfd3916b306dc826ec66"}, + {file = "virtualenv-20.14.0.tar.gz", hash = "sha256:8e5b402037287126e81ccde9432b95a8be5b19d36584f64957060a3488c11ca8"}, ] wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/pyproject.toml b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/pyproject.toml index 5cf34372b050..4fff27d4e0eb 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/pyproject.toml +++ b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry" -version = "1.1.12" +version = "1.1.13" description = "Python dependency management and packaging made easy." authors = [ "Sébastien Eustace " @@ -57,7 +57,7 @@ functools32 = { version = "^3.2.3", python = "~2.7" } keyring = [ { version = "^18.0.1", python = "~2.7" }, { version = "^20.0.1", python = "~3.5" }, - { version = "^21.2.0", python = "^3.6" } + { version = ">=21.2.0", python = "^3.6" } ] # Use subprocess32 for Python 2.7 subprocess32 = { version = "^3.5", python = "~2.7" } @@ -66,7 +66,8 @@ importlib-metadata = {version = "^1.6.0", python = "<3.8"} [tool.poetry.dev-dependencies] pytest = [ {version = "^4.1", python = "<3.5"}, - {version = "^5.4.3", python = ">=3.5"} + {version = "^5.4.3", python = "~3.5"}, + {version = "^6.2.5", python = ">=3.6"} ] pytest-cov = "^2.5" pytest-mock = "^1.9" diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/src.json b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/src.json index aeee3abb7d42..7b35dc31494e 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/src.json +++ b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/src.json @@ -1,7 +1,7 @@ { - "owner": "python-poetry", - "repo": "poetry", - "rev": "020fb336e6da11d3a9909f30bd908437a69f13b3", - "sha256": "1fm4yj6wxr24v7b77gmf63j7xsgszhbhzw2i9fvlfi0p9l0q34pm", - "fetchSubmodules": true + "owner": "python-poetry", + "repo": "poetry", + "rev": "1.1.13", + "sha256": "0zm73wcxjfad3841wl1xpx20drhynrqlxsjh1d1gsh618b7ldpib", + "fetchSubmodules": true } diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/update b/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/update deleted file mode 100755 index 95b7f5bb3318..000000000000 --- a/pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/update +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash -p curl nix-prefetch-github jq - -rev=$(curl -s https://api.github.com/repos/python-poetry/poetry/releases/latest | jq -r '.name') -nix-prefetch-github --rev "$rev" python-poetry poetry > src.json -echo >> src.json - -src=$(nix-build --no-out-link --expr 'with import {}; fetchFromGitHub (lib.importJSON ./src.json)') -cp $src/pyproject.toml $src/poetry.lock . -nix-shell -p poetry --run 'poetry lock' -nix-build --expr '(import { overlays = [ (import ../../overlay.nix) ]; }).poetry' diff --git a/pkgs/development/tools/poetry2nix/update b/pkgs/development/tools/poetry2nix/update index ac8c98a33d9c..047f7a8fea65 100755 --- a/pkgs/development/tools/poetry2nix/update +++ b/pkgs/development/tools/poetry2nix/update @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -euo pipefail pwd=$(pwd) workdir=$(mktemp -d) @@ -15,8 +16,8 @@ mv poetry2nix-master/* . mkdir build cp *.* build/ -cp -r pkgs hooks bin build/ -rm build/shell.nix build/generate.py build/overlay.nix build/flake.* build/check-fmt.nix +cp -r overrides pkgs hooks bin build/ +rm build/shell.nix build/generate.py build/overlay.nix build/flake.* build/check-fmt.nix build/pkgs/poetry/update* cat > build/README.md << EOF Dont change these files here, they are maintained at https://github.com/nix-community/poetry2nix diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 495a7094f9b4..6495b024b008 100644 --- a/pkgs/pkgs-lib/formats.nix +++ b/pkgs/pkgs-lib/formats.nix @@ -31,6 +31,9 @@ rec { */ + inherit (import ./formats/java-properties/default.nix { inherit lib pkgs; }) + javaProperties; + json = {}: { type = with lib.types; let diff --git a/pkgs/pkgs-lib/formats/java-properties/default.nix b/pkgs/pkgs-lib/formats/java-properties/default.nix new file mode 100644 index 000000000000..b63b96d32769 --- /dev/null +++ b/pkgs/pkgs-lib/formats/java-properties/default.nix @@ -0,0 +1,90 @@ +{ lib, pkgs }: +{ + javaProperties = { comment ? "Generated with Nix" }: { + type = lib.types.attrsOf lib.types.str; + + generate = name: value: + pkgs.runCommandLocal name + { + # Requirements + # ============ + # + # 1. Strings in Nix carry over to the same + # strings in Java => need proper escapes + # 2. Generate files quickly + # - A JVM would have to match the app's + # JVM to avoid build closure bloat + # - Even then, JVM startup would slow + # down config generation. + # + # + # Implementation + # ============== + # + # Escaping has two steps + # + # 1. jq + # Escape known separators, in order not + # to break up the keys and values. + # This handles typical whitespace correctly, + # but may produce garbage for other control + # characters. + # + # 2. iconv + # Escape >ascii code points to java escapes, + # as .properties files are supposed to be + # encoded in ISO 8859-1. It's an old format. + # UTF-8 behavior may exist in some apps and + # libraries, but we can't rely on this in + # general. + + passAsFile = [ "value" ]; + value = builtins.toJSON value; + nativeBuildInputs = [ + pkgs.jq + pkgs.libiconvReal + ]; + + jqCode = + let + main = '' + to_entries + | .[] + | "\( + .key + | ${commonEscapes} + | gsub(" "; "\\ ") + | gsub("="; "\\=") + ) = \( + .value + | ${commonEscapes} + | gsub("^ "; "\\ ") + | gsub("\\n "; "\n\\ ") + )" + ''; + # Most escapes are equal for both keys and values. + commonEscapes = '' + gsub("\\\\"; "\\\\") + | gsub("\\n"; "\\n\\\n") + | gsub("#"; "\\#") + | gsub("!"; "\\!") + | gsub("\\t"; "\\t") + | gsub("\r"; "\\r") + ''; + in + main; + + inputEncoding = "UTF-8"; + + inherit comment; + + } '' + ( + echo "$comment" | while read -r ln; do echo "# $ln"; done + echo + jq -r --arg hash '#' "$jqCode" "$valuePath" \ + | iconv --from-code "$inputEncoding" --to-code JAVA \ + ) > "$out" + ''; + }; +} diff --git a/pkgs/pkgs-lib/formats/java-properties/test/Main.java b/pkgs/pkgs-lib/formats/java-properties/test/Main.java new file mode 100644 index 000000000000..dc83944f24b0 --- /dev/null +++ b/pkgs/pkgs-lib/formats/java-properties/test/Main.java @@ -0,0 +1,27 @@ +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.Properties; +import java.util.SortedSet; +import java.util.TreeSet; + +class Main { + public static void main (String args[]) { + try { + InputStream input = new FileInputStream(args[0]); + Properties prop = new Properties(); + prop.load(input); + SortedSet keySet = new TreeSet(prop.keySet()); + for (String key : keySet) { + System.out.println("KEY"); + System.out.println(key); + System.out.println("VALUE"); + System.out.println(prop.get(key)); + System.out.println(""); + } + } catch (Exception e) { + e.printStackTrace(); + System.err.println(e.toString()); + System.exit(1); + } + } +} diff --git a/pkgs/pkgs-lib/formats/java-properties/test/default.nix b/pkgs/pkgs-lib/formats/java-properties/test/default.nix new file mode 100644 index 000000000000..4b3845c10296 --- /dev/null +++ b/pkgs/pkgs-lib/formats/java-properties/test/default.nix @@ -0,0 +1,85 @@ +{ fetchurl +, formats +, glibcLocales +, jdk +, lib +, stdenv +}: +let + inherit (lib) concatStrings attrValues mapAttrs; + + javaProperties = formats.javaProperties { }; + + input = { + foo = "bar"; + "empty value" = ""; + "typical.dot.syntax" = "com.sun.awt"; + "" = "empty key's value"; + "1" = "2 3"; + "#" = "not a comment # still not"; + "!" = "not a comment!"; + "!a" = "still not! a comment"; + "!b" = "still not ! a comment"; + "dos paths" = "C:\\Program Files\\Nix For Windows\\nix.exe"; + "a \t\nb" = " c"; + "angry \t\nkey" = '' + multi + ${"\tline\r"} + space- + indented + trailing-space${" "} + trailing-space${" "} + value + ''; + "this=not" = "bad"; + "nor = this" = "bad"; + "all stuff" = "foo = bar"; + "unicode big brain" = "e = mc□"; + "ütf-8" = "dûh"; + # NB: Some editors (vscode) show this _whole_ line in right-to-left order + "الجبر" = "أكثر من مجرد أرقام"; + }; + +in +stdenv.mkDerivation { + name = "pkgs.formats.javaProperties-test-${jdk.name}"; + nativeBuildInputs = [ + jdk + glibcLocales + ]; + + # technically should go through the type.merge first, but that's tested + # in tests/formats.nix. + properties = javaProperties.generate "example.properties" input; + + # Expected output as printed by Main.java + passAsFile = [ "expected" ]; + expected = concatStrings (attrValues ( + mapAttrs + (key: value: + '' + KEY + ${key} + VALUE + ${value} + + '' + ) + input + )); + + src = lib.sourceByRegex ./. [ + ".*\.java" + ]; + LANG = "C.UTF-8"; + buildPhase = '' + javac Main.java + ''; + doCheck = true; + checkPhase = '' + cat -v $properties + java Main $properties >actual + diff -U3 $expectedPath actual + ''; + installPhase = "touch $out"; +} diff --git a/pkgs/pkgs-lib/tests/default.nix b/pkgs/pkgs-lib/tests/default.nix index f3549ea9b0f2..ae91e15aa9ef 100644 --- a/pkgs/pkgs-lib/tests/default.nix +++ b/pkgs/pkgs-lib/tests/default.nix @@ -1,7 +1,45 @@ # Call nix-build on this file to run all tests in this directory -{ pkgs ? import ../../.. {} }: + +# This produces a link farm derivation with the original attrs +# merged on top of it. +# You can run parts of the "hierarchy" with for example: +# nix-build -A java-properties +# See `structured` below. + +{ pkgs ? import ../../.. { } }: let - formats = import ./formats.nix { inherit pkgs; }; -in pkgs.linkFarm "nixpkgs-pkgs-lib-tests" [ - { name = "formats"; path = import ./formats.nix { inherit pkgs; }; } -] + inherit (pkgs.lib) mapAttrs mapAttrsToList isDerivation mergeAttrs foldl' attrValues recurseIntoAttrs; + + structured = { + formats = import ./formats.nix { inherit pkgs; }; + java-properties = recurseIntoAttrs { + jdk8 = pkgs.callPackage ../formats/java-properties/test { jdk = pkgs.jdk8; }; + jdk11 = pkgs.callPackage ../formats/java-properties/test { jdk = pkgs.jdk11_headless; }; + jdk17 = pkgs.callPackage ../formats/java-properties/test { jdk = pkgs.jdk17_headless; }; + }; + }; + + flatten = prefix: as: + foldl' + mergeAttrs + { } + (attrValues + (mapAttrs + (k: v: + if isDerivation v + then { "${prefix}${k}" = v; } + else if v?recurseForDerivations + then flatten "${prefix}${k}-" (removeAttrs v [ "recurseForDerivations" ]) + else builtins.trace v throw "expected derivation or recurseIntoAttrs") + as + ) + ); +in + +# It has to be a link farm for inclusion in the hydra unstable jobset. +pkgs.linkFarm "pkgs-lib-formats-tests" + (mapAttrsToList + (k: v: { name = k; path = v; }) + (flatten "" structured) + ) +// structured diff --git a/pkgs/pkgs-lib/tests/formats.nix b/pkgs/pkgs-lib/tests/formats.nix index 2bc4e407fe75..1efe9d8686b1 100644 --- a/pkgs/pkgs-lib/tests/formats.nix +++ b/pkgs/pkgs-lib/tests/formats.nix @@ -168,4 +168,23 @@ in runBuildTests { level4 = "deep" ''; }; + + # See also java-properties/default.nix for more complete tests + testJavaProperties = { + drv = evalFormat formats.javaProperties {} { + foo = "bar"; + "1" = "2"; + "ütf 8" = "dûh"; + # NB: Some editors (vscode) show this _whole_ line in right-to-left order + "الجبر" = "أكثر من مجرد أرقام"; + }; + expected = '' + # Generated with Nix + + 1 = 2 + foo = bar + \u00fctf\ 8 = d\u00fbh + \u0627\u0644\u062c\u0628\u0631 = \u0623\u0643\u062b\u0631 \u0645\u0646 \u0645\u062c\u0631\u062f \u0623\u0631\u0642\u0627\u0645 + ''; + }; } diff --git a/pkgs/servers/monitoring/prometheus/dmarc-exporter/default.nix b/pkgs/servers/monitoring/prometheus/dmarc-exporter/default.nix index 98848ee67022..e083df90b413 100644 --- a/pkgs/servers/monitoring/prometheus/dmarc-exporter/default.nix +++ b/pkgs/servers/monitoring/prometheus/dmarc-exporter/default.nix @@ -7,7 +7,8 @@ let poetry2nix.defaultPoetryOverrides (import ./poetry-git-overlay.nix { inherit pkgs; }) (self: super: { - dmarc-metrics-exporter = super.dmarc-metrics-exporter.overridePythonAttrs ({ meta ? {}, ... }: { + dmarc-metrics-exporter = super.dmarc-metrics-exporter.overridePythonAttrs ({ nativeBuildInputs ? [ ], meta ? {}, ... }: { + nativeBuildInputs = nativeBuildInputs ++ [ self.poetry ]; meta = with lib; meta // { license = licenses.mit; homepage = "https://github.com/jgosmann/dmarc-metrics-exporter/"; @@ -44,6 +45,9 @@ let ''; }); dataclasses = null; + bite-parser = super.bite-parser.overridePythonAttrs (old: { + nativeBuildInputs = old.nativeBuildInputs ++ [ self.poetry ]; + }); }) ]; }) python; diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index d572c0390609..63aaf6bb72e7 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -70,4 +70,6 @@ with pkgs; dhall = callPackage ./dhall { }; makeWrapper = callPackage ./make-wrapper {}; + + pkgs-lib = recurseIntoAttrs (import ../pkgs-lib/tests { inherit pkgs; }); } diff --git a/pkgs/tools/bluetooth/blueberry/default.nix b/pkgs/tools/bluetooth/blueberry/default.nix index bbc3babbd132..6a0f1d2d00bc 100644 --- a/pkgs/tools/bluetooth/blueberry/default.nix +++ b/pkgs/tools/bluetooth/blueberry/default.nix @@ -3,18 +3,15 @@ , fetchFromGitHub , bluez-tools , cinnamon +, gnome , gobject-introspection , intltool , pavucontrol , python3Packages , util-linux , wrapGAppsHook -, callPackage }: -let - gnome-bluetooth = callPackage ./gnome-bluetooth.nix {}; -in stdenv.mkDerivation rec { pname = "blueberry"; version = "1.4.7"; @@ -35,7 +32,7 @@ stdenv.mkDerivation rec { buildInputs = [ bluez-tools cinnamon.xapps - gnome-bluetooth + gnome.gnome-bluetooth_1_0 python3Packages.python util-linux ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 23b82d0d6593..d2ca2bb05fd0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21656,6 +21656,9 @@ with pkgs; morty = callPackage ../servers/web-apps/morty { }; + inherit (callPackage ../applications/networking/mullvad { }) + mullvad; + mullvad-vpn = callPackage ../applications/networking/mullvad-vpn { }; mycorrhiza = callPackage ../servers/mycorrhiza {