1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "pth";
5 version = "2.0.7";
6
7 src = fetchurl {
8 url = "mirror://gnu/pth/pth-${version}.tar.gz";
9 sha256 = "0ckjqw5kz5m30srqi87idj7xhpw6bpki43mj07bazjm2qmh3cdbj";
10 };
11
12 preConfigure = lib.optionalString stdenv.isAarch32 ''
13 configureFlagsArray=("CFLAGS=-DJB_SP=8 -DJB_PC=9")
14 '' + lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
15 configureFlagsArray+=("ac_cv_check_sjlj=ssjlj")
16 '';
17
18 # Fails parallel build due to missing dependency on autogenrated
19 # 'pth_p.h' file:
20 # ./shtool scpp -o pth_p.h ...
21 # ./libtool --mode=compile --quiet gcc -c -I. -O2 -pipe pth_uctx.c
22 # pth_uctx.c:31:10: fatal error: pth_p.h: No such file
23 enableParallelBuilding = false;
24
25 meta = with lib; {
26 description = "GNU Portable Threads library";
27 mainProgram = "pth-config";
28 homepage = "https://www.gnu.org/software/pth";
29 license = licenses.lgpl21Plus;
30 platforms = platforms.all;
31 };
32}