2024-10-16 16:53:17 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
|
2024-10-16 16:53:17 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
2023-05-10 20:09:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libcpr";
|
|
|
|
repo = "cpr";
|
2023-05-22 07:20:51 +00:00
|
|
|
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 ];
|
|
|
|
|
2023-05-17 08:27:11 +00:00
|
|
|
propagatedBuildInputs = [ curl ];
|
2023-05-10 20:09:22 +00:00
|
|
|
|
2024-10-16 16:53:17 +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;
|
|
|
|
};
|
|
|
|
}
|