From 1ac185bf1bade4202a89ca14fcb62434e133d72f Mon Sep 17 00:00:00 2001 From: Palmer Cox Date: Thu, 14 May 2026 02:59:18 +0000 Subject: [PATCH] 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. --- pkgs/by-name/ne/nethack/package.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ne/nethack/package.nix b/pkgs/by-name/ne/nethack/package.nix index e91bcc0c708c..11a26a67f6b1 100644 --- a/pkgs/by-name/ne/nethack/package.nix +++ b/pkgs/by-name/ne/nethack/package.nix @@ -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;