summary refs log tree commit diff
path: root/pkgs/development/libraries/libclthreads/default.nix
blob: ea27046279c706dfaafce4af3aeed0480117f8c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "libclthreads-${version}";
  version = "2.4.0";

  src = fetchurl {
    url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/clthreads-${version}.tar.bz2";
    sha256 = "1s8xx99z6llv46cvkllmd72v2pkzbfl5gngcql85mf14mxkdb7x6";
  };

  patchPhase = ''
    # Fix hardcoded paths to executables
    sed -e "s@/usr/bin/install@install@" -i ./Makefile
    sed -e "s@/sbin/ldconfig@ldconfig@" -i ./Makefile

    # Remove useless symlink: /lib64 -> /lib
    sed -e '/ln -sf \$(CLTHREADS_MIN) \$(PREFIX)\/\$(LIBDIR)\/\$(CLTHREADS_SO)/d' -i ./Makefile
  '';

  makeFlags = [
    "PREFIX=$(out)"
    "SUFFIX=''"
  ];

  preInstall = ''
    # The Makefile does not create the include directory
    mkdir -p $out/include
  '';

  postInstall = ''
    ln -s $out/lib/libclthreads.so.${version} $out/lib/libclthreads.so
  '';

  meta = with stdenv.lib; {
    description = "Zita thread library";
    homepage = http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html;
    license = licenses.lgpl21;
    maintainers = with maintainers; [ magnetophon ];
    platforms = platforms.linux;
  };
}