fix(overlay): adopt upstream fix for Lua readline

9f58e7b926
("maybe fix nixpkgs-unstable lua")

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
Raito Bezarius 2024-09-07 21:52:30 +02:00
parent 94a5b19c77
commit 0ee2ce4183
2 changed files with 20 additions and 20 deletions

View file

@ -1,23 +1,24 @@
final: prev: final: prev:
let let
isCross = final.stdenv.buildPlatform != final.stdenv.hostPlatform;
crossOnly = pkg : amendFn : if isCross then (amendFn pkg) else pkg;
extraPkgs = import ./pkgs/default.nix { extraPkgs = import ./pkgs/default.nix {
inherit (final) lib callPackage; inherit (final) lib callPackage;
}; };
inherit (final) fetchpatch; inherit (final) fetchpatch;
lua_no_readline = prev.lua5_3; luaHost = prev.lua5_3.overrideAttrs(o: {
# lua_no_readline = prev.lua5_3.overrideAttrs(o: { name = "lua-tty";
# name = "lua-tty"; preBuild = ''
# preBuild = '' makeFlagsArray+=(PLAT="posix" SYSLIBS="-Wl,-E -ldl" CFLAGS="-O2 -fPIC -DLUA_USE_POSIX -DLUA_USE_DLOPEN")
# makeFlagsArray+=(PLAT="posix" SYSLIBS="-Wl,-E -ldl" CFLAGS="-O2 -fPIC -DLUA_USE_POSIX -DLUA_USE_DLOPEN") '';
# ''; # lua in nixpkgs has a postInstall stanza that assumes only
# # lua in nixpkgs has a postInstall stanza that assumes only # one output, we need to override that if we're going to
# # one output, we need to override that if we're going to # convert to multi-output
# # convert to multi-output # outputs = ["bin" "man" "out"];
# # outputs = ["bin" "man" "out"]; makeFlags =
# makeFlags = builtins.filter (x: (builtins.match "(PLAT|MYLIBS).*" x) == null)
# builtins.filter (x: (builtins.match "(PLAT|MYLIBS).*" x) == null) o.makeFlags;
# o.makeFlags; });
# });
s6 = prev.s6.overrideAttrs(o: s6 = prev.s6.overrideAttrs(o:
let let
@ -42,7 +43,6 @@ let
(if o ? patches then o.patches else []) ++ (if o ? patches then o.patches else []) ++
(if patch_needed then [ patch ] else []); (if patch_needed then [ patch ] else []);
}); });
lua = let s = lua_no_readline.override { self = s; }; in s;
in in
extraPkgs // { extraPkgs // {
# liminix library functions # liminix library functions
@ -214,8 +214,7 @@ extraPkgs // {
]; ];
}); });
luaFull = prev.lua; lua = crossOnly prev.lua5_3 (_: luaHost);
inherit lua;
mtdutils = prev.mtdutils.overrideAttrs(o: { mtdutils = prev.mtdutils.overrideAttrs(o: {
patches = (if o ? patches then o.patches else []) ++ [ patches = (if o ? patches then o.patches else []) ++ [

View file

@ -2,14 +2,15 @@
qemuLim qemuLim
, socat , socat
, writeShellScript , writeShellScript
, writeFennel
, runCommand , runCommand
, fennel
, lib , lib
, lua , lua
, pkgsBuildBuild , pkgsBuildBuild
}: let }: let
run-liminix-vm = pkgsBuildBuild.writeFennel "run-liminix-vm" { writeFennel = pkgsBuildBuild.writeFennel.override { inherit lua; };
packages = [ qemuLim pkgsBuildBuild.lua.pkgs.luaposix pkgsBuildBuild.lua.pkgs.fennel ]; run-liminix-vm = writeFennel "run-liminix-vm" {
packages = [ qemuLim lua.pkgs.luaposix fennel ];
} ./run-liminix-vm.fnl; } ./run-liminix-vm.fnl;
connect = writeShellScript "connect-vm" '' connect = writeShellScript "connect-vm" ''
export PATH="${lib.makeBinPath [socat]}:$PATH" export PATH="${lib.makeBinPath [socat]}:$PATH"