From eab2ba0a67d13b65eaa9b2f5befbe7fbd0fc0468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Thu, 4 Mar 2021 08:45:33 +0100 Subject: [PATCH 1/2] python3Packages.etebase: switch to buildPythonPackage + cargoSetupHook The derivation also built OpenSSL statically. Switch to our OpenSSL derivation instead, so that the package gets automatic OpenSSL security updates. --- .../python-modules/etebase/default.nix | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/pkgs/development/python-modules/etebase/default.nix b/pkgs/development/python-modules/etebase/default.nix index 7832f6b4787..9151e2471c4 100644 --- a/pkgs/development/python-modules/etebase/default.nix +++ b/pkgs/development/python-modules/etebase/default.nix @@ -1,19 +1,17 @@ -{ lib, stdenv -, wheel -, rustPlatform -, pipInstallHook -, setuptools-rust -, python -, msgpack -, requests -, openssl -, perl -, rustfmt +{ lib +, stdenv , fetchFromGitHub +, buildPythonPackage +, rustPlatform +, pkg-config +, rustfmt +, setuptools-rust +, openssl , Security +, msgpack }: -rustPlatform.buildRustPackage rec { +buildPythonPackage rec { pname = "etebase"; version = "0.31.1"; @@ -24,33 +22,38 @@ rustPlatform.buildRustPackage rec { sha256 = "163iw64l8lwawf84qswcjsq9p8qddv9ysjrr3dzqpqxb2yb0sy39"; }; - cargoSha256 = "0w8ypl6kj1mf6ahbdiwbd4jw6ldxdaig47zwk91jjsww5lbyx4lf"; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + sha256 = "0w8ypl6kj1mf6ahbdiwbd4jw6ldxdaig47zwk91jjsww5lbyx4lf"; + }; + + format = "pyproject"; nativeBuildInputs = [ + pkg-config rustfmt - perl - openssl - pipInstallHook setuptools-rust - wheel - ]; + ] ++ (with rustPlatform; [ + cargoSetupHook + rust.cargo + rust.rustc + ]); - buildInputs = lib.optionals stdenv.isDarwin [ Security ]; + buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ]; propagatedBuildInputs = [ - python msgpack ]; - doCheck = true; - - buildPhase = '' - ${python.interpreter} setup.py bdist_wheel + postPatch = '' + # Use system OpenSSL, which gets security updates. + substituteInPlace Cargo.toml \ + --replace ', features = ["vendored"]' "" ''; - installPhase = '' - pipInstallPhase - ''; + pythonImportsCheck = [ "etebase" ]; + meta = with lib; { homepage = "https://www.etebase.com/"; From 65671395da07d5d6f7daaf69aa7a30d614c3a438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Thu, 4 Mar 2021 08:48:26 +0100 Subject: [PATCH 2/2] python3Packages.etebase: 0.31.1 -> 0.31.2 Changelog: https://github.com/etesync/etebase-py/releases/tag/v0.31.2 (Fixes crashes with Python 3.9.) --- pkgs/development/python-modules/etebase/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/etebase/default.nix b/pkgs/development/python-modules/etebase/default.nix index 9151e2471c4..14c93fc719f 100644 --- a/pkgs/development/python-modules/etebase/default.nix +++ b/pkgs/development/python-modules/etebase/default.nix @@ -13,19 +13,19 @@ buildPythonPackage rec { pname = "etebase"; - version = "0.31.1"; + version = "0.31.2"; src = fetchFromGitHub { owner = "etesync"; repo = "etebase-py"; rev = "v${version}"; - sha256 = "163iw64l8lwawf84qswcjsq9p8qddv9ysjrr3dzqpqxb2yb0sy39"; + hash = "sha256-enGmfXW8eV6FgdHfJqXr1orAsGbxDz9xUY6T706sf5U="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; - sha256 = "0w8ypl6kj1mf6ahbdiwbd4jw6ldxdaig47zwk91jjsww5lbyx4lf"; + hash = "sha256-4eJvFf6aY+DYkrYgam5Ok9941PX4uQOmtRznEY0+1TE="; }; format = "pyproject";