libdeltachat: support Darwin

This commit is contained in:
Robert Schütz 2021-08-04 12:49:07 +02:00 committed by Robert Schütz
parent d665f8499a
commit 734e2b7b11
2 changed files with 25 additions and 3 deletions

View file

@ -1,12 +1,17 @@
{ lib { lib
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, cmake , cmake
, openssl , openssl
, perl , perl
, pkg-config , pkg-config
, rustPlatform , rustPlatform
, sqlite , sqlite
, fixDarwinDylibNames
, CoreFoundation
, Security
, libiconv
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -20,6 +25,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-ZyVEI6q+GzHLEFH01TxS7NqwT7zqVgg0vduyf/fibB8="; sha256 = "sha256-ZyVEI6q+GzHLEFH01TxS7NqwT7zqVgg0vduyf/fibB8=";
}; };
patches = [
# https://github.com/deltachat/deltachat-core-rust/pull/2589
(fetchpatch {
url = "https://github.com/deltachat/deltachat-core-rust/commit/408467e85d04fbbfd6bed5908d84d9e995943487.patch";
sha256 = "1j2ywaazglgl6370js34acrg0wrh0b7krqg05dfjf65n527lzn59";
})
];
cargoDeps = rustPlatform.fetchCargoTarball { cargoDeps = rustPlatform.fetchCargoTarball {
inherit src; inherit src;
name = "${pname}-${version}"; name = "${pname}-${version}";
@ -33,11 +46,17 @@ stdenv.mkDerivation rec {
] ++ (with rustPlatform; [ ] ++ (with rustPlatform; [
cargoSetupHook cargoSetupHook
rust.cargo rust.cargo
]); ]) ++ lib.optionals stdenv.isDarwin [
fixDarwinDylibNames
];
buildInputs = [ buildInputs = [
openssl openssl
sqlite sqlite
] ++ lib.optionals stdenv.isDarwin [
CoreFoundation
Security
libiconv
]; ];
checkInputs = with rustPlatform; [ checkInputs = with rustPlatform; [
@ -49,7 +68,7 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/deltachat/deltachat-core-rust/"; homepage = "https://github.com/deltachat/deltachat-core-rust/";
changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${version}/CHANGELOG.md"; changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${version}/CHANGELOG.md";
license = licenses.mpl20; license = licenses.mpl20;
platforms = platforms.linux;
maintainers = with maintainers; [ dotlambda ]; maintainers = with maintainers; [ dotlambda ];
platforms = platforms.unix;
}; };
} }

View file

@ -16520,7 +16520,10 @@ with pkgs;
libdeflate = callPackage ../development/libraries/libdeflate { }; libdeflate = callPackage ../development/libraries/libdeflate { };
libdeltachat = callPackage ../development/libraries/libdeltachat { }; libdeltachat = callPackage ../development/libraries/libdeltachat {
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
inherit (darwin) libiconv;
};
libdevil = callPackage ../development/libraries/libdevil { libdevil = callPackage ../development/libraries/libdevil {
inherit (darwin.apple_sdk.frameworks) OpenGL; inherit (darwin.apple_sdk.frameworks) OpenGL;