luaPackages: update

- luarocks-nix: bumped to pass args too, `package_X = callPackage ...`.
  It allows to remove the annoying `with self`.
  This new version disables tests (because broken) and now emits derivation
  with a callPackage in front.
- replaced X.override with lib.overrideLuarocks, it should be used
whenever buildInputs/extraVariables is changed since it impacts the
generated luarocks config.
Once structured attributes are in, it will be easier to have the
luarocks config generated by a hook and we probably will be able to
replace all overrideLuarocks by overrideAttrs.
This commit is contained in:
Matthieu Coudron 2021-10-04 00:10:46 +02:00 committed by Matthieu Coudron
parent ecd018bb00
commit 253af9151f
7 changed files with 626 additions and 369 deletions

View file

@ -33,8 +33,7 @@ TMP_FILE="$(mktemp)"
GENERATED_NIXFILE="pkgs/development/lua-modules/generated-packages.nix" GENERATED_NIXFILE="pkgs/development/lua-modules/generated-packages.nix"
LUAROCKS_CONFIG="$NIXPKGS_PATH/maintainers/scripts/luarocks-config.lua" LUAROCKS_CONFIG="$NIXPKGS_PATH/maintainers/scripts/luarocks-config.lua"
HEADER = """ HEADER = """/* {GENERATED_NIXFILE} is an auto-generated file -- DO NOT EDIT!
/* {GENERATED_NIXFILE} is an auto-generated file -- DO NOT EDIT!
Regenerate it with: Regenerate it with:
nixpkgs$ ./maintainers/scripts/update-luarocks-packages nixpkgs$ ./maintainers/scripts/update-luarocks-packages
@ -99,9 +98,8 @@ class LuaEditor(Editor):
header2 = textwrap.dedent( header2 = textwrap.dedent(
# header2 = inspect.cleandoc( # header2 = inspect.cleandoc(
""" """
{ self, stdenv, lib, fetchurl, fetchgit, ... } @ args: { self, stdenv, lib, fetchurl, fetchgit, callPackage, ... } @ args:
self: super: final: prev:
with self;
{ {
""") """)
f.write(header2) f.write(header2)
@ -199,6 +197,7 @@ def generate_pkg_nix(plug: LuaPlugin):
log.debug("running %s", ' '.join(cmd)) log.debug("running %s", ' '.join(cmd))
output = subprocess.check_output(cmd, text=True) output = subprocess.check_output(cmd, text=True)
output = "callPackage(" + output.strip() + ") {};\n\n"
return (plug, output) return (plug, output)
def main(): def main():

View file

@ -25,7 +25,6 @@ pname
# propagate build dependencies so in case we have A -> B -> C, # propagate build dependencies so in case we have A -> B -> C,
# C can import package A propagated by B # C can import package A propagated by B
, propagatedBuildInputs ? [] , propagatedBuildInputs ? []
, propagatedNativeBuildInputs ? []
# used to disable derivation, useful for specific lua versions # used to disable derivation, useful for specific lua versions
# TODO move from this setting meta.broken to a 'disabled' attribute on the # TODO move from this setting meta.broken to a 'disabled' attribute on the
@ -50,7 +49,7 @@ pname
# The latter is used to work-around luarocks having a problem with # The latter is used to work-around luarocks having a problem with
# multiple-output derivations as external deps: # multiple-output derivations as external deps:
# https://github.com/luarocks/luarocks/issues/766<Paste> # https://github.com/luarocks/luarocks/issues/766<Paste>
, externalDeps ? lib.unique (lib.filter (drv: !drv ? luaModule) (propagatedBuildInputs ++ buildInputs)) , externalDeps ? []
# Appended to the generated luarocks config # Appended to the generated luarocks config
, extraConfig ? "" , extraConfig ? ""
@ -74,7 +73,6 @@ pname
let let
generatedRockspecFilename = "${rockspecDir}/${pname}-${version}.rockspec"; generatedRockspecFilename = "${rockspecDir}/${pname}-${version}.rockspec";
# TODO fix warnings "Couldn't load rockspec for ..." during manifest # TODO fix warnings "Couldn't load rockspec for ..." during manifest
# construction -- from initial investigation, appears it will require # construction -- from initial investigation, appears it will require
# upstream luarocks changes to fix cleanly (during manifest construction, # upstream luarocks changes to fix cleanly (during manifest construction,
@ -83,7 +81,7 @@ let
luarocks_config = "luarocks-config.lua"; luarocks_config = "luarocks-config.lua";
luarocks_content = let luarocks_content = let
generatedConfig = lua.pkgs.lib.generateLuarocksConfig { generatedConfig = lua.pkgs.lib.generateLuarocksConfig {
inherit externalDeps; externalDeps = externalDeps ++ externalDepsGenerated;
inherit extraVariables; inherit extraVariables;
inherit rocksSubdir; inherit rocksSubdir;
inherit requiredLuaRocks; inherit requiredLuaRocks;
@ -99,12 +97,13 @@ let
# Filter out the lua derivation itself from the Lua module dependency # Filter out the lua derivation itself from the Lua module dependency
# closure, as it doesn't have a rock tree :) # closure, as it doesn't have a rock tree :)
requiredLuaRocks = lib.filter (d: d ? luaModule) requiredLuaRocks = lib.filter (d: d ? luaModule)
(lua.pkgs.requiredLuaModules propagatedBuildInputs); (lua.pkgs.requiredLuaModules luarocksDrv.propagatedBuildInputs);
# example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ] # example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ]
externalDepsGenerated = lib.unique (lib.filter (drv: !drv ? luaModule) (luarocksDrv.propagatedBuildInputs ++ luarocksDrv.buildInputs));
externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps; externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
in
toLuaModule ( lua.stdenv.mkDerivation ( luarocksDrv = toLuaModule ( lua.stdenv.mkDerivation (
builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // { builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariables"] // {
name = namePrefix + pname + "-" + version; name = namePrefix + pname + "-" + version;
@ -146,13 +145,12 @@ builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariab
runHook postConfigure runHook postConfigure
''; '';
# TODO could be moved to configurePhase
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
nix_debug "Using LUAROCKS_CONFIG=$LUAROCKS_CONFIG" nix_debug "Using LUAROCKS_CONFIG=$LUAROCKS_CONFIG"
LUAROCKS=luarocks LUAROCKS=${lua.pkgs.luarocks}/bin/luarocks
if (( ''${NIX_DEBUG:-0} >= 1 )); then if (( ''${NIX_DEBUG:-0} >= 1 )); then
LUAROCKS="$LUAROCKS --verbose" LUAROCKS="$LUAROCKS --verbose"
fi fi
@ -195,6 +193,7 @@ builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariab
passthru = { passthru = {
inherit lua; # The lua interpreter inherit lua; # The lua interpreter
inherit externalDeps; inherit externalDeps;
inherit luarocks_content;
} // passthru; } // passthru;
meta = { meta = {
@ -203,4 +202,6 @@ builtins.removeAttrs attrs ["disabled" "checkInputs" "externalDeps" "extraVariab
maintainers = (meta.maintainers or []) ++ [ ]; maintainers = (meta.maintainers or []) ++ [ ];
broken = disabled; broken = disabled;
} // meta; } // meta;
})) }));
in
luarocksDrv

View file

@ -15,7 +15,7 @@ let
overridenPackages = import ./overrides.nix { inherit pkgs; }; overridenPackages = import ./overrides.nix { inherit pkgs; };
generatedPackages = if (builtins.pathExists ./generated-packages.nix) then generatedPackages = if (builtins.pathExists ./generated-packages.nix) then
pkgs.callPackage ./generated-packages.nix { } else (final: prev: {}); (final: prev: pkgs.callPackage ./generated-packages.nix { inherit (final) callPackage; } final prev) else (final: prev: {});
extensible-self = lib.makeExtensible extensible-self = lib.makeExtensible
(extends overrides (extends overrides

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,20 @@ let
in unique ([lua] ++ modules ++ concatLists (catAttrs "requiredLuaModules" modules)); in unique ([lua] ++ modules ++ concatLists (catAttrs "requiredLuaModules" modules));
# Check whether a derivation provides a lua module. # Check whether a derivation provides a lua module.
hasLuaModule = drv: drv ? luaModule; hasLuaModule = drv: drv ? luaModule;
/*
Use this to override the arguments passed to buildLuarocksPackage
*/
overrideLuarocks = drv: f: (drv.override (args: args // {
buildLuarocksPackage = drv: (args.buildLuarocksPackage drv).override f;
})) // {
overrideScope = scope: overrideLuarocks (drv.overrideScope scope) f;
};
in in
rec { rec {
inherit overrideLuarocks;
inherit hasLuaModule requiredLuaModules; inherit hasLuaModule requiredLuaModules;
luaPathList = [ luaPathList = [

View file

@ -1,11 +1,11 @@
{ pkgs, ... }: { pkgs }:
self: super: final: prev:
with super; with prev;
{ {
##########################################3 ##########################################3
#### manual fixes for generated packages #### manual fixes for generated packages
##########################################3 ##########################################3
bit32 = super.bit32.override({ bit32 = prev.bit32.overrideAttrs(oa: {
# Small patch in order to no longer redefine a Lua 5.2 function that Luajit # Small patch in order to no longer redefine a Lua 5.2 function that Luajit
# 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for # 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for
# more # more
@ -14,7 +14,7 @@ with super;
]; ];
}); });
busted = super.busted.override({ busted = prev.busted.overrideAttrs(oa: {
postConfigure = '' postConfigure = ''
substituteInPlace ''${rockspecFilename} \ substituteInPlace ''${rockspecFilename} \
--replace "'lua_cliargs = 3.0-1'," "'lua_cliargs >= 3.0-1'," --replace "'lua_cliargs = 3.0-1'," "'lua_cliargs >= 3.0-1',"
@ -25,14 +25,7 @@ with super;
''; '';
}); });
cqueues = super.cqueues.override(rec { cqueues = (prev.lib.overrideLuarocks prev.cqueues (drv: {
# Parse out a version number without the Lua version inserted
version = with pkgs.lib; let
version' = super.cqueues.version;
rel = splitVersion version';
date = head rel;
rev = last (splitString "-" (last rel));
in "${date}-${rev}";
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.gnum4 pkgs.gnum4
]; ];
@ -41,9 +34,17 @@ with super;
{ name = "OPENSSL"; dep = pkgs.openssl; } { name = "OPENSSL"; dep = pkgs.openssl; }
]; ];
disabled = luaOlder "5.1" || luaAtLeast "5.4"; disabled = luaOlder "5.1" || luaAtLeast "5.4";
})).overrideAttrs(oa: rec {
# Parse out a version number without the Lua version inserted
version = with pkgs.lib; let
version' = prev.cqueues.version;
rel = splitVersion version';
date = head rel;
rev = last (splitString "-" (last rel));
in "${date}-${rev}";
# Upstream rockspec is pointlessly broken into separate rockspecs, per Lua # Upstream rockspec is pointlessly broken into separate rockspecs, per Lua
# version, which doesn't work well for us, so modify it # version, which doesn't work well for us, so modify it
postConfigure = let inherit (super.cqueues) pname; in '' postConfigure = let inherit (prev.cqueues) pname; in ''
# 'all' target auto-detects correct Lua version, which is fine for us as # 'all' target auto-detects correct Lua version, which is fine for us as
# we only have the right one available :) # we only have the right one available :)
sed -Ei ''${rockspecFilename} \ sed -Ei ''${rockspecFilename} \
@ -56,13 +57,13 @@ with super;
''; '';
}); });
cyrussasl = super.cyrussasl.override({ cyrussasl = prev.lib.overrideLuarocks prev.cyrussasl (drv: {
externalDeps = [ externalDeps = [
{ name = "LIBSASL"; dep = pkgs.cyrus_sasl; } { name = "LIBSASL"; dep = pkgs.cyrus_sasl; }
]; ];
}); });
http = super.http.override({ http = prev.http.overrideAttrs(oa: {
patches = [ patches = [
(pkgs.fetchpatch { (pkgs.fetchpatch {
name = "invalid-state-progression.patch"; name = "invalid-state-progression.patch";
@ -76,7 +77,7 @@ with super;
*/ */
}); });
ldbus = super.ldbus.override({ ldbus = prev.lib.overrideLuarocks prev.ldbus (drv: {
extraVariables = { extraVariables = {
DBUS_DIR="${pkgs.dbus.lib}"; DBUS_DIR="${pkgs.dbus.lib}";
DBUS_ARCH_INCDIR="${pkgs.dbus.lib}/lib/dbus-1.0/include"; DBUS_ARCH_INCDIR="${pkgs.dbus.lib}/lib/dbus-1.0/include";
@ -87,7 +88,7 @@ with super;
]; ];
}); });
ljsyscall = super.ljsyscall.override(rec { ljsyscall = prev.ljsyscall.overrideAttrs(oa: rec {
version = "unstable-20180515"; version = "unstable-20180515";
# package hasn't seen any release for a long time # package hasn't seen any release for a long time
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
@ -106,7 +107,7 @@ with super;
propagatedBuildInputs = with pkgs.lib; optional (!isLuaJIT) luaffi; propagatedBuildInputs = with pkgs.lib; optional (!isLuaJIT) luaffi;
}); });
lgi = super.lgi.override({ lgi = prev.lib.overrideLuarocks prev.lgi (drv: {
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.pkg-config pkgs.pkg-config
]; ];
@ -128,31 +129,31 @@ with super;
''; '';
}); });
lrexlib-gnu = super.lrexlib-gnu.override({ lrexlib-gnu = prev.lib.overrideLuarocks prev.lrexlib-gnu (drv: {
buildInputs = [ buildInputs = [
pkgs.gnulib pkgs.gnulib
]; ];
}); });
lrexlib-pcre = super.lrexlib-pcre.override({ lrexlib-pcre = prev.lib.overrideLuarocks prev.lrexlib-pcre (drv: {
externalDeps = [ externalDeps = [
{ name = "PCRE"; dep = pkgs.pcre; } { name = "PCRE"; dep = pkgs.pcre; }
]; ];
}); });
lrexlib-posix = super.lrexlib-posix.override({ lrexlib-posix = prev.lib.overrideLuarocks prev.lrexlib-posix (drv: {
buildInputs = [ buildInputs = [
pkgs.glibc.dev pkgs.glibc.dev
]; ];
}); });
lua-iconv = super.lua-iconv.override({ lua-iconv = prev.lib.overrideLuarocks prev.lua-iconv (drv: {
buildInputs = [ buildInputs = [
pkgs.libiconv pkgs.libiconv
]; ];
}); });
lua-lsp = super.lua-lsp.override({ lua-lsp = prev.lua-lsp.overrideAttrs(oa: {
# until Alloyed/lua-lsp#28 # until Alloyed/lua-lsp#28
postConfigure = '' postConfigure = ''
substituteInPlace ''${rockspecFilename} \ substituteInPlace ''${rockspecFilename} \
@ -160,14 +161,14 @@ with super;
''; '';
}); });
lua-zlib = super.lua-zlib.override({ lua-zlib = prev.lib.overrideLuarocks prev.lua-zlib (drv: {
buildInputs = [ buildInputs = [
pkgs.zlib.dev pkgs.zlib.dev
]; ];
disabled = luaOlder "5.1" || luaAtLeast "5.4"; disabled = luaOlder "5.1" || luaAtLeast "5.4";
}); });
luadbi-mysql = super.luadbi-mysql.override({ luadbi-mysql = prev.lib.overrideLuarocks prev.luadbi-mysql (drv: {
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.dev}/include/mysql"; MYSQL_INCDIR="${pkgs.libmysqlclient.dev}/include/mysql";
@ -179,19 +180,19 @@ with super;
]; ];
}); });
luadbi-postgresql = super.luadbi-postgresql.override({ luadbi-postgresql = prev.lib.overrideLuarocks prev.luadbi-postgresql (drv: {
buildInputs = [ buildInputs = [
pkgs.postgresql pkgs.postgresql
]; ];
}); });
luadbi-sqlite3 = super.luadbi-sqlite3.override({ luadbi-sqlite3 = prev.lib.overrideLuarocks prev.luadbi-sqlite3 (drv: {
externalDeps = [ externalDeps = [
{ name = "SQLITE"; dep = pkgs.sqlite; } { name = "SQLITE"; dep = pkgs.sqlite; }
]; ];
}); });
luaevent = super.luaevent.override({ luaevent = prev.lib.overrideLuarocks prev.luaevent (drv: {
propagatedBuildInputs = [ propagatedBuildInputs = [
luasocket luasocket
]; ];
@ -201,7 +202,7 @@ with super;
disabled = luaOlder "5.1" || luaAtLeast "5.4"; disabled = luaOlder "5.1" || luaAtLeast "5.4";
}); });
luaexpat = super.luaexpat.override({ luaexpat = prev.lib.overrideLuarocks prev.luaexpat (drv: {
externalDeps = [ externalDeps = [
{ name = "EXPAT"; dep = pkgs.expat; } { name = "EXPAT"; dep = pkgs.expat; }
]; ];
@ -212,59 +213,57 @@ with super;
# TODO Somehow automatically amend buildInputs for things that need luaffi # TODO Somehow automatically amend buildInputs for things that need luaffi
# but are in luajitPackages? # but are in luajitPackages?
luaffi = super.luaffi.override({ luaffi = prev.lib.overrideLuarocks prev.luaffi (drv: {
# The packaged .src.rock version is pretty old, and doesn't work with Lua 5.3 # The packaged .src.rock version is pretty old, and doesn't work with Lua 5.3
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "facebook"; repo = "luaffifb"; owner = "facebook"; repo = "luaffifb";
rev = "532c757e51c86f546a85730b71c9fef15ffa633d"; rev = "532c757e51c86f546a85730b71c9fef15ffa633d";
sha256 = "1nwx6sh56zfq99rcs7sph0296jf6a9z72mxknn0ysw9fd7m1r8ig"; sha256 = "1nwx6sh56zfq99rcs7sph0296jf6a9z72mxknn0ysw9fd7m1r8ig";
}; };
knownRockspec = with super.luaffi; "${pname}-${version}.rockspec"; knownRockspec = with prev.luaffi; "${pname}-${version}.rockspec";
disabled = luaOlder "5.1" || luaAtLeast "5.4" || isLuaJIT; disabled = luaOlder "5.1" || luaAtLeast "5.4" || isLuaJIT;
}); });
luaossl = super.luaossl.override({ luaossl = prev.lib.overrideLuarocks prev.luaossl (drv: {
externalDeps = [ externalDeps = [
{ name = "CRYPTO"; dep = pkgs.openssl; } { name = "CRYPTO"; dep = pkgs.openssl; }
{ name = "OPENSSL"; dep = pkgs.openssl; } { name = "OPENSSL"; dep = pkgs.openssl; }
]; ];
}); });
luasec = super.luasec.override({ luasec = prev.lib.overrideLuarocks prev.luasec (drv: {
externalDeps = [ externalDeps = [
{ name = "OPENSSL"; dep = pkgs.openssl; } { name = "OPENSSL"; dep = pkgs.openssl; }
]; ];
}); });
luasql-sqlite3 = super.luasql-sqlite3.override({ luasql-sqlite3 = prev.lib.overrideLuarocks prev.luasql-sqlite3 (drv: {
externalDeps = [ externalDeps = [
{ name = "SQLITE"; dep = pkgs.sqlite; } { name = "SQLITE"; dep = pkgs.sqlite; }
]; ];
}); });
luasystem = super.luasystem.override({ luasystem = prev.lib.overrideLuarocks prev.luasystem (drv: { buildInputs = [ pkgs.glibc.out ]; });
buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.glibc
];
});
luazip = super.luazip.override({ luazip = prev.lib.overrideLuarocks prev.luazip (drv: {
buildInputs = [ buildInputs = [
pkgs.zziplib pkgs.zziplib
]; ];
}); });
lua-yajl = super.lua-yajl.override({ lua-yajl = prev.lib.overrideLuarocks prev.lua-yajl (drv: {
buildInputs = [ buildInputs = [
pkgs.yajl pkgs.yajl
]; ];
}); });
luuid = super.luuid.override(old: { luuid = (prev.lib.overrideLuarocks prev.luuid (drv: {
externalDeps = [ externalDeps = [
{ name = "LIBUUID"; dep = pkgs.libuuid; } { name = "LIBUUID"; dep = pkgs.libuuid; }
]; ];
meta = old.meta // { disabled = luaOlder "5.1" || (luaAtLeast "5.4");
})).overrideAttrs(oa: {
meta = oa.meta // {
platforms = pkgs.lib.platforms.linux; platforms = pkgs.lib.platforms.linux;
}; };
# Trivial patch to make it work in both 5.1 and 5.2. Basically just the # Trivial patch to make it work in both 5.1 and 5.2. Basically just the
@ -276,13 +275,12 @@ with super;
patches = [ patches = [
./luuid.patch ./luuid.patch
]; ];
postConfigure = let inherit (super.luuid) version pname; in '' postConfigure = let inherit (prev.luuid) version pname; in ''
sed -Ei ''${rockspecFilename} -e 's|lua >= 5.2|lua >= 5.1,|' sed -Ei ''${rockspecFilename} -e 's|lua >= 5.2|lua >= 5.1,|'
''; '';
disabled = luaOlder "5.1" || (luaAtLeast "5.4");
}); });
luv = super.luv.override({ luv = prev.lib.overrideLuarocks prev.luv (drv: {
# Use system libuv instead of building local and statically linking # Use system libuv instead of building local and statically linking
# This is a hacky way to specify -DWITH_SHARED_LIBUV=ON which # This is a hacky way to specify -DWITH_SHARED_LIBUV=ON which
# is not possible with luarocks and the current luv rockspec # is not possible with luarocks and the current luv rockspec
@ -296,8 +294,8 @@ with super;
buildInputs = [ pkgs.libuv ]; buildInputs = [ pkgs.libuv ];
passthru = { passthru = {
libluv = self.luv.override ({ libluv = final.luv.overrideAttrs (oa: {
preBuild = self.luv.preBuild + '' preBuild = final.luv.preBuild + ''
sed -i 's,\(option(BUILD_MODULE.*\)ON,\1OFF,' CMakeLists.txt sed -i 's,\(option(BUILD_MODULE.*\)ON,\1OFF,' CMakeLists.txt
sed -i 's,\(option(BUILD_SHARED_LIBS.*\)OFF,\1ON,' CMakeLists.txt sed -i 's,\(option(BUILD_SHARED_LIBS.*\)OFF,\1ON,' CMakeLists.txt
sed -i 's,${"\${.*INSTALL_INC_DIR}"},${placeholder "out"}/include/luv,' CMakeLists.txt sed -i 's,${"\${.*INSTALL_INC_DIR}"},${placeholder "out"}/include/luv,' CMakeLists.txt
@ -312,32 +310,32 @@ with super;
}; };
}); });
lyaml = super.lyaml.override({ lyaml = prev.lib.overrideLuarocks prev.lyaml (oa: {
buildInputs = [ buildInputs = [
pkgs.libyaml pkgs.libyaml
]; ];
}); });
mpack = super.mpack.override({ mpack = prev.lib.overrideLuarocks prev.mpack (drv: {
buildInputs = [ pkgs.libmpack ]; buildInputs = [ pkgs.libmpack ];
# the rockspec doesn't use the makefile so you may need to export more flags # the rockspec doesn't use the makefile so you may need to export more flags
USE_SYSTEM_LUA = "yes"; USE_SYSTEM_LUA = "yes";
USE_SYSTEM_MPACK = "yes"; USE_SYSTEM_MPACK = "yes";
}); });
rapidjson = super.rapidjson.override({ rapidjson = prev.rapidjson.overrideAttrs(oa: {
preBuild = '' preBuild = ''
sed -i '/set(CMAKE_CXX_FLAGS/d' CMakeLists.txt sed -i '/set(CMAKE_CXX_FLAGS/d' CMakeLists.txt
sed -i '/set(CMAKE_C_FLAGS/d' CMakeLists.txt sed -i '/set(CMAKE_C_FLAGS/d' CMakeLists.txt
''; '';
}); });
readline = (super.readline.override ({ readline = (prev.lib.overrideLuarocks prev.readline (drv: {
unpackCmd = '' unpackCmd = ''
unzip "$curSrc" unzip "$curSrc"
tar xf *.tar.gz tar xf *.tar.gz
''; '';
propagatedBuildInputs = super.readline.propagatedBuildInputs ++ [ pkgs.readline ]; propagatedBuildInputs = prev.readline.propagatedBuildInputs ++ [ pkgs.readline.out ];
extraVariables = rec { extraVariables = rec {
READLINE_INCDIR = "${pkgs.readline.dev}/include"; READLINE_INCDIR = "${pkgs.readline.dev}/include";
HISTORY_INCDIR = READLINE_INCDIR; HISTORY_INCDIR = READLINE_INCDIR;
@ -349,14 +347,14 @@ with super;
''; '';
}); });
std-_debug = super.std-_debug.overrideAttrs(oa: { std-_debug = prev.std-_debug.overrideAttrs(oa: {
# run make to generate lib/std/_debug/version.lua # run make to generate lib/std/_debug/version.lua
preConfigure = '' preConfigure = ''
make all make all
''; '';
}); });
std-normalize = super.std-normalize.overrideAttrs(oa: { std-normalize = prev.std-normalize.overrideAttrs(oa: {
# run make to generate lib/std/_debug/version.lua # run make to generate lib/std/_debug/version.lua
preConfigure = '' preConfigure = ''
make all make all
@ -365,10 +363,10 @@ with super;
# TODO just while testing, remove afterwards # TODO just while testing, remove afterwards
# toVimPlugin should do it instead # toVimPlugin should do it instead
gitsigns-nvim = super.gitsigns-nvim.overrideAttrs(oa: { gitsigns-nvim = prev.gitsigns-nvim.overrideAttrs(oa: {
nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ pkgs.vimUtils.vimGenDocHook ]; nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ pkgs.vimUtils.vimGenDocHook ];
}); });
# aliases # aliases
cjson = super.lua-cjson; cjson = prev.lua-cjson;
} }

View file

@ -5,8 +5,8 @@ luarocks.overrideAttrs(old: {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "nix-community"; owner = "nix-community";
repo = "luarocks-nix"; repo = "luarocks-nix";
rev = "test-speedup"; rev = "standalone";
sha256 = "sha256-WfzLSpIp0V7Ib4sjYvoJHF+/vHaieccvfVAr5W47QsQ="; sha256 = "sha256-53Zi+GTayO9EQTCIVrzPeRRHeIkHLqy0mHyBDzbcQQk=";
}; };
patches = []; patches = [];