2023-05-24 13:37:59 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, curl }:
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
let version = "1.10.5"; in
|
2023-05-24 13:37:59 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "libcpr";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libcpr";
|
|
|
|
repo = "cpr";
|
|
|
|
rev = version;
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-mAuU2uF8d+aHvCmotgIrBi/pUp1jkP6G0f98M76zjOw=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ curl ];
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|