blob: c24ce4412ec083d9940e8db5845b1a081503e0e1 (
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
|
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (AUR): George Rawlinson <george@rawlinson.net.nz>
# Contributor (AUR): Max Zhao <alcasa dot mz at gmail dot com>
# Contributor (AUR): Leonard König <leonard.r.koenig at googlemail dot com>
# # I maintain this because:
# Arch version lacks additional optimization and hardening flags
# Arch version uses git
# Arch version forces compilation with all threads
# Arch version forces msse3, and single thread flto
# Arch version compiles a second time during package() with incorrect FLAGS
pkgname=endless-sky
pkgver=0.10.10
pkgrel=1
pkgdesc='A sandbox-style space exploration and combat game'
arch=('x86_64' 'i686' 'aarch64')
url='https://endless-sky.github.io/'
license=(
'GPL-3.0-only'
'CC-BY-3.0'
'CC-BY-4.0'
'CC-BY-NC-3.0'
'CC-BY-SA-3.0'
'CC-BY-SA-4.0'
'LicenseRef-public-domain'
)
options=('lto')
depends=(
'glibc'
'gcc-libs'
'openal'
'libpng'
'glew'
'hicolor-icon-theme'
'libjpeg-turbo'
'sdl2'
'libmad'
'util-linux-libs'
'libglvnd'
)
makedepends=('scons')
optdepends=(
'endless-sky-high-dpi: high resolution graphics assets'
)
source=("$pkgname-$pkgver.tar.gz::https://github.com/endless-sky/endless-sky/archive/v${pkgver}.tar.gz")
b2sums=('be312b00851bc91226a9b5a1462d9587ee38371d0a001afb5e2bad4deb51da3b3e56b03efeaa052afc832c47fb6fe48481dfa43ddf17ff80f4f9cdbcf44d5ce6')
prepare() {
cd "$pkgname-$pkgver"
# binary is installed to /usr/games instead of /usr/bin
sed -i 's:games", sky:bin", sky:' SConstruct
# Stop forcing msse3, O3, and single thread flto
sed \
-e 's|, "-O3", "-flto"||' \
-e 's|env.Append(LINKFLAGS = ["-O3", "-flto"])||' \
-i SConstruct
}
build() {
cd "$pkgname-$pkgver"
export CFLAGS="$CFLAGS -O3 -fPIE"
export CXXFLAGS="$CXXFLAGS -O3 -fPIE"
export LDFLAGS="$LDFLAGS,-pie"
# Fix scons to honor thread count in MAKEFLAGS
scons "${MAKEFLAGS}"
}
package() {
cd "$pkgname-$pkgver"
# For reasons of black magic, adding these flags again prevents a second compilation during this step.
# This halves compilation time.
# Also prevents this second compilation from being used in the resulting package with incorrect FLAGS.
# Madness.
export CFLAGS="$CFLAGS -O3 -fPIE"
export CXXFLAGS="$CXXFLAGS -O3 -fPIE"
export LDFLAGS="$LDFLAGS,-pie"
scons \
DESTDIR="$pkgdir" \
PREFIX=/usr \
install
# license
install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" copyright
}
|