From 66386396844a37c868f666e21ad5545d232b9ce1 Mon Sep 17 00:00:00 2001 From: Zitrone Date: Tue, 31 Dec 2024 02:09:30 +0100 Subject: [PATCH] font-util: refactored, moved to pkgs/by-name and renamed from xorg.fontutil --- lib/licenses.nix | 15 ++++++ pkgs/by-name/fo/font-util/package.nix | 49 +++++++++++++++++++ pkgs/servers/x11/xorg/default.nix | 33 +------------ .../x11/xorg/generate-expr-from-tarballs.pl | 3 ++ pkgs/servers/x11/xorg/tarballs.list | 1 - 5 files changed, 69 insertions(+), 32 deletions(-) create mode 100644 pkgs/by-name/fo/font-util/package.nix diff --git a/lib/licenses.nix b/lib/licenses.nix index f194528a5215..3f9f97828d3d 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -257,6 +257,11 @@ lib.mapAttrs mkLicense ( fullName = "BSD Protection License"; }; + bsdSourceCode = { + spdxId = "BSD-Source-Code"; + fullName = "BSD Source Code Attribution"; + }; + bsl11 = { spdxId = "BUSL-1.1"; fullName = "Business Source License 1.1"; @@ -942,6 +947,11 @@ lib.mapAttrs mkLicense ( fullName = "MIT No Attribution"; }; + mitOpenGroup = { + spdxId = "MIT-open-group"; + fullName = "MIT Open Group variant"; + }; + mpl10 = { spdxId = "MPL-1.0"; fullName = "Mozilla Public License 1.0"; @@ -1326,6 +1336,11 @@ lib.mapAttrs mkLicense ( fullName = "Unicode License Agreement - Data Files and Software (2016)"; }; + unicodeTOU = { + spdxId = "Unicode-TOU"; + fullName = "Unicode Terms of Use"; + }; + unlicense = { spdxId = "Unlicense"; fullName = "The Unlicense"; diff --git a/pkgs/by-name/fo/font-util/package.nix b/pkgs/by-name/fo/font-util/package.nix new file mode 100644 index 000000000000..b443788a941a --- /dev/null +++ b/pkgs/by-name/fo/font-util/package.nix @@ -0,0 +1,49 @@ +{ + lib, + stdenv, + fetchurl, + testers, + writeScript, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "font-util"; + version = "1.4.1"; + + src = fetchurl { + url = "mirror://xorg/individual/font/font-util-${finalAttrs.version}.tar.xz"; + hash = "sha256-XJ9kEjwZSxUP7okEmZFoc4bm/zbvKve4C6U++vNozJU="; + }; + + 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" + ''; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; + + meta = { + description = "X.Org font package creation/installation utilities"; + homepage = "https://gitlab.freedesktop.org/xorg/font/util"; + license = with lib.licenses; [ + mit + bsd2 + bsdSourceCode + mitOpenGroup + # there is a bit of a diff, but i think its close enough + # it was probably just adapted a bit to fit to the repository structure + # or its an older version that the one on spdx + unicodeTOU + ]; + maintainers = [ ]; + pkgConfigModules = [ "fontutil" ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 3d3ad92d60e7..7f4c518a4091 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -2,6 +2,7 @@ { lib, font-alias, + font-util, luit, pixman, }: @@ -11,6 +12,7 @@ self: with self; { inherit pixman; inherit luit; fontalias = font-alias; + fontutil = font-util; # THIS IS A GENERATED FILE. DO NOT EDIT! appres = callPackage ( @@ -1565,37 +1567,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - fontutil = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "font-util"; - version = "1.4.1"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/font/font-util-1.4.1.tar.xz"; - sha256 = "15fcd3rzlgm51fwgfapg6vzyd1kkd28rj149xq7iajqr7h9697sw"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ "fontutil" ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! fontwinitzkicyrillic = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 6d8467a73e40..3eb2080cc17f 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -36,6 +36,7 @@ $pcMap{"gl"} = "libGL"; $pcMap{"GL"} = "libGL"; $pcMap{"gbm"} = "libgbm"; $pcMap{"hwdata"} = "hwdata"; +$pcMap{"fontutil"} = "fontutil"; $pcMap{"\$PIXMAN"} = "pixman"; $pcMap{"\$RENDERPROTO"} = "xorgproto"; $pcMap{"\$DRI3PROTO"} = "xorgproto"; @@ -261,6 +262,7 @@ print OUT <