summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 90e7a75729cb233584a4496d417f3b3927da71e4 (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
# Maintainer: Tomáš Vyčítal <tom.vycital@gmail.com>
# Contributor: McModder <mcmodder@mcmodder.ru>
# Adapted from the PKGBUILD of openttd-git by McModder <mcmodder@mcmodder.ru>

# list of available versions: https://github.com/OpenTTD/OpenTTD/tags
gittag=1.9.1
pkgver=${gittag//[^0-9.a-zA-Z]/_}
pkgrel=2
pkgname="openttd-$gittag"
pkgdesc='An engine for running Transport Tycoon Deluxe (multiple versions of side by side)'
arch=('i686' 'x86_64')
url='http://openttd.org'
license=('GPL')
depends=('libpng' 'sdl' 'icu' 'fontconfig' 'lzo' 'hicolor-icon-theme' 'desktop-file-utils' 'xz')
optdepends=(
	'openttd-opengfx: free graphics'
	'openttd-opensfx: free soundset'
	'timidity++: for in-game music'
	'allegro4: to launch the game with -v allegro'
)
makedepends=('git')

reponame='openttd'

source=("$reponame::git+https://github.com/OpenTTD/OpenTTD.git#tag=${gittag}")
sha256sums=('SKIP')

build() {
	cd ${reponame}

	# http://site.icu-project.org/download/61#TOC-Migration-Issues
	CXXFLAGS+=' -DU_USING_ICU_NAMESPACE=1'

	./configure \
		--prefix-dir="/usr" \
		--binary-name="${pkgname}" \
		--binary-dir="bin" \
		--data-dir="share/${pkgname}" \
		--install-dir="${pkgdir}" \
		--doc-dir="share/doc/${pkgname}" \
		--menu-name="OpenTTD ${pkgver}" \
		--personal-dir=".${pkgname}"

	make
}

package() {
	cd ${reponame}

	# Makefile.bundle will fail if where will be no readme.txt
	if [[ ! -e readme.txt ]]; then
		cp README.md readme.txt
	fi

	make install
}