Unverified Commit 4cc23fda authored by quantenzitrone's avatar quantenzitrone
Browse files

libpthread-stubs: refactored, moved to pkgs/by-name and renamed from xorg.libpthreadstubs

parent 2461fe14
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
{
  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 -V | 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 −31
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
  font-util,
  gccmakedep,
  libpciaccess,
  libpthread-stubs,
  luit,
  pixman,
}:
@@ -19,6 +20,7 @@ self: with self; {
    ;
  fontalias = font-alias;
  fontutil = font-util;
  libpthreadstubs = libpthread-stubs;

  # THIS IS A GENERATED FILE.  DO NOT EDIT!
  appres = callPackage (
@@ -3199,37 +3201,6 @@ self: with self; {
    })
  ) { };

  # THIS IS A GENERATED FILE.  DO NOT EDIT!
  libpthreadstubs = callPackage (
    {
      stdenv,
      pkg-config,
      fetchurl,
      testers,
    }:
    stdenv.mkDerivation (finalAttrs: {
      pname = "libpthread-stubs";
      version = "0.5";
      builder = ./builder.sh;
      src = fetchurl {
        url = "mirror://xorg/individual/xcb/libpthread-stubs-0.5.tar.xz";
        sha256 = "1g224hyy694jch54357zc895z46r90xs193hg4m7rfnfxinmdnjr";
      };
      hardeningDisable = [
        "bindnow"
        "relro"
      ];
      strictDeps = true;
      nativeBuildInputs = [ pkg-config ];
      buildInputs = [ ];
      passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
      meta = {
        pkgConfigModules = [ "pthread-stubs" ];
        platforms = lib.platforms.unix;
      };
    })
  ) { };

  # THIS IS A GENERATED FILE.  DO NOT EDIT!
  libxcb = callPackage (
    {
+3 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ $pcMap{"gbm"} = "libgbm";
$pcMap{"hwdata"} = "hwdata";
$pcMap{"fontutil"} = "fontutil";
$pcMap{"pciaccess"} = "libpciaccess";
$pcMap{"pthread-stubs"} = "libpthreadstubs";
$pcMap{"\$PIXMAN"} = "pixman";
$pcMap{"\$RENDERPROTO"} = "xorgproto";
$pcMap{"\$DRI3PROTO"} = "xorgproto";
@@ -266,6 +267,7 @@ print OUT <<EOF;
  font-util,
  gccmakedep,
  libpciaccess,
  libpthread-stubs,
  luit,
  pixman,
}:
@@ -280,6 +282,7 @@ self: with self; {
    ;
  fontalias = font-alias;
  fontutil = font-util;
  libpthreadstubs = libpthread-stubs;

EOF

+0 −7
Original line number Diff line number Diff line
@@ -620,13 +620,6 @@ self: super:
    ]; # 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 = ''
      mkdir -p $out/share/man/man7
+0 −1
Original line number Diff line number Diff line
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