nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 35 lines 970 B view raw
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 NIX_CFLAGS_COMPILE = [ 26 "-Wno-error=range-loop-construct" 27 ]; 28 29 meta = with lib; { 30 description = "IPFS C++ API client library"; 31 homepage = "https://github.com/vasild/cpp-ipfs-http-client"; 32 license = licenses.mit; 33 platforms = [ "x86_64-linux" "x86_64-darwin" ]; 34 }; 35}