-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathtemplate
More file actions
114 lines (97 loc) · 4.1 KB
/
Copy pathtemplate
File metadata and controls
114 lines (97 loc) · 4.1 KB
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
# Template file for '0ad'
pkgname=0ad
version=0.28.0
revision=1
archs="x86_64* i686* aarch64* armv7l* ppc64le* riscv64*"
# Unclear whether ppc64le and riscv64 will work, though upstream seems to support them
build_helper=rust
_cxxtest_version=4.4
_fcollada_version=28209
_nvtt_version=28209
hostmakedepends="pkg-config perl cmake python3 rust cargo yasm llvm xz m4
premake5 subversion"
makedepends="SDL2-devel boost-devel-minimal libboost_filesystem
gloox-devel libcurl-devel libenet-devel
libopenal-devel libpng-devel libsodium-devel libxml2-devel miniupnpc-devel
nspr-devel wxWidgets-gtk3-devel fmt-devel freetype-devel mozjs128-devel"
depends="0ad-data"
checkdepends="0ad-data"
short_desc="Historically-based real-time strategy game"
maintainer="Helmut Pozimski <helmut@pozimski.eu>"
license="GPL-2.0-or-later, CC-BY-SA-3.0, MPL-2.0, MIT"
homepage="https://play0ad.com"
distfiles="
https://releases.wildfiregames.com/${pkgname}-${version}-unix-build.tar.xz
https://github.com/CxxTest/cxxtest/archive/refs/tags/${_cxxtest_version}.tar.gz>cxxtest-${_cxxtest_version}.tar.gz"
checksum="27e217755ef76a922fe58dbf593d96e54b6ed2375d23f548c35619aa6bd5a42a
1c154fef91c65dbf1cd4519af7ade70a61d85a923b6e0c0b007dc7f4895cf7d8"
skip_extraction="cxxtest-${_cxxtest_version}.tar.gz"
lib32disabled=yes
CXXFLAGS="-fpermissive"
# Use BFD linker to avoid erroneous detection of llvm pr8927 with *-musl
LDFLAGS="-fuse-ld=bfd"
export WX_CONFIG="wx-config-gtk3"
if [ "$XBPS_TARGET_LIBC" = musl ]; then
makedepends+=" libexecinfo-devel"
fi
post_extract() {
# tests still need to be extracted and built as a library as it is a dependency internally (for now)
msg_normal "Extracting cxxtest-${_cxxtest_version}"
vsrcextract -C ${wrksrc}/libraries/source/cxxtest-${_cxxtest_version}/ --no-strip-components cxxtest-${_cxxtest_version}.tar.gz
msg_normal "Fetching fcollada from svn\n"
svn export --quiet https://svn.wildfiregames.com/public/source-libs/trunk/fcollada@${_fcollada_version} ${wrksrc}/libraries/source/fcollada/fcollada-${_fcollada_version}
msg_normal "Fetching nvtt from svn\n"
svn export --quiet https://svn.wildfiregames.com/public/source-libs/trunk/nvtt@${_nvtt_version} ${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}
}
post_patch() {
msg_normal "Applying patch 0ad/files/nvtt-ppc-musl.patch\n"
patch -sNp1 -i ${FILESDIR}/nvtt-ppc-musl.patch -d ${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}
msg_normal "Applying patch 0ad/files/nvtt-ppc64.patch\n"
patch -sNp1 -i ${FILESDIR}/nvtt-ppc64.patch -d ${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
echo "TARGET_LINK_LIBRARIES(nvcore execinfo)" >> \
${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}/src/src/nvcore/CMakeLists.txt
fi
}
do_build() {
export JOBS="${makejobs}"
case "$XBPS_TARGET_MACHINE" in
i686*)
CXXFLAGS=" -msse2"
;;
esac
_build_options="--with-system-premake5 --with-lto --with-system-mozjs "
if [ -n "$CROSS_BUILD" ]; then
_build_options+="--without-tests "
fi
cd ${wrksrc}/libraries
msg_normal "Building libraries\n"
# These have to be set separately, as passing extra arguments errors out
./build-source-libs.sh --with-system-premake --with-system-mozjs
cd ${wrksrc}/build/workspaces
msg_normal "Building the project\n"
./update-workspaces.sh ${_build_options} \
--bindir=/usr/bin --libdir=/usr/lib/${pkgname} --datadir=/usr/share/${pkgname}/data
cd ${wrksrc}
make config=release -C build/workspaces/gcc ${makejobs}
}
pre_check() {
ln -sf /usr/share/${pkgname}/data/mods/mod ${wrksrc}/binaries/data/mods
ln -sf /usr/share/${pkgname}/data/mods/public ${wrksrc}/binaries/data/mods
ln -sf ${wrksrc}/binaries/system /usr/lib/${pkgname}
}
do_check() {
cd ${wrksrc}/binaries/system/
./test
}
do_install() {
vbin binaries/system/pyrogenesis
vmkdir usr/lib/${pkgname}
vcopy binaries/system/*.so usr/lib/${pkgname}
vmkdir usr/share/${pkgname}/data
vcopy binaries/data/l10n usr/share/${pkgname}/data
vbin build/resources/${pkgname}.sh ${pkgname}
vinstall build/resources/${pkgname}.desktop 0644 usr/share/applications
vinstall build/resources/${pkgname}.png 0644 usr/share/pixmaps
vlicense LICENSE.md
}