tkabber: Clean up TCLLIBPATH generation.

This should make things a lot more DRY as we now can generalize library paths by
using the libPrefix attribute of each library. In addition this also cuts the
line length in wrapProgram.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2012-09-09 05:41:40 +02:00
parent d058ae5b0b
commit 5d15972278
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961

View file

@ -1,7 +1,15 @@
{ stdenv, fetchurl, tcl, tk, tcllib, tcltls, tclgpg
, bwidget, cacert, makeWrapper, x11 }:
stdenv.mkDerivation rec {
let
tclLibraries = [ bwidget tcllib tcltls tclgpg ];
getTclLibPath = p: "${p}/lib/${p.libPrefix}";
tclLibPaths = stdenv.lib.concatStringsSep " "
(map getTclLibPath tclLibraries);
in stdenv.mkDerivation rec {
name = "tkabber-0.11.1";
src = fetchurl {
@ -27,10 +35,10 @@ stdenv.mkDerivation rec {
'';
postInstall = ''
wrapProgram $out/bin/tkabber --set TCLLIBPATH "${bwidget}/lib/${bwidget.libPrefix}\ ${tcllib}/lib/${tcllib.libPrefix}\ ${tcltls}/lib/${tcltls.libPrefix}\ ${tclgpg}/lib/${tclgpg.libPrefix}"
wrapProgram $out/bin/tkabber --set TCLLIBPATH '"${tclLibPaths}"'
'';
buildInputs = [ tcl tk tcllib tcltls tclgpg bwidget x11 makeWrapper ];
buildInputs = [ tcl tk x11 makeWrapper ] ++ tclLibraries;
meta = {
homepage = "http://tkabber.jabber.ru/";