From 9ef0609cf31fccaeb2811d939929bba677231e99 Mon Sep 17 00:00:00 2001 From: quantenzitrone Date: Tue, 26 Aug 2025 14:48:15 +0200 Subject: [PATCH] font-adobe-utopia-type1: refactor, move to pkgs/by-name and rename from xorg.fontadobeutopiatype1 relevant changes: - remove some dependencies that dont't seem to be needed - font is now in $out/share/fonts/X11 instead of $out/lib/X11/fonts i have no idea why fonts would be in lib, so lets see if this breaks anything - font is now under the license adobeUtopia (recognised by SPDX) instead of unfreeRedistributable --- .../fo/font-adobe-utopia-type1/package.nix | 38 ++++++++++++++++++ pkgs/servers/x11/xorg/default.nix | 40 +------------------ .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/overrides.nix | 1 - pkgs/servers/x11/xorg/tarballs.list | 1 - 5 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 pkgs/by-name/fo/font-adobe-utopia-type1/package.nix diff --git a/pkgs/by-name/fo/font-adobe-utopia-type1/package.nix b/pkgs/by-name/fo/font-adobe-utopia-type1/package.nix new file mode 100644 index 000000000000..8a51ac68b7f3 --- /dev/null +++ b/pkgs/by-name/fo/font-adobe-utopia-type1/package.nix @@ -0,0 +1,38 @@ +{ + lib, + stdenv, + fetchurl, + mkfontscale, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "font-adobe-utopia-type1"; + version = "1.0.5"; + + src = fetchurl { + url = "mirror://xorg/individual/font/font-adobe-utopia-type1-${finalAttrs.version}.tar.xz"; + hash = "sha256-TLKAvEdpOwfF4A/Q5a1XIaq+vAVIw/BndOXMPLz3Vpc="; + }; + + strictDeps = true; + nativeBuildInputs = [ mkfontscale ]; + + 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" + ''; + }; + + meta = { + description = "Adobe Utopia PostScript Type 1 fonts"; + homepage = "https://gitlab.freedesktop.org/xorg/font/adobe-utopia-type1"; + license = lib.licenses.adobeUtopia; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 3ff322232da3..d371c97deaea 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -6,6 +6,7 @@ font-adobe-75dpi, font-adobe-utopia-100dpi, font-adobe-utopia-75dpi, + font-adobe-utopia-type1, font-alias, font-bh-ttf, font-bh-type1, @@ -125,6 +126,7 @@ self: with self; { fontadobe75dpi = font-adobe-75dpi; fontadobeutopia100dpi = font-adobe-utopia-100dpi; fontadobeutopia75dpi = font-adobe-utopia-75dpi; + fontadobeutopiatype1 = font-adobe-utopia-type1; fontalias = font-alias; fontbhttf = font-bh-ttf; fontbhtype1 = font-bh-type1; @@ -300,44 +302,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - fontadobeutopiatype1 = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - fontutil, - mkfontscale, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "font-adobe-utopia-type1"; - version = "1.0.5"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/font/font-adobe-utopia-type1-1.0.5.tar.xz"; - sha256 = "15snyyy3rk75fikz1hs80nybxai1aynybl0gw32hffv98yy81cjc"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ - pkg-config - mkfontscale - ]; - buildInputs = [ fontutil ]; - configureFlags = [ "--with-fontrootdir=$(out)/lib/X11/fonts" ]; - postPatch = ''substituteInPlace configure --replace 'MAPFILES_PATH=`pkg-config' 'MAPFILES_PATH=`$PKG_CONFIG' ''; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! fontarabicmisc = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index d0a26a230c2c..793ad3a33e7b 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -322,6 +322,7 @@ print OUT <