dev-python/numpydoc: arm64 keyworded (bug #721130)
[gentoo.git] / games-action / minetest / minetest-5.2.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit cmake xdg
7
8 DESCRIPTION="A free open-source voxel game engine with easy modding and game creation"
9 HOMEPAGE="https://www.minetest.net"
10 SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="LGPL-2.1+ CC-BY-SA-3.0 OFL-1.1 Apache-2.0"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="+client +curl doc +leveldb ncurses nls postgres redis +server +sound spatial +truetype"
16 REQUIRED_USE="|| ( client server )"
17
18 RDEPEND="
19         dev-db/sqlite:3
20         dev-lang/luajit:2
21         dev-libs/gmp:0=
22         dev-libs/jsoncpp:=
23         sys-libs/zlib
24         client? (
25                 app-arch/bzip2
26                 dev-games/irrlicht
27                 media-libs/libpng:0=
28                 virtual/jpeg:0
29                 virtual/opengl
30                 x11-libs/libX11
31                 x11-libs/libXxf86vm
32                 sound? (
33                         media-libs/libogg
34                         media-libs/libvorbis
35                         media-libs/openal
36                 )
37                 truetype? ( media-libs/freetype:2 )
38         )
39         curl? ( net-misc/curl )
40         leveldb? ( dev-libs/leveldb:= )
41         ncurses? ( sys-libs/ncurses:0= )
42         nls? ( virtual/libintl )
43         postgres? ( >=dev-db/postgresql-9.5:= )
44         redis? ( dev-libs/hiredis:= )
45         server? (
46                 acct-group/minetest
47                 acct-user/minetest
48                 dev-games/irrlicht-headers
49         )
50         spatial? ( sci-libs/libspatialindex:= )"
51 DEPEND="${RDEPEND}"
52 BDEPEND="
53         doc? (
54                 app-doc/doxygen
55                 media-gfx/graphviz
56         )
57         nls? ( sys-devel/gettext )"
58
59 src_prepare() {
60         cmake_src_prepare
61         # set paths
62         sed \
63                 -e "s#@BINDIR@#${EPREFIX}/usr/bin#g" \
64                 -e "s#@GROUP@#${PN}#g" \
65                 "${FILESDIR}"/minetestserver.confd > "${T}"/minetestserver.confd || die
66
67         # remove bundled libraries
68         rm -rf lib || die
69 }
70
71 src_configure() {
72         local mycmakeargs=(
73                 -DBUILD_CLIENT=$(usex client)
74                 -DBUILD_SERVER=$(usex server)
75                 -DCUSTOM_BINDIR="${EPREFIX}/usr/bin"
76                 -DCUSTOM_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
77                 -DCUSTOM_EXAMPLE_CONF_DIR="${EPREFIX}/usr/share/doc/${PF}"
78                 -DCUSTOM_LOCALEDIR="${EPREFIX}/usr/share/${PN}/locale"
79                 -DCUSTOM_SHAREDIR="${EPREFIX}/usr/share/${PN}"
80                 -DENABLE_CURL=$(usex curl)
81                 -DENABLE_CURSES=$(usex ncurses)
82                 -DENABLE_FREETYPE=$(usex truetype)
83                 -DENABLE_GETTEXT=$(usex nls)
84                 -DENABLE_GLES=0
85                 -DENABLE_LEVELDB=$(usex leveldb)
86                 -DENABLE_LUAJIT=1
87                 -DENABLE_POSTGRESQL=$(usex postgres)
88                 -DENABLE_REDIS=$(usex redis)
89                 -DENABLE_SPATIAL=$(usex spatial)
90                 -DENABLE_SOUND=$(usex sound)
91                 -DENABLE_SYSTEM_GMP=1
92                 -DENABLE_SYSTEM_JSONCPP=1
93                 -DRUN_IN_PLACE=0
94         )
95
96         cmake_src_configure
97 }
98
99 src_compile() {
100         cmake_src_compile
101
102         if use doc ; then
103                 cmake_src_compile doc
104                 HTML_DOCS=( "${BUILD_DIR}"/doc/html/. )
105         fi
106 }
107
108 src_install() {
109         cmake_src_install
110
111         if use server ; then
112                 keepdir /var/log/minetest
113                 fowners minetest:minetest /var/log/minetest
114
115                 newconfd "${T}"/minetestserver.confd minetest-server
116                 newinitd "${FILESDIR}"/minetestserver.initd minetest-server
117         fi
118 }
119
120 pkg_postinst() {
121         xdg_pkg_postinst
122
123         if use server ; then
124                 elog
125                 elog "Configure your server via /etc/conf.d/minetest-server"
126                 elog
127         fi
128
129         elog
130         elog "The version 5.x series is not compatible to the version 0.4 series."
131         elog "This applies to clients and servers, other content such as mods,"
132         elog "texture packs and worlds is unaffected and backwards-compatible"
133         elog "as usual."
134         elog
135 }