presenterm: 0.9.0 -> 0.10.0 (#378946)
[NixPkgs.git] / pkgs / by-name / li / libcpr_1_10_5 / package.nix
blob2164dcce331ac6ab2bc74f7565eafa3a4e92b601
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   curl,
7 }:
9 let
10   version = "1.10.5";
12 stdenv.mkDerivation {
13   pname = "libcpr";
14   inherit version;
16   outputs = [
17     "out"
18     "dev"
19   ];
21   src = fetchFromGitHub {
22     owner = "libcpr";
23     repo = "cpr";
24     rev = version;
25     hash = "sha256-mAuU2uF8d+aHvCmotgIrBi/pUp1jkP6G0f98M76zjOw=";
26   };
28   nativeBuildInputs = [ cmake ];
30   propagatedBuildInputs = [ curl ];
32   cmakeFlags = [ "-DCPR_USE_SYSTEM_CURL=ON" ];
34   postPatch = ''
35     # Linking with stdc++fs is no longer necessary.
36     sed -i '/stdc++fs/d' include/CMakeLists.txt
37   '';
39   postInstall = ''
40     substituteInPlace "$out/lib/cmake/cpr/cprTargets.cmake" \
41       --replace "_IMPORT_PREFIX \"$out\"" \
42                 "_IMPORT_PREFIX \"$dev\""
43   '';
45   meta = with lib; {
46     description = "C++ wrapper around libcurl";
47     homepage = "https://docs.libcpr.org/";
48     license = licenses.mit;
49     maintainers = with maintainers; [ rycee ];
50     platforms = platforms.all;
51   };