1{ stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 name = "libclthreads-${version}";
5 version = "2.4.0";
6
7 src = fetchurl {
8 url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/clthreads-${version}.tar.bz2";
9 sha256 = "1s8xx99z6llv46cvkllmd72v2pkzbfl5gngcql85mf14mxkdb7x6";
10 };
11
12 patchPhase = ''
13 # Fix hardcoded paths to executables
14 sed -e "s@/usr/bin/install@install@" -i ./Makefile
15 sed -e "s@/sbin/ldconfig@ldconfig@" -i ./Makefile
16
17 # Remove useless symlink: /lib64 -> /lib
18 sed -e '/ln -sf \$(CLTHREADS_MIN) \$(PREFIX)\/\$(LIBDIR)\/\$(CLTHREADS_SO)/d' -i ./Makefile
19 '';
20
21 makeFlags = [
22 "PREFIX=$(out)"
23 "SUFFIX=''"
24 ];
25
26 preInstall = ''
27 # The Makefile does not create the include directory
28 mkdir -p $out/include
29 '';
30
31 postInstall = ''
32 ln -s $out/lib/libclthreads.so.${version} $out/lib/libclthreads.so
33 '';
34
35 meta = with stdenv.lib; {
36 description = "Zita thread library";
37 homepage = http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html;
38 license = licenses.lgpl21;
39 maintainers = with maintainers; [ magnetophon ];
40 platforms = platforms.linux;
41 };
42}