Skip to content
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

minetest-devel: new port in games #17080

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
127 changes: 127 additions & 0 deletions games/minetest-devel/Portfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# -*- 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

compiler.cxx_standard 2011
compiler.thread_local_storage yes

name minetest-devel
github.setup minetest minetest 5.6.1
revision 0

# the game version could be different to the minetest version
set game_version 5.6.1

# 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/minetest/minetest_game/archive/

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

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

checksums ${main_distfile} \
rmd160 7b32331e0007f29003107592522d1c906935e44d \
sha256 425d8e9363212dcb5bc7986dd12460c9c3784aca22eb1b90dad6a7fc2c6ef546 \
size 9925064 \
${game_distfile} \
rmd160 73d35423b856d141cebfa16396fe5dcf834dcf89 \
sha256 5dc857003d24bb489f126865fcd6bf0d9c0cb146ca4c1c733570699d15abd0e3 \
size 2590582

# rename directory - from github portgroup
post-extract {
if {[file exists [glob -nocomplain ${workpath}/${github.author}-${github.project}-*]] && \
[file isdirectory [glob -nocomplain ${workpath}/${github.author}-${github.project}-*]]} {
move [glob ${workpath}/${github.author}-${github.project}-*] ${workpath}/${distname}
}
}

license EUPL-1.2
Zweihorn marked this conversation as resolved.
Show resolved Hide resolved
categories games
platforms darwin
maintainers {macports.org:Zweihorn @Zweihorn}
Zweihorn marked this conversation as resolved.
Show resolved Hide resolved
description open source infinite-world block sandbox game with survival and crafting
long_description - ${description} - \
\
Minetest (usually abbreviated as MT) is an open source voxel game \
engine. Play one of our many games, mod a game to your liking, make your \
own game, or play on a multiplayer server. \
\
Available for Windows, macOS, GNU/Linux, FreeBSD, OpenBSD, DragonFly \
BSD, and Android. \
\
* More information at <https://www.minetest.net> \
* More MT mod expansions at <https://content.minetest.net/> \
* More on MT DB Backends at <https://wiki.minetest.net/Database_backends> \
\
This ${name} port provides a cutting edge Minetest (stable).

homepage https://www.minetest.net

conflicts minetest

depends_build-append port:doxygen

depends_lib-append port:irrlichtmt \
port:libjpeg-turbo \
port:libogg \
port:libvorbis \
port:freetype \
port:gettext \
port:leveldb \
port:sqlite3 \
port:zstd \
port:luajit \
port:gmp \
port:curl \
port:jsoncpp \
port:spatialindex \
port:xorg-libX11 \
port:xorg-libXxf86vm

# see https://trac.macports.org/ticket/58315 - possibly fixable?
universal_variant no
supported_archs x86_64

# 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} \
-DBUILD_UNITTESTS=OFF \
-DBUILD_CLIENT=ON \
-DBUILD_SERVER=ON \
-DENABLE_SOUND=ON \
-DENABLE_REDIS=OFF \
-DENABLE_POSTGRESQL=OFF \
-DENABLE_LEVELDB=ON \
-DENABLE_FREETYPE=ON \
-DENABLE_CURL=ON \
-DENABLE_GETTEXT=ON \
-DENABLE_SPATIAL=ON \
-DENABLE_SYSTEM_GMP=ON \
-DENABLE_SYSTEM_JSONCPP=ON \
-DCURSES_INCLUDE_PATH:FILEPATH=${prefix}/include \
-DENABLE_LUAJIT=ON \
-DVERSION_EXTRA=MacPorts

post-destroot {
move ${workpath}/minetest_game-${game_version} ${destroot}${applications_dir}/minetest.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 2017-12-08 11:49:52.000000000 -0800
+++ cmake/Modules/FindLua.cmake 2017-12-08 11:50:05.000000000 -0800
@@ -11,6 +11,7 @@
find_package(LuaJIT)
if(LUAJIT_FOUND)
set(USE_LUAJIT TRUE)
+ include_directories(BEFORE ${LUA_INCLUDE_DIR})
message (STATUS "Using LuaJIT provided by system.")
elseif(REQUIRE_LUAJIT)
message(FATAL_ERROR "LuaJIT not found whereas REQUIRE_LUAJIT=\"TRUE\" is used.\n"
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")) {