lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 18.03-beta 61 lines 2.5 kB view raw
1{ stdenv, fetchurl, fetchpatch, readline }: 2 3let 4 dsoPatch = fetchurl { 5 url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/lua-arch.patch?h=packages/lua51"; 6 sha256 = "11fcyb4q55p4p7kdb8yp85xlw8imy14kzamp2khvcyxss4vw8ipw"; 7 name = "lua-arch.patch"; 8 }; 9in 10stdenv.mkDerivation rec { 11 name = "lua-${version}"; 12 version = "5.1.5"; 13 luaversion = "5.1"; 14 15 src = fetchurl { 16 url = "http://www.lua.org/ftp/${name}.tar.gz"; 17 sha256 = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"; 18 }; 19 20 buildInputs = [ readline ]; 21 22 patches = (if stdenv.isDarwin then [ ./5.1.darwin.patch ] else [ dsoPatch ]) 23 ++ [(fetchpatch { 24 name = "CVE-2014-5461.patch"; 25 url = "http://anonscm.debian.org/cgit/pkg-lua/lua5.1.git/plain/debian/patches/" 26 + "0004-Fix-stack-overflow-in-vararg-functions.patch?id=b75a2014db2ad65683521f7bb295bfa37b48b389"; 27 sha256 = "05i5vh53d9i6dy11ibg9i9qpwz5hdm0s8bkx1d9cfcvy80cm4c7f"; 28 })]; 29 30 configurePhase = 31 if stdenv.isDarwin 32 then '' 33 makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" CC="$CC" ) 34 installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.5.1.5.dylib" INSTALL_DATA='cp -d' ) 35 '' else '' 36 makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" CC="$CC" AR="$AR q" RANLIB="$RANLIB" ) 37 installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.a liblua.so liblua.so.5.1 liblua.so.5.1.5" INSTALL_DATA='cp -d' ) 38 ''; 39 40 postInstall = '' 41 mkdir -p "$out/share/doc/lua" "$out/lib/pkgconfig" 42 sed <"etc/lua.pc" >"$out/lib/pkgconfig/lua.pc" -e "s|^prefix=.*|prefix=$out|" 43 mv "doc/"*.{gif,png,css,html} "$out/share/doc/lua/" 44 rmdir $out/{share,lib}/lua/5.1 $out/{share,lib}/lua 45 ''; 46 47 meta = { 48 homepage = http://www.lua.org; 49 description = "Powerful, fast, lightweight, embeddable scripting language"; 50 longDescription = '' 51 Lua combines simple procedural syntax with powerful data 52 description constructs based on associative arrays and extensible 53 semantics. Lua is dynamically typed, runs by interpreting bytecode 54 for a register-based virtual machine, and has automatic memory 55 management with incremental garbage collection, making it ideal 56 for configuration, scripting, and rapid prototyping. 57 ''; 58 license = stdenv.lib.licenses.mit; 59 hydraPlatforms = stdenv.lib.platforms.linux; 60 }; 61}