Skip to content

Commit

Permalink
minetest: 5.9.1 -> 5.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
06kellyjac authored and fgaz committed Dec 24, 2024
1 parent 11676f8 commit c006b91
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
13 changes: 13 additions & 0 deletions pkgs/games/minetest/0000-mark-rm-for-substitution.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/filesys.cpp b/src/filesys.cpp
index 8881eb2ca..e02d87a9f 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -384,7 +384,7 @@ bool RecursiveDelete(const std::string &path)
if (child_pid == 0) {
// Child
std::array<const char*, 4> argv = {
- "rm",
+ "@RM_COMMAND@",
"-rf",
path.c_str(),
nullptr
29 changes: 18 additions & 11 deletions pkgs/games/minetest/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
stdenv,
fetchFromGitHub,
gitUpdater,
substitute,
cmake,
coreutils,
libpng,
Expand Down Expand Up @@ -43,15 +44,30 @@

stdenv.mkDerivation (finalAttrs: {
pname = "minetest";
version = "5.9.1";
version = "5.10.0";

src = fetchFromGitHub {
owner = "minetest";
repo = "minetest";
rev = finalAttrs.version;
hash = "sha256-0WTDhFt7GDzN4AK8U17iLkjeSMK+gOWZRq46HBTeO3w=";
hash = "sha256-sumwm8mJghpSriVflMQSHQM4BTmAhfI/Wl/FroLTVts=";
};

patches = [
(substitute {
src = ./0000-mark-rm-for-substitution.patch;
substitutions = [
"--subst-var-by"
"RM_COMMAND"
"${coreutils}/bin/rm"
];
})
];

postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
sed -i '/pagezero_size/d;/fixup_bundle/d' src/CMakeLists.txt
'';

cmakeFlags = [
(lib.cmakeBool "BUILD_CLIENT" buildClient)
(lib.cmakeBool "BUILD_SERVER" buildServer)
Expand Down Expand Up @@ -125,15 +141,6 @@ stdenv.mkDerivation (finalAttrs: {
prometheus-cpp
];

postPatch =
''
substituteInPlace src/filesys.cpp \
--replace-fail "/bin/rm" "${coreutils}/bin/rm"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
sed -i '/pagezero_size/d;/fixup_bundle/d' src/CMakeLists.txt
'';

postInstall =
lib.optionalString stdenv.hostPlatform.isLinux ''
patchShebangs $out
Expand Down

0 comments on commit c006b91

Please sign in to comment.