From b96325543a358a168dc1a7c0f2dcac02a7642dfd Mon Sep 17 00:00:00 2001 From: quantenzitrone Date: Wed, 27 Aug 2025 04:07:45 +0200 Subject: [PATCH] font-bitstream-100dpi: refactor, move to pkgs/by-name and rename from xorg.fontbitstream100dpi the package output doesn't change --- .../fo/font-bitstream-100dpi/package.nix | 56 +++++++++++++++++++ pkgs/servers/x11/xorg/default.nix | 42 +------------- .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/tarballs.list | 1 - 4 files changed, 60 insertions(+), 41 deletions(-) create mode 100644 pkgs/by-name/fo/font-bitstream-100dpi/package.nix diff --git a/pkgs/by-name/fo/font-bitstream-100dpi/package.nix b/pkgs/by-name/fo/font-bitstream-100dpi/package.nix new file mode 100644 index 000000000000..70bdb81636af --- /dev/null +++ b/pkgs/by-name/fo/font-bitstream-100dpi/package.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchurl, + pkg-config, + font-util, + bdftopcf, + mkfontscale, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "font-bitstream-100dpi"; + version = "1.0.4"; + + src = fetchurl { + url = "mirror://xorg/individual/font/font-bitstream-100dpi-${finalAttrs.version}.tar.xz"; + hash = "sha256-LRzGgu/k9+vfX72Ilh2MoysnKZaHKGM96iChYnaQwac="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + bdftopcf + 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 = "Bitstream Charter and Terminal 100dpi pcf fonts"; + homepage = "https://gitlab.freedesktop.org/xorg/font/bitstream-100dpi"; + license = with lib.licenses; [ + hpnd + # TODO: change this license or remove this comment when + # https://github.com/spdx/license-list-XML/issues/2824 + # gets resolved + xfig + ]; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 8d98269160a1..a8b8c67d084f 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -15,6 +15,7 @@ font-bh-lucidatypewriter-75dpi, font-bh-ttf, font-bh-type1, + font-bitstream-100dpi, font-cronyx-cyrillic, font-encodings, font-isas-misc, @@ -197,6 +198,7 @@ self: with self; { fontbhlucidatypewriter75dpi = font-bh-lucidatypewriter-75dpi; fontbhttf = font-bh-ttf; fontbhtype1 = font-bh-type1; + fontbitstream100dpi = font-bitstream-100dpi; fontcronyxcyrillic = font-cronyx-cyrillic; fontisasmisc = font-isas-misc; fontmicromisc = font-micro-misc; @@ -390,46 +392,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - fontbitstream100dpi = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - fontutil, - bdftopcf, - mkfontscale, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "font-bitstream-100dpi"; - version = "1.0.4"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/font/font-bitstream-100dpi-1.0.4.tar.xz"; - sha256 = "19y1j1v65890x8yn6a47jqljfax3ihfrd25xbzgypxz4xy1cc71d"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ - pkg-config - bdftopcf - 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! fontbitstream75dpi = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 0eed02f53618..d6ab785a0067 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -338,6 +338,7 @@ print OUT <