2013-09-03 22:57:51 +01:00
|
|
|
{ stdenv, fetchurl, tcl }:
|
2008-02-27 15:48:53 +00:00
|
|
|
|
2013-09-03 22:57:51 +01:00
|
|
|
let version = "5.45";
|
|
|
|
in
|
2008-02-27 15:48:53 +00:00
|
|
|
stdenv.mkDerivation {
|
2013-09-03 22:57:51 +01:00
|
|
|
name = "expect-${version}";
|
2012-01-18 20:51:52 +00:00
|
|
|
|
2008-02-27 15:48:53 +00:00
|
|
|
src = fetchurl {
|
2013-09-03 22:57:51 +01:00
|
|
|
url = "mirror://sourceforge/expect/Expect/${version}/expect${version}.tar.gz";
|
|
|
|
sha256 = "0h60bifxj876afz4im35rmnbnxjx4lbdqp2ja3k30fwa8a8cm3dj";
|
2008-02-27 15:48:53 +00:00
|
|
|
};
|
|
|
|
|
2013-09-03 22:57:51 +01:00
|
|
|
buildInputs = [ tcl ];
|
2008-02-27 15:48:53 +00:00
|
|
|
|
|
|
|
#NIX_CFLAGS_COMPILE = "-DHAVE_UNISTD_H";
|
|
|
|
|
|
|
|
# http://wiki.linuxfromscratch.org/lfs/ticket/2126
|
|
|
|
#preBuild = ''
|
|
|
|
# substituteInPlace exp_inter.c --replace tcl.h tclInt.h
|
|
|
|
#'';
|
|
|
|
|
2008-04-04 19:24:41 +01:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace configure --replace /bin/stty "$(type -tP stty)"
|
2009-05-10 12:31:17 +01:00
|
|
|
sed -e '1i\#include <tclInt.h>' -i exp_inter.c
|
2009-12-21 08:55:31 +00:00
|
|
|
export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
|
2013-09-17 00:39:05 +01:00
|
|
|
'' + stdenv.lib.optionalString stdenv.isFreeBSD ''
|
|
|
|
ln -s libexpect.so.1 libexpect545.so
|
2008-04-04 19:24:41 +01:00
|
|
|
'';
|
2012-01-18 20:51:52 +00:00
|
|
|
|
2013-09-03 22:57:51 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-tcl=${tcl}/lib"
|
2012-01-18 20:51:52 +00:00
|
|
|
"--with-tclinclude=${tcl}/include"
|
2013-09-03 22:57:51 +01:00
|
|
|
"--exec-prefix=$out"
|
|
|
|
];
|
|
|
|
|
2013-09-04 09:15:32 +01:00
|
|
|
postInstall = let libSuff = if stdenv.isDarwin then "dylib" else "so";
|
|
|
|
in "cp expect $out/bin; mkdir -p $out/lib; cp *.${libSuff} $out/lib";
|
2008-02-27 15:48:53 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A tool for automating interactive applications";
|
|
|
|
homepage = http://expect.nist.gov/;
|
|
|
|
};
|
|
|
|
}
|