Unverified Commit dac2873b authored by Robert Helgesson's avatar Robert Helgesson Committed by GitHub
Browse files

libcpr: merge duplicate cpr package (and update to 1.13.0) (#462651)

parents a8b1b9d1 2447d64d
Loading
Loading
Loading
Loading

pkgs/by-name/cp/cpr/package.nix

deleted100644 → 0
+0 −61
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  pkg-config,
  openssl,
  curl,
  zlib,
  gtest,
  cppcheck,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "cpr";
  version = "1.12.0";

  src = fetchFromGitHub {
    owner = "libcpr";
    repo = "cpr";
    tag = finalAttrs.version;
    hash = "sha256-OkOyh2ibt/jX/Dc+TB1uSlWtzEhdSQwHVN96oCOh2yM=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
    gtest
    cppcheck
  ];

  buildInputs = [
    openssl
    zlib
    curl
  ];

  cmakeFlags = [
    # NOTE: Does not build with CPPCHECK
    # (lib.cmakeBool "CPR_ENABLE_CPPCHECK" true)
    (lib.cmakeBool "CPR_BUILD_TEST" true)
    (lib.cmakeBool "CURL_ZLIB" false)
    (lib.cmakeBool "BUILD_SHARED_LIBS" true)
    (lib.cmakeBool "CPR_USE_SYSTEM_CURL" true)
    (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release")
  ];

  # Install headers
  postInstall = ''
    mkdir -p $out/include
    cp -r $src/include/* $out/include/
  '';

  meta = {
    description = "C++ Requests: Curl for People, a spiritual port of Python Requests";
    homepage = "https://github.com/libcpr/cpr";
    license = lib.licenses.mit;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ phodina ];
  };
})
+15 −8
Original line number Diff line number Diff line
@@ -4,11 +4,12 @@
  fetchFromGitHub,
  cmake,
  curl,
  pkg-config,
  staticOnly ? stdenv.hostPlatform.isStatic,
}:

let
  version = "1.12.0";
  version = "1.13.0";
in
stdenv.mkDerivation {
  pname = "libcpr";
@@ -23,16 +24,19 @@ stdenv.mkDerivation {
    owner = "libcpr";
    repo = "cpr";
    rev = version;
    hash = "sha256-OkOyh2ibt/jX/Dc+TB1uSlWtzEhdSQwHVN96oCOh2yM=";
    hash = "sha256-qoNA88GL9Yv3r/7UsZduYXuyrQVxfFY/0P6RfLqT5Uw=";
  };

  nativeBuildInputs = [ cmake ];
  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  propagatedBuildInputs = [ curl ];

  cmakeFlags = [
    "-DBUILD_SHARED_LIBS=${if staticOnly then "OFF" else "ON"}"
    "-DCPR_USE_SYSTEM_CURL=ON"
    (lib.cmakeBool "BUILD_SHARED_LIBS" (!staticOnly))
    (lib.cmakeBool "CPR_USE_SYSTEM_CURL" true)
  ];

  postPatch = ''
@@ -42,7 +46,7 @@ stdenv.mkDerivation {

  postInstall = ''
    substituteInPlace "$out/lib/cmake/cpr/cprTargets.cmake" \
      --replace "_IMPORT_PREFIX \"$out\"" \
      --replace-fail "_IMPORT_PREFIX \"$out\"" \
                     "_IMPORT_PREFIX \"$dev\""
  '';

@@ -50,7 +54,10 @@ stdenv.mkDerivation {
    description = "C++ wrapper around libcurl";
    homepage = "https://docs.libcpr.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ rycee ];
    maintainers = with maintainers; [
      phodina
      rycee
    ];
    platforms = platforms.all;
  };
}
+2 −2
Original line number Diff line number Diff line
@@ -9,9 +9,9 @@
  openssl,
  sqlcipher,
  boost,
  cpr,
  curl,
  glib,
  libcpr,
  libsecret,
  libmaddy-markdown,
  testers,
@@ -48,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: {

  propagatedBuildInputs = [
    curl
    cpr
    libcpr
    libsecret
    libmaddy-markdown
    sqlcipher
+1 −0
Original line number Diff line number Diff line
@@ -457,6 +457,7 @@ mapAliases {
  cosmic-tasks = throw "'cosmic-tasks' has been renamed to/replaced by 'tasks'"; # Converted to throw 2025-10-27
  cotton = throw "'cotton' has been removed since it is vulnerable to CVE-2025-62518 and upstream is unmaintained"; # Added 2025-10-26
  cpp-ipfs-api = throw "'cpp-ipfs-api' has been renamed to/replaced by 'cpp-ipfs-http-client'"; # Converted to throw 2025-10-27
  cpr = warnAlias "'cpr' has been renamed to/replaced by 'libcpr'" libcpr; # Added 2025-11-17
  create-cycle-app = throw "'create-cycle-app' has been removed because it is unmaintained and has issues installing with recent nodejs versions."; # Added 2025-11-01
  crispyDoom = throw "'crispyDoom' has been renamed to/replaced by 'crispy-doom'"; # Converted to throw 2025-10-27
  critcl = throw "'critcl' has been renamed to/replaced by 'tclPackages.critcl'"; # Converted to throw 2025-10-27