2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-05-03 17:38:23 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-05-03 17:38:23 +00:00
|
|
|
, boost17x
|
|
|
|
, openssl
|
|
|
|
, olm
|
|
|
|
, spdlog
|
|
|
|
, nlohmann_json
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mtxclient";
|
2021-04-25 03:57:28 +00:00
|
|
|
version = "0.5.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Nheko-Reborn";
|
|
|
|
repo = "mtxclient";
|
|
|
|
rev = "v${version}";
|
2021-04-25 03:57:28 +00:00
|
|
|
sha256 = "sha256-UKroV1p7jYuNzCAFMsuUsYC/C9AZ1D4rhwpwuER39vc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
# This patch should be obsolete and should stop applying the in next release.
|
|
|
|
patches = [ ./fix-compilation-with-olm-3.2.5.patch ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeFlags = [
|
2020-05-03 17:38:23 +00:00
|
|
|
# Network requiring tests can't be disabled individually:
|
|
|
|
# https://github.com/Nheko-Reborn/mtxclient/issues/22
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DBUILD_LIB_TESTS=OFF"
|
|
|
|
"-DBUILD_LIB_EXAMPLES=OFF"
|
|
|
|
"-Dnlohmann_json_DIR=${nlohmann_json}/lib/cmake/nlohmann_json"
|
2020-05-03 17:38:23 +00:00
|
|
|
# Can be removed once either https://github.com/NixOS/nixpkgs/pull/85254 or
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/73940 are merged
|
|
|
|
"-DBoost_NO_BOOST_CMAKE=TRUE"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-05-03 17:38:23 +00:00
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
spdlog
|
|
|
|
boost17x
|
|
|
|
openssl
|
|
|
|
olm
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Client API library for Matrix, built on top of Boost.Asio";
|
|
|
|
homepage = "https://github.com/Nheko-Reborn/mtxclient";
|
|
|
|
license = licenses.mit;
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ fpletz pstn ];
|
2020-05-03 17:38:23 +00: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;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|