aboutsummaryrefslogtreecommitdiffstats
path: root/main/minetest/APKBUILD
blob: cee6c1643a316b1cf8cdf14e18c61b5e39695c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Contributor: <xmingske@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=minetest
pkgver=0.4.10
pkgrel=0
pkgdesc="An infinite-world block sandbox game and a game engine"
url="http://minetest.net/"
arch="all"
license="LGPL2.1 CCBY-SA3.0"
depends="$pkgname-common"
makedepends="sqlite-dev bzip2-dev openssl-dev irrlicht-dev cmake libvorbis-dev
	libjpeg-turbo-dev libpng-dev openal-soft-dev libogg-dev mesa-dev sqlite-dev
	luajit-dev hiredis-dev"
source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/minetest/${pkgname}/tar.gz/${pkgver}
	"
subpackages="$pkgname-doc $pkgname-common $pkgname-server"

_builddir="${srcdir}"/${pkgname}-${pkgver}

prepare() {
	local pf
	cd "${_builddir}"
	for pf in $source; do
		case $pf in
		*.patch) msg $pf; patch -p1 -i "$srcdir"/${pf} || return 1;;
		esac
	done
}

build() {
	mkdir "${_builddir}"/.build_client
	cd "${_builddir}"/.build_client
	cmake -DCUSTOM_BINDIR=/usr/bin \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCUSTOM_DOCDIR="/usr/share/doc/${pkgname}" \
		-DCUSTOM_SHAREDIR="/usr/share/${pkgname}" \
		-DBUILD_CLIENT=1 \
		-DBUILD_SERVER=0 \
		-DENABLE_REDIS=0 \
		-DRUN_IN_PLACE=0 \
		..
	make || return 1
	mkdir "${_builddir}"/.build_server
	cd "${_builddir}"/.build_server
        cmake -DCUSTOM_BINDIR=/usr/bin \
                -DCMAKE_INSTALL_PREFIX=/usr \
                -DCUSTOM_DOCDIR="/usr/share/doc/minetest" \
                -DCUSTOM_SHAREDIR="/usr/share/minetest" \
                -DBUILD_CLIENT=0 \
                -DBUILD_SERVER=1 \
                -DENABLE_REDIS=1 \
                -DRUN_IN_PLACE=0 \
                ..
        make || return 1
}

common() {
	arch="noarch"
	mkdir -p "${subpkgdir}/usr/share/minetest"
	mv "${pkgdir}/usr/share/minetest/builtin" "${subpkgdir}/usr/share/minetest" || return 1
	mv "${pkgdir}/usr/share/minetest/games" "${subpkgdir}/usr/share/minetest" || return 1
}

package() {
	cd "${_builddir}"/.build_client
	make DESTDIR="${pkgdir}" install || return 1
}

server(){
	mkdir -p "${subpkgdir}/usr/bin"
	cd "${_builddir}"
	cp bin/minetestserver ${subpkgdir}/usr/bin
}

md5sums="61bb35c9d5521f1b072bc3c3e634c863  minetest-0.4.10.tar.gz"
sha256sums="620a2f3c279d337a2ac405ea65a559cc9c87f3d58bb565f9935fe338d003bbf7  minetest-0.4.10.tar.gz"
sha512sums="882723996b4904b4b9e3653476c2b4a988967600fc2b0897f755dd28d5da2ae5cab45a14fcdf8827c3f2838e952399e1e7d7e264cd26070fef2dbcd33cd1c59a  minetest-0.4.10.tar.gz"