21 stdenv.mkDerivation rec {
22 pname = "libdeltachat";
25 src = fetchFromGitHub {
27 repo = "deltachat-core-rust";
29 hash = "sha256-XZLKvOvdyvR5poRY/oo9MHi1f2XzBmSDR8VqjW3wq74=";
36 cargoDeps = rustPlatform.fetchCargoVendor {
37 pname = "deltachat-core-rust";
39 hash = "sha256-ZxKR1M9wqmzKVbSdBKzTsKF9tDVRGHnd+Ra9Jy5CQQY=";
46 rustPlatform.cargoSetupHook
48 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
56 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
57 darwin.apple_sdk.frameworks.CoreFoundation
58 darwin.apple_sdk.frameworks.Security
59 darwin.apple_sdk.frameworks.SystemConfiguration
63 nativeCheckInputs = with rustPlatform; [
67 # Sometimes -fmacro-prefix-map= can redirect __FILE__ to non-existent
68 # paths. This breaks packages like `python3.pkgs.deltachat`. We embed
69 # absolute path to headers by expanding `__FILE__`.
71 substituteInPlace $out/include/deltachat.h \
72 --replace __FILE__ '"${placeholder "out"}/include/deltachat.h"'
76 CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTarget;
77 CARGO_BUILD_RUSTFLAGS = "-C linker=${stdenv.cc.targetPrefix}cc";
82 inherit deltachat-desktop deltachat-repl deltachat-rpc-server;
83 python = python3.pkgs.deltachat;
88 description = "Delta Chat Rust Core library";
89 homepage = "https://github.com/deltachat/deltachat-core-rust/";
90 changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${src.tag}/CHANGELOG.md";
91 license = licenses.mpl20;
92 maintainers = with maintainers; [ dotlambda ];
93 platforms = platforms.unix;