blob: 7ca611556e368885ddd2e79c6e492d36fc40cc17 (
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
# Maintainer: Jan Cholasta <grubber at grubber cz>
# Build with the recommended fmodex version:
_fmodex=4.26.36
# Build with the currently installed fmodex version:
#_fmodex=$(LC_ALL=C pacman -Q fmodex | grep -Po '(?<= ).+(?=-)')
# Build without fmodex:
#_fmodex=
# Build with OpenAL:
_openal=1
# Build without OpenAL:
#_openal=
_name=gzdoom
pkgname=${_name}-git
pkgver=2.2pre.709.g6f28735
pkgrel=1
_label='GZDoom'
_desc='Advanced Doom source port with OpenGL support'
pkgdesc="${_desc} (git version)"
arch=('i686' 'x86_64')
url='http://www.zdoom.org/'
license=('BSD' 'custom:BUILD' 'custom:doom' 'custom:dumb' 'LGPL')
depends=('fluidsynth'
${_fmodex:+"fmodex=$_fmodex"}
'gtk2'
'gxmessage'
'libgl'
'libgme'
${_openal:+'libsndfile'}
${_openal:+'mpg123'}
${_openal:+'openal'}
'sdl2')
makedepends=('cmake'
'desktop-file-utils'
'git'
'imagemagick'
'xdg-utils')
makedepends_i686=('nasm')
optdepends=('blasphemer-wad: Blasphemer (free Heretic) game data'
'chexquest3-wad: Chex Quest 3 game data'
'doom1-wad: Doom shareware game data'
'freedoom: FreeDoom game data'
'hacx-wad: HacX game data'
'harmony-wad: Harmony game data'
'heretic1-wad: Heretic shareware game data'
'hexen1-wad: Hexen demo game data'
'strife0-wad: Strife shareware game data'
'square1-wad: The Adventures of Square, Episode 1 game data'
'urbanbrawl-wad: Urban Brawl: Action Doom 2 game data')
provides=("${_name}")
conflicts=("${_name}")
install=install
source=("${_name}::git://github.com/coelckers/${_name}.git"
'desktop.template'
'0001-Mark-stack-as-not-executable-in-assembler-sources.patch'
'0002-Include-SHARE_DIR-in-IWADSearch.Directories.patch')
_srcsubdir="${_name}"
sha256sums=('SKIP'
'f2c58925238fe0d01e630527c8c4431681ccaec2d763ba075429b747d1a98a8c'
'52d03619b1e53d0d033eabc818661406a7b623918e81f6ca395e9ff2e9f77d2b'
'56ef41d8f96053886919a11a44a9e8080fbbee35e65631ad4aceb204a29b2ee6')
pkgver() {
cd "${_srcsubdir}"
git describe --long --tags --match '[Gg]*' | sed -r 's/^[Gg]//;s/([^-]*-g)/\1/;s/-/./g'
}
prepare() {
cd "${_srcsubdir}"
local _file
for _file in "${source[@]}"; do
if [[ "${_file}" == *.patch ]]; then
patch -p1 <"${srcdir}/${_file}"
fi
done
}
build() {
cd "${_srcsubdir}"
cat >"${_name}.sh" <<EOF
#!/bin/sh
exec /usr/lib/${_name}/${_name} "\$@"
EOF
local _nofmod _noopenal _fmodincdir
if [[ -n "${_fmodex}" ]]; then
_nofmod=OFF
_fmodincdir="/usr/include/fmodex-${_fmodex}"
if [[ ! -e "${_fmodincdir}" ]]; then
_fmodincdir='/usr/include/fmodex'
fi
else
_nofmod=ON
fi
if [[ -n "${_openal}" ]]; then
_noopenal=OFF
else
_noopenal=ON
fi
cmake -DNO_FMOD=${_nofmod} \
-DNO_OPENAL=${_noopenal} \
-DGME_INCLUDE_DIR='/usr/include/gme' \
-DFMOD_INCLUDE_DIR="${_fmodincdir}" \
-DFMOD_LIBRARY="/usr/lib/libfmodex-${_fmodex}.so" \
-DFORCE_INTERNAL_GME=OFF \
-DCMAKE_C_FLAGS="$CFLAGS -DSHARE_DIR=\\\"/usr/share/${_name}\\\"" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -DSHARE_DIR=\\\"/usr/share/${_name}\\\"" \
.
make
sed -n '/\*\*-/,/\*\*-/p' 'src/version.h' >'bsd.txt'
cp "${srcdir}/desktop.template" "${_name}.desktop"
desktop-file-edit --set-name="${_label}" \
--set-generic-name="${_desc}" \
--set-icon="${_name}" \
--set-key=Exec --set-value="${_name} %F" \
"${_name}.desktop"
mkdir 'icons'
convert 'src/win32/icon1.ico[2]' 'icons/48.png'
convert 'src/win32/icon1.ico[3]' 'icons/32.png'
convert 'src/win32/icon1.ico[4]' 'icons/16.png'
}
package() {
cd "${_srcsubdir}"
install -D "${_name}.sh" "${pkgdir}/usr/bin/${_name}"
mkdir -p "${pkgdir}/usr/lib/${_name}"
install "${_name}" "${pkgdir}/usr/lib/${_name}/"
install -m644 "${_name}.pk3" "${pkgdir}/usr/lib/${_name}/"
if [[ -n "${_fmodex}" ]]; then
install 'liboutput_sdl.so' "${pkgdir}/usr/lib/${_name}/"
fi
mkdir -p "${pkgdir}/usr/share/${_name}"
install -m644 'brightmaps.pk3' "${pkgdir}/usr/share/${_name}/"
install -m644 'lights.pk3' "${pkgdir}/usr/share/${_name}/"
ln -s '/usr/share/doom/doom.wad' "${pkgdir}/usr/share/${_name}/freedoomu.wad"
ln -s '/usr/share/doom/doom2.wad' "${pkgdir}/usr/share/${_name}/freedoom.wad"
ln -s '/usr/share/doom/heretic.wad' "${pkgdir}/usr/share/${_name}/blasphemer.wad"
ln -s '/usr/share/doom/hexen.wad' "${pkgdir}/usr/share/${_name}/hexendemo.wad"
mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}"
install -m644 'bsd.txt' "${pkgdir}/usr/share/licenses/${pkgname}/bsd.txt"
install -m644 'docs/BUILDLIC.TXT' "${pkgdir}/usr/share/licenses/${pkgname}/buildlic.txt"
install -m644 'docs/doomlic.txt' "${pkgdir}/usr/share/licenses/${pkgname}/doomlic.txt"
install -m644 'dumb/licence.txt' "${pkgdir}/usr/share/licenses/${pkgname}/dumb.txt"
desktop-file-install --dir="${pkgdir}/usr/share/applications" "${_name}.desktop"
mkdir -p "${pkgdir}/usr/share/icons/hicolor"
(
cd 'icons'
export XDG_DATA_DIRS="${pkgdir}/usr/share"
local _file
for _file in *.png; do
xdg-icon-resource install --noupdate \
--novendor \
--size "${_file%.png}" \
"${_file}" \
"${_name}"
done
)
}
|