summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-02-26 01:09:31 +0100
committerMatthieu Coudron <mattator@gmail.com>2020-02-26 01:14:29 +0100
commit6eeb434b3397b47f26589e3ceeb2aa88857ff33e (patch)
tree1243379023f6d0319967b74ab990ea950ada3e8b /pkgs/development
parent7aee5b838b25a353a453aa7db0560390dc8089cf (diff)
downloadnixpkgs-6eeb434b3397b47f26589e3ceeb2aa88857ff33e.tar
nixpkgs-6eeb434b3397b47f26589e3ceeb2aa88857ff33e.tar.gz
nixpkgs-6eeb434b3397b47f26589e3ceeb2aa88857ff33e.tar.bz2
nixpkgs-6eeb434b3397b47f26589e3ceeb2aa88857ff33e.tar.lz
nixpkgs-6eeb434b3397b47f26589e3ceeb2aa88857ff33e.tar.xz
nixpkgs-6eeb434b3397b47f26589e3ceeb2aa88857ff33e.tar.zst
nixpkgs-6eeb434b3397b47f26589e3ceeb2aa88857ff33e.zip
buildLuarocksPackage: extraVariables is now an attrset
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/interpreters/lua-5/build-lua-package.nix13
-rw-r--r--pkgs/development/lua-modules/overrides.nix10
2 files changed, 13 insertions, 10 deletions
diff --git a/pkgs/development/interpreters/lua-5/build-lua-package.nix b/pkgs/development/interpreters/lua-5/build-lua-package.nix
index 3b16ca68342..f46f88f5e1f 100644
--- a/pkgs/development/interpreters/lua-5/build-lua-package.nix
+++ b/pkgs/development/interpreters/lua-5/build-lua-package.nix
@@ -56,7 +56,7 @@ name ? "${attrs.pname}-${attrs.version}"
 # Appended to the generated luarocks config
 , extraConfig ? ""
 # Inserted into the generated luarocks config in the "variables" table
-, extraVariables ? ""
+, extraVariables ? {}
 # The two above arguments have access to builder variables -- e.g. to $out
 
 # relative to srcRoot, path to the rockspec to use when using rocks
@@ -77,7 +77,10 @@ let
   # luarocks only looks for rockspecs in the default/system tree instead of all
   # configured trees)
   luarocks_config = "luarocks-config.lua";
-  luarocks_content = ''
+  luarocks_content = let
+    extraVariablesStr = lib.concatStringsSep "\n "
+      (lib.mapAttrsToList (k: v: "${k}='${v}';") extraVariables);
+  in ''
     local_cache = ""
     -- To prevent collisions when creating environments, we install the rock
     -- files into per-package subdirectories
@@ -105,8 +108,8 @@ let
       -- Some needed machinery to handle multiple-output external dependencies,
       -- as per https://github.com/luarocks/luarocks/issues/766
       ${lib.optionalString (lib.length depVariables > 0) ''
-      ${lib.concatStringsSep "\n  " depVariables}''}
-      ${extraVariables}
+        ${lib.concatStringsSep "\n  " depVariables}''}
+      ${extraVariablesStr}
     }
     ${extraConfig}
   '';
@@ -139,7 +142,7 @@ let
   externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
 in
 toLuaModule ( lua.stdenv.mkDerivation (
-builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps"] // {
+builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // {
 
   name = namePrefix + name;
 
diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix
index fd99a70de3a..cb429e59c92 100644
--- a/pkgs/development/lua-modules/overrides.nix
+++ b/pkgs/development/lua-modules/overrides.nix
@@ -153,11 +153,11 @@ with super;
   });
 
   luadbi-mysql = super.luadbi-mysql.override({
-    extraVariables = ''
-      -- Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
-      MYSQL_INCDIR='${pkgs.libmysqlclient}/include/mysql';
-      MYSQL_LIBDIR='${pkgs.libmysqlclient}/lib/mysql';
-    '';
+    extraVariables = {
+      # Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
+      MYSQL_INCDIR="${pkgs.libmysqlclient}/include/mysql";
+      MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
+    };
     buildInputs = [
       pkgs.mysql.client
       pkgs.libmysqlclient