2021-04-27 19:12:36 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, rustPlatform
|
2022-01-24 03:40:16 +01:00
|
|
|
, sqlcipher
|
2021-04-27 19:12:36 +02:00
|
|
|
, sqlite
|
2021-08-04 12:49:07 +02:00
|
|
|
, fixDarwinDylibNames
|
|
|
|
, CoreFoundation
|
|
|
|
, Security
|
|
|
|
, libiconv
|
2021-04-27 19:12:36 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdeltachat";
|
2022-01-25 20:15:43 +01:00
|
|
|
version = "1.72.0";
|
2021-04-27 19:12:36 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deltachat";
|
|
|
|
repo = "deltachat-core-rust";
|
|
|
|
rev = version;
|
2022-01-25 20:15:43 +01:00
|
|
|
hash = "sha256-/StX22pSQtfOYbBTFL7vh0Y0V038Ohyq+qoDECITD80=";
|
2021-04-27 19:12:36 +02:00
|
|
|
};
|
|
|
|
|
2021-08-04 12:49:07 +02:00
|
|
|
patches = [
|
|
|
|
# https://github.com/deltachat/deltachat-core-rust/pull/2589
|
2021-11-07 23:25:23 +01:00
|
|
|
./darwin-dylib.patch
|
2021-08-06 11:21:50 +02:00
|
|
|
./no-static-lib.patch
|
2021-08-04 12:49:07 +02:00
|
|
|
];
|
|
|
|
|
2021-04-27 19:12:36 +02:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2022-01-25 20:15:43 +01:00
|
|
|
hash = "sha256-Jwf95oTyGsOikVMKAg+EaDNY78VW+kECD+lhNePSKWE=";
|
2021-04-27 19:12:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
rust.cargo
|
2021-08-04 12:49:07 +02:00
|
|
|
]) ++ lib.optionals stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
|
|
|
];
|
2021-04-27 19:12:36 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2022-01-24 03:40:16 +01:00
|
|
|
sqlcipher
|
2021-04-27 19:12:36 +02:00
|
|
|
sqlite
|
2021-08-04 12:49:07 +02:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreFoundation
|
|
|
|
Security
|
|
|
|
libiconv
|
2021-04-27 19:12:36 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = with rustPlatform; [
|
|
|
|
cargoCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Delta Chat Rust Core library";
|
|
|
|
homepage = "https://github.com/deltachat/deltachat-core-rust/";
|
|
|
|
changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${version}/CHANGELOG.md";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2021-08-04 12:49:07 +02:00
|
|
|
platforms = platforms.unix;
|
2021-04-27 19:12:36 +02:00
|
|
|
};
|
|
|
|
}
|