depot/third_party/nixpkgs/pkgs/development/libraries/libdeltachat/default.nix
Default email 4d5a95770c Project import generated by Copybara.
GitOrigin-RevId: 3c5319ad3aa51551182ac82ea17ab1c6b0f0df89
2023-03-04 15:14:45 +03:00

76 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, openssl
, perl
, pkg-config
, python3
, rustPlatform
, sqlcipher
, sqlite
, fixDarwinDylibNames
, CoreFoundation
, Security
, libiconv
}:
stdenv.mkDerivation rec {
pname = "libdeltachat";
version = "1.110.0";
src = fetchFromGitHub {
owner = "deltachat";
repo = "deltachat-core-rust";
rev = "v${version}";
hash = "sha256-SPBuStrBp9fnrLfFT2ec9yYItZsvQF9BHdJxi+plbgw=";
};
patches = [
./no-static-lib.patch
];
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-Y4+CkaV9njHqmmiZnDtfZ5OwMVk583FtncxOgAqACkA=";
};
nativeBuildInputs = [
cmake
perl
pkg-config
] ++ (with rustPlatform; [
cargoSetupHook
rust.cargo
]) ++ lib.optionals stdenv.isDarwin [
fixDarwinDylibNames
];
buildInputs = [
openssl
sqlcipher
sqlite
] ++ lib.optionals stdenv.isDarwin [
CoreFoundation
Security
libiconv
];
nativeCheckInputs = with rustPlatform; [
cargoCheckHook
];
passthru.tests = {
python = python3.pkgs.deltachat;
};
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/${src.rev}/CHANGELOG.md";
license = licenses.mpl20;
maintainers = with maintainers; [ dotlambda ];
platforms = platforms.unix;
};
}