Skip to content

Commit

Permalink
libpthread-stubs: refactored, moved to pkgs/by-name and renamed from …
Browse files Browse the repository at this point in the history
…xorg.libpthreadstubs
  • Loading branch information
quantenzitrone committed Dec 31, 2024
1 parent 7fd7b5e commit 02b6d0a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 6 deletions.
43 changes: 43 additions & 0 deletions pkgs/by-name/li/libpthread-stubs/package.nix
Original file line number Diff line number Diff line change
@@ -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" ];
};
})
2 changes: 2 additions & 0 deletions pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
font-util,
gccmakedep,
libpciaccess,
libpthread-stubs,
luit,
}:

Expand All @@ -278,6 +279,7 @@
;
fontalias = font-alias;
fontutil = font-util;
libpthreadstubs = libpthread-stubs;

EOF

Expand Down
5 changes: 0 additions & 5 deletions pkgs/servers/x11/xorg/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
''
Expand Down
1 change: 0 additions & 1 deletion pkgs/servers/x11/xorg/tarballs.list
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 02b6d0a

Please sign in to comment.