PKGBUILD 2.73 KB
Newer Older
gnastyle's avatar
gnastyle committed
1 2
pkgbase=flightgear
pkgname=('flightgear' 'flightgear-data')
3
pkgver=2018.2.2
4
pkgrel=1
gnastyle's avatar
gnastyle committed
5
_pkgver=${pkgver%.*}
6
pkgdesc="An open-source, multi-platform flight simulator."
7
url="https://home.flightgear.org/"
utg's avatar
utg committed
8
arch=('x86_64')
9 10
depends=('libxmu' 'libxi' 'zlib' 'openscenegraph' 'subversion' 'libxrandr' 'glu' 'openal')
makedepends=('boost' 'cmake' 'mesa' 'sharutils' 'plib' 'freeglut' 'freealut' 'glew' 'qt5-base' 'qt5-declarative')
gnastyle's avatar
gnastyle committed
11
license=('GPL')
12
screenshot="http://www.flightgear.org/wp-content/gallery/gallery-v2-6/737-300_egkk_hom.jpg"
Giuseppe's avatar
Giuseppe committed
13
categories=('games')
14 15
options=('makeflags' 'staticlibs' '!strip')
source=( # flightgear
16
        "https://downloads.sourceforge.net/project/flightgear/release-$_pkgver/flightgear-$pkgver.tar.bz2"
17
         # flightgear-data
18
        "https://downloads.sourceforge.net/project/flightgear/release-$_pkgver/FlightGear-$pkgver-data.tar.bz2"
19
         # simgear
20
        "https://downloads.sourceforge.net/project/flightgear/release-$_pkgver/simgear-$pkgver.tar.bz2")
21 22 23
sha1sums=('7bf06d3ad218ce4e99eede7aa250fbdf938eb7a3'
          '4244106a93841e8fe27422134ec7cdcd91c03658'
          'ba24275236aa461c4b0fee3e37e4fb6877734a1c')
Jeff Huang's avatar
Jeff Huang committed
24 25

prepare() {
26
  mkdir -p fake_install
Jeff Huang's avatar
Jeff Huang committed
27
}
28 29

build() {
30
  # build simgear
31
  cd simgear-$pkgver
32
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .
gnastyle's avatar
gnastyle committed
33
  make
34
  make DESTDIR=../fake_install install
utg's avatar
utg committed
35

gnastyle's avatar
gnastyle committed
36
  # build flightgear
37 38 39
  cd ../$pkgbase-$pkgver
  INCLUDEPATH+=../fake_install/usr/include/simgear
  LD_PRELOAD=../fake_install/usr/lib/{libSimGearCore.a,libSimGearScene.a}
40
  cmake \
utg's avatar
utg committed
41 42
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
gnastyle's avatar
gnastyle committed
43
	-DFG_DATA_DIR:STRING="/usr/share/flightgear/data" \
44 45 46
	-DSimGear_DIR=../fake_install/usr/lib/cmake/SimGear \
	-DCMAKE_BUILD_TYPE=Release \
	-DFG_BUILD_TYPE=Release
47
  make
48
  sed -i 's|Exec=.*|Exec=fgfs --fg-root=/usr/share/flightgear/data|' package/org.flightgear.FlightGear.desktop  
49 50
}

gnastyle's avatar
gnastyle committed
51
package_flightgear() {
52
  depends+=('flightgear-data' 'qt5-base' 'qt5-declarative')
53

gnastyle's avatar
gnastyle committed
54
  cd $pkgbase-$pkgver
55
  
56 57
  make DESTDIR=$pkgdir install

utg's avatar
utg committed
58
  # Desktop Integration
59
  install -Dm0644 package/org.flightgear.FlightGear.desktop $pkgdir/usr/share/applications/org.flightgear.FlightGear.desktop
utg's avatar
utg committed
60
  install -Dm0644 package/flightgear.ico $pkgdir/usr/share/icons/flightgear.ico
gnastyle's avatar
gnastyle committed
61
  install -Dm0644 scripts/completion/fg-completion.bash $pkgdir/usr/share/bash-completion/completions/fgfs
62
  install -Dm0644 scripts/completion/fg-completion.zsh "$pkgdir"/usr/share/zsh/site-functions/_fgfs
utg's avatar
utg committed
63
  ln -sf flightgear $pkgdir/usr/share/FlightGear
gnastyle's avatar
gnastyle committed
64 65 66 67
}

package_flightgear-data(){
  pkgdesc="Base-Data for FlightGear - contains aircraft and world map addons"
68
  arch=('x86_64')
utg's avatar
utg committed
69

gnastyle's avatar
gnastyle committed
70 71 72
  install -d $pkgdir/usr/share/flightgear
  mv fgdata/ $pkgdir/usr/share/flightgear/data
  chown root:root $pkgdir/usr/share/flightgear/data
73
}