Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / mtxclient / default.nix
blob13816faefce9ad25cb674c0c6aa24f60b6fad286
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , pkg-config
7 , coeurl
8 , curl
9 , libevent
10 , nlohmann_json
11 , olm
12 , openssl
13 , re2
14 , spdlog
17 stdenv.mkDerivation rec {
18   pname = "mtxclient";
19   version = "0.9.2";
21   src = fetchFromGitHub {
22     owner = "Nheko-Reborn";
23     repo = "mtxclient";
24     rev = "v${version}";
25     hash = "sha256-r+bD2L5+3AwkdYa3FwsM+yf7V5w+6ZJC92CMdVeYLJQ=";
26   };
28   postPatch = ''
29     # See https://github.com/gabime/spdlog/issues/1897
30     sed -i '1a add_compile_definitions(SPDLOG_FMT_EXTERNAL)' CMakeLists.txt
31   '';
33   cmakeFlags = [
34     # Network requiring tests can't be disabled individually:
35     # https://github.com/Nheko-Reborn/mtxclient/issues/22
36     "-DBUILD_LIB_TESTS=OFF"
37     "-DBUILD_LIB_EXAMPLES=OFF"
38   ];
40   nativeBuildInputs = [
41     cmake
42     pkg-config
43   ];
45   buildInputs = [
46     coeurl
47     curl
48     libevent
49     nlohmann_json
50     olm
51     openssl
52     re2
53     spdlog
54   ];
56   meta = with lib; {
57     description = "Client API library for the Matrix protocol.";
58     homepage = "https://github.com/Nheko-Reborn/mtxclient";
59     license = licenses.mit;
60     maintainers = with maintainers; [ fpletz pstn ];
61     platforms = platforms.all;
62     # Should be fixable if a higher clang version is used, see:
63     # https://github.com/NixOS/nixpkgs/pull/85922#issuecomment-619287177
64     broken = stdenv.hostPlatform.isDarwin;
65   };