vis: simplify thanks to lua update

This commit is contained in:
Matthieu Coudron 2021-09-11 23:58:18 +02:00
parent e9c921a301
commit 823d0d835c
2 changed files with 8 additions and 11 deletions

View File

@ -1,8 +1,11 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, makeWrapper, makeDesktopItem
, ncurses, libtermkey, lpeg, lua
, ncurses, libtermkey, lua
, acl ? null, libselinux ? null
}:
let
luaEnv = lua.withPackages(ps: [ps.lpeg]);
in
stdenv.mkDerivation rec {
pname = "vis";
version = "0.7";
@ -19,8 +22,7 @@ stdenv.mkDerivation rec {
buildInputs = [
ncurses
libtermkey
lua
lpeg
luaEnv
] ++ lib.optionals stdenv.isLinux [
acl
libselinux
@ -30,16 +32,13 @@ stdenv.mkDerivation rec {
patchShebangs ./configure
'';
LUA_CPATH="${lpeg}/lib/lua/${lua.luaversion}/?.so;";
LUA_PATH="${lpeg}/share/lua/${lua.luaversion}/?.lua";
postInstall = ''
mkdir -p "$out/share/applications"
cp $desktopItem/share/applications/* $out/share/applications
echo wrapping $out/bin/vis with runtime environment
wrapProgram $out/bin/vis \
--prefix LUA_CPATH ';' "${lpeg}/lib/lua/${lua.luaversion}/?.so" \
--prefix LUA_PATH ';' "${lpeg}/share/lua/${lua.luaversion}/?.lua" \
--prefix LUA_CPATH ';' "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
--prefix LUA_PATH ';' "${luaEnv}/share/lua/${lua.luaversion}/?.lua" \
--prefix VIS_PATH : "\$HOME/.config:$out/share/vis"
'';

View File

@ -28187,9 +28187,7 @@ with pkgs;
neovim-remote = callPackage ../applications/editors/neovim/neovim-remote.nix { };
vis = callPackage ../applications/editors/vis {
inherit (lua52Packages) lpeg;
};
vis = callPackage ../applications/editors/vis { };
viw = callPackage ../applications/editors/viw { };