From 657ebfddbb0365705acaaccec01c48525dd9231e Mon Sep 17 00:00:00 2001 From: quantenzitrone Date: Thu, 21 Aug 2025 04:51:43 +0200 Subject: [PATCH] font-adobe-100dpi: refactor, move to pkgs/by-name and rename from xorg.fontadobe100dpi relevant changes: - 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 this also fixes one occasion i could find in nixpkgs where the font path was relevant --- pkgs/by-name/fo/font-adobe-100dpi/package.nix | 51 +++++++++++++++++++ pkgs/by-name/xd/xdummy/package.nix | 2 +- pkgs/servers/x11/xorg/default.nix | 43 +--------------- .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/tarballs.list | 1 - 5 files changed, 56 insertions(+), 43 deletions(-) create mode 100644 pkgs/by-name/fo/font-adobe-100dpi/package.nix diff --git a/pkgs/by-name/fo/font-adobe-100dpi/package.nix b/pkgs/by-name/fo/font-adobe-100dpi/package.nix new file mode 100644 index 000000000000..3acef2334674 --- /dev/null +++ b/pkgs/by-name/fo/font-adobe-100dpi/package.nix @@ -0,0 +1,51 @@ +{ + lib, + stdenv, + fetchurl, + pkg-config, + font-util, + bdftopcf, + mkfontscale, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "font-adobe-100dpi"; + version = "1.0.4"; + + src = fetchurl { + url = "mirror://xorg/individual/font/font-adobe-100dpi-${finalAttrs.version}.tar.xz"; + hash = "sha256-tnr/RF4FYyjVP5cy05iE9V3Y0wP8Ja89u6M6i6NanM8="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + bdftopcf + font-util + mkfontscale + ]; + + buildInputs = [ font-util ]; + + configureFlags = [ "--with-fontrootdir=$(out)/share/fonts/X11" ]; + + 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 100dpi pcf fonts"; + homepage = "https://gitlab.freedesktop.org/xorg/font/adobe-100dpi"; + license = lib.licenses.hpndSellVariant; # plus a trademark that doesn't change the license + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/xd/xdummy/package.nix b/pkgs/by-name/xd/xdummy/package.nix index df0911e1299f..33b8087ad225 100644 --- a/pkgs/by-name/xd/xdummy/package.nix +++ b/pkgs/by-name/xd/xdummy/package.nix @@ -30,7 +30,7 @@ let ModulePath "${xorg.xf86videodummy}/lib/xorg/modules" XkbDir "${xkeyboard_config}/share/X11/xkb" FontPath "${xorg.fontadobe75dpi}/share/fonts/X11/75dpi" - FontPath "${xorg.fontadobe100dpi}/lib/X11/fonts/100dpi" + FontPath "${xorg.fontadobe100dpi}/share/fonts/X11/100dpi" FontPath "${xorg.fontmiscmisc}/lib/X11/fonts/misc" FontPath "${xorg.fontcursormisc}/lib/X11/fonts/misc" ${lib.optionalString unfreeFonts '' diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index c13ec42c4435..08de18866e42 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -2,6 +2,7 @@ { lib, bdftopcf, + font-adobe-100dpi, font-adobe-75dpi, font-alias, font-bh-ttf, @@ -118,6 +119,7 @@ self: with self; { xwud ; encodings = font-encodings; + fontadobe100dpi = font-adobe-100dpi; fontadobe75dpi = font-adobe-75dpi; fontalias = font-alias; fontbhttf = font-bh-ttf; @@ -294,47 +296,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - fontadobe100dpi = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - fontutil, - bdftopcf, - mkfontscale, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "font-adobe-100dpi"; - version = "1.0.4"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/font/font-adobe-100dpi-1.0.4.tar.xz"; - sha256 = "1kwwbaiqnfm3pcysy9gw0g9xhpgmhjcd6clp7zajhqq5br2gyymn"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ - pkg-config - bdftopcf - fontutil - 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! fontadobeutopia100dpi = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 240fd3d930d1..a26b9705523c 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -318,6 +318,7 @@ print OUT <