summaryrefslogtreecommitdiff
path: root/freeminer-git/PKGBUILD
blob: f8579ba4070d6bb095c2d32f9339be9532f7c2ac (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Olivia May <olivia.may@tuta.io>
# Contributor: Felix Golatofski <contact@xdfr.de>
# Contributor: Frederic Bezies <fredbezies at gmail dot com>
# Contributor: Alfredo Ramos <alfredo dot ramos at yandex dot com>
# Contributor: Martin C. Doege <mdoege at compuserve dot com>
# Contributor: kusakata <shohei atmark kusakata period com>

_pkgbase=freeminer
pkgbase="${_pkgbase}-git"
pkgname=("${_pkgbase}-git" "${_pkgbase}-server-git" "${_pkgbase}-common-git")
pkgver=0.4.14.8.r6633.g9e9c77698
pkgrel=1
arch=('i686' 'pentium4' 'x86_64')
url='https://freeminer.org/'
license=('GPL3' 'CCPL:cc-by-sa-3.0')

makedepends=(
	'leveldb' 'curl' 'git' 'hiredis' 'sqlite' 'libglvnd' 'libjpeg-turbo' 'libxi' 'luajit'
	'openal' 'libvorbis' 'hicolor-icon-theme' 'freetype2' 'cmake' 'doxygen'
)

prepare() {
	cd "${srcdir}"
	
	git clone --recursive "https://github.com/${_pkgbase}/${_pkgbase}"

	# Create build directory
	mkdir -p "${srcdir}"/build-{client,server}
}

pkgver() {
	cd "${srcdir}"/${_pkgbase}
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	# Building client
	cd "${srcdir}"/build-client
	cmake ../${_pkgbase} \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_CLIENT=1 \
		-DBUILD_SERVER=0 \
		-DRUN_IN_PLACE=0
	
	nice make

	# Building server
	cd "${srcdir}"/build-server
	cmake ../${_pkgbase} \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_CLIENT=0 \
		-DBUILD_SERVER=1 \
		-DRUN_IN_PLACE=0

	nice make
}

package_freeminer-git() {
	pkgdesc='An open source sandbox game inspired by Minecraft'
	_pinned_dependencies=(
	  'gcc-libs=14.1.1+r58+gfc9fb69ad62'
	  'glibc>=2.38'
	  'gmp=6.3.0'
	  'hiredis=1.2.0'
	  'leveldb=1.23'
	  'libcurl.so=4'
	  'libfreetype.so=6'
	  'libGL.so=1'
	  'libjpeg.so=8'
	  'libjsoncpp.so=25'
	  'libncursesw.so=6'
	  'libopenal.so=1'
	  'libpng16.so=16'
	  'libsqlite3.so=0'
	  'libvorbisfile.so=3'
	  'libx11=1.8.9'
	  'libxi=1.8.1'
	  'libz.so=1'
	  'libzstd.so=1'
	  'luajit=2.1.1716656478'
	)
	depends=(
		"${_pkgbase}-common-git" 'leveldb' 'curl' 'hiredis' 'sqlite'
		'luajit' 'openal' 'libvorbis' 'hicolor-icon-theme' 'freetype2' 'doxygen'
		"${_pinned_dependencies[@]}"
	)
	provides=("${_pkgbase}=${pkgver}")
	conflicts=("${_pkgbase}")

	# Installing client
	cd "${srcdir}"/build-client
	make DESTDIR="${pkgdir}" install

	# Translations
	cp -R locale "${pkgdir}"/usr/share/

	# Provided by freeminer-common
	rm -fR "${pkgdir}"/usr/share/{${_pkgbase},doc}

	# Provided by freeminer-server
	rm -f "${pkgdir}"/usr/share/man/man6/${_pkgbase}server.6
}

package_freeminer-server-git() {
	pkgdesc='Server of an open source sandbox game inspired by Minecraft'
	_pinned_dependencies=(
	  'gcc-libs=14.1.1+r58+gfc9fb69ad62'
	  'glibc>=2.38'
	  'gmp=6.3.0'
	  'hiredis=1.2.0'
	  'leveldb=1.23'
	  'libcurl.so=4'
	  'libjsoncpp.so=25'
	  'libncursesw.so=6'
	  'libsqlite3.so=0'
	  'libz.so=1'
	  'libzstd.so=1'
	  'luajit=2.1.1716656478'
	)
	depends=(
		"${_pkgbase}-common-git" 'leveldb' 'curl' 'hiredis' 'sqlite'
		'luajit' 'doxygen'
		"${_pinned_dependencies[@]}"
	)
	provides=("${_pkgbase}-server=${pkgver}")
	conflicts=("${_pkgbase}-server")

	# Installing server
	cd "${srcdir}"/build-server
	make DESTDIR="${pkgdir}" install

	# Provided by freeminer
	rm -fR "${pkgdir}"/usr/share/{metainfo,appdata,applications,icons}
	rm -f "${pkgdir}"/usr/share/man/man6/${_pkgbase}.6

	# Provided by freeminer-common
	rm -fR "${pkgdir}"/usr/share/{${_pkgbase},doc}
}

package_freeminer-common-git() {
	pkgdesc="Common data files for ${_pkgbase}-git and ${_pkgbase}-server-git"
	arch=('any')
	provides=("${_pkgbase}-common=${pkgver}")
	conflicts=("${_pkgbase}-common")
	_pinned_dependencies=(
	)

	# Install common data files
	cd "${srcdir}"/${_pkgbase}
	mkdir -p "${pkgdir}"/usr/share/${_pkgbase}/{,doc}
	cp -R {games,builtin,client,fonts,textures} "${pkgdir}"/usr/share/${_pkgbase}/
	cp doc/*.txt "${pkgdir}"/usr/share/${_pkgbase}/doc/
}