From 506db072ab0419ab38f213d87d269f49ea92547c Mon Sep 17 00:00:00 2001 From: quantenzitrone Date: Sat, 15 Nov 2025 23:18:48 +0100 Subject: [PATCH] font-ibm-type1: refactor, move to pkgs/by-name and rename from xorg.fontibmtype1 the output doesn't change --- pkgs/by-name/fo/font-ibm-type1/package.nix | 48 +++++++++++++++++++ pkgs/servers/x11/xorg/default.nix | 40 +--------------- .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/overrides.nix | 8 +--- pkgs/servers/x11/xorg/tarballs.list | 1 - 5 files changed, 53 insertions(+), 46 deletions(-) create mode 100644 pkgs/by-name/fo/font-ibm-type1/package.nix diff --git a/pkgs/by-name/fo/font-ibm-type1/package.nix b/pkgs/by-name/fo/font-ibm-type1/package.nix new file mode 100644 index 000000000000..88168367e60b --- /dev/null +++ b/pkgs/by-name/fo/font-ibm-type1/package.nix @@ -0,0 +1,48 @@ +{ + lib, + stdenv, + fetchurl, + pkg-config, + fontutil, + mkfontscale, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "font-ibm-type1"; + version = "1.0.4"; + + src = fetchurl { + url = "mirror://xorg/individual/font/font-ibm-type1-${finalAttrs.version}.tar.xz"; + hash = "sha256-xDlelbpG1AxK0XN+kcrCDAq3VBEym2DbXZn+2Stgzn8="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + mkfontscale + ]; + + buildInputs = [ fontutil ]; + + 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 = "IBM Courier Type1 fonts"; + homepage = "https://gitlab.freedesktop.org/xorg/font/ibm-type1"; + license = lib.licenses.unfreeRedistributable; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 0edc2598824f..692bb119dab8 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -24,6 +24,7 @@ font-daewoo-misc, font-dec-misc, font-encodings, + font-ibm-type1, font-isas-misc, font-micro-misc, font-misc-cyrillic, @@ -231,6 +232,7 @@ self: with self; { fontcursormisc = font-cursor-misc; fontdaewoomisc = font-daewoo-misc; fontdecmisc = font-dec-misc; + fontibmtype1 = font-ibm-type1; fontisasmisc = font-isas-misc; fontmicromisc = font-micro-misc; fontmisccyrillic = font-misc-cyrillic; @@ -390,44 +392,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - fontibmtype1 = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - fontutil, - mkfontscale, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "font-ibm-type1"; - version = "1.0.4"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/font/font-ibm-type1-1.0.4.tar.xz"; - sha256 = "0zyfc0mxkzlrbpdn16rj25abf2hcqb592zkks550rm26paamwff4"; - }; - 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! fontjismisc = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index dae1a1e55376..317cfff13415 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -355,6 +355,7 @@ print OUT <