nethack: Convert the preBuild hook into a postUnpack hook

I think this makes sense in that unpacking lua is part of the process of
unpacking the source code. Also, it will be handy in a future commit
since this means that we can use the patch phase in order to patch lua
code for cross-compilation.
This commit is contained in:
Palmer Cox
2026-05-14 14:21:04 +00:00
parent e074cce0cc
commit 1ac185bf1b
+12 -12
View File
@@ -52,6 +52,18 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "sha256-KVm3iGqsdhhbkK6gyfgNFDQ/YE3grpaz3Sp2D3qzvek=";
};
postUnpack =
let
lua548 = fetchurl {
url = "https://www.lua.org/ftp/lua-5.4.8.tar.gz";
hash = "sha256-TxjdrhVOeT5G7qtyfFnvHAwMK3ROe5QhlxDXb1MGKa4=";
};
in
''
mkdir -p NetHack-${finalAttrs.version}/lib
tar zxf ${lua548} -C NetHack-${finalAttrs.version}/lib
'';
buildInputs = [
ncurses
]
@@ -136,18 +148,6 @@ stdenv.mkDerivation (finalAttrs: {
popd
'';
preBuild =
let
lua548 = fetchurl {
url = "https://www.lua.org/ftp/lua-5.4.8.tar.gz";
hash = "sha256-TxjdrhVOeT5G7qtyfFnvHAwMK3ROe5QhlxDXb1MGKa4=";
};
in
''
mkdir -p lib
tar zxf ${lua548} -C lib
'';
# https://github.com/NixOS/nixpkgs/issues/294751
enableParallelBuilding = false;