From 4bb08abe141498c48ddba3604771364b523ecc5a Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 22 Apr 2025 10:57:39 +0900 Subject: [PATCH 1/6] fontconfig: prefer GitLab for src https://www.freedesktop.org/software/fontconfig/release/ does not include latest releases such as 2.16.{1,2}. They use GitLab and the releases since 2.16.1. It was announced in https://lists.freedesktop.org/archives/fontconfig/2025-March/007154.html. This change requires to remove unpackaged man pages. --- .../development/libraries/fontconfig/default.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index b068e627f844..41ad0bf9541f 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, - fetchurl, + fetchFromGitLab, pkg-config, python3, freetype, @@ -24,11 +24,12 @@ stdenv.mkDerivation (finalAttrs: { "out" ]; # $out contains all the config - src = fetchurl { - url = - with finalAttrs; - "https://www.freedesktop.org/software/fontconfig/release/${pname}-${version}.tar.xz"; - hash = "sha256-ajPcVVzJuosQyvdpWHjvE07rNtCvNmBB9jmx2ptu0iA="; + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "fontconfig"; + repo = "fontconfig"; + tag = finalAttrs.version; + hash = "sha256-ELn1WL2kueFj97GfjvjDa82iAJKFv4J5mkHon9vqtXE="; }; nativeBuildInputs = [ @@ -86,9 +87,6 @@ stdenv.mkDerivation (finalAttrs: { ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \ > fonts.conf.tmp mv fonts.conf.tmp $out/etc/fonts/fonts.conf - # We don't keep section 3 of the manpages, as they are quite large and - # probably not so useful. - rm -r $bin/share/man/man3 ''; passthru.tests = { From ad4e04502c006ab259eda808a677e286489e4849 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 22 Apr 2025 11:47:49 +0900 Subject: [PATCH 2/6] fontconfig: add updateScript --- pkgs/development/libraries/fontconfig/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 41ad0bf9541f..bf1dc0aeac8b 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -11,6 +11,7 @@ dejavu_fonts, autoreconfHook, testers, + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { @@ -89,10 +90,14 @@ stdenv.mkDerivation (finalAttrs: { mv fonts.conf.tmp $out/etc/fonts/fonts.conf ''; - passthru.tests = { - pkg-config = testers.hasPkgConfigModules { - package = finalAttrs.finalPackage; + passthru = { + tests = { + pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + }; }; + + updateScript = nix-update-script { }; }; meta = with lib; { From 227188afb014f039e1753be181136b706eca8816 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 23 Apr 2025 15:00:33 +0900 Subject: [PATCH 3/6] fontconfig: add versionCheckHook --- pkgs/development/libraries/fontconfig/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index bf1dc0aeac8b..88c9a4eca9db 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -10,6 +10,7 @@ gperf, dejavu_fonts, autoreconfHook, + versionCheckHook, testers, nix-update-script, }: @@ -90,6 +91,13 @@ stdenv.mkDerivation (finalAttrs: { mv fonts.conf.tmp $out/etc/fonts/fonts.conf ''; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + versionCheckProgram = "${placeholder "bin"}/bin/fc-list"; + versionCheckProgramArg = "--version"; + passthru = { tests = { pkg-config = testers.hasPkgConfigModules { From 873eb8eafe9a681b1ed6d8077440a97576752909 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 22 Apr 2025 11:48:22 +0900 Subject: [PATCH 4/6] fontconfig: 2.16.0 -> 2.16.2 Diff: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/compare/2.16.0...2.16.2 --- pkgs/development/libraries/fontconfig/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 88c9a4eca9db..e5d1e700f377 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "fontconfig"; - version = "2.16.0"; + version = "2.16.2"; outputs = [ "bin" @@ -31,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "fontconfig"; repo = "fontconfig"; tag = finalAttrs.version; - hash = "sha256-ELn1WL2kueFj97GfjvjDa82iAJKFv4J5mkHon9vqtXE="; + hash = "sha256-R2y5H4JbtpCLRW7BvLXj5H6NrzVZf6+DsaQCuIhibzM="; }; nativeBuildInputs = [ From b3bb63f4410df02280b31e5e1ca711c45bbfe73f Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 23 Apr 2025 17:34:44 +0900 Subject: [PATCH 5/6] fontconfig: use tarball for src to include man pages Co-authored-by: Jan Tojnar --- .../libraries/fontconfig/default.nix | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index e5d1e700f377..8c1f058317ac 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, - fetchFromGitLab, + fetchurl, pkg-config, python3, freetype, @@ -12,7 +12,7 @@ autoreconfHook, versionCheckHook, testers, - nix-update-script, + gitUpdater, }: stdenv.mkDerivation (finalAttrs: { @@ -26,12 +26,11 @@ stdenv.mkDerivation (finalAttrs: { "out" ]; # $out contains all the config - src = fetchFromGitLab { - domain = "gitlab.freedesktop.org"; - owner = "fontconfig"; - repo = "fontconfig"; - tag = finalAttrs.version; - hash = "sha256-R2y5H4JbtpCLRW7BvLXj5H6NrzVZf6+DsaQCuIhibzM="; + # GitLab repositrory does not include pre-generated man pages. + # ref: https://github.com/NixOS/nixpkgs/pull/401037#discussion_r2055430206 + src = fetchurl { + url = "https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/${finalAttrs.version}/fontconfig-${finalAttrs.version}.tar.xz"; + hash = "sha256-FluP0qEZhkyHRksjOYbEobwJ77CcZd4cpAzB6F/7d+I="; }; nativeBuildInputs = [ @@ -89,6 +88,9 @@ stdenv.mkDerivation (finalAttrs: { ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \ > fonts.conf.tmp mv fonts.conf.tmp $out/etc/fonts/fonts.conf + # We don't keep section 3 of the manpages, as they are quite large and + # probably not so useful. + rm -r $bin/share/man/man3 ''; nativeInstallCheckInputs = [ @@ -105,7 +107,9 @@ stdenv.mkDerivation (finalAttrs: { }; }; - updateScript = nix-update-script { }; + updateScript = gitUpdater { + url = "https://gitlab.freedesktop.org/fontconfig/fontconfig.git"; + }; }; meta = with lib; { From f80a788128b2f8235b62f08cc1b4eed3077b308a Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 23 Apr 2025 17:55:09 +0900 Subject: [PATCH 6/6] fontconfig: add man pages checks --- pkgs/development/libraries/fontconfig/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 8c1f058317ac..b51a835d6103 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -100,6 +100,16 @@ stdenv.mkDerivation (finalAttrs: { versionCheckProgram = "${placeholder "bin"}/bin/fc-list"; versionCheckProgramArg = "--version"; + installCheckPhase = '' + runHook preInstallCheck + + [ -d "$bin/share/man/man1" ] + [ -d "$bin/share/man/man5" ] + echo "man pages exist" + + runHook postInstallCheck + ''; + passthru = { tests = { pkg-config = testers.hasPkgConfigModules {