diff options
Diffstat (limited to 'pkgs/development/lua-modules/overrides.nix')
-rw-r--r-- | pkgs/development/lua-modules/overrides.nix | 114 |
1 files changed, 56 insertions, 58 deletions
diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index 399dbd8269b76..f01fb7df1172e 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -1,11 +1,11 @@ -{ pkgs, ... }: -self: super: -with super; +{ pkgs }: +final: prev: +with prev; { ##########################################3 #### manual fixes for generated packages ##########################################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 # 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for # more @@ -14,7 +14,7 @@ with super; ]; }); - busted = super.busted.override({ + busted = prev.busted.overrideAttrs(oa: { postConfigure = '' substituteInPlace ''${rockspecFilename} \ --replace "'lua_cliargs = 3.0-1'," "'lua_cliargs >= 3.0-1'," @@ -25,14 +25,7 @@ with super; ''; }); - cqueues = super.cqueues.override(rec { - # 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}"; + cqueues = (prev.lib.overrideLuarocks prev.cqueues (drv: { nativeBuildInputs = [ pkgs.gnum4 ]; @@ -41,9 +34,17 @@ with super; { name = "OPENSSL"; dep = pkgs.openssl; } ]; 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 # 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 # we only have the right one available :) sed -Ei ''${rockspecFilename} \ @@ -56,13 +57,13 @@ with super; ''; }); - cyrussasl = super.cyrussasl.override({ + cyrussasl = prev.lib.overrideLuarocks prev.cyrussasl (drv: { externalDeps = [ { name = "LIBSASL"; dep = pkgs.cyrus_sasl; } ]; }); - http = super.http.override({ + http = prev.http.overrideAttrs(oa: { patches = [ (pkgs.fetchpatch { name = "invalid-state-progression.patch"; @@ -76,7 +77,7 @@ with super; */ }); - ldbus = super.ldbus.override({ + ldbus = prev.lib.overrideLuarocks prev.ldbus (drv: { extraVariables = { DBUS_DIR="${pkgs.dbus.lib}"; 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"; # package hasn't seen any release for a long time src = pkgs.fetchFromGitHub { @@ -106,7 +107,7 @@ with super; propagatedBuildInputs = with pkgs.lib; optional (!isLuaJIT) luaffi; }); - lgi = super.lgi.override({ + lgi = prev.lib.overrideLuarocks prev.lgi (drv: { nativeBuildInputs = [ 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 = [ pkgs.gnulib ]; }); - lrexlib-pcre = super.lrexlib-pcre.override({ + lrexlib-pcre = prev.lib.overrideLuarocks prev.lrexlib-pcre (drv: { externalDeps = [ { name = "PCRE"; dep = pkgs.pcre; } ]; }); - lrexlib-posix = super.lrexlib-posix.override({ + lrexlib-posix = prev.lib.overrideLuarocks prev.lrexlib-posix (drv: { buildInputs = [ pkgs.glibc.dev ]; }); - lua-iconv = super.lua-iconv.override({ + lua-iconv = prev.lib.overrideLuarocks prev.lua-iconv (drv: { buildInputs = [ pkgs.libiconv ]; }); - lua-lsp = super.lua-lsp.override({ + lua-lsp = prev.lua-lsp.overrideAttrs(oa: { # until Alloyed/lua-lsp#28 postConfigure = '' substituteInPlace ''${rockspecFilename} \ @@ -160,14 +161,14 @@ with super; ''; }); - lua-zlib = super.lua-zlib.override({ + lua-zlib = prev.lib.overrideLuarocks prev.lua-zlib (drv: { buildInputs = [ pkgs.zlib.dev ]; disabled = luaOlder "5.1" || luaAtLeast "5.4"; }); - luadbi-mysql = super.luadbi-mysql.override({ + luadbi-mysql = prev.lib.overrideLuarocks prev.luadbi-mysql (drv: { extraVariables = { # Can't just be /include and /lib, unfortunately needs the trailing '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 = [ pkgs.postgresql ]; }); - luadbi-sqlite3 = super.luadbi-sqlite3.override({ + luadbi-sqlite3 = prev.lib.overrideLuarocks prev.luadbi-sqlite3 (drv: { externalDeps = [ { name = "SQLITE"; dep = pkgs.sqlite; } ]; }); - luaevent = super.luaevent.override({ + luaevent = prev.lib.overrideLuarocks prev.luaevent (drv: { propagatedBuildInputs = [ luasocket ]; @@ -201,7 +202,7 @@ with super; disabled = luaOlder "5.1" || luaAtLeast "5.4"; }); - luaexpat = super.luaexpat.override({ + luaexpat = prev.lib.overrideLuarocks prev.luaexpat (drv: { externalDeps = [ { name = "EXPAT"; dep = pkgs.expat; } ]; @@ -212,59 +213,57 @@ with super; # TODO Somehow automatically amend buildInputs for things that need luaffi # 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 src = pkgs.fetchFromGitHub { owner = "facebook"; repo = "luaffifb"; rev = "532c757e51c86f546a85730b71c9fef15ffa633d"; sha256 = "1nwx6sh56zfq99rcs7sph0296jf6a9z72mxknn0ysw9fd7m1r8ig"; }; - knownRockspec = with super.luaffi; "${pname}-${version}.rockspec"; + knownRockspec = with prev.luaffi; "${pname}-${version}.rockspec"; disabled = luaOlder "5.1" || luaAtLeast "5.4" || isLuaJIT; }); - luaossl = super.luaossl.override({ + luaossl = prev.lib.overrideLuarocks prev.luaossl (drv: { externalDeps = [ { name = "CRYPTO"; dep = pkgs.openssl; } { name = "OPENSSL"; dep = pkgs.openssl; } ]; }); - luasec = super.luasec.override({ + luasec = prev.lib.overrideLuarocks prev.luasec (drv: { externalDeps = [ { name = "OPENSSL"; dep = pkgs.openssl; } ]; }); - luasql-sqlite3 = super.luasql-sqlite3.override({ + luasql-sqlite3 = prev.lib.overrideLuarocks prev.luasql-sqlite3 (drv: { externalDeps = [ { name = "SQLITE"; dep = pkgs.sqlite; } ]; }); - luasystem = super.luasystem.override({ - buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [ - pkgs.glibc - ]; - }); + luasystem = prev.lib.overrideLuarocks prev.luasystem (drv: { buildInputs = [ pkgs.glibc.out ]; }); - luazip = super.luazip.override({ + luazip = prev.lib.overrideLuarocks prev.luazip (drv: { buildInputs = [ pkgs.zziplib ]; }); - lua-yajl = super.lua-yajl.override({ + lua-yajl = prev.lib.overrideLuarocks prev.lua-yajl (drv: { buildInputs = [ pkgs.yajl ]; }); - luuid = super.luuid.override(old: { + luuid = (prev.lib.overrideLuarocks prev.luuid (drv: { externalDeps = [ { 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; }; # Trivial patch to make it work in both 5.1 and 5.2. Basically just the @@ -276,13 +275,12 @@ with super; patches = [ ./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,|' ''; - 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 # This is a hacky way to specify -DWITH_SHARED_LIBUV=ON which # is not possible with luarocks and the current luv rockspec @@ -296,8 +294,8 @@ with super; buildInputs = [ pkgs.libuv ]; passthru = { - libluv = self.luv.override ({ - preBuild = self.luv.preBuild + '' + libluv = final.luv.overrideAttrs (oa: { + preBuild = final.luv.preBuild + '' sed -i 's,\(option(BUILD_MODULE.*\)ON,\1OFF,' 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 @@ -312,32 +310,32 @@ with super; }; }); - lyaml = super.lyaml.override({ + lyaml = prev.lib.overrideLuarocks prev.lyaml (oa: { buildInputs = [ pkgs.libyaml ]; }); - mpack = super.mpack.override({ + mpack = prev.lib.overrideLuarocks prev.mpack (drv: { buildInputs = [ pkgs.libmpack ]; # the rockspec doesn't use the makefile so you may need to export more flags USE_SYSTEM_LUA = "yes"; USE_SYSTEM_MPACK = "yes"; }); - rapidjson = super.rapidjson.override({ + rapidjson = prev.rapidjson.overrideAttrs(oa: { preBuild = '' sed -i '/set(CMAKE_CXX_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 = '' unzip "$curSrc" tar xf *.tar.gz ''; - propagatedBuildInputs = super.readline.propagatedBuildInputs ++ [ pkgs.readline ]; + propagatedBuildInputs = prev.readline.propagatedBuildInputs ++ [ pkgs.readline.out ]; extraVariables = rec { READLINE_INCDIR = "${pkgs.readline.dev}/include"; 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 preConfigure = '' 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 preConfigure = '' make all @@ -365,10 +363,10 @@ with super; # TODO just while testing, remove afterwards # 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 ]; }); # aliases - cjson = super.lua-cjson; + cjson = prev.lua-cjson; } |