File: package.nix

package info (click to toggle)
pysequoia 0.1.29-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 664 kB
  • sloc: sh: 22; python: 20; makefile: 11
file content (60 lines) | stat: -rw-r--r-- 1,166 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, buildPythonPackage
, src
, cargoTomlPkg
, pkg-config
, rustPlatform
, cargo
, rustc
, bzip2
, nettle
, openssl
, stdenv
, darwin
, libiconv
}:

buildPythonPackage rec {
  pname = "pysequoia";
  inherit src;
  inherit (cargoTomlPkg) version;
  pyproject = true;

  # This attribute is defined differently in Nixpkgs - using
  # `rustPlatform.fetchCargoTarball`. Since we have a Cargo.lock file available
  # here, we can use it instead.
  cargoDeps = rustPlatform.importCargoLock {
    lockFile = ./Cargo.lock;
  };

  nativeBuildInputs = [
    pkg-config
    rustPlatform.bindgenHook
    rustPlatform.cargoSetupHook
    rustPlatform.maturinBuildHook
    cargo
    rustc
  ];

  buildInputs = [
    bzip2
  ] ++ lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.CoreFoundation
    darwin.apple_sdk.frameworks.Security
    libiconv
  ] ++ lib.optionals stdenv.isLinux [
    nettle
  ];

  pythonImportsCheck = [ "pysequoia" ];

  meta = {
    inherit (cargoTomlPkg)
      description
      homepage
    ;
    downloadPage = cargoTomlPkg.repository;
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ doronbehar ];
  };
}