2021-04-27 18:12:36 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, rustPlatform
|
|
|
|
, sqlite
|
2021-08-04 11:49:07 +01:00
|
|
|
, fixDarwinDylibNames
|
|
|
|
, CoreFoundation
|
|
|
|
, Security
|
|
|
|
, libiconv
|
2021-04-27 18:12:36 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdeltachat";
|
2021-11-30 23:11:32 +00:00
|
|
|
version = "1.69.0";
|
2021-04-27 18:12:36 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deltachat";
|
|
|
|
repo = "deltachat-core-rust";
|
|
|
|
rev = version;
|
2021-11-30 23:11:32 +00:00
|
|
|
hash = "sha256-yW6MXDb7kiI24akJrEPHeb4bI8jEldBcPYx+5+dwJR0=";
|
2021-04-27 18:12:36 +01:00
|
|
|
};
|
|
|
|
|
2021-08-04 11:49:07 +01:00
|
|
|
patches = [
|
|
|
|
# https://github.com/deltachat/deltachat-core-rust/pull/2589
|
2021-11-07 22:25:23 +00:00
|
|
|
./darwin-dylib.patch
|
2021-08-06 10:21:50 +01:00
|
|
|
./no-static-lib.patch
|
2021-08-04 11:49:07 +01:00
|
|
|
];
|
|
|
|
|
2021-04-27 18:12:36 +01:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2021-11-30 23:11:32 +00:00
|
|
|
hash = "sha256-76TraZCJhppPhkdQfAf1XqOoK7RS+VoYIp2keTn4es4=";
|
2021-04-27 18:12:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
rust.cargo
|
2021-08-04 11:49:07 +01:00
|
|
|
]) ++ lib.optionals stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
|
|
|
];
|
2021-04-27 18:12:36 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
sqlite
|
2021-08-04 11:49:07 +01:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreFoundation
|
|
|
|
Security
|
|
|
|
libiconv
|
2021-04-27 18:12:36 +01: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 11:49:07 +01:00
|
|
|
platforms = platforms.unix;
|
2021-04-27 18:12:36 +01:00
|
|
|
};
|
|
|
|
}
|