nixpkgs/pkgs/development/libraries/libcpr/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
973 B
Nix
Raw Normal View History

2023-05-10 20:09:22 +00:00
{ lib, stdenv, fetchFromGitHub, cmake, curl }:
2023-05-17 05:31:22 +00:00
let version = "1.10.3"; in
2023-05-10 20:09:22 +00:00
stdenv.mkDerivation {
pname = "libcpr";
inherit version;
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "libcpr";
repo = "cpr";
2023-05-17 05:31:22 +00:00
rev = "1.10.3";
hash = "sha256-NueZPBiICrh8GXXdCqNtVaB7PfqwtQ0WolvRij8SYbE=";
2023-05-10 20:09:22 +00:00
};
nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ curl ];
2023-05-10 20:09:22 +00:00
cmakeFlags = [
"-DCPR_USE_SYSTEM_CURL=ON"
];
postPatch = ''
# Linking with stdc++fs is no longer necessary.
sed -i '/stdc++fs/d' include/CMakeLists.txt
'';
postInstall = ''
substituteInPlace "$out/lib/cmake/cpr/cprTargets.cmake" \
--replace "_IMPORT_PREFIX \"$out\"" \
"_IMPORT_PREFIX \"$dev\""
'';
meta = with lib; {
description = "C++ wrapper around libcurl";
homepage = "https://docs.libcpr.org/";
license = licenses.mit;
maintainers = with maintainers; [ rycee ];
platforms = platforms.all;
};
}