From 9040833b3f88f47fd3d92470f0e1ea8e95acee5d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 8 Feb 2025 12:30:14 +0100 Subject: [PATCH] libpsl: backport pkg-config static fix This was merged 9 months ago, and still no release, so let's backport it, because the alternative is adding the same hack as curl in other packages, like libsoup. --- pkgs/by-name/cu/curlMinimal/package.nix | 5 ----- pkgs/by-name/li/libpsl/package.nix | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/cu/curlMinimal/package.nix b/pkgs/by-name/cu/curlMinimal/package.nix index 1c58c12f9860..90eb467c4df7 100644 --- a/pkgs/by-name/cu/curlMinimal/package.nix +++ b/pkgs/by-name/cu/curlMinimal/package.nix @@ -123,11 +123,6 @@ stdenv.mkDerivation (finalAttrs: { preConfigure = '' sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure rm src/tool_hugehelp.c - '' + lib.optionalString (pslSupport && stdenv.hostPlatform.isStatic) '' - # curl doesn't understand that libpsl2 has deps because it doesn't use - # pkg-config. - # https://github.com/curl/curl/pull/12919 - configureFlagsArray+=("LIBS=-lidn2 -lunistring") ''; configureFlags = [ diff --git a/pkgs/by-name/li/libpsl/package.nix b/pkgs/by-name/li/libpsl/package.nix index 15cfedbdae89..81dd87ded09c 100644 --- a/pkgs/by-name/li/libpsl/package.nix +++ b/pkgs/by-name/li/libpsl/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, autoreconfHook, docbook_xsl, docbook_xml_dtd_43, @@ -25,6 +26,16 @@ stdenv.mkDerivation rec { hash = "sha256-mp9qjG7bplDPnqVUdc0XLdKEhzFoBOnHMgLZdXLNOi0="; }; + patches = [ + # Can be dropped on next release, or if we switch to Meson for + # this package. Test pkgsStatic.curl still builds. + (fetchpatch { + name = "static.patch"; + url = "https://github.com/rockdaboot/libpsl/commit/490bd6f98a2addcade55028ea60c36cce07e21e4.patch"; + hash = "sha256-7Uu9gaVuA9Aly2mmnhUVgv2BYQTSBODJ2rDl5xp0uVY="; + }) + ]; + outputs = [ "out"