1{
2 lib,
3 stdenv,
4 fetchurl,
5 testers,
6 writeScript,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "libpthread-stubs";
11 version = "0.5";
12
13 src = fetchurl {
14 url = "mirror://xorg/individual/lib/libpthread-stubs-${finalAttrs.version}.tar.xz";
15 hash = "sha256-WdpWbezOunwqeXCkoDtI2ZBfEmL/lEEKZJIk4z0kQrw=";
16 };
17
18 passthru = {
19 updateScript = writeScript "update-${finalAttrs.pname}" ''
20 #!/usr/bin/env nix-shell
21 #!nix-shell -i bash -p common-updater-scripts
22
23 version="$(list-directory-versions --pname ${finalAttrs.pname} \
24 --url https://xorg.freedesktop.org/releases/individual/lib/ \
25 | sort -V | tail -n1)"
26
27 update-source-version ${finalAttrs.pname} "$version"
28 '';
29 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
30 };
31
32 meta = {
33 description = "Provides a pkg-config file `pthread-stubs.pc` containing the Cflags/Libs flags applicable to programs/libraries that use only lightweight pthread API";
34 homepage = "https://gitlab.freedesktop.org/xorg/lib/pthread-stubs";
35 # gitlab says x11-distribute-modifications but it's not
36 # maybe due to https://github.com/spdx/spdx-online-tools/issues/540
37 license = lib.licenses.x11;
38 maintainers = [ ];
39 pkgConfigModules = [ "pthread-stubs" ];
40 platforms = lib.platforms.unix;
41 };
42})