2010-08-23 15:27:33 +01:00
|
|
|
{stdenv, fetchurl, ncurses, readline}:
|
2006-02-02 17:07:07 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2009-04-21 20:47:20 +01:00
|
|
|
name = "lua-5.1.4";
|
2010-08-23 15:27:33 +01:00
|
|
|
|
2006-02-02 17:07:07 +00:00
|
|
|
src = fetchurl {
|
2010-08-23 15:27:33 +01:00
|
|
|
url = "http://www.lua.org/ftp/lua-5.1.4.tar.gz";
|
2009-04-21 20:47:20 +01:00
|
|
|
sha256 = "0fmgk100ficm1jbm4ga9xy484v4cm89wsdfckdybb9gjx8jy4f5h";
|
2006-02-02 17:07:07 +00:00
|
|
|
};
|
2010-08-23 15:27:33 +01:00
|
|
|
|
2010-09-07 13:56:49 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-fPIC";
|
2010-08-23 15:41:03 +01:00
|
|
|
buildFlags = if stdenv.isLinux then "linux" else
|
|
|
|
if stdenv.isDarwin then "macosx" else
|
|
|
|
if stdenv.isFreeBSD then "freebsd" else
|
|
|
|
if stdenv.isBSD then "bsd" else
|
2010-08-23 16:20:49 +01:00
|
|
|
"posix";
|
2007-07-17 17:43:06 +01:00
|
|
|
installFlags = "install INSTALL_TOP=\${out}";
|
2010-08-09 07:48:21 +01:00
|
|
|
postInstall = ''
|
|
|
|
sed -i -e "s@/usr/local@$out@" etc/lua.pc
|
|
|
|
sed -i -e "s@-llua -lm@-llua -lm -ldl@" etc/lua.pc
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/lib/pkgconfig"
|
2010-08-23 16:09:02 +01:00
|
|
|
install -m 644 etc/lua.pc $out/lib/pkgconfig/lua.pc
|
2010-08-09 07:48:21 +01:00
|
|
|
'';
|
2007-07-17 17:43:06 +01:00
|
|
|
buildInputs = [ ncurses readline ];
|
2010-08-23 15:26:26 +01:00
|
|
|
|
2010-09-15 10:56:06 +01:00
|
|
|
crossAttrs = {
|
|
|
|
preBuild = ''
|
|
|
|
sed -i -e "s/ gcc/$crossConfig-gcc/" \
|
|
|
|
-e "s/ ar/$crossConfig-ar/" \
|
|
|
|
-e "s/ ranlib/$crossConfig-ranlib/" \
|
|
|
|
src/Makefile
|
|
|
|
'';
|
2012-01-03 19:12:06 +00:00
|
|
|
dontStrip = true;
|
2010-09-15 10:56:06 +01:00
|
|
|
};
|
|
|
|
|
2010-08-23 15:26:26 +01:00
|
|
|
meta = {
|
|
|
|
homepage = "http://www.lua.org";
|
|
|
|
description = "Lua is a powerful, fast, lightweight, embeddable scripting language.";
|
|
|
|
longDescription = ''
|
|
|
|
Lua combines simple procedural syntax with powerful data
|
|
|
|
description constructs based on associative arrays and extensible
|
|
|
|
semantics. Lua is dynamically typed, runs by interpreting bytecode
|
|
|
|
for a register-based virtual machine, and has automatic memory
|
|
|
|
management with incremental garbage collection, making it ideal
|
|
|
|
for configuration, scripting, and rapid prototyping.
|
|
|
|
'';
|
|
|
|
license = "MIT";
|
2010-08-23 15:41:03 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2010-08-23 15:26:26 +01:00
|
|
|
maintainers = [];
|
|
|
|
};
|
2006-02-02 17:07:07 +00:00
|
|
|
}
|