Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / cpp-ipfs-http-client / default.nix
blobd44eed5e76f0fa53ebf371b15ee92e82773413c4
1 { lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }:
3 stdenv.mkDerivation {
4   pname = "cpp-ipfs-http-client";
5   version = "unstable-2022-01-30";
7   src = fetchFromGitHub {
8     owner = "vasild";
9     repo = "cpp-ipfs-http-client";
10     rev = "3cdfa7fc6326e49fc81b3c7ca43ce83bdccef6d9";
11     sha256 = "sha256-/oyafnk4SbrvoCh90wkZXNBjknMKA6EEUoEGo/amLUo=";
12   };
14   patches = [ ./unvendor-nlohmann-json.patch ];
16   postPatch = ''
17     substituteInPlace CMakeLists.txt \
18       --replace '# Fetch "JSON for Modern C++"' "include_directories(${nlohmann_json}/include)"
19   '';
21   nativeBuildInputs = [ cmake ];
22   buildInputs = [ curl ];
23   propagatedBuildInputs = [ nlohmann_json ];
25   env.NIX_CFLAGS_COMPILE = toString [
26     "-Wno-error=range-loop-construct"
27     # Needed with GCC 12
28     "-Wno-error=deprecated-declarations"
29   ];
31   meta = with lib; {
32     description = "IPFS C++ API client library";
33     homepage = "https://github.com/vasild/cpp-ipfs-http-client";
34     license = licenses.mit;
35     platforms = [ "x86_64-linux" "x86_64-darwin" ];
36   };