Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libcpr / default.nix
blob8a4025cf7097fb053f16265c4e8f284ba43fba65
1 { lib, stdenv, fetchFromGitHub, cmake, curl }:
3 let version = "1.10.5"; in
4 stdenv.mkDerivation {
5   pname = "libcpr";
6   inherit version;
8   outputs = [ "out" "dev" ];
10   src = fetchFromGitHub {
11     owner = "libcpr";
12     repo = "cpr";
13     rev = version;
14     hash = "sha256-mAuU2uF8d+aHvCmotgIrBi/pUp1jkP6G0f98M76zjOw=";
15   };
17   nativeBuildInputs = [ cmake ];
19   propagatedBuildInputs = [ curl ];
21   cmakeFlags = [
22     "-DCPR_USE_SYSTEM_CURL=ON"
23   ];
25   postPatch = ''
26     # Linking with stdc++fs is no longer necessary.
27     sed -i '/stdc++fs/d' include/CMakeLists.txt
28   '';
30   postInstall = ''
31     substituteInPlace "$out/lib/cmake/cpr/cprTargets.cmake" \
32       --replace "_IMPORT_PREFIX \"$out\"" \
33                 "_IMPORT_PREFIX \"$dev\""
34   '';
36   meta = with lib; {
37     description = "C++ wrapper around libcurl";
38     homepage = "https://docs.libcpr.org/";
39     license = licenses.mit;
40     maintainers = with maintainers; [ rycee ];
41     platforms = platforms.all;
42   };