blob: 055bf9ae7eb77fdb8271db91c3ea96806c350d53 (
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
|
# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>
# Contributor: Duy Truong <jimreynold2nd@yahoo.com>
pkgname=ubports-installer
pkgver=0.10.0
pkgrel=1
pkgdesc='A simple tool to install Ubuntu Touch on UBports devices'
arch=('x86_64' 'i686')
url='https://github.com/ubports/ubports-installer'
license=('GPL3')
depends=('android-tools' 'android-udev' 'electron' 'e2fsprogs' 'heimdall' 'p7zip')
makedepends=('npm' 'nodejs' 'electron')
options=('!strip' '!emptydirs')
conflicts=('ubports-installer-git' 'ubports-installer-bin')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ubports/${pkgname}/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('9962c0e44c28c13e5e77b16804514721009e899b035615edbf404a9bf1a08259')
_srcdir="$pkgname-$pkgver"
prepare() {
cd "$_srcdir"
npm ci
}
build() {
cd "$_srcdir"
npm run build
./node_modules/.bin/electron-builder --linux --x64 --dir -c.electronDist=/usr/lib/electron -c.electronVersion="$(cat /usr/lib/electron/version)"
}
package() {
cd "$_srcdir"
find ./dist/linux-unpacked/resources/app.asar.unpacked -type d \( -name linux -o -name mac -o -name win32 -o -name darwin \) -print -exec rm -rf {} + &>/dev/null
install -dm755 "$pkgdir/usr/share/${pkgname}"
cp -rt "$pkgdir/usr/share/${pkgname}" dist/linux-unpacked/*
cd build/icons
for i in *x*.png; do
install -Dm644 "$i" "$pkgdir/usr/share/icons/hicolor/${i%.png}/apps/ubports-installer.png"
done
install -Dm755 <(cat << EOF
#!/usr/bin/env sh
USE_SYSTEM_7ZA=true USE_SYSTEM_TOOLS=1 electron /usr/share/${pkgname}/resources/app.asar "\$@"
EOF
) "${pkgdir}/usr/bin/${pkgname}"
install -Dm644 <(cat << EOF
[Desktop Entry]
Name=UBports Installer
Comment=UBports Installer
Exec=${pkgname} %U
Terminal=false
Type=Application
Icon=${pkgname}
Categories=System
EOF
) "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}
|