From 1b67ef952a72dfc04c59ab492df4942aa9c89ecf Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 17 Nov 2025 18:52:05 +0100 Subject: [PATCH 1/2] libcpr: merge duplicate cpr package Adds an alias from the old name and updates libnick to use libcpr. See #462153 --- pkgs/by-name/cp/cpr/package.nix | 61 ----------------------------- pkgs/by-name/li/libcpr/package.nix | 19 ++++++--- pkgs/by-name/li/libnick/package.nix | 4 +- pkgs/top-level/aliases.nix | 1 + 4 files changed, 16 insertions(+), 69 deletions(-) delete mode 100644 pkgs/by-name/cp/cpr/package.nix diff --git a/pkgs/by-name/cp/cpr/package.nix b/pkgs/by-name/cp/cpr/package.nix deleted file mode 100644 index ef29bd248a54..000000000000 --- a/pkgs/by-name/cp/cpr/package.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - 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 ]; - }; -}) diff --git a/pkgs/by-name/li/libcpr/package.nix b/pkgs/by-name/li/libcpr/package.nix index d3f10664c66f..ac574f74103c 100644 --- a/pkgs/by-name/li/libcpr/package.nix +++ b/pkgs/by-name/li/libcpr/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, cmake, curl, + pkg-config, staticOnly ? stdenv.hostPlatform.isStatic, }: @@ -26,13 +27,16 @@ stdenv.mkDerivation { hash = "sha256-OkOyh2ibt/jX/Dc+TB1uSlWtzEhdSQwHVN96oCOh2yM="; }; - 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,15 +46,18 @@ stdenv.mkDerivation { postInstall = '' substituteInPlace "$out/lib/cmake/cpr/cprTargets.cmake" \ - --replace "_IMPORT_PREFIX \"$out\"" \ - "_IMPORT_PREFIX \"$dev\"" + --replace-fail "_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 ]; + maintainers = with maintainers; [ + phodina + rycee + ]; platforms = platforms.all; }; } diff --git a/pkgs/by-name/li/libnick/package.nix b/pkgs/by-name/li/libnick/package.nix index e9a4a8be68a1..f583c3fc9b86 100644 --- a/pkgs/by-name/li/libnick/package.nix +++ b/pkgs/by-name/li/libnick/package.nix @@ -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 diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index aab228079512..30b57ae69cbd 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -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 From 2447d64db0aebb0fbd05ab5f1d4901e95f2415f8 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 17 Nov 2025 19:51:18 +0100 Subject: [PATCH 2/2] libcpr: 1.12.0 -> 1.13.0 --- pkgs/by-name/li/libcpr/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/li/libcpr/package.nix b/pkgs/by-name/li/libcpr/package.nix index ac574f74103c..94cb2361d46a 100644 --- a/pkgs/by-name/li/libcpr/package.nix +++ b/pkgs/by-name/li/libcpr/package.nix @@ -9,7 +9,7 @@ }: let - version = "1.12.0"; + version = "1.13.0"; in stdenv.mkDerivation { pname = "libcpr"; @@ -24,7 +24,7 @@ stdenv.mkDerivation { owner = "libcpr"; repo = "cpr"; rev = version; - hash = "sha256-OkOyh2ibt/jX/Dc+TB1uSlWtzEhdSQwHVN96oCOh2yM="; + hash = "sha256-qoNA88GL9Yv3r/7UsZduYXuyrQVxfFY/0P6RfLqT5Uw="; }; nativeBuildInputs = [