Skip to content

luanti: new submission 5.11.0 #28330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions games/luanti/Portfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup github 1.0
PortGroup cmake 1.1

github.setup luanti-org luanti 5.11.0
github.tarball_from archive

revision 0

set game_version 5.8.0

# to add on more files to a github portgroup download
# have to cache the preset distfiles from the github PG
set main_distfile ${distfiles}

# then add another distfile, with a direct URL as can't use the github PG again
set game_distfile ${game_version}${extract.suffix}
set game_mastersite https://github.com/luanti-org/minetest_game/archive/refs/tags

distfiles ${main_distfile}:main \
${game_distfile}:game

master_sites ${github.master_sites}:main \
${game_mastersite}:game

checksums ${name}-${version}${extract.suffix} \
rmd160 70e23bcc5170e2824478138671f83f70640f6639 \
sha256 70e531d0776988ce6e579ea5490fdf6be3e349a4ade5281f5111aa4fdd8ee510 \
size 12350797 \
${game_version}${extract.suffix} \
rmd160 9300fde834d5f7e37286225ba0e851e891db2ef1 \
sha256 33a3bb43b08497a0bdb2f49f140a2829e582d5c16c0ad52be1595c803f706912 \
size 2608281

compiler.cxx_standard 2017
compiler.thread_local_storage yes

# rename directory - from github portgroup
extract.rename yes

license LGPL-2.1+
categories games

maintainers @fvhovell openmaintainer
description open source infinite-world block sandbox game with survival and crafting
long_description ${description} - \
Find more Luanti mods at <https://content.luanti.org/> and have fun.

homepage https://www.luanti.org

depends_build-append path:bin/doxygen:doxygen

depends_lib-append path:include/turbojpeg.h:libjpeg-turbo \
port:libogg \
port:libpng \
port:libvorbis \
port:freetype \
port:gettext \
port:leveldb \
port:sqlite3 \
port:zlib \
port:zstd \
path:lib/libluajit-5.1.dylib:luajit \
port:gmp \
port:curl \
port:jsoncpp \
port:spatialindex \
port:xorg-libX11 \
port:xorg-libXxf86vm

conflicts irrlichtmt \
minetest

universal_variant no
supported_archs x86_64 arm64

# 001. the original build calls fixup_bundle to move all the deps into the app bundle.
# this doesn't work correctly with macports destrooting, and isn't necessary for a macports install so deleted it
patchfiles-append 001-patch-src-CMakeLists-disable-bundlefixup.diff

# 002. patch to get the luajit include headers ahead of the system includes, or the build finds the
# wrong lua headers if you have a newer version of lua installed
patchfiles-append 002-patch-cmake-Modules-FindLua-include-LUADIR-before-system.diff

# 003. patch main.cpp to not barf on the unrecognized command-line option -psn from Apple launch
patchfiles-append 003-patch-ignore-psn-option-mac-bundle.diff

configure.args-append -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=${applications_dir} \
-DCMAKE_FIND_FRAMEWORK=FIRST \
-DBUILD_UNITTESTS=OFF \
-DENABLE_UPDATE_CHECKER=OFF \
-DBUILD_CLIENT=ON \
-DBUILD_SERVER=ON \
-DENABLE_SOUND=ON \
-DUSE_SDL2=OFF \
-DENABLE_GLES2=OFF \
-DENABLE_OPENGL=ON \
-DENABLE_OPENGL3=OFF \
-DENABLE_REDIS=OFF \
-DENABLE_POSTGRESQL=OFF \
-DENABLE_LEVELDB=ON \
-DENABLE_CURL=ON \
-DENABLE_GETTEXT=ON \
-DENABLE_SPATIAL=ON \
-DENABLE_SYSTEM_GMP=ON \
-DENABLE_SYSTEM_JSONCPP=ON \
-DENABLE_LUAJIT=ON \
-DINSTALL_DEVTEST=ON \
-DVERSION_EXTRA=MacPorts-rev${revision} \
-USE_GPROF=FALSE

post-destroot {
move ${workpath}/minetest_game-${game_version} ${destroot}${applications_dir}/${name}.app/Contents/Resources/games/minetest_game
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- ./src/CMakeLists.txt.orig 2016-12-18 11:32:01.000000000 -0800
+++ ./src/CMakeLists.txt 2016-12-18 11:32:13.000000000 -0800
@@ -818,13 +818,6 @@
BUNDLE DESTINATION .
)

- if(APPLE)
- install(CODE "
- set(BU_CHMOD_BUNDLE_ITEMS ON)
- include(BundleUtilities)
- fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${BUNDLE_PATH}\" \"\" \"\${CMAKE_INSTALL_PREFIX}/${BINDIR}\")
- " COMPONENT Runtime)
- endif()

if(USE_GETTEXT)
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- cmake/Modules/FindLua.cmake.orig 2025-02-14 19:38:27
+++ cmake/Modules/FindLua.cmake 2025-05-04 16:15:24
@@ -11,6 +11,7 @@
find_package(LuaJIT)
if(LUAJIT_FOUND)
set(USE_LUAJIT TRUE)
+ include_directories(BEFORE ${LUA_INCLUDE_DIR})
message (STATUS "Using LuaJIT")
elseif(REQUIRE_LUAJIT)
message(FATAL_ERROR "LuaJIT not found whereas REQUIRE_LUAJIT=\"TRUE\" is used.\n"
11 changes: 11 additions & 0 deletions games/luanti/files/003-patch-ignore-psn-option-mac-bundle.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ./src/main.cpp.orig 2016-12-18 15:49:42.000000000 -0800
+++ ./src/main.cpp 2016-12-18 15:50:13.000000000 -0800
@@ -126,7 +126,7 @@
|| cmd_args.getFlag("help")
|| cmd_args.exists("nonopt1")) {
print_help(allowed_options);
- return cmd_args_ok ? 0 : 1;
+// return cmd_args_ok ? 0 : 1;
}

if (cmd_args.getFlag("version")) {