commit b1ed0f6df6aac56093c09c1e955dbc93ea39b3f5
parent c2df723eb1549fc94518749d2db6688df6da8e0e
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Sun, 5 Mar 2023 22:53:25 +0400
Add cpr
Diffstat:
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -309,6 +309,7 @@ lib.makeScope newScope (
};
capture2text = libsForQt5.callPackage ./misc/capture2text { };
cfiles = callPackage ./misc/cfiles { };
+ cpr = callPackage ./misc/cpr { };
csvquote = callPackage ./misc/csvquote { };
csvtools = callPackage ./misc/csvtools { };
didder = callPackage ./misc/didder { };
diff --git a/pkgs/misc/cpr/default.nix b/pkgs/misc/cpr/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, cmake, curl }:
+
+stdenv.mkDerivation (finalAttrs: {
+ pname = "cpr";
+ version = "1.10.1";
+
+ src = fetchFromGitHub {
+ owner = "libcpr";
+ repo = "cpr";
+ rev = finalAttrs.version;
+ hash = "sha256-826OVUULl0Rvoirb0XujwjeV8MgiWT3qVb2PYqVGTCo=";
+ };
+
+ postPatch = ''
+ substituteInPlace include/CMakeLists.txt \
+ --replace "target_link_libraries(cpr PUBLIC stdc++fs)" ""
+ '';
+
+ nativeBuildInputs = [ cmake ];
+
+ propagatedBuildInputs = [ curl ];
+
+ cmakeFlags = [
+ "-DCPR_USE_SYSTEM_CURL=ON"
+ ];
+
+ meta = with lib; {
+ description = "Simple C++ wrapper around libcurl";
+ inherit (finalAttrs.src.meta) homepage;
+ license = licenses.mit;
+ maintainers = [ maintainers.sikmir ];
+ platforms = platforms.unix;
+ };
+})