2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-05-24 13:37:59 +00:00
|
|
|
, cargo
|
2021-05-20 23:08:51 +00:00
|
|
|
, cmake
|
2024-01-02 11:29:13 +00:00
|
|
|
, deltachat-desktop
|
2023-11-16 04:20:00 +00:00
|
|
|
, deltachat-repl
|
2024-06-20 14:57:18 +00:00
|
|
|
, deltachat-rpc-server
|
2021-05-20 23:08:51 +00:00
|
|
|
, 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
|
2024-09-19 14:19:46 +00:00
|
|
|
, darwin
|
2021-08-10 14:31:46 +00:00
|
|
|
, libiconv
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
let
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2024-04-21 15:54:59 +00:00
|
|
|
"email-0.0.20" = "sha256-rV4Uzqt2Qdrfi5Ti1r+Si1c2iW1kKyWLwOgLkQ5JGGw=";
|
2023-11-16 04:20:00 +00:00
|
|
|
"encoded-words-0.2.0" = "sha256-KK9st0hLFh4dsrnLd6D8lC6pRFFs8W+WpZSGMGJcosk=";
|
|
|
|
"lettre-0.9.2" = "sha256-+hU1cFacyyeC9UGVBpS14BWlJjHy90i/3ynMkKAzclk=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "libdeltachat";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.142.12";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deltachat";
|
|
|
|
repo = "deltachat-core-rust";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-WjzmRRHdi31Eg3UAy4rD2xrx1LVew9Y4bb50Zyv+8JA=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
patches = [
|
|
|
|
./no-static-lib.patch
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
cargoDeps = rustPlatform.importCargoLock cargoLock;
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
perl
|
|
|
|
pkg-config
|
2023-05-24 13:37:59 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
cargo
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-08-10 14:31:46 +00:00
|
|
|
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 [
|
2024-09-19 14:19:46 +00:00
|
|
|
darwin.apple_sdk.frameworks.CoreFoundation
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
2021-08-10 14:31:46 +00:00
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# Sometimes -fmacro-prefix-map= can redirect __FILE__ to non-existent
|
|
|
|
# paths. This breaks packages like `python3.pkgs.deltachat`. We embed
|
|
|
|
# absolute path to headers by expanding `__FILE__`.
|
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace $out/include/deltachat.h \
|
|
|
|
--replace __FILE__ '"${placeholder "out"}/include/deltachat.h"'
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru = {
|
|
|
|
inherit cargoLock;
|
|
|
|
tests = {
|
2024-06-20 14:57:18 +00:00
|
|
|
inherit deltachat-desktop deltachat-repl deltachat-rpc-server;
|
2023-11-16 04:20:00 +00:00
|
|
|
python = python3.pkgs.deltachat;
|
|
|
|
};
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
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/";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${src.rev}/CHANGELOG.md";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.mpl20;
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2021-08-10 14:31:46 +00:00
|
|
|
platforms = platforms.unix;
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|