lua-packages: try splicing

This commit is contained in:
Artturin 2022-08-23 01:45:37 +03:00
parent 613c410750
commit ec35f6341b
14 changed files with 194 additions and 185 deletions

View file

@ -20,7 +20,7 @@ in
}@attrs:
let
originalLuaDrv = lua51Packages.${luaAttr};
luaDrv = lua51Packages.lib.overrideLuarocks originalLuaDrv (drv: {
luaDrv = lua51Packages.luaLib.overrideLuarocks originalLuaDrv (drv: {
extraConfig = ''
-- to create a flat hierarchy
lua_modules_path = "lua"

View file

@ -115,8 +115,8 @@ let
] ++ lib.optionals (binPath != "") [
"--suffix" "PATH" ":" binPath
] ++ lib.optionals (luaEnv != null) [
"--prefix" "LUA_PATH" ";" (neovim-unwrapped.lua.pkgs.lib.genLuaPathAbsStr luaEnv)
"--prefix" "LUA_CPATH" ";" (neovim-unwrapped.lua.pkgs.lib.genLuaCPathAbsStr luaEnv)
"--prefix" "LUA_PATH" ";" (neovim-unwrapped.lua.pkgs.luaLib.genLuaPathAbsStr luaEnv)
"--prefix" "LUA_CPATH" ";" (neovim-unwrapped.lua.pkgs.luaLib.genLuaCPathAbsStr luaEnv)
];
manifestRc = vimUtils.vimrcContent ({ customRC = ""; }) ;

View file

@ -1,10 +1,12 @@
# Generic builder for lua packages
{ lib
, lua
, buildPackages
, wrapLua
, luarocks
# Whether the derivation provides a lua module or not.
, toLuaModule
, luarocksCheckHook
, luaLib
}:
{
@ -82,7 +84,7 @@ let
# configured trees)
luarocks_config = "luarocks-config.lua";
luarocks_content = let
generatedConfig = lua.pkgs.lib.generateLuarocksConfig {
generatedConfig = luaLib.generateLuarocksConfig {
externalDeps = externalDeps ++ externalDepsGenerated;
inherit extraVariables;
inherit rocksSubdir;
@ -107,14 +109,14 @@ let
);
externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
luarocksDrv = toLuaModule ( lua.stdenv.mkDerivation (
luarocksDrv = luaLib.toLuaModule ( lua.stdenv.mkDerivation (
builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // {
name = namePrefix + pname + "-" + version;
nativeBuildInputs = [
wrapLua
lua.pkgs.luarocks
luarocks
]
++ buildInputs
++ lib.optionals doCheck ([ luarocksCheckHook ] ++ checkInputs)
@ -156,7 +158,7 @@ builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariab
nix_debug "Using LUAROCKS_CONFIG=$LUAROCKS_CONFIG"
LUAROCKS=${lua.pkgs.luarocks}/bin/luarocks
LUAROCKS=luarocks
if (( ''${NIX_DEBUG:-0} >= 1 )); then
LUAROCKS="$LUAROCKS --verbose"
fi

View file

@ -11,9 +11,12 @@
, staticOnly ? stdenv.hostPlatform.isStatic
}:
let
luaversion = with sourceVersion; "${major}.${minor}";
luaPackages = callPackage ../../lua-modules {
lua = self;
overrides = packageOverrides;
packagesAttr = "lua${lib.replaceChars ["."] ["_"] luaversion}.pkgs";
};
plat = if (stdenv.isLinux && lib.versionOlder self.luaversion "5.4") then "linux"
@ -28,7 +31,6 @@ plat = if (stdenv.isLinux && lib.versionOlder self.luaversion "5.4") then "linux
self = stdenv.mkDerivation rec {
pname = "lua";
luaversion = with sourceVersion; "${major}.${minor}";
version = "${luaversion}.${sourceVersion.patch}";
src = fetchurl {
@ -36,8 +38,8 @@ self = stdenv.mkDerivation rec {
sha256 = hash;
};
LuaPathSearchPaths = luaPackages.lib.luaPathList;
LuaCPathSearchPaths = luaPackages.lib.luaCPathList;
LuaPathSearchPaths = luaPackages.luaLib.luaPathList;
LuaCPathSearchPaths = luaPackages.luaLib.luaCPathList;
setupHook = luaPackages.lua-setup-hook LuaPathSearchPaths LuaCPathSearchPaths;
nativeBuildInputs = [ makeWrapper ];
@ -124,6 +126,7 @@ self = stdenv.mkDerivation rec {
'';
passthru = rec {
inherit luaversion;
buildEnv = callPackage ./wrapper.nix {
lua = self;
inherit makeWrapper;

View file

@ -1,6 +1,7 @@
{ self, callPackage, lib }:
callPackage ./default.nix {
inherit self;
packagesAttr = "luajit_2_0.pkgs";
version = "2.0.5-2022-03-13";
rev = "93a65d3cc263aef2d2feb3d7ff2206aca3bee17e";
isStable = true;

View file

@ -1,6 +1,7 @@
{ self, callPackage }:
callPackage ./default.nix {
inherit self;
packagesAttr = "luajit_2_1.pkgs";
version = "2.1.0-2022-04-05";
rev = "5e3c45c43bb0e0f1f2917d432e9d2dba12c42a6e";
isStable = false;

View file

@ -7,6 +7,7 @@
, hash
, rev
, version
, packagesAttr
, extraMeta ? { }
, callPackage
, self
@ -27,7 +28,11 @@ assert enableJITDebugModule -> enableJIT;
assert enableGDBJITSupport -> enableJIT;
assert enableValgrindSupport -> valgrind != null;
let
luaPackages = callPackage ../../lua-modules { lua = self; overrides = packageOverrides; };
luaPackages = callPackage ../../lua-modules {
lua = self;
overrides = packageOverrides;
inherit packagesAttr;
};
XCFLAGS = with lib;
optional (!enableFFI) "-DLUAJIT_DISABLE_FFI"
@ -93,10 +98,10 @@ stdenv.mkDerivation rec {
ln -s "$out"/bin/luajit-* "$out"/bin/luajit
'';
LuaPathSearchPaths = luaPackages.lib.luaPathList;
LuaCPathSearchPaths = luaPackages.lib.luaCPathList;
LuaPathSearchPaths = luaPackages.luaLib.luaPathList;
LuaCPathSearchPaths = luaPackages.luaLib.luaCPathList;
setupHook = luaPackages.lua-setup-hook luaPackages.lib.luaPathList luaPackages.lib.luaCPathList;
setupHook = luaPackages.lua-setup-hook luaPackages.luaLib.luaPathList luaPackages.luaLib.luaCPathList;
passthru = rec {
buildEnv = callPackage ../lua-5/wrapper.nix {

View file

@ -1,6 +1,8 @@
# inspired by pkgs/development/haskell-modules/default.nix
{ pkgs, lib
, lua
, packagesAttr
, stdenv
, overrides ? (final: prev: {})
}:
@ -8,9 +10,9 @@ let
inherit (lib) extends;
initialPackages = (pkgs.callPackage ../../top-level/lua-packages.nix {
inherit lua;
});
initialPackages = import ../../top-level/lua-packages.nix {
inherit lua pkgs lib stdenv;
};
overridenPackages = import ./overrides.nix { inherit pkgs; };
@ -23,7 +25,18 @@ let
overrides
];
extensible-self = lib.makeExtensible (lib.extends extensions initialPackages);
otherSplices = let
packagesAttrFun = set: lib.getAttrFromPath (lib.splitString "." packagesAttr) set;
in {
selfBuildBuild = packagesAttrFun pkgs.pkgsBuildBuild;
selfBuildHost = packagesAttrFun pkgs.pkgsBuildHost;
selfBuildTarget = packagesAttrFun pkgs.pkgsBuildTarget;
selfHostHost = packagesAttrFun pkgs.pkgsHostHost;
selfTargetTarget = if pkgs.pkgsTargetTarget.__raw or false then {} else packagesAttrFun pkgs.pkgsTargetTarget; # might be missing;
};
keep = self: { };
extra = spliced0: { };
in
extensible-self
lib.makeScopeWithSplicing pkgs.splicePackages pkgs.newScope otherSplices keep extra
(lib.extends extensions initialPackages)

View file

@ -1,4 +1,4 @@
{ fetchFromGitHub, buildLuarocksPackage, lua, maintainers, pkg-config
{ fetchFromGitHub, buildLuarocksPackage, lua, pkg-config, lib
, substituteAll, zenity }:
buildLuarocksPackage {
@ -35,7 +35,7 @@ buildLuarocksPackage {
description =
"A tiny, neat lua library that portably invokes native file open and save dialogs.";
homepage = "https://github.com/Alloyed/nativefiledialog/tree/master/lua";
license.fullName = "zlib";
maintainers = [ maintainers.scoder12 ];
license = lib.licenses.zlib;
maintainers = [ lib.maintainers.scoder12 ];
};
}

View file

@ -29,7 +29,7 @@ with prev;
'';
});
cqueues = (prev.lib.overrideLuarocks prev.cqueues (drv: {
cqueues = (prev.luaLib.overrideLuarocks prev.cqueues (drv: {
externalDeps = [
{ name = "CRYPTO"; dep = pkgs.openssl_1_1; }
{ name = "OPENSSL"; dep = pkgs.openssl_1_1; }
@ -63,7 +63,7 @@ with prev;
'';
});
cyrussasl = prev.lib.overrideLuarocks prev.cyrussasl (drv: {
cyrussasl = prev.luaLib.overrideLuarocks prev.cyrussasl (drv: {
externalDeps = [
{ name = "LIBSASL"; dep = pkgs.cyrus_sasl; }
];
@ -83,7 +83,7 @@ with prev;
*/
});
ldbus = prev.lib.overrideLuarocks prev.ldbus (drv: {
ldbus = prev.luaLib.overrideLuarocks prev.ldbus (drv: {
extraVariables = {
DBUS_DIR="${pkgs.dbus.lib}";
DBUS_ARCH_INCDIR="${pkgs.dbus.lib}/lib/dbus-1.0/include";
@ -94,7 +94,7 @@ with prev;
];
});
ljsyscall = prev.lib.overrideLuarocks prev.ljsyscall (drv: rec {
ljsyscall = prev.luaLib.overrideLuarocks prev.ljsyscall (drv: rec {
version = "unstable-20180515";
# package hasn't seen any release for a long time
src = pkgs.fetchFromGitHub {
@ -135,7 +135,7 @@ with prev;
'';
});
lmathx = prev.lib.overrideLuarocks prev.lmathx (drv:
lmathx = prev.luaLib.overrideLuarocks prev.lmathx (drv:
if luaAtLeast "5.1" && luaOlder "5.2" then {
version = "20120430.51-1";
knownRockspec = (pkgs.fetchurl {
@ -167,7 +167,7 @@ with prev;
'';
});
lmpfrlib = prev.lib.overrideLuarocks prev.lmpfrlib (drv: {
lmpfrlib = prev.luaLib.overrideLuarocks prev.lmpfrlib (drv: {
externalDeps = [
{ name = "GMP"; dep = pkgs.gmp; }
{ name = "MPFR"; dep = pkgs.mpfr; }
@ -177,25 +177,25 @@ with prev;
'';
});
lrexlib-gnu = prev.lib.overrideLuarocks prev.lrexlib-gnu (drv: {
lrexlib-gnu = prev.luaLib.overrideLuarocks prev.lrexlib-gnu (drv: {
buildInputs = [
pkgs.gnulib
];
});
lrexlib-pcre = prev.lib.overrideLuarocks prev.lrexlib-pcre (drv: {
lrexlib-pcre = prev.luaLib.overrideLuarocks prev.lrexlib-pcre (drv: {
externalDeps = [
{ name = "PCRE"; dep = pkgs.pcre; }
];
});
lrexlib-posix = prev.lib.overrideLuarocks prev.lrexlib-posix (drv: {
lrexlib-posix = prev.luaLib.overrideLuarocks prev.lrexlib-posix (drv: {
buildInputs = [
pkgs.glibc.dev
];
});
lua-iconv = prev.lib.overrideLuarocks prev.lua-iconv (drv: {
lua-iconv = prev.luaLib.overrideLuarocks prev.lua-iconv (drv: {
buildInputs = [
pkgs.libiconv
];
@ -209,14 +209,14 @@ with prev;
'';
});
lua-zlib = prev.lib.overrideLuarocks prev.lua-zlib (drv: {
lua-zlib = prev.luaLib.overrideLuarocks prev.lua-zlib (drv: {
buildInputs = [
pkgs.zlib.dev
];
disabled = luaOlder "5.1" || luaAtLeast "5.4";
});
luadbi-mysql = prev.lib.overrideLuarocks prev.luadbi-mysql (drv: {
luadbi-mysql = prev.luaLib.overrideLuarocks prev.luadbi-mysql (drv: {
extraVariables = {
# Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
MYSQL_INCDIR="${pkgs.libmysqlclient.dev}/include/mysql";
@ -228,19 +228,19 @@ with prev;
];
});
luadbi-postgresql = prev.lib.overrideLuarocks prev.luadbi-postgresql (drv: {
luadbi-postgresql = prev.luaLib.overrideLuarocks prev.luadbi-postgresql (drv: {
buildInputs = [
pkgs.postgresql
];
});
luadbi-sqlite3 = prev.lib.overrideLuarocks prev.luadbi-sqlite3 (drv: {
luadbi-sqlite3 = prev.luaLib.overrideLuarocks prev.luadbi-sqlite3 (drv: {
externalDeps = [
{ name = "SQLITE"; dep = pkgs.sqlite; }
];
});
luaevent = prev.lib.overrideLuarocks prev.luaevent (drv: {
luaevent = prev.luaLib.overrideLuarocks prev.luaevent (drv: {
propagatedBuildInputs = [
luasocket
];
@ -250,7 +250,7 @@ with prev;
disabled = luaOlder "5.1" || luaAtLeast "5.4";
});
luaexpat = prev.lib.overrideLuarocks prev.luaexpat (drv: {
luaexpat = prev.luaLib.overrideLuarocks prev.luaexpat (drv: {
externalDeps = [
{ name = "EXPAT"; dep = pkgs.expat; }
];
@ -258,7 +258,7 @@ with prev;
# TODO Somehow automatically amend buildInputs for things that need luaffi
# but are in luajitPackages?
luaffi = prev.lib.overrideLuarocks prev.luaffi (drv: {
luaffi = prev.luaLib.overrideLuarocks prev.luaffi (drv: {
# The packaged .src.rock version is pretty old, and doesn't work with Lua 5.3
src = pkgs.fetchFromGitHub {
owner = "facebook"; repo = "luaffifb";
@ -269,7 +269,7 @@ with prev;
disabled = luaOlder "5.1" || luaAtLeast "5.4" || isLuaJIT;
});
luaossl = prev.lib.overrideLuarocks prev.luaossl (drv: {
luaossl = prev.luaLib.overrideLuarocks prev.luaossl (drv: {
externalDeps = [
# https://github.com/wahern/luaossl/pull/199
{ name = "CRYPTO"; dep = pkgs.openssl_1_1; }
@ -277,41 +277,41 @@ with prev;
];
});
luasec = prev.lib.overrideLuarocks prev.luasec (drv: {
luasec = prev.luaLib.overrideLuarocks prev.luasec (drv: {
externalDeps = [
{ name = "OPENSSL"; dep = pkgs.openssl_1_1; }
];
});
luasql-sqlite3 = prev.lib.overrideLuarocks prev.luasql-sqlite3 (drv: {
luasql-sqlite3 = prev.luaLib.overrideLuarocks prev.luasql-sqlite3 (drv: {
externalDeps = [
{ name = "SQLITE"; dep = pkgs.sqlite; }
];
});
luasystem = prev.lib.overrideLuarocks prev.luasystem (drv: pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
luasystem = prev.luaLib.overrideLuarocks prev.luasystem (drv: pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
buildInputs = [ pkgs.glibc.out ];
});
luazip = prev.lib.overrideLuarocks prev.luazip (drv: {
luazip = prev.luaLib.overrideLuarocks prev.luazip (drv: {
buildInputs = [
pkgs.zziplib
];
});
lua-yajl = prev.lib.overrideLuarocks prev.lua-yajl (drv: {
lua-yajl = prev.luaLib.overrideLuarocks prev.lua-yajl (drv: {
buildInputs = [
pkgs.yajl
];
});
luaunbound = prev.lib.overrideLuarocks prev.luaunbound(drv: {
luaunbound = prev.luaLib.overrideLuarocks prev.luaunbound(drv: {
externalDeps = [
{ name = "libunbound"; dep = pkgs.unbound; }
];
});
luuid = (prev.lib.overrideLuarocks prev.luuid (drv: {
luuid = (prev.luaLib.overrideLuarocks prev.luuid (drv: {
externalDeps = [
{ name = "LIBUUID"; dep = pkgs.libuuid; }
];
@ -361,7 +361,7 @@ with prev;
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.fixDarwinDylibNames ];
};
luv = prev.lib.overrideLuarocks prev.luv (drv: {
luv = prev.luaLib.overrideLuarocks prev.luv (drv: {
buildInputs = [ pkgs.pkg-config pkgs.libuv ];
@ -381,13 +381,13 @@ with prev;
});
lyaml = prev.lib.overrideLuarocks prev.lyaml (oa: {
lyaml = prev.luaLib.overrideLuarocks prev.lyaml (oa: {
buildInputs = [
pkgs.libyaml
];
});
mpack = prev.lib.overrideLuarocks prev.mpack (drv: {
mpack = prev.luaLib.overrideLuarocks prev.mpack (drv: {
buildInputs = [ pkgs.libmpack ];
# the rockspec doesn't use the makefile so you may need to export more flags
USE_SYSTEM_LUA = "yes";
@ -401,7 +401,7 @@ with prev;
'';
});
readline = (prev.lib.overrideLuarocks prev.readline (drv: {
readline = (prev.luaLib.overrideLuarocks prev.readline (drv: {
unpackCmd = ''
unzip "$curSrc"
tar xf *.tar.gz
@ -418,7 +418,7 @@ with prev;
'';
});
sqlite = prev.lib.overrideLuarocks prev.sqlite (drv: {
sqlite = prev.luaLib.overrideLuarocks prev.sqlite (drv: {
doCheck = true;
checkInputs = [ final.plenary-nvim pkgs.neovim-unwrapped ];

View file

@ -1,4 +1,4 @@
{lib, stdenv, fetchFromGitHub
{lib, stdenv, fetchFromGitHub, buildPackages
, curl, makeWrapper, which, unzip
, lua
# for 'luarocks pack'
@ -43,12 +43,13 @@ stdenv.mkDerivation rec {
fi
'';
nativeBuildInputs = [ makeWrapper installShellFiles ];
nativeBuildInputs = [ makeWrapper installShellFiles lua unzip ];
buildInputs = [ lua curl which ];
buildInputs = [ curl which ];
postInstall = ''
sed -e "1s@.*@#! ${lua}/bin/lua$LUA_SUFFIX@" -i "$out"/bin/*
for i in "$out"/bin/*; do
test -L "$i" || {
wrapProgram "$i" \
@ -58,7 +59,7 @@ stdenv.mkDerivation rec {
--suffix LUA_CPATH ";" "$(echo "$out"/share/lua/*/)?/init.lua"
}
done
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd luarocks --bash <($out/bin/luarocks completion bash)
installShellCompletion --cmd luarocks --zsh <($out/bin/luarocks completion zsh)
'';

View file

@ -37,8 +37,8 @@ stdenv.mkDerivation rec {
cp openrussian $out/bin
wrapProgram $out/bin/openrussian \
--prefix LUA_PATH ';' '${lua.pkgs.lib.genLuaPathAbsStr luaEnv}' \
--prefix LUA_CPATH ';' '${lua.pkgs.lib.genLuaCPathAbsStr luaEnv}'
--prefix LUA_PATH ';' '${lua.pkgs.luaLib.genLuaPathAbsStr luaEnv}' \
--prefix LUA_CPATH ';' '${lua.pkgs.luaLib.genLuaCPathAbsStr luaEnv}'
runHook postInstall
'';

View file

@ -50,6 +50,6 @@ stdenv.mkDerivation rec {
description = "Named Data Neworking (NDN) Forwarding Daemon";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = [ maintainers.bertof ];
maintainers = [ lib.maintainers.bertof ];
};
}

View file

@ -5,140 +5,123 @@
for each package in a separate file: the call to the function would
be almost as must code as the function itself. */
{ fetchurl
, stdenv
{ stdenv
, lua
, pkg-config
, fetchFromGitHub
, which
, writeText
, pkgs
, lib
}@args:
}:
self:
let
packages = (self:
inherit (self) callPackage;
let
callPackage = pkgs.newScope self;
buildLuaApplication = args: buildLuarocksPackage ({ namePrefix = ""; } // args);
buildLuaApplication = args: buildLuarocksPackage ({ namePrefix = ""; } // args);
buildLuarocksPackage = lib.makeOverridable (callPackage ../development/interpreters/lua-5/build-lua-package.nix { });
buildLuarocksPackage = lib.makeOverridable (callPackage ../development/interpreters/lua-5/build-lua-package.nix {
inherit lua;
inherit (pkgs) lib;
inherit (luaLib) toLuaModule;
});
luaLib = callPackage ../development/lua-modules/lib.nix { };
luaLib = import ../development/lua-modules/lib.nix {
inherit (pkgs) lib;
inherit pkgs lua;
};
#define build lua package function
buildLuaPackage = callPackage ../development/lua-modules/generic { };
#define build lua package function
buildLuaPackage = callPackage ../development/lua-modules/generic {
inherit writeText;
};
getPath = drv: pathListForVersion:
lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion;
getPath = drv: pathListForVersion:
lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion;
in
{
# helper functions for dealing with LUA_PATH and LUA_CPATH
lib = luaLib;
getLuaPath = drv: getPath drv luaLib.luaPathList;
getLuaCPath = drv: getPath drv luaLib.luaCPathList;
inherit (callPackage ../development/interpreters/lua-5/hooks { inherit (args) lib; })
luarocksMoveDataFolder luarocksCheckHook lua-setup-hook;
inherit lua callPackage;
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 lua lib;
inherit (pkgs.buildPackages) makeSetupHook makeWrapper;
};
luarocks = callPackage ../development/tools/misc/luarocks/default.nix {
inherit lua lib;
};
# a fork of luarocks used to generate nix lua derivations from rockspecs
luarocks-nix = callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { };
luxio = buildLuaPackage {
pname = "luxio";
version = "13";
src = fetchurl {
url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-13.tar.bz2";
sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
};
nativeBuildInputs = [ which pkg-config ];
postPatch = ''
patchShebangs .
'';
preBuild = ''
makeFlagsArray=(
INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
INST_LUADIR="$out/share/lua/${lua.luaversion}"
LUA_BINDIR="$out/bin"
INSTALL=install
);
'';
meta = with lib; {
broken = stdenv.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;
};
};
nfd = callPackage ../development/lua-modules/nfd {
inherit (lib) maintainers;
inherit (pkgs.gnome) zenity;
};
vicious = luaLib.toLuaModule (stdenv.mkDerivation rec {
pname = "vicious";
version = "2.5.1";
src = fetchFromGitHub {
owner = "vicious-widgets";
repo = "vicious";
rev = "v${version}";
sha256 = "sha256-geu/g/dFAVxtY1BuJYpZoVtFS/oL66NFnqiLAnJELtI=";
};
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
'';
meta = with lib; {
description = "A modular widget library for the awesome window manager";
homepage = "https://vicious.rtfd.io";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ makefu mic92 McSinyx ];
platforms = platforms.linux;
};
});
});
in
packages
{
# 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 { })
luarocksMoveDataFolder luarocksCheckHook lua-setup-hook;
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;
};
luarocks = callPackage ../development/tools/misc/luarocks/default.nix { };
# a fork of luarocks used to generate nix lua derivations from rockspecs
luarocks-nix = callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { };
luxio = callPackage ({ fetchurl, which, pkg-config }: buildLuaPackage {
pname = "luxio";
version = "13";
src = fetchurl {
url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-13.tar.bz2";
sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
};
nativeBuildInputs = [ which pkg-config ];
postPatch = ''
patchShebangs .
'';
preBuild = ''
makeFlagsArray=(
INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
INST_LUADIR="$out/share/lua/${lua.luaversion}"
LUA_BINDIR="$out/bin"
INSTALL=install
);
'';
meta = with lib; {
broken = stdenv.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;
};
});
nfd = callPackage ../development/lua-modules/nfd {
inherit (pkgs.gnome) zenity;
};
vicious = (callPackage ({ fetchFromGitHub }: stdenv.mkDerivation rec {
pname = "vicious";
version = "2.5.1";
src = fetchFromGitHub {
owner = "vicious-widgets";
repo = "vicious";
rev = "v${version}";
sha256 = "sha256-geu/g/dFAVxtY1BuJYpZoVtFS/oL66NFnqiLAnJELtI=";
};
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
'';
meta = with lib; {
description = "A modular widget library for the awesome window manager";
homepage = "https://vicious.rtfd.io";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ makefu mic92 McSinyx ];
platforms = platforms.linux;
};
}) {});
}