From c61d607340391bad86cd4167527874dd8d7552e5 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 7 May 2014 22:13:35 +0200 Subject: [PATCH] tkgate: rewrite expressions to get along without the broken 'libiconvOrLibc' attribute --- .../science/electronics/tkgate/1.x.nix | 14 ++++++++------ .../science/electronics/tkgate/2.x.nix | 12 +++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix index 07c266c62c52..1feac0b31c17 100644 --- a/pkgs/applications/science/electronics/tkgate/1.x.nix +++ b/pkgs/applications/science/electronics/tkgate/1.x.nix @@ -1,7 +1,9 @@ -{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc, which, yacc, flex, imake, xproto, gccmakedep }: - -assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; +{ stdenv, fetchurl, tcl, tk, libX11, glibc, which, yacc, flex, imake, xproto, gccmakedep }: +let + libiconvInc = stdenv.lib.optionalString stdenv.isLinux "${glibc}/include"; + libiconvLib = stdenv.lib.optionalString stdenv.isLinux "${glibc}/lib"; +in stdenv.mkDerivation rec { name = "tkgate-1.8.7"; @@ -10,13 +12,13 @@ stdenv.mkDerivation rec { sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs"; }; - buildInputs = [ tcl tk libX11 libiconvOrLibc which yacc flex imake xproto gccmakedep ]; + buildInputs = [ tcl tk libX11 which yacc flex imake xproto gccmakedep ]; patchPhase = '' sed -i config.h \ -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "8.5"|' \ - -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvOrLibc}/include ${libX11}/include"|' \ - -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib ${libX11}/lib"|' \ + -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvInc} ${libX11}/include"|' \ + -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvLib} ${libX11}/lib"|' \ \ -e '20 i #define TCL_LIBRARY "${tcl}/lib"' \ -e '20 i #define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"' \ diff --git a/pkgs/applications/science/electronics/tkgate/2.x.nix b/pkgs/applications/science/electronics/tkgate/2.x.nix index fdb9e9b56929..25c6a309cf37 100644 --- a/pkgs/applications/science/electronics/tkgate/2.x.nix +++ b/pkgs/applications/science/electronics/tkgate/2.x.nix @@ -1,7 +1,9 @@ -{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc }: - -assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; +{ stdenv, fetchurl, tcl, tk, libX11, glibc }: +let + libiconvInc = stdenv.lib.optionalString stdenv.isLinux "${glibc}/include"; + libiconvLib = stdenv.lib.optionalString stdenv.isLinux "${glibc}/lib"; +in stdenv.mkDerivation rec { name = "tkgate-2.0-b10"; @@ -16,8 +18,8 @@ stdenv.mkDerivation rec { patchPhase = '' sed -i configure \ - -e 's|TKGATE_INCDIRS=.*|TKGATE_INCDIRS="${tcl}/include ${tk}/include ${libiconvOrLibc}/include"|' \ - -e 's|TKGATE_LIBDIRS=.*|TKGATE_LIBDIRS="${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib"|' + -e 's|TKGATE_INCDIRS=.*|TKGATE_INCDIRS="${tcl}/include ${tk}/include ${libiconvInc}"|' \ + -e 's|TKGATE_LIBDIRS=.*|TKGATE_LIBDIRS="${tcl}/lib ${tk}/lib ${libiconvLib}"|' sed -i options.h \ -e 's|.* #define TCL_LIBRARY .*|#define TCL_LIBRARY "${tcl}/${tcl.libdir}"|' \ -e 's|.* #define TK_LIBRARY .*|#define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"|'