From 83fa9994e5c34a516c0eb9f7eed7b841e4cb85a2 Mon Sep 17 00:00:00 2001 From: codyopel Date: Thu, 28 May 2015 01:53:23 -0400 Subject: [PATCH] libclthreads: refactor fix include directories fix symlink to library --- .../libraries/libclthreads/default.nix | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/pkgs/development/libraries/libclthreads/default.nix b/pkgs/development/libraries/libclthreads/default.nix index 5d5a9e49381f..ea27046279c7 100644 --- a/pkgs/development/libraries/libclthreads/default.nix +++ b/pkgs/development/libraries/libclthreads/default.nix @@ -1,26 +1,42 @@ -{ stdenv, fetchurl, }: +{ 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"; }; - configurePhase = '' - sed -e "s@/usr/local@$out@" -i Makefile - sed -e "s@/usr/bin/install@install@" -i Makefile - sed -e "s@/sbin/ldconfig@ldconfig@" -i Makefile - sed -e "s@SUFFIX :=.*@SUFFIX =@" -i Makefile + 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 ''; - meta = { - description = "zita thread library"; - version = "${version}"; - homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html"; - license = stdenv.lib.licenses.lgpl21; - maintainers = [ stdenv.lib.maintainers.magnetophon ]; - platforms = stdenv.lib.platforms.linux; + 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; }; }