From 521809e86ff9763fa5349a4ac61722ebaa7a2feb Mon Sep 17 00:00:00 2001 From: Zitrone Date: Fri, 11 Apr 2025 15:31:51 +0200 Subject: [PATCH] util-macros: refactor, move to pkgs/by-name and rename from xorg.utilmacros --- pkgs/by-name/ut/util-macros/package.nix | 55 +++++++++++++++++++ pkgs/servers/x11/xorg/default.nix | 33 +---------- .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/overrides.nix | 9 --- pkgs/servers/x11/xorg/tarballs.list | 1 - 5 files changed, 59 insertions(+), 41 deletions(-) create mode 100644 pkgs/by-name/ut/util-macros/package.nix diff --git a/pkgs/by-name/ut/util-macros/package.nix b/pkgs/by-name/ut/util-macros/package.nix new file mode 100644 index 000000000000..a6ff12c619b1 --- /dev/null +++ b/pkgs/by-name/ut/util-macros/package.nix @@ -0,0 +1,55 @@ +{ + lib, + stdenv, + fetchurl, + pkg-config, + automake, + autoconf, + libtool, + testers, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "util-macros"; + version = "1.20.2"; + + src = fetchurl { + url = "mirror://xorg/individual/util/util-macros-${finalAttrs.version}.tar.xz"; + hash = "sha256-msJp66JPZy19ezV05L5fMz0T8Ep3EjA7GCGypRrILo4="; + }; + + strictDeps = true; + + nativeBuildInputs = [ pkg-config ]; + + # not needed for releases, we propagate the needed tools + propagatedNativeBuildInputs = [ + automake + autoconf + libtool + ]; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + 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/util/ \ + | sort -V | tail -n1)" + update-source-version ${finalAttrs.pname} "$version" + ''; + }; + + meta = { + description = "GNU autoconf macros shared across X.Org projects"; + homepage = "https://gitlab.freedesktop.org/xorg/util/macros"; + license = with lib.licenses; [ + hpndSellVariant + mit + ]; + maintainers = [ ]; + pkgConfigModules = [ "xorg-macros" ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 6cd4b9add954..8f318964222e 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -10,6 +10,7 @@ luit, makedepend, pixman, + util-macros, }: self: with self; { @@ -25,6 +26,7 @@ self: with self; { fontalias = font-alias; fontutil = font-util; libpthreadstubs = libpthread-stubs; + utilmacros = util-macros; # THIS IS A GENERATED FILE. DO NOT EDIT! appres = callPackage ( @@ -3701,37 +3703,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - utilmacros = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "util-macros"; - version = "1.20.2"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/util/util-macros-1.20.2.tar.xz"; - sha256 = "13ifr0dabci130xk04kp9bq16g9kbyzf8x1mgdyjsrsglbmnkhls"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ "xorg-macros" ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! viewres = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index c95488493cb6..beba69ad6bec 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -272,6 +272,7 @@ print OUT <