summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4737fb01922643d2835e312762ebdc234bac813e (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
# Maintainer: begin-theadventure <begin-thecontact.ncncb at dralias dot com>

pkgname=flightcore
pkgver=2.26.1
_commit=2fd8a99fcdd4d0c40221e1234b7f10299fad27dc
pkgrel=1
pkgdesc="Installer/Updater/Launcher for Northstar"
url="https://github.com/R2NorthstarTools/FlightCore"
license=('MIT')
arch=('x86_64')
depends=('bzip2' 'gcc-libs' 'hicolor-icon-theme' 'webkit2gtk')
makedepends=('cargo' 'git' 'npm')
options+=('!lto')
source=("git+$url.git#commit=$_commit")
sha256sums=('SKIP')

prepare() {
# Shortcut
  echo -e '[Desktop Entry]
Categories=Development;
Exec=flightcore
Icon=flightcore
Name=FlightCore
Terminal=false
Type=Application' > $pkgname.desktop

# Only build the executable
  cd FlightCore/src-tauri
  sed -i '/"bundle": {/,/},/{/"active":/s/true/false/}' tauri.conf.json
# Disable the updater
  sed -i '/"updater": {/,/},/{/"active":/s/true/false/}' tauri.conf.json
  cd ..

# Prioritize IPv4 (some machines have a problem with IPv6)
  export NODE_OPTIONS=--dns-result-order=ipv4first

# npm dependencies
  export CARGO_HOME="$srcdir/CARGO_HOME"
  export npm_config_cache="$srcdir/npm_cache"
  npm install
  cd src-vue
  npm install
}

build() {
  export CARGO_HOME="$srcdir/CARGO_HOME"
  export RUSTUP_TOOLCHAIN=stable
  export npm_config_cache="$srcdir/npm_cache"
  cd FlightCore
  npm run tauri build
}

package() {
  install -Dm644 $pkgname.desktop -t "$pkgdir/usr/share/applications"
  cd FlightCore
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
  cd docs
  install -Dm644 ../README.md DEV-TOOLS.md DEVELOPMENT.md FAQ.md TROUBLESHOOTING.md\
  -t "$pkgdir/usr/share/doc/$pkgname"
  cd ../src-tauri/icons
  _icdr=usr/share/icons/hicolor
  install -Dm644 32x32.png "$pkgdir/$_icdr/32x32/apps/$pkgname.png"
  install -Dm644 128x128.png "$pkgdir/$_icdr/128x128/apps/$pkgname.png"
  install -Dm644 128x128@2x.png "$pkgdir/$_icdr/256x256/apps/$pkgname.png"
  install -Dm644 icon.png "$pkgdir/$_icdr/512x512/apps/$pkgname.png"
  install -Dm755 ../target/release/flight-core "$pkgdir/usr/bin/$pkgname"
}