diff options
Diffstat (limited to 'pkgs/top-level/lua-packages.nix')
-rw-r--r-- | pkgs/top-level/lua-packages.nix | 103 |
1 files changed, 70 insertions, 33 deletions
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 839db36ca7a45..71aef7544dd12 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -14,6 +14,14 @@ let isLua51 = lua.luaversion == "5.1"; isLua52 = lua.luaversion == "5.2"; + + platformString = + if stdenv.isDarwin then "macosx" + else if stdenv.isFreeBSD then "freebsd" + else if stdenv.isLinux then "linux" + else if stdenv.isSunOS then "solaris" + else throw "unsupported platform"; + self = _self; _self = with self; { inherit lua; @@ -104,6 +112,11 @@ let buildInputs = [ expat ]; + preConfigure = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile \ + --replace '-shared' '-bundle -undefined dynamic_lookup -all_load' + ''; + preBuild = '' makeFlagsArray=( LUA_LDIR="$out/share/lua/${lua.luaversion}" @@ -113,7 +126,7 @@ let meta = { homepage = "http://matthewwild.co.uk/projects/luaexpat"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; maintainers = [ stdenv.lib.maintainers.flosse ]; }; }; @@ -124,13 +137,35 @@ let url = "https://github.com/keplerproject/luafilesystem/archive/v1_6_2.tar.gz"; sha256 = "134azkxw84xp9g5qmzjsmcva629jm7plwcmjxkdzdg05vyd7kig1"; }; + preConfigure = "substituteInPlace config --replace 'CC= gcc' '';" + + stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace config \ + --replace 'LIB_OPTION= -shared' '###' \ + --replace '#LIB_OPTION= -bundle' 'LIB_OPTION= -bundle' + substituteInPlace Makefile --replace '10.3' '10.5' + ''; meta = { homepage = "https://github.com/keplerproject/luafilesystem"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; maintainers = with maintainers; [ flosse ]; }; }; + luaposix = buildLuaPackage rec { + name = "posix-${version}"; + version = "33.4.0"; + src = fetchurl { + url = "https://github.com/luaposix/luaposix/archive/release-v${version}.tar.gz"; + sha256 = "e66262f5b7fe1c32c65f17a5ef5ffb31c4d1877019b4870a5d373e2ab6526a21"; + }; + buildInputs = [ perl ]; + meta = { + description = "Lua bindings for POSIX API"; + homepage = "https://github.com/luaposix/luaposix"; + platforms = stdenv.lib.platforms.unix; + }; + }; + lpty = buildLuaPackage rec { name = "lpty-${version}"; version = "1.1.1"; @@ -140,7 +175,7 @@ let }; meta = { homepage = "http://www.tset.de/lpty"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux; license = stdenv.lib.licenses.mit; }; preBuild = '' @@ -155,19 +190,19 @@ let }; luasec = buildLuaPackage rec { - name = "sec-0.6pre-2015-04-17"; + name = "sec-0.6"; src = fetchFromGitHub { owner = "brunoos"; repo = "luasec"; - rev = "12e1b1f1d9724974ecc6ca273a0661496d96b3e7"; - sha256 = "0m917qgi54p6n2ak33m67q8sxcw3cdni99bm216phjjka9rg7qwd"; + rev = "lua${name}"; + sha256 = "0wv8l7f7na7kw5xn8mjik2wpxbizl7zvvp5s7fcwvz9kl5jdpk5b"; }; buildInputs = [ openssl ]; preBuild = '' makeFlagsArray=( - linux + ${platformString} LUAPATH="$out/lib/lua/${lua.luaversion}" LUACPATH="$out/lib/lua/${lua.luaversion}" INC_PATH="-I${lua}/include" @@ -176,7 +211,7 @@ let meta = { homepage = "https://github.com/brunoos/luasec"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; maintainers = [ stdenv.lib.maintainers.flosse ]; }; }; @@ -197,18 +232,14 @@ let preBuild = '' makeFlagsArray=( LUAV=${lua.luaversion} - PLAT=${if stdenv.isDarwin then "macosx" - else if stdenv.isFreeBSD then "freebsd" - else if stdenv.isLinux then "linux" - else if stdenv.isSunOS then "solaris" - else throw "unsupported platform"} + PLAT=${platformString} prefix=$out ); ''; meta = with stdenv.lib; { homepage = "http://w3.impa.br/~diego/software/luasocket/"; - hydraPlatforms = with platforms; [darwin linux freebsd illumos]; + platforms = with platforms; darwin ++ linux ++ freebsd ++ illumos; maintainers = with maintainers; [ mornfall ]; }; }; @@ -226,41 +257,43 @@ let disabled = isLua52; meta = { homepage = "https://github.com/luaforge/luazip"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux; license = stdenv.lib.licenses.mit; }; }; luazlib = buildLuaPackage rec { name = "zlib-${version}"; - version = "0.4"; + version = "1.1"; src = fetchzip { url = "https://github.com/brimworks/lua-zlib/archive/v${version}.tar.gz"; - sha256 = "1pgxnjc0gvk25wsr69nsm60y5ad86z1nlq7mzj3ckygzkgi782dd"; + sha256 = "1520lk4xpf094xn2zallqgqhs0zb4w61l49knv9y8pmhkdkxzzgy"; }; buildInputs = [ zlib ]; + preConfigure = "substituteInPlace Makefile --replace gcc cc --replace '-llua' ''"; + preBuild = '' makeFlagsArray=( - linux + ${platformString} LUAPATH="$out/share/lua/${lua.luaversion}" LUACPATH="$out/lib/lua/${lua.luaversion}" INCDIR="-I${lua}/include" - LIBDIR="-L$out/lib"); + LIBDIR="-L${lua}/lib"); ''; preInstall = "mkdir -p $out/lib/lua/${lua.luaversion}"; meta = with stdenv.lib; { homepage = https://github.com/brimworks/lua-zlib; - hydraPlatforms = platforms.linux; + platforms = platforms.unix; license = licenses.mit; maintainers = [ maintainers.koral ]; }; }; - + luastdlib = buildLuaPackage { name = "stdlib"; @@ -271,7 +304,7 @@ let buildInputs = [ autoreconfHook unzip ]; meta = { homepage = "https://github.com/lua-stdlib/lua-stdlib/"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux; license = stdenv.lib.licenses.mit; }; }; @@ -306,7 +339,7 @@ let meta = { homepage = "https://github.com/lua-stdlib/lua-stdlib/"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux; license = stdenv.lib.licenses.mit; broken = true; }; @@ -326,7 +359,7 @@ let meta = { homepage = "https://github.com/LuaDist/luasql-sqlite3"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux; license = stdenv.lib.licenses.mit; }; }; @@ -344,7 +377,7 @@ let makeFlagsArray=(CC=$CC); ''; - buildFlags = if stdenv.isDarwin then "macosx" else ""; + buildFlags = platformString; installPhase = '' mkdir -p $out/lib/lua/${lua.luaversion} @@ -354,7 +387,7 @@ let meta = { homepage = "http://www.inf.puc-rio.br/~roberto/lpeg/"; - hydraPlatforms = stdenv.lib.platforms.all; + platforms = stdenv.lib.platforms.all; license = stdenv.lib.licenses.mit; }; }; @@ -426,25 +459,29 @@ let meta = { description = "Simple implementation of msgpack in C Lua 5.1"; homepage = "https://github.com/tarruda/libmpack"; - hydraPlatforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; license = stdenv.lib.licenses.mit; + # gcc -llua fails with luajit + broken = (builtins.parseDrvName lua.name).name != "lua"; }; }; vicious = stdenv.mkDerivation rec { name = "vicious-${version}"; - version = "2.1.3"; + version = "2.2.0"; - src = fetchzip { - url = "http://git.sysphere.org/vicious/snapshot/vicious-${version}.tar.xz"; - sha256 = "1c901siza5vpcbkgx99g1vkqiki5qgkzx2brnj4wrpbsbfzq0bcq"; + src = fetchFromGitHub { + owner = "Mic92"; + repo = "vicious"; + rev = "v${version}"; + sha256 = "0dhy0vklrhqrnmxb9pyqbfvkwwy86lwysk93pzg1j1zwprx366fj"; }; meta = with stdenv.lib; { description = "Vicious widgets for window managers"; - homepage = http://git.sysphere.org/vicious/; + homepage = https://github.com/Mic92/vicious; license = licenses.gpl2; - maintainers = with maintainers; [ makefu ]; + maintainers = with maintainers; [ makefu mic92 ]; platforms = platforms.linux; }; |