2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv
|
2020-04-30 08:57:48 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
2021-01-19 07:50:56 +01:00
|
|
|
, pkg-config
|
2020-04-30 08:57:48 +02:00
|
|
|
, openssl
|
|
|
|
, olm
|
2020-04-24 10:09:33 +02:00
|
|
|
, spdlog
|
2020-04-30 08:57:48 +02:00
|
|
|
, nlohmann_json
|
2021-11-19 11:27:11 +01:00
|
|
|
, coeurl
|
|
|
|
, libevent
|
|
|
|
, curl
|
2020-04-30 08:57:48 +02:00
|
|
|
}:
|
2018-09-09 22:12:52 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "mtxclient";
|
2022-03-10 20:23:56 +01:00
|
|
|
version = "0.7.0";
|
2018-09-09 22:12:52 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-06-19 14:25:06 +02:00
|
|
|
owner = "Nheko-Reborn";
|
2018-09-09 22:12:52 +02:00
|
|
|
repo = "mtxclient";
|
|
|
|
rev = "v${version}";
|
2022-03-10 20:23:56 +01:00
|
|
|
sha256 = "sha256-iGw+qdw7heL5q7G0dwtl4PX2UA0Kka0FUmH610dM/00=";
|
2018-09-09 22:12:52 +02:00
|
|
|
};
|
|
|
|
|
2021-11-19 11:27:11 +01:00
|
|
|
postPatch = ''
|
|
|
|
# See https://github.com/gabime/spdlog/issues/1897
|
|
|
|
sed -i '1a add_compile_definitions(SPDLOG_FMT_EXTERNAL)' CMakeLists.txt
|
|
|
|
'';
|
2021-10-22 18:14:22 +02:00
|
|
|
|
2019-06-19 14:25:06 +02:00
|
|
|
cmakeFlags = [
|
2020-04-30 09:05:16 +02:00
|
|
|
# Network requiring tests can't be disabled individually:
|
|
|
|
# https://github.com/Nheko-Reborn/mtxclient/issues/22
|
2019-06-19 14:25:06 +02:00
|
|
|
"-DBUILD_LIB_TESTS=OFF"
|
|
|
|
"-DBUILD_LIB_EXAMPLES=OFF"
|
2019-03-25 18:49:40 +01:00
|
|
|
];
|
|
|
|
|
2020-04-30 08:57:48 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-01-19 07:50:56 +01:00
|
|
|
pkg-config
|
2020-04-30 08:57:48 +02:00
|
|
|
];
|
|
|
|
buildInputs = [
|
2020-04-24 10:09:33 +02:00
|
|
|
spdlog
|
2021-11-19 11:27:11 +01:00
|
|
|
nlohmann_json
|
2020-04-30 08:57:48 +02:00
|
|
|
openssl
|
|
|
|
olm
|
2021-11-19 11:27:11 +01:00
|
|
|
coeurl
|
|
|
|
libevent
|
|
|
|
curl
|
2020-04-30 08:57:48 +02:00
|
|
|
];
|
2018-09-09 22:12:52 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2021-11-19 11:27:11 +01:00
|
|
|
description = "Client API library for the Matrix protocol.";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/Nheko-Reborn/mtxclient";
|
2018-09-09 22:12:52 +02:00
|
|
|
license = licenses.mit;
|
2021-01-22 10:53:17 +01:00
|
|
|
maintainers = with maintainers; [ fpletz pstn ];
|
2020-04-30 09:25:38 +02:00
|
|
|
platforms = platforms.all;
|
|
|
|
# Should be fixable if a higher clang version is used, see:
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/85922#issuecomment-619287177
|
|
|
|
broken = stdenv.targetPlatform.isDarwin;
|
2018-09-09 22:12:52 +02:00
|
|
|
};
|
|
|
|
}
|