nixpkgs/pkgs/development/interpreters/lua-5/default.nix
2010-08-23 15:20:49 +00:00

49 lines
1.8 KiB
Nix

{stdenv, fetchurl, ncurses, readline}:
stdenv.mkDerivation {
name = "lua-5.1.4";
src = fetchurl {
url = "http://www.lua.org/ftp/lua-5.1.4.tar.gz";
sha256 = "0fmgk100ficm1jbm4ga9xy484v4cm89wsdfckdybb9gjx8jy4f5h";
};
# Disabled: -fPIC cannot be passed this way, because setting CFLAGS
# breaks lua's internal mechanism for passing flags from the
# top-level Makefile to src/Makefile. The desired effect
# could probably be achieved by modifying the Makefile with
# sed(1), etc. I didn't add that, though, because it's not
# clear to me why -fPIC is required in the first place.
#
# makeFlags = "CFLAGS=-fPIC";
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
"posix";
installFlags = "install INSTALL_TOP=\${out}";
postInstall = ''
sed -i -e "s@/usr/local@$out@" etc/lua.pc
sed -i -e "s@-llua -lm@-llua -lm -ldl@" etc/lua.pc
ensureDir "$out/lib/pkgconfig"
install -m 644 etc/lua.pc $out/lib/pkgconfig/lua.pc
'';
buildInputs = [ ncurses readline ];
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";
platforms = stdenv.lib.platforms.unix;
maintainers = [];
};
}