blob: ed527ea8a9bbe48023277a17b2c79ff59bb10add (
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Contributor: aqua <aqua@iserlohn-fortress.net>
# Maintainer (Arch): Kyle Keen <keenerd@gmail.com>
# # I maintain this because:
# Arch version is not BN
# BN version has done enough changes I dislike to force me to fork
# Arch version has non-functional desktop file
# Arch version lacks additional optimization and hardening flags
# Arch version segfaults due to -Wp,-D_GLIBCXX_ASSERTIONS
pkgbase=cataclysm-bn
pkgname=(cataclysm-bn cataclysm-bn-tiles)
pkgname=cataclysm-bn
#_pkgname=Cataclysm-BN-cbn
#_pkgname=Cataclysm-BN
#pkgver=0.6.0
pkgver=0.6.3
#pkgver=202310040030
#_pkgver=2023-10-04-0030
pkgrel=2
pkgdesc="A post-apocalyptic roguelike."
#url="http://cataclysmrl.blogspot.com/"
#url="http://www.cataclysm.glyphgryph.com/"
#url="http://en.cataclysmdda.com/"
url="https://github.com/cataclysmbnteam/Cataclysm-BN"
arch=('x86_64' 'aarch64')
license=("CCPL:by-sa")
options=('lto')
depends=(
'gettext'
'hicolor-icon-theme'
'ncurses'
)
makedepends=(
'astyle'
'freetype2'
'lzip'
'sdl2_image'
'sdl2_mixer'
'sdl2_ttf'
)
#source=("$pkgname-$_pkgver.tar.gz::https://github.com/cataclysmbnteam/Cataclysm-BN/archive/refs/tags/cbn-experimental-$_pkgver.tar.gz"
#source=("$pkgname-$pkgver.tar.gz::https://github.com/cataclysmbnteam/Cataclysm-BN/archive/refs/tags/cbn-$pkgver.tar.gz" # Pre 0.5.2
#source=("$pkgname-$pkgver.tar.gz::https://github.com/cataclysmbnteam/Cataclysm-BN/archive/refs/tags/v$pkgver.tar.gz"
source=(
"cataclysm-jc-0.0.3.tar.lz"
"cataclysm-bn.desktop"
"cataclysm-bn-tiles.desktop"
"icon_128x128.png"
#"src-18-v7_monsters-can-go-up-stairs.patch"
#"src-19_triffids-do-not-burrow-v2.patch"
#"src-20_prevent-holstering-gunmods.patch"
"vampirism.patch"
)
b2sums=('8d66556c1f16a34f885c231922ae797bd38fd0de9d914f132e759e0d8329a89bab5c678177f253e9006158923a8ae26a8df11a975f661ade37135237dd4b85b4'
'069ecde58859b3d44cd687c4b6e718610cefb693ff86e66f199ebfb1b3072023ad2b6f0c28e27ef9c1ce4997f6a5b2ca0d45046996b3ff35a4aeaeb1a7cf9421'
'ad88bc6c1e3c8183a313b5eec42f98d6956afea349feff34a86e4536c9921fa99d2594282caf27de8ebb7ffb56376ed2e76d572227bfd6d8173c7bb1f01e23b8'
'6f70e90359a14e4839d9a2683debb88850e5dd387add911ad68fd87e5512cfcdd435da63e1e370358153673fd5a72a9b1e9c94f1979edb7948b4da8c82407bad'
'11ed6cc089964c4dc171b91f83f5ac041ced4b480151f77b21febafe392342ba4931af9c71266d4694a0ed236012ce2cbbb6ad58ff32721766cc4b88f9abe7e4')
prepare() {
#cd "${_pkgname}-${pkgver}"
cd "repo"
# Assorted workarounds
sed \
-e 's/-Werror//' \
-e 's/shell git/shell false/' \
-i Makefile
# Disable default optimizations
sed \
-e 's/-Os/-O3/' \
-e 's/-O0/-O3/' \
-e 's/-Og/-O3/' \
-i Makefile
# Fix version
# sed -i 's|VERSION = unstable|VERSION = "0.2-experimental 2023-10-04-0030"|' Makefile
# sed -i 's|VERSION = unstable|VERSION = "0.6.0"|' Makefile
sed -i 's|VERSION = 0.6.0|VERSION = "0.0.3"|' Makefile
# # # Hotfixes
#echo "Applying hotfixes"
# # # Various other fixes for bugs I came across that modify src
#echo "Applying source code fixes"
# Fix monsters not travelling up stairs: (Still in testing) FIXME
#patch -Np1 --no-backup-if-mismatch -i "$srcdir"/src-18-v7_monsters-can-go-up-stairs.patch
# Fix triffid queens from destroying terrain and burrowing to the center of the Earth: FIXME
# The growplants function was destroying the terrain, not the furniture.
# And since p is somehow being lost, the new terrain was never added.
# This workaround has the side effect of making triffid terraforming silent, but its better than burrowing.
#patch -Np1 --no-backup-if-mismatch -i "$srcdir"/src-19_triffids-do-not-burrow.patch
# Prevent gunmods from being holstered: (Still in testing) FIXME
# This is a hack fix due to how drawing a holstered gunmod that accepts magazines crashes the game.
#patch -Np1 --no-backup-if-mismatch -i "$srcdir"/src-20_prevent-holstering-gunmods.patch
# # # Additional changes
echo "Applying vampirism patch"
# Add vampire mutation lines and modify a number of functions to facilitate these traits.
patch -Np1 --no-backup-if-mismatch -i "$srcdir"/vampirism.patch
}
build() {
#cd "${_pkgname}-${pkgver}"
cd "repo"
#export CFLAGS="$CFLAGS -fPIE"
export CXXFLAGS="$CXXFLAGS -fPIE"
export LDFLAGS="$LDFLAGS,-pie"
# Prevent segfaults when examine tile->search returns no results.
#export CXXFLAGS="$(echo $CXXFLAGS | sed -i 's/-Wp,-D_GLIBCXX_ASSERTIONS//' - )" # No longer works
export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-Wp,-D_GLIBCXX_ASSERTIONS//')"
#echo $CXXFLAGS
# Disable astyle until I can custom build a copy of 3.1
# And disable json linting for the moment
make PREFIX=/usr RELEASE=1 USE_XDG_DIR=1 BACKTRACE=0 LOCALIZE=1 LANGUAGES=all RUNTESTS=0 ASTYLE=0 LINTJSON=0 VERBOSE=1 PCH=0 LUA=0 CCACHE=0
make PREFIX=/usr RELEASE=1 USE_XDG_DIR=1 BACKTRACE=0 LOCALIZE=1 LANGUAGES=all RUNTESTS=0 ASTYLE=0 LINTJSON=0 VERBOSE=1 PCH=0 LUA=0 CCACHE=0 TILES=1 SOUND=1
#./lang/compile_mo.sh
}
package_cataclysm-bn() {
#cd "${_pkgname}-${pkgver}"
cd "repo"
make DESTDIR="$pkgdir" PREFIX="/usr" RELEASE=1 USE_HOME_DIR=1 LOCALIZE=1 LANGUAGES=all RUNTESTS=0 ASTYLE=0 LINTJSON=0 VERBOSE=1 PCH=0 LUA=0 CCACHE=0 install
# Docs
install -d "$pkgdir/usr/share/doc/cataclysm-bn"
cp --reflink -r doc/* "$pkgdir/usr/share/doc/cataclysm-bn"
# Fix tileset readme being duplicated in curses package
rm "$pkgdir/usr/share/cataclysm-bn/json/external_tileset/README.md"
# License
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Languages
cd lang/mo
for i in *; do
install -d "${pkgdir}/usr/share/locale/${i}/LC_MESSAGES"
cp --reflink "${i}/LC_MESSAGES/cataclysm-bn.mo" "${pkgdir}/usr/share/locale/${i}/LC_MESSAGES"
done
# Help
cd ./../..
cp -r --reflink --no-preserve=ownership "./data/help" "${pkgdir}/usr/share/${pkgname}/"
# install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}
package_cataclysm-bn-tiles() {
pkgdesc="A graphical post-apocalyptic roguelike."
depends=(
'cataclysm-bn'
'freetype2'
'sdl2_image'
'sdl2_mixer'
'sdl2_ttf'
)
#cd "${_pkgname}-${pkgver}"
cd "repo"
make DESTDIR="$pkgdir" PREFIX="/usr" RELEASE=1 LOCALIZE=1 LANGUAGES=all RUNTESTS=0 ASTYLE=0 LINTJSON=0 VERBOSE=1 PCH=0 LUA=0 CCACHE=0 TILES=1 SOUND=1 install
# Icon
#install -D 'data/osx/AppIcon.iconset/icon_128x128.png' "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png"
#install -D 'data/osx/AppIcon.iconset/icon_128x128.png' "$pkgdir/usr/share/pixmaps/$pkgname.png"
install -Dm644 "${srcdir}/icon_128x128.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png"
install -Dm644 "${srcdir}/icon_128x128.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
install -Dm644 "${srcdir}/$pkgname.desktop" "${pkgdir}/usr/share/applications/$pkgname.desktop"
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Remove unmaintained UDP tileset
# Use my forked cataclysm-bn-tileset package for a working UDP tileset
rm -rf "$pkgdir/usr/share/cataclysm-bn/gfx/MSX++UnDeadPeopleEdition"
# hack: remove overlapping files
cd "$pkgdir/../cataclysm-bn"
find . -type f -exec rm -f "$pkgdir"/{} \;
cd "$pkgdir"
find . -type d -empty -delete
# Fix mapgen readme being duplicated in tileset package
rm "$pkgdir/usr/share/cataclysm-bn/json/mapgen/lab/README.md"
}
|