diff options
author | Julian Ospald <hasufell@gentoo.org> | 2013-08-05 22:31:13 +0000 |
---|---|---|
committer | Julian Ospald <hasufell@gentoo.org> | 2013-08-05 22:31:13 +0000 |
commit | 1e7fbb2684910aede0d653de9db062f538607d81 (patch) | |
tree | d6fd9febcd11aa2a6d576ab77d57e0f502b812fb /games-action/minetest | |
parent | Version bump (bug #479872). (diff) | |
download | gentoo-2-1e7fbb2684910aede0d653de9db062f538607d81.tar.gz gentoo-2-1e7fbb2684910aede0d653de9db062f538607d81.tar.bz2 gentoo-2-1e7fbb2684910aede0d653de9db062f538607d81.zip |
initial import wrt #399867
(Portage version: 2.2.0_alpha194/cvs/Linux x86_64, signed Manifest commit with key E73C35B3)
Diffstat (limited to 'games-action/minetest')
-rw-r--r-- | games-action/minetest/ChangeLog | 14 | ||||
-rw-r--r-- | games-action/minetest/Manifest | 10 | ||||
-rw-r--r-- | games-action/minetest/files/minetest-0.4.7-as-needed.patch | 36 | ||||
-rw-r--r-- | games-action/minetest/files/minetest-0.4.7-jthread-option-and-pkgconfig.patch | 83 | ||||
-rw-r--r-- | games-action/minetest/files/minetest-0.4.7-lua-luajit-option.patch | 49 | ||||
-rw-r--r-- | games-action/minetest/files/minetest-0.4.7-shared-irrlicht.patch | 23 | ||||
-rw-r--r-- | games-action/minetest/files/minetestserver.confd | 16 | ||||
-rw-r--r-- | games-action/minetest/files/minetestserver.initd | 36 | ||||
-rw-r--r-- | games-action/minetest/metadata.xml | 49 | ||||
-rw-r--r-- | games-action/minetest/minetest-0.4.7.ebuild | 144 |
10 files changed, 460 insertions, 0 deletions
diff --git a/games-action/minetest/ChangeLog b/games-action/minetest/ChangeLog new file mode 100644 index 000000000000..b588570cd060 --- /dev/null +++ b/games-action/minetest/ChangeLog @@ -0,0 +1,14 @@ +# ChangeLog for games-action/minetest +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/minetest/ChangeLog,v 1.1 2013/08/05 22:31:13 hasufell Exp $ + +*minetest-0.4.7 (05 Aug 2013) + + 05 Aug 2013; Julian Ospald <hasufell@gentoo.org> +minetest-0.4.7.ebuild, + +files/minetest-0.4.7-as-needed.patch, + +files/minetest-0.4.7-jthread-option-and-pkgconfig.patch, + +files/minetest-0.4.7-lua-luajit-option.patch, + +files/minetest-0.4.7-shared-irrlicht.patch, +files/minetestserver.confd, + +files/minetestserver.initd, +metadata.xml: + initial import wrt #399867 + diff --git a/games-action/minetest/Manifest b/games-action/minetest/Manifest new file mode 100644 index 000000000000..4d24589ea260 --- /dev/null +++ b/games-action/minetest/Manifest @@ -0,0 +1,10 @@ +AUX minetest-0.4.7-as-needed.patch 889 SHA256 95c4fb67c15daaea2ec241aa710d512244cf5f3c7364a3d41165d229b3a3b98b SHA512 d124f7e881796f49b0d5dc8d196051cb7a22583d34fe7452506e8174a8fa1a6a6e97f2ed2d418e1ea17a200c41d8cd5ee643d10214d4293891e2c91fdeac767a WHIRLPOOL 23428361202784ff03478628b194de124c6ffd670b17e95f6a4ffbf10d9934f706a5c8d6d83ffcc420feaec5ac1a2b30a986b2dc00fd90b54a583a46c8fee97f +AUX minetest-0.4.7-jthread-option-and-pkgconfig.patch 2740 SHA256 86d1ff02e35b7cf5b0d3b79808f9a5ea4e4fe16c8b47a07d35457af67d869caa SHA512 2b0e25ea1b0422b7c8e1d2ba9dd8863d752d14d5bb59f3e0deb23773c7fdaad05c874fbd5d96ce70f54ad96a47f934097092a90846b169dca8ea21aee315a5a7 WHIRLPOOL 00e303565388d2a267a6f581bc3b403beaa0f4f56bd41d68da5fdd2938f88318dfc6f527247cd1d4901ed8df39783f945ab142c3a968679babc114f5bd883a33 +AUX minetest-0.4.7-lua-luajit-option.patch 1530 SHA256 311027d316eec9ea5d5de582cd57b684246164c86490f8484579b15f971ef0f1 SHA512 0dd5e31db5489f8974c64c367eff076b1da2cae0e66ce1e786291732a4b2c8d999d2c514f8f39796d5b3993f17029078862ffed29626baf1c996fff98999b22e WHIRLPOOL 619bba39c8d7267a097fea24b5c067769d6a02c3eea7b1368c5f9627f4a11f1626d66ea785beb17161ea8072f92924f0433155698ef0c56bf8a37b916252ca34 +AUX minetest-0.4.7-shared-irrlicht.patch 614 SHA256 12d03fb8f9523028dacd5fd45d74dfe901b6d659698cf90aafa8f164018f28cc SHA512 d737d076db32bf62df73f6568f7423511ee27573c08fb975c8d876f7cd56a8f942804ed667b9988f3048cb1efdb52fca0ae9a4f1ff1e912607c7d3765b6149e7 WHIRLPOOL 33452e4c94744f20abebe4ce8db75260c83efb2588ba7235844a3a02dab72f3c6c5a60e62383c3dc3fd04db7cbc9b60bf2ebccd7f173fb12220223c9e9fa5546 +AUX minetestserver.confd 313 SHA256 b360d2f80fb9793994a33778ef907a5b9220ba0a6a8a312d75499718cb9b5f81 SHA512 96fe764d78b383f294bce81e8631861057f309fd9d13f9397ca0c715396f3793f201f313a3507c0b190f41891441eb4fe418b5888cb73ffdea0d27969d0172c3 WHIRLPOOL 6be18593d29f593904760e19486eb77b3ac6bb6b02eaf7de54aba7f5cc117ebafa6ab355787015d3fc2baec6ef8368b3dc8e37bf5df9a901595ccc082adae941 +AUX minetestserver.initd 570 SHA256 77d66efa729b28605d377fbe550356adda695521d93b1cc791aa368b042de1e2 SHA512 56a006b412be876437ebdf79f854d512388828e39990f17771d9f7c614f441e3151ffefc6dabcccc51e2a72d16404bc2ee62aa57ef41e6663f2894d9f468ed72 WHIRLPOOL 24be2e83b5e3ac8661f302b6f2181eff9d5ea0a3e2b0607aaea8008c040c460f48cd6409a9bafeb1bf89d9062013705a46880048734aa3190f5c02163e93da0c +DIST minetest-0.4.7.tar.gz 2775618 SHA256 08aa3695ae32aa5e1c1468fba3159fa84abcf465da89324af2f356eaa9b0b29e SHA512 59faa70e081ecf1d440ac919124a81a06996fbf86237f06b687db2015d53dc5e180d65f2d1aa4f01f7078ee8cf4134f645bc4a21eab3b37f976d7b791ac3e369 WHIRLPOOL 85bab3251e095061249b345c4f45fdb6bb5517f6f189479f065ec62ec81fae458a1fa2d793468f14eb7bd16245380d9a2903158e93626ae362e8a18bb6101ecc +EBUILD minetest-0.4.7.ebuild 3349 SHA256 0c90d38f281e0a60029a2cacde57c4bb804455eba53d812c337bd4dd0aa20726 SHA512 7751e63b36c5b959e24b2e4823c7b148761058acdb90fe7dfe14f23fac6103052a5fa7bb71ae300105bd3bbf6313ca333ca3418819352344b31187c47d7a1a6d WHIRLPOOL e7548e32c2ada08704cc255407085d46b6691598e06d1d9d03a6406faacc76f797f5d228025fbed3d5e10b7547f7410dc18098c7cf58877f8cb49e8296a582f8 +MISC ChangeLog 530 SHA256 b2a721b9b4bee884c3468366f8f1716c303a753107246e3d18d80791b1c7e780 SHA512 181c01e0608bf1b125be0a14f167f2f327e1fa18f48e95264263b8c3319107ad5c8fd8c9b172a47a0718828fa98e62a85c484c9e9b4aca53bd444ce8db31e694 WHIRLPOOL c872879ee4189710b8ee00351b871ba7c3757c9fb5c575209a4ad5f368e8b0257f4f6e6d2366a5008b97817d4b62a38ff2c30528d467612ce41dd2440d80e003 +MISC metadata.xml 1851 SHA256 8b92715ad8c2abf2d6f02d2eb73b8d2290185d936328eab71ecc4daffddb48c2 SHA512 ba997212a5ba51a1dc9f6fbaf12fe0d8a0eff6fc8820f0d6931768fa38fa284bff7f56e62858994c2429a3467048f61f7b497f3b6f881dd604e2d3363de20721 WHIRLPOOL 1daaf7e50244697089b18cc0cd2ddcb49d4cce960cee74b3cfed5d90d395b5ad49e43113bcf883902ba2fddce6e973c307dd914fed01898a192a8dbd73050535 diff --git a/games-action/minetest/files/minetest-0.4.7-as-needed.patch b/games-action/minetest/files/minetest-0.4.7-as-needed.patch new file mode 100644 index 000000000000..efe2cfc526bc --- /dev/null +++ b/games-action/minetest/files/minetest-0.4.7-as-needed.patch @@ -0,0 +1,36 @@ +commit e886e5adba69870bcb00a0aaaa3f3157fe1843be +Author: hasufell <julian.ospald@googlemail.com> +Date: Sat Jun 8 14:51:56 2013 +0200 + + CMAKE: fix linking order + + this also fixes linking with as-needed wrt + https://github.com/minetest/minetest/issues/617 + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f4586e7..9f24536 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -391,19 +391,19 @@ + target_link_libraries( + ${PROJECT_NAME} + ${ZLIB_LIBRARIES} +- ${IRRLICHT_LIBRARY} ++ ${X11_LIBRARIES} + ${OPENGL_LIBRARIES} ++ ${OPENGLES2_LIBRARIES} + ${JPEG_LIBRARIES} + ${BZIP2_LIBRARIES} + ${PNG_LIBRARIES} +- ${X11_LIBRARIES} ++ ${IRRLICHT_LIBRARY} + ${GETTEXT_LIBRARY} + ${SOUND_LIBRARIES} + ${JTHREAD_LIBRARY} + ${SQLITE3_LIBRARY} + ${LUA_LIBRARY} + ${JSON_LIBRARY} +- ${OPENGLES2_LIBRARIES} + ${PLATFORM_LIBS} + ${CLIENT_PLATFORM_LIBS} + ) diff --git a/games-action/minetest/files/minetest-0.4.7-jthread-option-and-pkgconfig.patch b/games-action/minetest/files/minetest-0.4.7-jthread-option-and-pkgconfig.patch new file mode 100644 index 000000000000..854b0ee937bc --- /dev/null +++ b/games-action/minetest/files/minetest-0.4.7-jthread-option-and-pkgconfig.patch @@ -0,0 +1,83 @@ +commit c0a7c530f213cb947cc703c39f2d7a4d9d008daf +Author: hasufell <julian.ospald@googlemail.com> +Date: Sat Jun 8 13:40:12 2013 +0200 + + CMAKE: add option to use system JThread and use pkg-config + +diff --git a/cmake/Modules/FindJthread.cmake b/cmake/Modules/FindJthread.cmake +index 302a3c2..70d6e92 100644 +--- a/cmake/Modules/FindJthread.cmake ++++ b/cmake/Modules/FindJthread.cmake +@@ -1,16 +1,41 @@ + # Look for jthread, use our own if not found + +-FIND_PATH(JTHREAD_INCLUDE_DIR jthread.h) + +-FIND_LIBRARY(JTHREAD_LIBRARY NAMES jthread) ++option(WITH_SYSTEM_JTHREAD "Use systm JThread copy" OFF) + +-IF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR) +- SET( JTHREAD_FOUND TRUE ) +-ENDIF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR) ++IF(WITH_SYSTEM_JTHREAD) ++ IF(UNIX) ++ # try to use pkgconfig file first ++ FIND_PACKAGE(PkgConfig QUIET) ++ pkg_check_modules(_PC_JTHREAD jthread) ++ IF(_PC_JTHREAD_FOUND) ++ SET(JTHREAD_FOUND TRUE) ++ # use CFLAGS/LDFLAGS instead of INCLUDE_DIR/LIBRARY ++ # because we want the full dependencies ++ SET(JTHREAD_CFLAGS ${_PC_JTHREAD_CFLAGS}) ++ SET(JTHREAD_LDFLAGS ${_PC_JTHREAD_LDFLAGS}) ++ ENDIF(_PC_JTHREAD_FOUND) ++ ENDIF(UNIX) ++ ++ # fall back to cmake macros ++ IF(NOT JTHREAD_FOUND) ++ FIND_PATH(JTHREAD_INCLUDE_DIR jthread.h PATHS /usr/include/jthread) ++ FIND_LIBRARY(JTHREAD_LIBRARY NAMES jthread) ++ ++ IF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR) ++ SET( JTHREAD_FOUND TRUE ) ++ ENDIF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR) ++ ENDIF(NOT JTHREAD_FOUND) ++ENDIf(WITH_SYSTEM_JTHREAD) + + IF(JTHREAD_FOUND) +- MESSAGE(STATUS "Found system jthread header file in ${JTHREAD_INCLUDE_DIR}") +- MESSAGE(STATUS "Found system jthread library ${JTHREAD_LIBRARY}") ++ IF(_PC_JTHREAD_FOUND) ++ MESSAGE(STATUS "Found system jthread: ${_PC_JTHREAD_VERSION}") ++ ELSE(_PC_JTHREAD_FOUND) ++ MESSAGE(STATUS "Found system jthread header file in ${JTHREAD_INCLUDE_DIR}") ++ MESSAGE(STATUS "Found system jthread library ${JTHREAD_LIBRARY}") ++ ENDIF(_PC_JTHREAD_FOUND) ++# fall back to bundled jthread + ELSE(JTHREAD_FOUND) + SET(JTHREAD_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/jthread) + SET(JTHREAD_LIBRARY jthread) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3d7e815..f4586e7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -420,6 +420,9 @@ if(BUILD_CLIENT) + ${CGUITTFONT_LIBRARY} + ) + endif(USE_FREETYPE) ++ set_target_properties(${PROJECT_NAME} ++ PROPERTIES COMPILE_FLAGS "${JTHREAD_CFLAGS}" ++ LINK_FLAGS "${JTHREAD_LDFLAGS}") + endif(BUILD_CLIENT) + + if(BUILD_SERVER) +@@ -440,6 +443,9 @@ if(BUILD_SERVER) + ${CURL_LIBRARY} + ) + endif(USE_CURL) ++ set_target_properties(${PROJECT_NAME}server ++ PROPERTIES COMPILE_FLAGS "${JTHREAD_CFLAGS}" ++ LINK_FLAGS "${JTHREAD_LDFLAGS}") + endif(BUILD_SERVER) + + diff --git a/games-action/minetest/files/minetest-0.4.7-lua-luajit-option.patch b/games-action/minetest/files/minetest-0.4.7-lua-luajit-option.patch new file mode 100644 index 000000000000..3d41be979c5a --- /dev/null +++ b/games-action/minetest/files/minetest-0.4.7-lua-luajit-option.patch @@ -0,0 +1,49 @@ +commit 054055b5115af6046dc9b4396b7911221a3b765c +Author: hasufell <julian.ospald@googlemail.com> +Date: Sat Jun 8 13:32:21 2013 +0200 + + CMAKE: add option to choose between system luajit/lua + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 51ed278..3d7e815 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -180,19 +180,28 @@ if(USE_FREETYPE) + set(CGUITTFONT_LIBRARY cguittfont) + endif(USE_FREETYPE) + +- +-find_library(LUA_LIBRARY luajit +- NAMES luajit-5.1) +-find_path(LUA_INCLUDE_DIR luajit.h +- NAMES luajit.h +- PATH_SUFFIXES luajit-2.0) +-message (STATUS "LuaJIT library: ${LUA_LIBRARY}") +-message (STATUS "LuaJIT headers: ${LUA_INCLUDE_DIR}") ++option(USE_LUAJIT "Use luajit instead of lua" OFF) ++ ++if(USE_LUAJIT) ++ find_library(LUA_LIBRARY luajit ++ NAMES libluajit-5.1.so luajit-5.1) ++ find_path(LUA_INCLUDE_DIR luajit.h ++ NAMES luajit.h ++ PATH_SUFFIXES luajit-2.0) ++ message (STATUS "LuaJIT library: ${LUA_LIBRARY}") ++ message (STATUS "LuaJIT headers: ${LUA_INCLUDE_DIR}") ++else(USE_LUAJIT) ++ find_package(Lua51) ++endif(USE_LUAJIT) + + if(LUA_LIBRARY AND LUA_INCLUDE_DIR) +- message (STATUS "LuaJIT found.") ++ if(USE_LUAJIT) ++ message (STATUS "LuaJIT found.") ++ else(USE_LUAJIT) ++ message (STATUS "Lua51 found.") ++ endif(USE_LUAJIT) + else(LUA_LIBRARY AND LUA_INCLUDE_DIR) +- message (STATUS "LuaJIT not found, using bundled Lua.") ++ message (STATUS "LuaJIT/Lua51 not found, using bundled Lua.") + set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src") + set(LUA_LIBRARY "lua") + add_subdirectory(lua) diff --git a/games-action/minetest/files/minetest-0.4.7-shared-irrlicht.patch b/games-action/minetest/files/minetest-0.4.7-shared-irrlicht.patch new file mode 100644 index 000000000000..b552c0937039 --- /dev/null +++ b/games-action/minetest/files/minetest-0.4.7-shared-irrlicht.patch @@ -0,0 +1,23 @@ +commit 11d35e62fe13b47c5b34139559e650dfe6ebbd84 +Author: hasufell <julian.ospald@googlemail.com> +Date: Sat Jun 8 13:40:30 2013 +0200 + + CMAKE: use shared lib from Irrlicht + +diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake +index bd00422..4632993 100644 +--- a/cmake/Modules/FindIrrlicht.cmake ++++ b/cmake/Modules/FindIrrlicht.cmake +@@ -50,10 +50,11 @@ else() + /usr/include/irrlicht + ) + +- FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.a Irrlicht ++ FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.so Irrlicht + PATHS + /usr/local/lib + /usr/lib ++ /usr/lib64 + ) + endif() + diff --git a/games-action/minetest/files/minetestserver.confd b/games-action/minetest/files/minetestserver.confd new file mode 100644 index 000000000000..ec3d0138cb73 --- /dev/null +++ b/games-action/minetest/files/minetestserver.confd @@ -0,0 +1,16 @@ +# /etc/conf.d/minetest-server: config file for /etc/init.d/minetest-server + +# user +USER="minetest" + +# group +GROUP="@GROUP@" + +# pidfile +PIDFILE="/var/run/minetest.pid" + +# executable +MINETESTBIN="@BINDIR@/minetestserver" + +# additional arguments for the server +ARGS="--logfile /var/lib/minetest/minetest-server.log" diff --git a/games-action/minetest/files/minetestserver.initd b/games-action/minetest/files/minetestserver.initd new file mode 100644 index 000000000000..24fd5fb6dbd3 --- /dev/null +++ b/games-action/minetest/files/minetestserver.initd @@ -0,0 +1,36 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/minetest/files/minetestserver.initd,v 1.1 2013/08/05 22:31:13 hasufell Exp $ + +description="Minetest dedicated server" + +depend() { + need net +} + +start() { + ebegin "starting server" + start-stop-daemon \ + --start \ + --quiet \ + --make-pidfile \ + --pidfile "${PIDFILE}" \ + --background \ + --user ${USER} \ + --group ${GROUP} \ + --exec "${MINETESTBIN}" -- ${ARGS} + + eend $? +} + +stop() { + ebegin "stopping server" + start-stop-daemon \ + --stop \ + --signal 15 \ + --quiet \ + --pidfile "${PIDFILE}" + + eend $? +} diff --git a/games-action/minetest/metadata.xml b/games-action/minetest/metadata.xml new file mode 100644 index 000000000000..fd7ce545d351 --- /dev/null +++ b/games-action/minetest/metadata.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>games</herd> + <maintainer> + <email>hasufell@gentoo.org</email> + <name>Julian Ospald</name> + </maintainer> + <longdescription lang="en"> + Minetest is an infinite-world block sandbox game and a game + engine, inspired by InfiniMiner, Minecraft and the like. It has + been in development and use since October 2010. + + It is Free and Open Source Software, released under the LGPL 2.1 + or later, available for Windows, Mac OS X and Linux. + + Minetest is developed by a random bunch of lunatics. + + Minetest is designed to be simple, stable and portable. It is + lightweight enough to run on fairly old hardware. It currently + runs playably on a laptop with Intel 945GM graphics. Though, as + for the CPU, dualcore is recommended. + + Features + * Walk around, dig and build in an infinite voxel world, + and craft stuff from raw materials to help you along the way. + * Simplistic Modding API that supports many kinds of additions + and modifications to the game. + * Multiplayer support for tens of players, via servers hosted by + users. + * Voxel based lighting with gameplay consequences + (light caves and buildings with torches) + * Almost infinite world and a beautiful map generator. + * Runs natively on Windows, Linux, OS X and FreeBSD. + * Supports multiple languages, translated by the community. + </longdescription> + <use> + <flag name="luajit"> + Use <pkg>dev-lang/luajit</pkg> + instead of <pkg>dev-lang/lua</pkg> + </flag> + <flag name="server">Build minetest server</flag> + </use> + <upstream> + <bugs-to>https://github.com/minetest/minetest/issues</bugs-to> + <doc lang="en">http://wiki.minetest.net/Main_Page</doc> + <remote-id type="github">minetest/minetest</remote-id> + </upstream> +</pkgmetadata> diff --git a/games-action/minetest/minetest-0.4.7.ebuild b/games-action/minetest/minetest-0.4.7.ebuild new file mode 100644 index 000000000000..d3dd2c5749dc --- /dev/null +++ b/games-action/minetest/minetest-0.4.7.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/minetest/minetest-0.4.7.ebuild,v 1.1 2013/08/05 22:31:13 hasufell Exp $ + +EAPI=5 +inherit eutils cmake-utils gnome2-utils vcs-snapshot user games + +DESCRIPTION="An InfiniMiner/Minecraft inspired game" +HOMEPAGE="http://c55.me/minetest/" +SRC_URI="http://github.com/minetest/minetest/tarball/${PV} -> ${P}.tar.gz" + +LICENSE="LGPL-2.1+ CC-BY-SA-3.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+curl dedicated luajit nls +server +sound +truetype" + +RDEPEND="dev-db/sqlite:3 + >=dev-games/irrlicht-1.8-r2 + sys-libs/zlib + curl? ( net-misc/curl ) + !dedicated? ( + app-arch/bzip2 + media-libs/libpng:0 + virtual/jpeg + virtual/opengl + x11-libs/libX11 + x11-libs/libXxf86vm + sound? ( + media-libs/libogg + media-libs/libvorbis + media-libs/openal + ) + truetype? ( media-libs/freetype:2 ) + ) + luajit? ( dev-lang/luajit:2 ) + !luajit? ( >=dev-lang/lua-5.1.4 ) + nls? ( virtual/libintl )" +DEPEND="${RDEPEND} + nls? ( sys-devel/gettext )" + +pkg_setup() { + games_pkg_setup + + if use server || use dedicated ; then + enewuser ${PN} -1 -1 /var/lib/${PN} ${GAMES_GROUP} + fi +} + +src_unpack() { + vcs-snapshot_src_unpack +} + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-lua-luajit-option.patch \ + "${FILESDIR}"/${P}-jthread-option-and-pkgconfig.patch \ + "${FILESDIR}"/${P}-shared-irrlicht.patch \ + "${FILESDIR}"/${P}-as-needed.patch + + # correct gettext behavior + if [[ -n "${LINGUAS+x}" ]] ; then + for i in $(cd po ; echo *) ; do + if ! has ${i} ${LINGUAS} ; then + rm -r po/${i} || die + fi + done + fi + + # jthread is modified + # json is modified + rm -r src/{lua,sqlite} || die + + # set paths + sed \ + -e "s#@BINDIR@#${GAMES_BINDIR}#g" \ + -e "s#@GROUP@#${GAMES_GROUP}#g" \ + "${FILESDIR}"/minetestserver.confd > "${T}"/minetestserver.confd || die +} + +src_configure() { + local mycmakeargs=( + -DRUN_IN_PLACE=0 + -DCUSTOM_SHAREDIR="${GAMES_DATADIR}/${PN}" + -DCUSTOM_BINDIR="${GAMES_BINDIR}" + -DCUSTOM_DOCDIR="/usr/share/doc/${PF}" + -DCUSTOM_LOCALEDIR="/usr/share/locale" + $(usex dedicated "-DBUILD_SERVER=ON -DBUILD_CLIENT=OFF" "$(cmake-utils_use_build server SERVER) -DBUILD_CLIENT=ON") + $(cmake-utils_use_enable nls GETTEXT) + $(cmake-utils_use_enable curl CURL) + $(cmake-utils_use_use luajit LUAJIT) + $(cmake-utils_use_enable truetype FREETYPE) + $(cmake-utils_use_enable sound SOUND) + -DWITH_SYSTEM_JTHREAD=OFF + ) + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_compile +} + +src_install() { + cmake-utils_src_install + + if use server || use dedicated ; then + newinitd "${FILESDIR}"/minetestserver.initd minetest-server + newconfd "${T}"/minetestserver.confd minetest-server + fi + + prepgamesdirs +} + +pkg_preinst() { + games_pkg_preinst + gnome2_icon_savelist +} + +pkg_postinst() { + games_pkg_postinst + gnome2_icon_cache_update + + if ! use dedicated ; then + elog + elog "optional dependencies:" + elog " games-action/minetest_game (official mod)" + elog " games-action/minetest_common (official mod)" + elog " games-action/minetest_build (official mod)" + elog " games-action/minetest_survival (official mod)" + elog + fi + + if use server || use dedicated ; then + elog + elog "Configure your server via /etc/conf.d/minetest-server" + elog "The user \"minetest\" is created with /var/lib/${PN} homedir." + elog "Default logfile is ~/minetest-server.log" + elog + fi +} + +pkg_postrm() { + gnome2_icon_cache_update +} |