From 02b6d0a8f3d34f6d3cb45f6a563a5f8f1ae7cf1e Mon Sep 17 00:00:00 2001 From: Zitrone Date: Tue, 31 Dec 2024 16:39:28 +0100 Subject: [PATCH] libpthread-stubs: refactored, moved to pkgs/by-name and renamed from xorg.libpthreadstubs --- pkgs/by-name/li/libpthread-stubs/package.nix | 43 +++++++++++++++++++ .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/overrides.nix | 5 --- pkgs/servers/x11/xorg/tarballs.list | 1 - 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 pkgs/by-name/li/libpthread-stubs/package.nix diff --git a/pkgs/by-name/li/libpthread-stubs/package.nix b/pkgs/by-name/li/libpthread-stubs/package.nix new file mode 100644 index 0000000000000..ccfda2afe177e --- /dev/null +++ b/pkgs/by-name/li/libpthread-stubs/package.nix @@ -0,0 +1,43 @@ +{ + lib, + stdenv, + fetchurl, + testers, + writeScript, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "libpthread-stubs"; + version = "0.5"; + + src = fetchurl { + url = "mirror://xorg/individual/lib/libpthread-stubs-${finalAttrs.version}.tar.xz"; + hash = "sha256-WdpWbezOunwqeXCkoDtI2ZBfEmL/lEEKZJIk4z0kQrw="; + }; + + 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/lib/ \ + | sort | tail -n1)" + + update-source-version ${finalAttrs.pname} "$version" + ''; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; + + meta = { + description = "Provides a pkg-config file `pthread-stubs.pc` containing the Cflags/Libs flags applicable to programs/libraries that use only lightweight pthread API"; + homepage = "https://gitlab.freedesktop.org/xorg/lib/pthread-stubs"; + # gitlab says x11-distribute-modifications but it's not + # maybe due to https://github.com/spdx/spdx-online-tools/issues/540 + license = lib.licenses.x11; + maintainers = [ ]; + pkgConfigModules = [ "pthread-stubs" ]; + # on these platforms according to the readme + platforms = with lib.platforms; linux ++ cygwin ++ darwin ++ [ "x86_64-solaris" ]; + }; +}) diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 1bd25645ee5a3..d947b3e40aca3 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -265,6 +265,7 @@ font-util, gccmakedep, libpciaccess, + libpthread-stubs, luit, }: @@ -278,6 +279,7 @@ ; fontalias = font-alias; fontutil = font-util; + libpthreadstubs = libpthread-stubs; EOF diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 61b2d23a192c7..3e45ecf7a6a0d 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -414,11 +414,6 @@ self: super: outputs = [ "out" "dev" ]; # mainly to avoid propagation }); - libpthreadstubs = super.libpthreadstubs.overrideAttrs (attrs: { - # only contains a pkgconfig file on linux and windows - meta = attrs.meta // { platforms = lib.platforms.unix ++ lib.platforms.windows; }; - }); - setxkbmap = super.setxkbmap.overrideAttrs (attrs: { postInstall = '' diff --git a/pkgs/servers/x11/xorg/tarballs.list b/pkgs/servers/x11/xorg/tarballs.list index f06e883c3a6bf..4411dbb90ae12 100644 --- a/pkgs/servers/x11/xorg/tarballs.list +++ b/pkgs/servers/x11/xorg/tarballs.list @@ -1,4 +1,3 @@ -mirror://xorg/individual/xcb/libpthread-stubs-0.5.tar.xz mirror://xorg/individual/xcb/xcb-util-0.4.1.tar.xz mirror://xorg/individual/xcb/xcb-util-errors-1.0.1.tar.xz mirror://xorg/individual/xcb/xcb-util-image-0.4.1.tar.xz