summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 80633dc537d6e1cb06970f150854b4ec260c15e7 (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
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Maintainer (Arch): Carl Smedstad <carsme@archlinux.org>
# Contributor (Arch): Eric Bélanger <eric@archlinux.org>

# # I maintain this because:
# Arch version lacks additional optimization and hardening flags
# Arch version broken with arch-style lto

pkgname=lincity-ng
pkgver=2.12.0
pkgrel=1
pkgdesc="A city simulation game"
arch=('x86_64')
url="https://github.com/lincity-ng/lincity-ng"
license=(
  'CC-BY-SA-2.0'
  'GPL-2.0-or-later'
  'LicenseRef-ArevFontsCopyright'
  'LicenseRef-BitstreamVeraFontsCopyright'
)
depends=(
  'gcc-libs'
  'glibc'
  'hicolor-icon-theme'
  'libglvnd'
  'libxml2'
  'physfs'
  'sdl2'
  'sdl2_gfx'
  'sdl2_image'
  'sdl2_mixer'
  'sdl2_ttf'
  'zlib'
)
makedepends=(
  'cmake'
  'libxslt'
)
# # For some reason this breaks compiling. "error: C++ compiler cannot create executables"
# # But old-fashioned raw injection of -flto=auto via export doesn't.
options=(!lto)
source=(https://github.com/lincity-ng/lincity-ng/archive/$pkgname-$pkgver.tar.gz)
sha256sums=('c9ca345a77c42c31ec569af6ca7b81acf39d61291caaaeb449b6bebfd30457e0')
b2sums=('f18def346c56de4553a06e220197ea65c862dd6cb9292ac3315ef6834eea3d3248cfce853f41f9c8f779490916492f816e14e711f51c0c7a41ed013484ac2015')

build() {
  cd ${pkgname}-${pkgname}-${pkgver}

  export CFLAGS="$CFLAGS -O3 -fPIE -flto=auto"
  export CXXFLAGS="$CXXFLAGS -O3 -fPIE -flto=auto"
  export LDFLAGS="$LDFLAGS,-pie"
  
  cmake -S . -B build \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -Wno-dev
  cmake --build build
}

package() {
  cd ${pkgname}-${pkgname}-${pkgver}
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" COPYING-data.txt
  install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" COPYING-fonts.txt
}