Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libdeltachat / default.nix
blobd62e8bf245cad08ba074ec3029d56a17176288e6
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cargo
5 , cmake
6 , deltachat-repl
7 , openssl
8 , perl
9 , pkg-config
10 , python3
11 , rustPlatform
12 , sqlcipher
13 , sqlite
14 , fixDarwinDylibNames
15 , CoreFoundation
16 , Security
17 , SystemConfiguration
18 , libiconv
21 let
22   cargoLock = {
23     lockFile = ./Cargo.lock;
24     outputHashes = {
25       "email-0.0.21" = "sha256-u4CsK/JqFgq5z3iJGxxGtb7QbSkOAqmOvrmagsqfXIU=";
26       "encoded-words-0.2.0" = "sha256-KK9st0hLFh4dsrnLd6D8lC6pRFFs8W+WpZSGMGJcosk=";
27       "iroh-0.4.1" = "sha256-oLvka1nV2yQPzlcaq5CXqXRRu7GkbMocV6GoIlxQKlo=";
28       "lettre-0.9.2" = "sha256-+hU1cFacyyeC9UGVBpS14BWlJjHy90i/3ynMkKAzclk=";
29     };
30   };
31 in stdenv.mkDerivation rec {
32   pname = "libdeltachat";
33   version = "1.131.1";
35   src = fetchFromGitHub {
36     owner = "deltachat";
37     repo = "deltachat-core-rust";
38     rev = "v${version}";
39     hash = "sha256-JXSZrlekvPVGKR+ritxk3Eru2DhtUN9UBtqUZ7G9/gg=";
40   };
42   patches = [
43     ./no-static-lib.patch
44   ];
46   cargoDeps = rustPlatform.importCargoLock cargoLock;
48   nativeBuildInputs = [
49     cmake
50     perl
51     pkg-config
52     rustPlatform.cargoSetupHook
53     cargo
54   ] ++ lib.optionals stdenv.isDarwin [
55     fixDarwinDylibNames
56   ];
58   buildInputs = [
59     openssl
60     sqlcipher
61     sqlite
62   ] ++ lib.optionals stdenv.isDarwin [
63     CoreFoundation
64     Security
65     SystemConfiguration
66     libiconv
67   ];
69   nativeCheckInputs = with rustPlatform; [
70     cargoCheckHook
71   ];
73   passthru = {
74     inherit cargoLock;
75     tests = {
76       inherit deltachat-repl;
77       python = python3.pkgs.deltachat;
78     };
79   };
81   meta = with lib; {
82     description = "Delta Chat Rust Core library";
83     homepage = "https://github.com/deltachat/deltachat-core-rust/";
84     changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${src.rev}/CHANGELOG.md";
85     license = licenses.mpl20;
86     maintainers = with maintainers; [ dotlambda ];
87     platforms = platforms.unix;
88   };