about summary refs log tree commit diff
path: root/pkgs/applications/networking
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2019-06-19 14:23:31 +0200
committerGitHub <noreply@github.com>2019-06-19 14:23:31 +0200
commitc33153bf1395e1149bf018ea391977b0ae399dde (patch)
tree030fb5d077f9942f9c9181b9b72d3079bb124128 /pkgs/applications/networking
parent56cc1e3aca3d877c3cab4f2d5b170245470deb46 (diff)
parent671e53af6736630cad70e8c404f263c8720ae3a1 (diff)
Merge pull request #63108 from Shados/lua-packaging-improvements-pr
Lua/luarocks packaging improvements
Diffstat (limited to 'pkgs/applications/networking')
-rw-r--r--pkgs/applications/networking/browsers/luakit/default.nix25
1 files changed, 10 insertions, 15 deletions
diff --git a/pkgs/applications/networking/browsers/luakit/default.nix b/pkgs/applications/networking/browsers/luakit/default.nix
index 60e9c603e29ec..69beeb167590e 100644
--- a/pkgs/applications/networking/browsers/luakit/default.nix
+++ b/pkgs/applications/networking/browsers/luakit/default.nix
@@ -1,17 +1,9 @@
 { stdenv, fetchFromGitHub, pkgconfig, wrapGAppsHook
-, help2man, lua5, luafilesystem, luajit, sqlite
+, help2man, luafilesystem, luajit, sqlite
 , webkitgtk, gtk3, gst_all_1, glib-networking
 }:
 
-let
-  lualibs = [luafilesystem];
-  getPath       = lib : type : "${lib}/lib/lua/${lua5.luaversion}/?.${type};${lib}/share/lua/${lua5.luaversion}/?.${type}";
-  getLuaPath    = lib : getPath lib "lua";
-  getLuaCPath   = lib : getPath lib "so";
-  luaPath       = stdenv.lib.concatStringsSep ";" (map getLuaPath lualibs);
-  luaCPath      = stdenv.lib.concatStringsSep ";" (map getLuaCPath lualibs);
-
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "luakit";
   version = "2.1";
 
@@ -27,7 +19,7 @@ in stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    webkitgtk lua5 luafilesystem luajit sqlite gtk3
+    webkitgtk luafilesystem luajit sqlite gtk3
     gst_all_1.gstreamer gst_all_1.gst-plugins-base
     gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-ugly
     gst_all_1.gst-libav
@@ -36,8 +28,11 @@ in stdenv.mkDerivation rec {
 
   preBuild = ''
     # build-utils/docgen/gen.lua:2: module 'lib.lousy.util' not found
-    # TODO: why is not this the default?
-    LUA_PATH=?.lua
+    # TODO: why is not this the default? The test runner adds
+    # ';./lib/?.lua;./lib/?/init.lua' to package.path, but the build-utils
+    # scripts don't add an equivalent
+    export LUA_PATH="$NIX_LUA_PATH;./?.lua;./?/init.lua"
+    export LUA_CPATH="$NIX_LUA_CPATH"
   '';
 
   makeFlags = [
@@ -54,8 +49,8 @@ in stdenv.mkDerivation rec {
   in ''
     gappsWrapperArgs+=(
       --prefix XDG_CONFIG_DIRS : "$out/etc/xdg"
-      --set LUA_PATH '${luaKitPath};${luaPath};'
-      --set LUA_CPATH '${luaCPath};'
+      --prefix LUA_PATH ';' "${luaKitPath};$NIX_LUA_PATH"
+      --prefix LUA_CPATH ';' "$NIX_LUA_CPATH"
     )
   '';