From f8a26c443a08644b37d0775bd637bc0901959190 Mon Sep 17 00:00:00 2001 From: quantenzitrone Date: Sun, 16 Nov 2025 00:22:29 +0100 Subject: [PATCH] font-misc-misc: refactor, move to pkgs/by-name and rename from xorg.fontmiscmisc relevant changes: - remove the explicit copying of the alias file from font-alias - potenially fix the nixos xorg module(maybe it didn't even break) --- nixos/modules/services/x11/xserver.nix | 3 +- pkgs/by-name/fo/font-misc-misc/package.nix | 51 +++++++++++++++++++ pkgs/servers/x11/xorg/default.nix | 43 +--------------- .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/overrides.nix | 8 --- pkgs/servers/x11/xorg/tarballs.list | 1 - 6 files changed, 57 insertions(+), 51 deletions(-) create mode 100644 pkgs/by-name/fo/font-misc-misc/package.nix diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index fdc2164f0f9d..517305daab25 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -1021,7 +1021,8 @@ in fonts.packages = [ (if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc) - pkgs.xorg.fontmiscmisc + pkgs.font-misc-misc + pkgs.font-alias ]; }; diff --git a/pkgs/by-name/fo/font-misc-misc/package.nix b/pkgs/by-name/fo/font-misc-misc/package.nix new file mode 100644 index 000000000000..2cc4f9c92c49 --- /dev/null +++ b/pkgs/by-name/fo/font-misc-misc/package.nix @@ -0,0 +1,51 @@ +{ + lib, + stdenv, + fetchurl, + pkg-config, + font-util, + bdftopcf, + mkfontscale, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "font-misc-misc"; + version = "1.1.3"; + + src = fetchurl { + url = "mirror://xorg/individual/font/font-misc-misc-${finalAttrs.version}.tar.xz"; + hash = "sha256-eavjYfWLshren1ZYmOSGMAzhzGIdUoW+wm4Utqhhj+0="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + bdftopcf + font-util + mkfontscale + ]; + + buildInputs = [ font-util ]; + + configureFlags = [ "--with-fontrootdir=$(out)/lib/X11/fonts" ]; + + 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 = "Misc pcf fonts in different sizes"; + homepage = "https://gitlab.freedesktop.org/xorg/font/misc-misc"; + license = lib.licenses.publicDomain; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 1396f117e6c6..46a49e3f7d54 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -31,6 +31,7 @@ font-misc-cyrillic, font-misc-ethiopic, font-misc-meltho, + font-misc-misc, font-mutt-misc, font-schumacher-misc, font-screen-cyrillic, @@ -241,6 +242,7 @@ self: with self; { fontmisccyrillic = font-misc-cyrillic; fontmiscethiopic = font-misc-ethiopic; fontmiscmeltho = font-misc-meltho; + fontmiscmisc = font-misc-misc; fontmuttmisc = font-mutt-misc; fontschumachermisc = font-schumacher-misc; fontscreencyrillic = font-screen-cyrillic; @@ -396,47 +398,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - fontmiscmisc = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - fontutil, - bdftopcf, - mkfontscale, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "font-misc-misc"; - version = "1.1.3"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/font/font-misc-misc-1.1.3.tar.xz"; - sha256 = "1vcgc6lbc53fqaz8alhxcb6f231hhvj9hn2nkzg1mclbymhy7avr"; - }; - 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! fonttosfnt = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 9c2f977b5451..5e7eb1243b5b 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -362,6 +362,7 @@ print OUT <