summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: f949d0807bdfe5b44a6d46581bdf6b9f5896b8be (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
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): George Rawlinson <grawlinson@archlinux.org>
# Contributor: (AUR): Dimitris Kiziridis <ragouel at outlook dot com>
# Contributor (AUR): Christian Krause ("wookietreiber") <christian.krause@mailbox.org>

# # I maintain this because:
# AUR version lacks additional optimization and hardening flags

_isaarch64=0
pkgname=freeorion
pkgver=0.5.0.1
pkgrel=1
pkgdesc='A turn-based space empire and galactic conquest game'
url='https://www.freeorion.org'
arch=('x86_64' 'i686' 'aarch64')
license=('GPL2')
options=(lto)
depends=(
  'boost-libs'
  'python'
  'sdl2'
  'libvorbis'
  'glew'
  'openal'
  'hicolor-icon-theme'
  'freetype2'
)
makedepends=(
  'cmake'
  'boost'
)
conflicts=('freeorion-git' 'freeorion-bin')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/freeorion/freeorion/archive/v${pkgver}.tar.gz")
sha512sums=('1c772b10e0f92d80b005fdb626d004cedb7039a8d1a75c85c8c97ad31fb315ce23b070a110036cfa98b6305a67b936b34fedd251e22e965b7067055c7d9b77e0')
b2sums=('855ee3d6aa6b3cb181c4c0575fe12cf7627f03c1a0d02d40e111d4a6bae3da78be9c44776070837faaf2edda19f2f128b57d61de53407196187279e67e0d9f3c')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # PIE breaks compiling
  # aarch64 is prone to oom
if [ "${_isaarch64}" == "1" ]; then
  export CFLAGS="$(echo $CFLAGS | sed 's/ -pipe//' - )"
  export CXXFLAGS="$(echo $CXXFLAGS | sed 's/ -pipe//' - )"
  export CFLAGS="$CFLAGS -O3 -fstack-protector-all -flto=1"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -flto=1"
  export MAKEFLAGS="-j1"
else
  export CFLAGS="$CFLAGS -O3 -fstack-protector-all"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all"
fi

  cmake \
    -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release

  cmake --build build
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  DESTDIR="$pkgdir" cmake --install build
}