font-util: switch from fetchurl to fetchFromGitLab (#435396)

This commit is contained in:
Fabián Heredia Montiel
2025-08-27 10:51:54 -06:00
committed by GitHub
+20 -15
View File
@@ -1,31 +1,36 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitLab,
testers,
writeScript,
gitUpdater,
autoreconfHook,
util-macros,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-util";
version = "1.4.1";
src = fetchurl {
url = "mirror://xorg/individual/font/font-util-${finalAttrs.version}.tar.xz";
hash = "sha256-XJ9kEjwZSxUP7okEmZFoc4bm/zbvKve4C6U++vNozJU=";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
group = "xorg";
owner = "font";
repo = "util";
tag = "font-util-${finalAttrs.version}";
hash = "sha256-cv6Whex1s4+J7Ue4IOHdO9WtrarTgSpLEghWpbUl+0o=";
};
nativeBuildInputs = [
autoreconfHook
util-macros
];
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/font/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
updateScript = gitUpdater {
rev-prefix = "font-util-";
ignoredVersions = "1_0_1";
};
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};