Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }: 2 3stdenv.mkDerivation { 4 pname = "cpp-ipfs-http-client"; 5 version = "unstable-2022-01-30"; 6 7 src = fetchFromGitHub { 8 owner = "vasild"; 9 repo = "cpp-ipfs-http-client"; 10 rev = "3cdfa7fc6326e49fc81b3c7ca43ce83bdccef6d9"; 11 sha256 = "sha256-/oyafnk4SbrvoCh90wkZXNBjknMKA6EEUoEGo/amLUo="; 12 }; 13 14 patches = [ ./unvendor-nlohmann-json.patch ]; 15 16 postPatch = '' 17 substituteInPlace CMakeLists.txt \ 18 --replace '# Fetch "JSON for Modern C++"' "include_directories(${nlohmann_json}/include)" 19 ''; 20 21 nativeBuildInputs = [ cmake ]; 22 buildInputs = [ curl ]; 23 propagatedBuildInputs = [ nlohmann_json ]; 24 25 env.NIX_CFLAGS_COMPILE = toString [ 26 "-Wno-error=range-loop-construct" 27 # Needed with GCC 12 28 "-Wno-error=deprecated-declarations" 29 ]; 30 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 }; 37}