blob: ab1e2b5156e4bc95ac26214c99d1018410785476 (
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
|
# Maintainer: Sam S <smls75@gmail.com>
# Based on the 'community/openttd' PKGBUILD by: Vesa Kaihlavirta <vegai@iki.fi>
pkgname=openttd-jgrpp-git
_installname=openttd
pkgver=1.6.0+r27564+p0.13.2+r3.0f11908
pkgrel=1
pkgdesc="OpenTTD with JGR's patch pack"
arch=('i686' 'x86_64')
url='http://www.tt-forums.net/viewtopic.php?f=33&t=73469'
license=('GPL')
depends=('libpng' 'sdl' 'icu' 'fontconfig' 'lzo' 'hicolor-icon-theme' 'desktop-file-utils' 'xz')
conflicts=('openttd')
install=openttd-jgrpp.install
optdepends=('openttd-opengfx: free graphics'
'openttd-opensfx: free soundset')
_gitname=OpenTTD-patches
# If you want the latest *stable* release of the patch pack, uncomment this line:
# _fragment="#tag=jgrpp-0.12.0"
#_fragment=#branch=crashlog_header_compile_fix_tmp
source=("git+https://github.com/JGRennison/$_gitname.git$_fragment"
"http://finger.openttd.org/tags.txt")
sha256sums=(SKIP SKIP)
pkgver() {
cd "$_gitname"
_openttdrev="$(./findversion.sh | cut -f2)"
_openttdver="$(cat "$srcdir"/tags.txt |
awk '$1<='"$_openttdrev"' {print $3; exit}' |
sed -e 's/[^0-9a-z.]//ig' -e 's/./\L&/g')"
rm "$srcdir"/tags.txt # make sure it is re-downloaded nect time the package is built
_patchtag="$(git describe --abbrev=0 --tags)"
_patchver="$(echo $_patchtag | sed -e 's/^[a-z-]*//')"
_patchcommits="$(git log "$_patchtag".. --pretty=oneline | wc -l)"
_patchrev=$(LC_ALL=C git log -1 --format="%h")
_patchsuffix=""
[[ $_patchcommits -ne 0 ]] && _patchsuffix="+r$_patchcommits.$_patchrev"
echo "$_openttdver+r$_openttdrev+p$_patchver$_patchsuffix"
}
build() {
cd $_gitname
# sed -i'' -E 's|\#include \"safeguards\.h\"|#include <string>\n#include "safeguards.h"|' src/crashlog.cpp
./configure \
--prefix-dir=/usr \
--binary-name=$_installname \
--binary-dir=bin \
--data-dir=share/$_installname \
--install-dir=$pkgdir \
--doc-dir=share/doc/$_installname \
--menu-name="OpenTTD" \
--personal-dir=.$_installname # \
# --without-libbfd
make
}
package() {
cd $_gitname
mkdir -p "$pkgdir"/usr/share/$_installname/{data,game}
make install
cp -rT bin/game "$pkgdir"/usr/share/$_installname/game
}
|