mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 10:32:13 +08:00
74 lines
2.7 KiB
Bash
74 lines
2.7 KiB
Bash
pkgbase=flightgear
|
|
pkgname=('flightgear' 'flightgear-data')
|
|
pkgver=2018.2.2
|
|
pkgrel=1
|
|
_pkgver=${pkgver%.*}
|
|
pkgdesc="An open-source, multi-platform flight simulator."
|
|
url="https://home.flightgear.org/"
|
|
arch=('x86_64')
|
|
depends=('libxmu' 'libxi' 'zlib' 'openscenegraph' 'subversion' 'libxrandr' 'glu' 'openal')
|
|
makedepends=('boost' 'cmake' 'mesa' 'sharutils' 'plib' 'freeglut' 'freealut' 'glew' 'qt5-base' 'qt5-declarative')
|
|
license=('GPL')
|
|
screenshot="http://www.flightgear.org/wp-content/gallery/gallery-v2-6/737-300_egkk_hom.jpg"
|
|
categories=('games')
|
|
options=('makeflags' 'staticlibs' '!strip')
|
|
source=( # flightgear
|
|
"https://downloads.sourceforge.net/project/flightgear/release-$_pkgver/flightgear-$pkgver.tar.bz2"
|
|
# flightgear-data
|
|
"https://downloads.sourceforge.net/project/flightgear/release-$_pkgver/FlightGear-$pkgver-data.tar.bz2"
|
|
# simgear
|
|
"https://downloads.sourceforge.net/project/flightgear/release-$_pkgver/simgear-$pkgver.tar.bz2")
|
|
sha1sums=('7bf06d3ad218ce4e99eede7aa250fbdf938eb7a3'
|
|
'4244106a93841e8fe27422134ec7cdcd91c03658'
|
|
'ba24275236aa461c4b0fee3e37e4fb6877734a1c')
|
|
|
|
prepare() {
|
|
mkdir -p fake_install
|
|
}
|
|
|
|
build() {
|
|
# build simgear
|
|
cd simgear-$pkgver
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .
|
|
make
|
|
make DESTDIR=../fake_install install
|
|
|
|
# build flightgear
|
|
cd ../$pkgbase-$pkgver
|
|
INCLUDEPATH+=../fake_install/usr/include/simgear
|
|
LD_PRELOAD=../fake_install/usr/lib/{libSimGearCore.a,libSimGearScene.a}
|
|
cmake \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
|
-DFG_DATA_DIR:STRING="/usr/share/flightgear/data" \
|
|
-DSimGear_DIR=../fake_install/usr/lib/cmake/SimGear \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DFG_BUILD_TYPE=Release
|
|
make
|
|
sed -i 's|Exec=.*|Exec=fgfs --fg-root=/usr/share/flightgear/data|' package/org.flightgear.FlightGear.desktop
|
|
}
|
|
|
|
package_flightgear() {
|
|
depends+=('flightgear-data' 'qt5-base' 'qt5-declarative')
|
|
|
|
cd $pkgbase-$pkgver
|
|
|
|
make DESTDIR=$pkgdir install
|
|
|
|
# Desktop Integration
|
|
install -Dm0644 package/org.flightgear.FlightGear.desktop $pkgdir/usr/share/applications/org.flightgear.FlightGear.desktop
|
|
install -Dm0644 package/flightgear.ico $pkgdir/usr/share/icons/flightgear.ico
|
|
install -Dm0644 scripts/completion/fg-completion.bash $pkgdir/usr/share/bash-completion/completions/fgfs
|
|
install -Dm0644 scripts/completion/fg-completion.zsh "$pkgdir"/usr/share/zsh/site-functions/_fgfs
|
|
ln -sf flightgear $pkgdir/usr/share/FlightGear
|
|
}
|
|
|
|
package_flightgear-data(){
|
|
pkgdesc="Base-Data for FlightGear - contains aircraft and world map addons"
|
|
arch=('x86_64')
|
|
|
|
install -d $pkgdir/usr/share/flightgear
|
|
mv fgdata/ $pkgdir/usr/share/flightgear/data
|
|
chown root:root $pkgdir/usr/share/flightgear/data
|
|
}
|