nixpkgs/pkgs/by-name/li/libcpr_1_10_5/package.nix

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

53 lines
989 B
Nix
Raw Normal View History

{
lib,
stdenv,
fetchFromGitHub,
cmake,
curl,
}:
let
version = "1.10.5";
in
2023-05-10 20:09:22 +00:00
stdenv.mkDerivation {
pname = "libcpr";
inherit version;
outputs = [
"out"
"dev"
];
2023-05-10 20:09:22 +00:00
src = fetchFromGitHub {
owner = "libcpr";
repo = "cpr";
rev = version;
2023-10-15 13:15:54 +00:00
hash = "sha256-mAuU2uF8d+aHvCmotgIrBi/pUp1jkP6G0f98M76zjOw=";
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" ];
2023-05-10 20:09:22 +00:00
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;
};
}