2014-09-19 19:40:37 +00:00
|
|
|
/*
|
|
|
|
This file defines the composition for Lua packages. It has
|
2022-08-22 14:42:58 +00:00
|
|
|
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.
|
|
|
|
*/
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-26 03:17:06 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
stdenv,
|
2019-01-30 14:13:15 +00:00
|
|
|
lib,
|
2022-08-26 03:17:06 +00:00
|
|
|
lua,
|
2022-08-22 22:45:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
self:
|
2014-09-19 19:40:37 +00:00
|
|
|
|
2014-09-23 11:56:29 +00:00
|
|
|
let
|
2022-08-22 22:45:37 +00:00
|
|
|
inherit (self) callPackage;
|
|
|
|
|
|
|
|
buildLuaApplication = args: buildLuarocksPackage ({ namePrefix = ""; } // args);
|
|
|
|
|
2023-07-09 15:45:02 +00:00
|
|
|
buildLuarocksPackage = lib.makeOverridable (
|
|
|
|
callPackage ../development/interpreters/lua-5/build-luarocks-package.nix { }
|
|
|
|
);
|
2022-08-22 22:45:37 +00:00
|
|
|
|
|
|
|
luaLib = callPackage ../development/lua-modules/lib.nix { };
|
|
|
|
|
|
|
|
#define build lua package function
|
|
|
|
buildLuaPackage = callPackage ../development/lua-modules/generic { };
|
|
|
|
|
|
|
|
getPath =
|
|
|
|
drv: pathListForVersion: lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion;
|
|
|
|
|
2021-09-11 22:01:49 +00:00
|
|
|
in
|
2022-12-19 07:43:14 +00:00
|
|
|
rec {
|
2022-08-22 22:45:37 +00:00
|
|
|
|
|
|
|
# Dont take luaPackages from "global" pkgs scope to avoid mixing lua versions
|
|
|
|
luaPackages = self;
|
|
|
|
|
|
|
|
# helper functions for dealing with LUA_PATH and LUA_CPATH
|
|
|
|
inherit luaLib;
|
|
|
|
|
|
|
|
getLuaPath = drv: getPath drv luaLib.luaPathList;
|
|
|
|
getLuaCPath = drv: getPath drv luaLib.luaCPathList;
|
|
|
|
|
|
|
|
inherit (callPackage ../development/interpreters/lua-5/hooks { })
|
2024-04-23 22:30:33 +00:00
|
|
|
luarocksMoveDataFolder
|
|
|
|
luarocksCheckHook
|
|
|
|
;
|
2022-08-22 22:45:37 +00:00
|
|
|
|
|
|
|
inherit lua;
|
|
|
|
inherit buildLuaPackage buildLuarocksPackage buildLuaApplication;
|
|
|
|
inherit (luaLib)
|
|
|
|
luaOlder
|
|
|
|
luaAtLeast
|
|
|
|
isLua51
|
|
|
|
isLua52
|
|
|
|
isLua53
|
|
|
|
isLuaJIT
|
|
|
|
requiredLuaModules
|
|
|
|
toLuaModule
|
|
|
|
hasLuaModule
|
|
|
|
;
|
|
|
|
|
|
|
|
# wraps programs in $out/bin with valid LUA_PATH/LUA_CPATH
|
|
|
|
wrapLua = callPackage ../development/interpreters/lua-5/wrap-lua.nix {
|
|
|
|
inherit (pkgs.buildPackages) makeSetupHook makeWrapper;
|
|
|
|
};
|
|
|
|
|
2024-05-31 15:42:08 +00:00
|
|
|
luarocks_bootstrap = toLuaModule (callPackage ../development/tools/misc/luarocks/default.nix { });
|
2022-08-22 22:45:37 +00:00
|
|
|
|
|
|
|
# a fork of luarocks used to generate nix lua derivations from rockspecs
|
2023-07-07 14:26:00 +00:00
|
|
|
luarocks-nix = toLuaModule (callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { });
|
2022-12-19 07:43:14 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
lua-pam = callPackage (
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2023-12-28 19:43:15 +00:00
|
|
|
fetchFromGitHub,
|
|
|
|
linux-pam,
|
|
|
|
openpam,
|
|
|
|
}:
|
|
|
|
buildLuaPackage rec {
|
|
|
|
pname = "lua-pam";
|
|
|
|
version = "unstable-2015-07-03";
|
|
|
|
# Needed for `disabled`, overridden in buildLuaPackage
|
|
|
|
name = "${pname}-${version}";
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "devurandom";
|
|
|
|
repo = "lua-pam";
|
|
|
|
rev = "3818ee6346a976669d74a5cbc2a83ad2585c5953";
|
|
|
|
hash = "sha256-YlMZ5mM9Ij/9yRmgA0X1ahYVZMUx8Igj5OBvAMskqTg=";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
# The makefile tries to link to `-llua<luaversion>`
|
|
|
|
LUA_LIBS = "-llua";
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
buildInputs =
|
|
|
|
lib.optionals stdenv.hostPlatform.isLinux [ linux-pam ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ openpam ];
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
install -Dm755 pam.so $out/lib/lua/${lua.luaversion}/pam.so
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
# The package does not build with lua 5.4 or luaJIT
|
|
|
|
disabled = luaAtLeast "5.4" || isLuaJIT;
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2023-12-28 19:43:15 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Lua module for PAM authentication";
|
|
|
|
homepage = "https://github.com/devurandom/lua-pam";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ traxys ];
|
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
2023-12-28 19:43:15 +00:00
|
|
|
) { };
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:43:32 +00:00
|
|
|
lua-resty-core = callPackage (
|
|
|
|
{ fetchFromGitHub }:
|
|
|
|
buildLuaPackage rec {
|
|
|
|
pname = "lua-resty-core";
|
2024-04-22 19:46:54 +00:00
|
|
|
version = "0.1.28";
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:43:32 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openresty";
|
|
|
|
repo = "lua-resty-core";
|
|
|
|
rev = "v${version}";
|
2024-04-22 19:46:54 +00:00
|
|
|
sha256 = "sha256-RJ2wcHTu447wM0h1fa2qCBl4/p9XL6ZqX9pktRW64RI=";
|
2022-12-19 07:43:32 +00:00
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:43:32 +00:00
|
|
|
propagatedBuildInputs = [ lua-resty-lrucache ];
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:43:32 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "New FFI-based API for lua-nginx-module";
|
|
|
|
homepage = "https://github.com/openresty/lua-resty-core";
|
|
|
|
license = licenses.bsd3;
|
2024-07-28 14:44:11 +00:00
|
|
|
maintainers = [ ];
|
2022-12-19 07:43:32 +00:00
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
2022-12-19 07:43:32 +00:00
|
|
|
) { };
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:43:14 +00:00
|
|
|
lua-resty-lrucache = callPackage (
|
|
|
|
{ fetchFromGitHub }:
|
|
|
|
buildLuaPackage rec {
|
|
|
|
pname = "lua-resty-lrucache";
|
|
|
|
version = "0.13";
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:43:14 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openresty";
|
|
|
|
repo = "lua-resty-lrucache";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-J8RNAMourxqUF8wPKd8XBhNwGC/x1KKvrVnZtYDEu4Q=";
|
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:43:14 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Lua-land LRU Cache based on LuaJIT FFI";
|
|
|
|
homepage = "https://github.com/openresty/lua-resty-lrucache";
|
|
|
|
license = licenses.bsd3;
|
2024-07-28 14:44:11 +00:00
|
|
|
maintainers = [ ];
|
2022-12-19 07:43:14 +00:00
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
2022-12-19 07:43:14 +00:00
|
|
|
) { };
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-12-19 07:36:19 +00:00
|
|
|
luxio = callPackage (
|
|
|
|
{
|
|
|
|
fetchurl,
|
|
|
|
which,
|
|
|
|
pkg-config,
|
|
|
|
}:
|
|
|
|
buildLuaPackage rec {
|
2022-08-22 22:45:37 +00:00
|
|
|
pname = "luxio";
|
|
|
|
version = "13";
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
src = fetchurl {
|
2022-12-19 07:36:19 +00:00
|
|
|
url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-${version}.tar.bz2";
|
2022-08-22 22:45:37 +00:00
|
|
|
sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
|
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
which
|
|
|
|
pkg-config
|
|
|
|
];
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
postPatch = ''
|
2022-12-19 07:36:19 +00:00
|
|
|
patchShebangs const-proc.lua
|
2022-08-22 22:45:37 +00:00
|
|
|
'';
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray=(
|
|
|
|
INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
|
|
|
|
INST_LUADIR="$out/share/lua/${lua.luaversion}"
|
|
|
|
LUA_BINDIR="$out/bin"
|
|
|
|
INSTALL=install
|
2022-12-19 07:36:19 +00:00
|
|
|
);
|
2022-08-22 22:45:37 +00:00
|
|
|
'';
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
|
|
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;
|
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
2022-12-19 07:36:19 +00:00
|
|
|
) { };
|
2022-08-22 22:45:37 +00:00
|
|
|
|
|
|
|
nfd = callPackage ../development/lua-modules/nfd {
|
2024-06-22 12:28:53 +00:00
|
|
|
inherit (pkgs) zenity;
|
2022-12-09 05:23:56 +00:00
|
|
|
inherit (pkgs.darwin.apple_sdk.frameworks) AppKit;
|
2022-08-22 22:45:37 +00:00
|
|
|
};
|
|
|
|
|
2022-12-19 07:36:19 +00:00
|
|
|
vicious = callPackage (
|
|
|
|
{ fetchFromGitHub }:
|
|
|
|
stdenv.mkDerivation rec {
|
2022-08-22 22:45:37 +00:00
|
|
|
pname = "vicious";
|
2023-01-04 03:31:35 +00:00
|
|
|
version = "2.6.0";
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vicious-widgets";
|
|
|
|
repo = "vicious";
|
|
|
|
rev = "v${version}";
|
2023-01-04 03:31:35 +00:00
|
|
|
sha256 = "sha256-VlJ2hNou2+t7eSyHmFkC2xJ92OH/uJ/ewYHkFLQjUPQ=";
|
2022-08-22 22:45:37 +00:00
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
buildInputs = [ lua ];
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
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
|
|
|
|
'';
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2022-08-22 22:45:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Modular widget library for the awesome window manager";
|
|
|
|
homepage = "https://vicious.rtfd.io";
|
2023-01-04 03:31:35 +00:00
|
|
|
changelog = "https://vicious.rtfd.io/en/v${version}/changelog.html";
|
2022-08-22 22:45:37 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
makefu
|
|
|
|
mic92
|
|
|
|
McSinyx
|
|
|
|
];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
2022-12-19 07:36:19 +00:00
|
|
|
) { };
|
2022-08-22 22:45:37 +00:00
|
|
|
}
|