nixpkgs-suyu/pkgs/applications/science/electronics/tkgate/1.x.nix

43 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, tcl, tk, libX11, glibc, which, bison, flex, imake, xorgproto, gccmakedep }:
let
2021-01-15 14:21:58 +01:00
libiconvInc = lib.optionalString stdenv.isLinux "${glibc.dev}/include";
libiconvLib = lib.optionalString stdenv.isLinux "${glibc.out}/lib";
in
2012-11-08 17:30:44 +01:00
stdenv.mkDerivation rec {
name = "tkgate-1.8.7";
src = fetchurl {
url = "http://www.tkgate.org/downloads/${name}.tgz";
sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs";
};
nativeBuildInputs = [ which bison flex imake gccmakedep ];
buildInputs = [ tcl tk libX11 xorgproto ];
dontUseImakeConfigure = true;
2012-11-08 17:30:44 +01:00
patchPhase = ''
sed -i config.h \
2015-04-27 06:21:59 +02:00
-e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "${tcl.release}"|' \
-e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvInc} ${libX11.dev}/include"|' \
-e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvLib} ${libX11.out}/lib"|' \
2012-11-08 17:30:44 +01:00
\
-e '20 i #define TCL_LIBRARY "${tcl}/lib"' \
-e '20 i #define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"' \
-e '20 i #define USE_ICONV 1' \
\
-e "s|.*#define.*TKGATE_HOMEDIRBASE.*|#define TKGATE_HOMEDIRBASE \\\"$out/lib\\\"|" \
-e "s|.*#define.*TKGATE_BINDIR.*|#define TKGATE_BINDIR \\\"$out/bin\\\"|" \
-e "s|.*#define.*TKGATE_MANDIR.*|#define TKGATE_MANDIR \\\"$out/share/man/man1\\\"|" \
-e "s|file:/usr/X11R6/lib/tkgate-|file://$out/lib/tkgate-|"
'';
meta = {
description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
homepage = "http://www.tkgate.org/";
2021-01-15 14:21:58 +01:00
license = lib.licenses.gpl2Plus;
maintainers = [ lib.maintainers.peti ];
hydraPlatforms = lib.platforms.linux;
2012-11-08 17:30:44 +01:00
};
}