1 { lib, stdenv, fetchurl, tcl, tk, libX11, glibc, which, bison, flex, imake, xorgproto, gccmakedep }:
4 libiconvInc = lib.optionalString stdenv.hostPlatform.isLinux "${glibc.dev}/include";
5 libiconvLib = lib.optionalString stdenv.hostPlatform.isLinux "${glibc.out}/lib";
7 stdenv.mkDerivation rec {
12 url = "http://www.tkgate.org/downloads/tkgate-${version}.tgz";
13 sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs";
16 nativeBuildInputs = [ which bison flex imake gccmakedep ];
17 buildInputs = [ tcl tk libX11 xorgproto ];
18 dontUseImakeConfigure = true;
22 -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "${tcl.release}"|' \
23 -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvInc} ${libX11.dev}/include"|' \
24 -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvLib} ${libX11.out}/lib"|' \
26 -e '20 i #define TCL_LIBRARY "${tcl}/lib"' \
27 -e '20 i #define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"' \
28 -e '20 i #define USE_ICONV 1' \
30 -e "s|.*#define.*TKGATE_HOMEDIRBASE.*|#define TKGATE_HOMEDIRBASE \\\"$out/lib\\\"|" \
31 -e "s|.*#define.*TKGATE_BINDIR.*|#define TKGATE_BINDIR \\\"$out/bin\\\"|" \
32 -e "s|.*#define.*TKGATE_MANDIR.*|#define TKGATE_MANDIR \\\"$out/share/man/man1\\\"|" \
33 -e "s|file:/usr/X11R6/lib/tkgate-|file://$out/lib/tkgate-|"
37 description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
39 homepage = "http://www.tkgate.org/";
40 license = lib.licenses.gpl2Plus;
41 hydraPlatforms = lib.platforms.linux;