2021-04-27 17:12:36 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
2022-05-05 18:16:38 +00:00
|
|
|
, python3
|
2021-04-27 17:12:36 +00:00
|
|
|
, rustPlatform
|
2022-01-24 02:40:16 +00:00
|
|
|
, sqlcipher
|
2021-04-27 17:12:36 +00:00
|
|
|
, sqlite
|
2021-08-04 10:49:07 +00:00
|
|
|
, fixDarwinDylibNames
|
|
|
|
, CoreFoundation
|
|
|
|
, Security
|
|
|
|
, libiconv
|
2021-04-27 17:12:36 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdeltachat";
|
2023-03-23 21:47:45 +00:00
|
|
|
version = "1.112.0";
|
2021-04-27 17:12:36 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deltachat";
|
|
|
|
repo = "deltachat-core-rust";
|
2023-02-24 19:42:31 +00:00
|
|
|
rev = "v${version}";
|
2023-03-23 21:47:45 +00:00
|
|
|
hash = "sha256-byUQQu+lzqTVufEHoeSd9hrDBWj92JCokzetdRITRns=";
|
2021-04-27 17:12:36 +00:00
|
|
|
};
|
|
|
|
|
2021-08-04 10:49:07 +00:00
|
|
|
patches = [
|
2021-08-06 09:21:50 +00:00
|
|
|
./no-static-lib.patch
|
2021-08-04 10:49:07 +00:00
|
|
|
];
|
|
|
|
|
2021-04-27 17:12:36 +00:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2023-03-23 21:47:45 +00:00
|
|
|
hash = "sha256-j0Cz1tl6N1JuKt2io+uoqUo/cL/VRVVasJ0CU3X1xtw=";
|
2021-04-27 17:12:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
rust.cargo
|
2021-08-04 10:49:07 +00:00
|
|
|
]) ++ lib.optionals stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
|
|
|
];
|
2021-04-27 17:12:36 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2022-01-24 02:40:16 +00:00
|
|
|
sqlcipher
|
2021-04-27 17:12:36 +00:00
|
|
|
sqlite
|
2021-08-04 10:49:07 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreFoundation
|
|
|
|
Security
|
|
|
|
libiconv
|
2021-04-27 17:12:36 +00:00
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = with rustPlatform; [
|
2021-04-27 17:12:36 +00:00
|
|
|
cargoCheckHook
|
|
|
|
];
|
|
|
|
|
2022-05-05 18:16:38 +00:00
|
|
|
passthru.tests = {
|
|
|
|
python = python3.pkgs.deltachat;
|
|
|
|
};
|
|
|
|
|
2021-04-27 17:12:36 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Delta Chat Rust Core library";
|
|
|
|
homepage = "https://github.com/deltachat/deltachat-core-rust/";
|
2023-02-24 19:42:31 +00:00
|
|
|
changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${src.rev}/CHANGELOG.md";
|
2021-04-27 17:12:36 +00:00
|
|
|
license = licenses.mpl20;
|
2023-03-05 23:01:59 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda srapenne ];
|
2021-08-04 10:49:07 +00:00
|
|
|
platforms = platforms.unix;
|
2021-04-27 17:12:36 +00:00
|
|
|
};
|
|
|
|
}
|