openrussian-cli: refactor to use lua.withPackages instead of luaPackages

This commit is contained in:
Zane van Iperen 2022-02-23 15:02:49 +10:00
parent d362e7c238
commit 3c7e3a328c
No known key found for this signature in database
GPG key ID: 68616B2D8AC4DCC5
2 changed files with 10 additions and 7 deletions

View file

@ -1,6 +1,9 @@
{ stdenv, lib, fetchFromGitHub, gnumake, pkg-config, wget, unzip, gawk
, sqlite, which, luaPackages, installShellFiles, makeWrapper
, sqlite, which, lua, installShellFiles, makeWrapper
}:
let
luaEnv = lua.withPackages(p: with p; [ luasql-sqlite3 luautf8 ]);
in
stdenv.mkDerivation rec {
pname = "openrussian-cli";
version = "1.0.0";
@ -16,11 +19,11 @@ stdenv.mkDerivation rec {
gnumake pkg-config wget unzip gawk sqlite which installShellFiles makeWrapper
];
buildInputs = with luaPackages; [ lua luasql-sqlite3 luautf8 ];
buildInputs = [ luaEnv ];
makeFlags = [
"LUA=${luaPackages.lua}/bin/lua"
"LUAC=${luaPackages.lua}/bin/luac"
"LUA=${luaEnv}/bin/lua"
"LUAC=${luaEnv}/bin/luac"
];
dontConfigure = true;
@ -34,8 +37,8 @@ stdenv.mkDerivation rec {
cp openrussian $out/bin
wrapProgram $out/bin/openrussian \
--prefix LUA_PATH ';' "$LUA_PATH" \
--prefix LUA_CPATH ';' "$LUA_CPATH"
--prefix LUA_PATH ';' '${lua.pkgs.lib.genLuaPathAbsStr luaEnv}' \
--prefix LUA_CPATH ';' '${lua.pkgs.lib.genLuaCPathAbsStr luaEnv}'
runHook postInstall
'';

View file

@ -8577,7 +8577,7 @@ with pkgs;
openrgb = libsForQt5.callPackage ../applications/misc/openrgb { };
openrussian-cli = callPackage ../misc/openrussian-cli {
luaPackages = lua53Packages;
lua = lua5_3;
};
opensbi = callPackage ../misc/opensbi { };