font-bitstream-{100dpi,75dpi,type1}: refactor, move to pkgs/by-name and rename from xorg.fontbitstream*, xorg.fontbitstreamspeedo: drop (#442323)

This commit is contained in:
jopejoe1
2025-09-25 13:05:09 +02:00
committed by GitHub
8 changed files with 193 additions and 181 deletions
+5
View File
@@ -167,6 +167,11 @@ lib.mapAttrs mkLicense (
fullName = "Apache License 2.0";
};
bitstreamCharter = {
spdxId = "Bitstream-Charter";
fullName = "Bitstream Charter Font License";
};
bitstreamVera = {
spdxId = "Bitstream-Vera";
fullName = "Bitstream Vera Font License";
@@ -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)/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 = "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;
};
})
@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
font-util,
bdftopcf,
mkfontscale,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-bitstream-75dpi";
version = "1.0.4";
src = fetchurl {
url = "mirror://xorg/individual/font/font-bitstream-75dpi-${finalAttrs.version}.tar.xz";
hash = "sha256-qus02HQkqcKwzw6FkHBMkMtbQsajtqDvnkZ273c7+CY=";
};
strictDeps = true;
nativeBuildInputs = [
pkg-config
bdftopcf
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 = "Bitstream Charter and Terminal 75dpi pcf fonts";
homepage = "https://gitlab.freedesktop.org/xorg/font/bitstream-75dpi";
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;
};
})
@@ -0,0 +1,58 @@
{
lib,
stdenv,
fetchurl,
mkfontscale,
fontforge,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-bitstream-type1";
version = "1.0.4";
src = fetchurl {
url = "mirror://xorg/individual/font/font-bitstream-type1-${finalAttrs.version}.tar.xz";
hash = "sha256-3i8ji0zXLbQiigumeCnXait8A54imT1mpyLuOFJIxig=";
};
strictDeps = true;
nativeBuildInputs = [
mkfontscale
fontforge
];
postBuild = ''
# convert Postscript (Type 1) font to otf
for i in $(find -type f -name '*.pfa' -o -name '*.pfb'); do
name=$(basename $i | cut -d. -f1)
fontforge -lang=ff -c "Open(\"$i\"); Generate(\"$name.otf\")"
done
'';
postInstall = ''
# install the otf fonts
fontDir="$out/share/fonts/X11/otf"
install -Dm444 -t "$fontDir" *.otf
mkfontscale "$fontDir"
'';
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 PostScript Type 1 and OpenType fonts";
homepage = "https://gitlab.freedesktop.org/xorg/font/bitstream-type1";
license = lib.licenses.bitstreamCharter;
maintainers = [ ];
platforms = lib.platforms.unix;
};
})
+6 -156
View File
@@ -15,6 +15,9 @@
font-bh-lucidatypewriter-75dpi,
font-bh-ttf,
font-bh-type1,
font-bitstream-100dpi,
font-bitstream-75dpi,
font-bitstream-type1,
font-cronyx-cyrillic,
font-encodings,
font-isas-misc,
@@ -216,6 +219,9 @@ self: with self; {
fontbhlucidatypewriter75dpi = font-bh-lucidatypewriter-75dpi;
fontbhttf = font-bh-ttf;
fontbhtype1 = font-bh-type1;
fontbitstream100dpi = font-bitstream-100dpi;
fontbitstream75dpi = font-bitstream-75dpi;
fontbitstreamtype1 = font-bitstream-type1;
fontcronyxcyrillic = font-cronyx-cyrillic;
fontisasmisc = font-isas-misc;
fontmicromisc = font-micro-misc;
@@ -416,162 +422,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 (
{
stdenv,
pkg-config,
fetchurl,
fontutil,
bdftopcf,
mkfontscale,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-bitstream-75dpi";
version = "1.0.4";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/font/font-bitstream-75dpi-1.0.4.tar.xz";
sha256 = "09pq7dvyyxj6kvps1dm3qr15pjwh9iq9118fryqc5a94fkc39sxa";
};
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!
fontbitstreamspeedo = callPackage (
{
stdenv,
pkg-config,
fetchurl,
fontutil,
mkfontscale,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-bitstream-speedo";
version = "1.0.2";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/font/font-bitstream-speedo-1.0.2.tar.gz";
sha256 = "0wmy58cd3k7w2j4v20icnfs8z3b61qj3vqdx958z18w00h9mzsmf";
};
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!
fontbitstreamtype1 = callPackage (
{
stdenv,
pkg-config,
fetchurl,
fontutil,
mkfontscale,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-bitstream-type1";
version = "1.0.4";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/font/font-bitstream-type1-1.0.4.tar.xz";
sha256 = "0a669193ivi2lxk3v692kq1pqavaswlpi9hbi8ib8bfp9j5j6byy";
};
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!
fontcursormisc = callPackage (
{
@@ -346,6 +346,9 @@ print OUT <<EOF;
font-bh-lucidatypewriter-75dpi,
font-bh-ttf,
font-bh-type1,
font-bitstream-100dpi,
font-bitstream-75dpi,
font-bitstream-type1,
font-cronyx-cyrillic,
font-encodings,
font-isas-misc,
@@ -547,6 +550,9 @@ self: with self; {
fontbhlucidatypewriter75dpi = font-bh-lucidatypewriter-75dpi;
fontbhttf = font-bh-ttf;
fontbhtype1 = font-bh-type1;
fontbitstream100dpi = font-bitstream-100dpi;
fontbitstream75dpi = font-bitstream-75dpi;
fontbitstreamtype1 = font-bitstream-type1;
fontcronyxcyrillic = font-cronyx-cyrillic;
fontisasmisc = font-isas-misc;
fontmicromisc = font-micro-misc;
+6 -21
View File
@@ -1,6 +1,7 @@
{
callPackage,
lib,
config,
stdenv,
makeWrapper,
fetchurl,
@@ -787,27 +788,6 @@ self: super:
});
xwd = addMainProgram super.xwd { };
# convert Type1 vector fonts to OpenType fonts
fontbitstreamtype1 = super.fontbitstreamtype1.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ fontforge ];
postBuild = ''
# convert Postscript (Type 1) font to otf
for i in $(find -type f -name '*.pfa' -o -name '*.pfb'); do
name=$(basename $i | cut -d. -f1)
fontforge -lang=ff -c "Open(\"$i\"); Generate(\"$name.otf\")"
done
'';
postInstall = ''
# install the otf fonts
fontDir="$out/lib/X11/fonts/misc/"
install -D -m 644 -t "$fontDir" *.otf
mkfontscale "$fontDir"
'';
});
}
# mark some packages as unfree
@@ -841,3 +821,8 @@ self: super:
mapNamesToAttrs (setLicense lib.licenses.unfreeRedistributable) redist
// mapNamesToAttrs (setLicense lib.licenses.unfree) unfree
)
# deprecate some packages
// lib.optionalAttrs config.allowAliases {
fontbitstreamspeedo = throw "Bitstream Speedo is an obsolete font format that hasn't been supported by Xorg since 2005"; # added 2025-09-24
}
-4
View File
@@ -69,10 +69,6 @@ mirror://xorg/individual/driver/xf86-video-vmware-13.4.0.tar.xz
mirror://xorg/individual/driver/xf86-video-voodoo-1.2.6.tar.xz
mirror://xorg/individual/driver/xf86-video-wsfb-0.4.0.tar.bz2
mirror://xorg/individual/font/font-arabic-misc-1.0.4.tar.xz
mirror://xorg/individual/font/font-bitstream-75dpi-1.0.4.tar.xz
mirror://xorg/individual/font/font-bitstream-100dpi-1.0.4.tar.xz
mirror://xorg/individual/font/font-bitstream-speedo-1.0.2.tar.gz
mirror://xorg/individual/font/font-bitstream-type1-1.0.4.tar.xz
mirror://xorg/individual/font/font-cursor-misc-1.0.4.tar.xz
mirror://xorg/individual/font/font-daewoo-misc-1.0.4.tar.xz
mirror://xorg/individual/font/font-dec-misc-1.0.4.tar.xz