From 823d0d835ce789726d8df681c6ba286f04d8998c Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 11 Sep 2021 23:58:18 +0200 Subject: [PATCH] vis: simplify thanks to lua update --- pkgs/applications/editors/vis/default.nix | 15 +++++++-------- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/editors/vis/default.nix b/pkgs/applications/editors/vis/default.nix index 9a020233f3b0..2bafbce8be5f 100644 --- a/pkgs/applications/editors/vis/default.nix +++ b/pkgs/applications/editors/vis/default.nix @@ -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" ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f63059be15b2..20f649d85532 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };