Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
95 lines
2.0 KiB
Nix
95 lines
2.0 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
cargo,
|
|
cmake,
|
|
deltachat-desktop,
|
|
deltachat-repl,
|
|
deltachat-rpc-server,
|
|
openssl,
|
|
perl,
|
|
pkg-config,
|
|
python3,
|
|
rustPlatform,
|
|
sqlcipher,
|
|
sqlite,
|
|
fixDarwinDylibNames,
|
|
libiconv,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "libdeltachat";
|
|
version = "2.17.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "chatmail";
|
|
repo = "core";
|
|
tag = "v${version}";
|
|
hash = "sha256-jU26H3CeW/V2xJg2R/0xJK5RR81CZUiJDyMGidEISrc=";
|
|
};
|
|
|
|
patches = [
|
|
./no-static-lib.patch
|
|
];
|
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
pname = "chatmail-core";
|
|
inherit version src;
|
|
hash = "sha256-cZIQMkVPcGOhrrQrgEpEMKieoq+6gXxDsevnP3wG+Gc=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
perl
|
|
pkg-config
|
|
rustPlatform.cargoSetupHook
|
|
cargo
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
fixDarwinDylibNames
|
|
];
|
|
|
|
buildInputs = [
|
|
openssl
|
|
sqlcipher
|
|
sqlite
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
libiconv
|
|
];
|
|
|
|
nativeCheckInputs = with rustPlatform; [
|
|
cargoCheckHook
|
|
];
|
|
|
|
# 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"'
|
|
'';
|
|
|
|
env = {
|
|
CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTarget;
|
|
CARGO_BUILD_RUSTFLAGS = "-C linker=${stdenv.cc.targetPrefix}cc";
|
|
};
|
|
|
|
passthru = {
|
|
tests = {
|
|
inherit deltachat-desktop deltachat-repl deltachat-rpc-server;
|
|
python = python3.pkgs.deltachat;
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Delta Chat Rust Core library";
|
|
homepage = "https://github.com/chatmail/core";
|
|
changelog = "https://github.com/chatmail/core/blob/${src.tag}/CHANGELOG.md";
|
|
license = licenses.mpl20;
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|