2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
2022-05-18 14:49:53 +00:00
|
|
|
, python3
|
2021-05-20 23:08:51 +00:00
|
|
|
, rustPlatform
|
2022-01-26 04:04:25 +00:00
|
|
|
, sqlcipher
|
2021-05-20 23:08:51 +00:00
|
|
|
, sqlite
|
2021-08-10 14:31:46 +00:00
|
|
|
, fixDarwinDylibNames
|
|
|
|
, CoreFoundation
|
|
|
|
, Security
|
|
|
|
, libiconv
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdeltachat";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.107.0";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deltachat";
|
|
|
|
repo = "deltachat-core-rust";
|
|
|
|
rev = version;
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-fjiS7GZy1BLgmxu4LFOWgucORcVx+9KleQcga+hRkSY=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
patches = [
|
|
|
|
./no-static-lib.patch
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-7XhSI/C0GEmsaL0UupvufB1bfPGbzSQJH720Y4/Do3o=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
rust.cargo
|
2021-08-10 14:31:46 +00:00
|
|
|
]) ++ lib.optionals stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2022-01-26 04:04:25 +00:00
|
|
|
sqlcipher
|
2021-05-20 23:08:51 +00:00
|
|
|
sqlite
|
2021-08-10 14:31:46 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreFoundation
|
|
|
|
Security
|
|
|
|
libiconv
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with rustPlatform; [
|
2021-05-20 23:08:51 +00:00
|
|
|
cargoCheckHook
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
passthru.tests = {
|
|
|
|
python = python3.pkgs.deltachat;
|
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
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-10 14:31:46 +00:00
|
|
|
platforms = platforms.unix;
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|