buildLuarocksPackage: extraVariables is now an attrset
This commit is contained in:
parent
7aee5b838b
commit
6eeb434b33
@ -56,7 +56,7 @@ name ? "${attrs.pname}-${attrs.version}"
|
|||||||
# Appended to the generated luarocks config
|
# Appended to the generated luarocks config
|
||||||
, extraConfig ? ""
|
, extraConfig ? ""
|
||||||
# Inserted into the generated luarocks config in the "variables" table
|
# 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
|
# 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
|
# 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
|
# luarocks only looks for rockspecs in the default/system tree instead of all
|
||||||
# configured trees)
|
# configured trees)
|
||||||
luarocks_config = "luarocks-config.lua";
|
luarocks_config = "luarocks-config.lua";
|
||||||
luarocks_content = ''
|
luarocks_content = let
|
||||||
|
extraVariablesStr = lib.concatStringsSep "\n "
|
||||||
|
(lib.mapAttrsToList (k: v: "${k}='${v}';") extraVariables);
|
||||||
|
in ''
|
||||||
local_cache = ""
|
local_cache = ""
|
||||||
-- To prevent collisions when creating environments, we install the rock
|
-- To prevent collisions when creating environments, we install the rock
|
||||||
-- files into per-package subdirectories
|
-- files into per-package subdirectories
|
||||||
@ -106,7 +109,7 @@ let
|
|||||||
-- as per https://github.com/luarocks/luarocks/issues/766
|
-- as per https://github.com/luarocks/luarocks/issues/766
|
||||||
${lib.optionalString (lib.length depVariables > 0) ''
|
${lib.optionalString (lib.length depVariables > 0) ''
|
||||||
${lib.concatStringsSep "\n " depVariables}''}
|
${lib.concatStringsSep "\n " depVariables}''}
|
||||||
${extraVariables}
|
${extraVariablesStr}
|
||||||
}
|
}
|
||||||
${extraConfig}
|
${extraConfig}
|
||||||
'';
|
'';
|
||||||
@ -139,7 +142,7 @@ let
|
|||||||
externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
|
externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
|
||||||
in
|
in
|
||||||
toLuaModule ( lua.stdenv.mkDerivation (
|
toLuaModule ( lua.stdenv.mkDerivation (
|
||||||
builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps"] // {
|
builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // {
|
||||||
|
|
||||||
name = namePrefix + name;
|
name = namePrefix + name;
|
||||||
|
|
||||||
|
@ -153,11 +153,11 @@ with super;
|
|||||||
});
|
});
|
||||||
|
|
||||||
luadbi-mysql = super.luadbi-mysql.override({
|
luadbi-mysql = super.luadbi-mysql.override({
|
||||||
extraVariables = ''
|
extraVariables = {
|
||||||
-- Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
|
# Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
|
||||||
MYSQL_INCDIR='${pkgs.libmysqlclient}/include/mysql';
|
MYSQL_INCDIR="${pkgs.libmysqlclient}/include/mysql";
|
||||||
MYSQL_LIBDIR='${pkgs.libmysqlclient}/lib/mysql';
|
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
|
||||||
'';
|
};
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgs.mysql.client
|
pkgs.mysql.client
|
||||||
pkgs.libmysqlclient
|
pkgs.libmysqlclient
|
||||||
|
Loading…
x
Reference in New Issue
Block a user