2014-09-19 19:40:37 +00:00
|
|
|
/* This file defines the composition for Lua packages. It has
|
|
|
|
been factored out of all-packages.nix because there are many of
|
|
|
|
them. Also, because most Nix expressions for Lua packages are
|
|
|
|
trivial, most are actually defined here. I.e. there's no function
|
|
|
|
for each package in a separate file: the call to the function would
|
|
|
|
be almost as must code as the function itself. */
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
{ fetchurl, stdenv, lua, unzip, pkg-config
|
2018-07-21 00:44:44 +00:00
|
|
|
, pcre, oniguruma, gnulib, tre, glibc, sqlite, openssl, expat
|
2019-06-16 19:59:06 +00:00
|
|
|
, autoreconfHook, gnum4
|
2021-03-14 16:11:57 +00:00
|
|
|
, postgresql, cyrus_sasl
|
2019-06-16 19:59:06 +00:00
|
|
|
, fetchFromGitHub, which, writeText
|
2019-01-30 14:13:15 +00:00
|
|
|
, pkgs
|
|
|
|
, lib
|
2021-09-18 19:56:32 +00:00
|
|
|
}@args:
|
2014-09-19 19:40:37 +00:00
|
|
|
|
2014-09-23 11:56:29 +00:00
|
|
|
let
|
2019-01-30 14:13:15 +00:00
|
|
|
packages = ( self:
|
|
|
|
|
|
|
|
let
|
|
|
|
callPackage = pkgs.newScope self;
|
|
|
|
|
2019-02-04 11:30:58 +00:00
|
|
|
buildLuaApplication = args: buildLuarocksPackage ({namePrefix="";} // args );
|
|
|
|
|
2021-09-11 22:01:49 +00:00
|
|
|
buildLuarocksPackage = lib.makeOverridable(callPackage ../development/interpreters/lua-5/build-lua-package.nix {
|
2019-02-17 12:18:49 +00:00
|
|
|
inherit lua;
|
2021-09-11 22:01:49 +00:00
|
|
|
inherit (pkgs) lib;
|
|
|
|
inherit (luaLib) toLuaModule;
|
2019-02-04 11:30:58 +00:00
|
|
|
});
|
2019-01-30 14:13:15 +00:00
|
|
|
|
2021-09-11 22:01:49 +00:00
|
|
|
luaLib = import ../development/lua-modules/lib.nix {
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
inherit pkgs lua;
|
|
|
|
};
|
2016-06-12 02:11:31 +00:00
|
|
|
|
2014-09-19 19:40:37 +00:00
|
|
|
#define build lua package function
|
2018-02-25 20:48:48 +00:00
|
|
|
buildLuaPackage = callPackage ../development/lua-modules/generic {
|
2021-09-11 22:01:49 +00:00
|
|
|
inherit writeText;
|
2018-02-25 20:48:48 +00:00
|
|
|
};
|
2014-09-19 19:40:37 +00:00
|
|
|
|
2021-09-11 22:01:49 +00:00
|
|
|
getPath = drv: pathListForVersion:
|
|
|
|
lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion;
|
2019-01-30 14:13:15 +00:00
|
|
|
|
2021-09-11 22:01:49 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
# helper functions for dealing with LUA_PATH and LUA_CPATH
|
|
|
|
lib = luaLib;
|
|
|
|
|
2021-10-04 13:36:39 +00:00
|
|
|
getLuaPath = drv: getPath drv luaLib.luaPathList;
|
|
|
|
getLuaCPath = drv: getPath drv luaLib.luaCPathList;
|
2021-09-11 22:01:49 +00:00
|
|
|
|
2021-09-18 19:56:32 +00:00
|
|
|
inherit (callPackage ../development/interpreters/lua-5/hooks { inherit (args) lib;})
|
2022-06-18 16:26:29 +00:00
|
|
|
luarocksCheckHook lua-setup-hook;
|
2021-09-11 22:01:49 +00:00
|
|
|
|
2021-09-18 19:56:32 +00:00
|
|
|
inherit lua callPackage;
|
2021-09-11 22:01:49 +00:00
|
|
|
inherit buildLuaPackage buildLuarocksPackage buildLuaApplication;
|
|
|
|
inherit (luaLib) luaOlder luaAtLeast isLua51 isLua52 isLua53 isLuaJIT
|
|
|
|
requiredLuaModules toLuaModule hasLuaModule;
|
2019-01-30 14:13:15 +00:00
|
|
|
|
2019-02-04 11:30:58 +00:00
|
|
|
# wraps programs in $out/bin with valid LUA_PATH/LUA_CPATH
|
|
|
|
wrapLua = callPackage ../development/interpreters/lua-5/wrap-lua.nix {
|
2021-09-11 22:01:49 +00:00
|
|
|
inherit lua lib;
|
|
|
|
inherit (pkgs) makeSetupHook makeWrapper;
|
2019-02-04 11:30:58 +00:00
|
|
|
};
|
|
|
|
|
2022-03-29 01:19:54 +00:00
|
|
|
luarocks = callPackage ../development/tools/misc/luarocks/default.nix {
|
2021-10-16 18:57:36 +00:00
|
|
|
inherit lua lib;
|
|
|
|
};
|
|
|
|
|
2021-09-11 22:01:49 +00:00
|
|
|
# a fork of luarocks used to generate nix lua derivations from rockspecs
|
2019-01-22 06:06:07 +00:00
|
|
|
luarocks-nix = callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { };
|
|
|
|
|
2021-08-15 21:11:32 +00:00
|
|
|
luxio = buildLuaPackage {
|
|
|
|
pname = "luxio";
|
2017-09-24 14:02:02 +00:00
|
|
|
version = "13";
|
2017-10-13 03:48:17 +00:00
|
|
|
|
2017-09-24 14:02:02 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-13.tar.bz2";
|
|
|
|
sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
|
|
|
|
};
|
2017-10-13 03:48:17 +00:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ which pkg-config ];
|
2017-10-13 03:48:17 +00:00
|
|
|
|
2017-09-24 14:44:43 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
2017-10-13 03:48:17 +00:00
|
|
|
|
2017-09-24 14:02:02 +00:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray=(
|
|
|
|
INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
|
|
|
|
INST_LUADIR="$out/share/lua/${lua.luaversion}"
|
|
|
|
LUA_BINDIR="$out/bin"
|
2017-09-24 14:44:43 +00:00
|
|
|
INSTALL=install
|
2017-09-24 14:02:02 +00:00
|
|
|
);
|
|
|
|
'';
|
2017-10-13 03:48:17 +00:00
|
|
|
|
2021-01-10 11:03:59 +00:00
|
|
|
meta = with lib; {
|
2022-05-29 08:51:04 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2017-10-13 03:48:17 +00:00
|
|
|
description = "Lightweight UNIX I/O and POSIX binding for Lua";
|
|
|
|
homepage = "https://www.gitano.org.uk/luxio/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ richardipsum ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2017-09-24 14:02:02 +00:00
|
|
|
};
|
|
|
|
|
2021-09-11 23:20:30 +00:00
|
|
|
vicious = luaLib.toLuaModule( stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "vicious";
|
2022-05-04 01:52:25 +00:00
|
|
|
version = "2.5.1";
|
2015-08-06 06:29:07 +00:00
|
|
|
|
2017-03-30 18:06:37 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-05-04 01:52:25 +00:00
|
|
|
owner = "vicious-widgets";
|
2017-03-30 18:06:37 +00:00
|
|
|
repo = "vicious";
|
|
|
|
rev = "v${version}";
|
2022-05-04 01:52:25 +00:00
|
|
|
sha256 = "sha256-geu/g/dFAVxtY1BuJYpZoVtFS/oL66NFnqiLAnJELtI=";
|
2015-08-06 06:29:07 +00:00
|
|
|
};
|
|
|
|
|
2017-10-13 03:48:17 +00:00
|
|
|
buildInputs = [ lua ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib/lua/${lua.luaversion}/
|
|
|
|
cp -r . $out/lib/lua/${lua.luaversion}/vicious/
|
|
|
|
printf "package.path = '$out/lib/lua/${lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${lua.luaversion}/vicious.lua
|
|
|
|
'';
|
|
|
|
|
2021-01-10 11:03:59 +00:00
|
|
|
meta = with lib; {
|
2017-12-22 09:06:27 +00:00
|
|
|
description = "A modular widget library for the awesome window manager";
|
2022-05-04 01:52:25 +00:00
|
|
|
homepage = "https://vicious.rtfd.io";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ makefu mic92 McSinyx ];
|
2015-08-06 06:29:07 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2019-02-05 15:00:19 +00:00
|
|
|
});
|
2015-08-06 06:29:07 +00:00
|
|
|
|
2019-01-30 14:13:15 +00:00
|
|
|
});
|
2019-03-07 06:09:33 +00:00
|
|
|
in packages
|