1{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkgsCross }:
2
3stdenv.mkDerivation rec {
4 pname = "npth";
5 version = "1.7";
6
7 src = fetchurl {
8 url = "mirror://gnupg/npth/npth-${version}.tar.bz2";
9 sha256 = "sha256-hYn1aTe3XOM7KNMS/MvzArO3HsPzlF/eaqp0AnkUrQU=";
10 };
11
12 patches = [
13 (fetchpatch {
14 name = "musl.patch";
15 url = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=npth.git;a=patch;h=417abd56fd7bf45cd4948414050615cb1ad59134";
16 hash = "sha256-0g2tLFjW1bybNi6oxlW7vPimsQLjmTih4JZSoATjESI=";
17 })
18 ];
19
20 nativeBuildInputs = [ autoreconfHook ];
21
22 doCheck = true;
23
24 passthru.tests = {
25 musl = pkgsCross.musl64.npth;
26 };
27
28 meta = with lib; {
29 description = "New GNU Portable Threads Library";
30 mainProgram = "npth-config";
31 longDescription = ''
32 This is a library to provide the GNU Pth API and thus a non-preemptive
33 threads implementation.
34
35 In contrast to GNU Pth is is based on the system's standard threads
36 implementation. This allows the use of libraries which are not
37 compatible to GNU Pth. Experience with a Windows Pth emulation showed
38 that this is a solid way to provide a co-routine based framework.
39 '';
40 homepage = "http://www.gnupg.org";
41 license = licenses.lgpl3;
42 platforms = platforms.all;
43 };
44}