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.
This commit is contained in:
Daniël de Kok 2021-03-04 08:45:33 +01:00
parent 78aa2c4e93
commit eab2ba0a67

View File

@ -1,19 +1,17 @@
{ lib, stdenv { lib
, wheel , stdenv
, rustPlatform
, pipInstallHook
, setuptools-rust
, python
, msgpack
, requests
, openssl
, perl
, rustfmt
, fetchFromGitHub , fetchFromGitHub
, buildPythonPackage
, rustPlatform
, pkg-config
, rustfmt
, setuptools-rust
, openssl
, Security , Security
, msgpack
}: }:
rustPlatform.buildRustPackage rec { buildPythonPackage rec {
pname = "etebase"; pname = "etebase";
version = "0.31.1"; version = "0.31.1";
@ -24,33 +22,38 @@ rustPlatform.buildRustPackage rec {
sha256 = "163iw64l8lwawf84qswcjsq9p8qddv9ysjrr3dzqpqxb2yb0sy39"; sha256 = "163iw64l8lwawf84qswcjsq9p8qddv9ysjrr3dzqpqxb2yb0sy39";
}; };
cargoSha256 = "0w8ypl6kj1mf6ahbdiwbd4jw6ldxdaig47zwk91jjsww5lbyx4lf"; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
sha256 = "0w8ypl6kj1mf6ahbdiwbd4jw6ldxdaig47zwk91jjsww5lbyx4lf";
};
format = "pyproject";
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config
rustfmt rustfmt
perl
openssl
pipInstallHook
setuptools-rust setuptools-rust
wheel ] ++ (with rustPlatform; [
]; cargoSetupHook
rust.cargo
rust.rustc
]);
buildInputs = lib.optionals stdenv.isDarwin [ Security ]; buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
propagatedBuildInputs = [ propagatedBuildInputs = [
python
msgpack msgpack
]; ];
doCheck = true; postPatch = ''
# Use system OpenSSL, which gets security updates.
buildPhase = '' substituteInPlace Cargo.toml \
${python.interpreter} setup.py bdist_wheel --replace ', features = ["vendored"]' ""
''; '';
installPhase = '' pythonImportsCheck = [ "etebase" ];
pipInstallPhase
'';
meta = with lib; { meta = with lib; {
homepage = "https://www.etebase.com/"; homepage = "https://www.etebase.com/";