summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Lisin2019-03-02 03:23:10 +0100
committerMatthias Lisin2019-03-02 03:32:34 +0100
commitc2a7ed3a4f4658dc633e01788c048a521f3c7d2f (patch)
tree7cf60314507b328e20b5a71560162a60b7f3acdf
parente7f18b6e98e3aa384791f7a4a62f267bbfd6290c (diff)
downloadaur-c2a7ed3a4f4658dc633e01788c048a521f3c7d2f.tar.gz
upgpkg: ubports-installer-git 2
- Add android-udev to depends. - Update electron2 dependency to electron. (3) - Add jq to makedepends. - Use jq to patch json file (system electron dir and version). - Expand tabs to spaces. Lel. - Install desktop file. - Uninstall useless npm packages. - Remove electron-sudo and make app rootless.
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD40
-rw-r--r--rootless.patch21
-rwxr-xr-xubports-installer2
-rw-r--r--use-system-electron2.patch11
5 files changed, 50 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9d382cfeae3..65abd6ab7de 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,26 @@
pkgbase = ubports-installer-git
pkgdesc = A simple tool to install Ubuntu Touch on UBports devices
pkgver = 0.1.21_beta.r23.ga569e6b
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/ubports/ubports-installer
arch = any
license = GPL3
makedepends = git
+ makedepends = jq
makedepends = npm
depends = android-tools
- depends = electron2
+ depends = android-udev
+ depends = electron
provides = ubports-installer
conflicts = ubports-installer
source = ubports-installer-git::git+https://github.com/ubports/ubports-installer.git
source = ubports-installer
source = ubports-installer.desktop
- source = use-system-electron2.patch
+ source = rootless.patch
sha512sums = SKIP
- sha512sums = 55bba31095b0d38b3571e274be585abd426cfb30bbda42244dcb11ebc183d87bf8db040884f46072e4e66a682fe828d9983e5cefc20c46ddbd49ba047121287f
+ sha512sums = 51280df65c791b745aa06c689cbb0830ba48b69ebcb5ebfc96e4f9917c3da49d4aca6468dbac4bf1221988105f682861c6b76784a877b875ddaa29942e0ef1a2
sha512sums = 5370dae98ea52ef6d1a6d35cc15774687457836cc7a74538d32279617db329f215989863f15ed46d3aba7e384d703161a1cf6ae92101d88c8efa1445464bea59
- sha512sums = c380783750dddfb67f0f26b34981f345cc0366643f6d0a04c970d357ed2586e748acc10352e96982f7353553e120ee1156e7b55d8765c765997e38f7284f0f55
+ sha512sums = 5e1a99f7bde3fd7b5b6b22d771421520e360f5f133fdc78ed35eea03969aa0f379df1ab720c792fd2c7155e92e4ccb70db9e77732ecedbb60e4ab294c8ea7107
pkgname = ubports-installer-git
diff --git a/PKGBUILD b/PKGBUILD
index ea3f4386206..c6401a5bc33 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,46 +1,52 @@
# Maintainer: Matthias Lisin <ml@visu.li>
pkgname=ubports-installer-git
pkgver=0.1.21_beta.r23.ga569e6b
-pkgrel=1
+pkgrel=2
pkgdesc='A simple tool to install Ubuntu Touch on UBports devices'
arch=(any)
url='https://github.com/ubports/ubports-installer'
license=('GPL3')
-depends=('android-tools' 'electron2')
-makedepends=('git' 'npm')
+depends=('android-tools' 'android-udev' 'electron')
+makedepends=('git' 'jq' 'npm')
provides=('ubports-installer')
conflicts=('ubports-installer')
source=("$pkgname::git+${url}.git"
ubports-installer
ubports-installer.desktop
- use-system-electron2.patch)
+ rootless.patch)
sha512sums=('SKIP'
- '55bba31095b0d38b3571e274be585abd426cfb30bbda42244dcb11ebc183d87bf8db040884f46072e4e66a682fe828d9983e5cefc20c46ddbd49ba047121287f'
+ '51280df65c791b745aa06c689cbb0830ba48b69ebcb5ebfc96e4f9917c3da49d4aca6468dbac4bf1221988105f682861c6b76784a877b875ddaa29942e0ef1a2'
'5370dae98ea52ef6d1a6d35cc15774687457836cc7a74538d32279617db329f215989863f15ed46d3aba7e384d703161a1cf6ae92101d88c8efa1445464bea59'
- 'c380783750dddfb67f0f26b34981f345cc0366643f6d0a04c970d357ed2586e748acc10352e96982f7353553e120ee1156e7b55d8765c765997e38f7284f0f55')
+ '5e1a99f7bde3fd7b5b6b22d771421520e360f5f133fdc78ed35eea03969aa0f379df1ab720c792fd2c7155e92e4ccb70db9e77732ecedbb60e4ab294c8ea7107')
pkgver() {
- cd "$pkgname"
+ cd "$pkgname"
git describe --long --tags | sed 's/-/_/;s/-/.r/;s/-/./'
}
prepare() {
local cache="$srcdir/npm-cache"
+ local dist=/usr/lib/electron
- # this will be very useful in near future
- #patch -p1 -d "$pkgname" < use-system-electron2.patch
+ patch -p1 -d "$pkgname" < rootless.patch
- cd "$pkgname"
- npm install --cache "$cache" "electron@$(sed 's/^v//' </usr/lib/electron2/version)"
- npm install --cache "$cache"
+ cd "$pkgname"
+ jq '.electronDist = $dist | .electronVersion = $version' \
+ --arg dist "$dist" \
+ --arg version "$(sed s/^v// $dist/version)" \
+ buildconfig-generic.json > new-buildconfig.json
+ mv new-buildconfig.json buildconfig-generic.json
+
+ npm uninstall --no-audit --cache "$cache" electron{,-packager,-sudo,-view-renderer} spectron
}
build() {
- cd "$pkgname"
+ cd "$pkgname"
node build.js --build-to-dir --linux --no-platform-tools
}
package() {
+ install -Dm644 ubports-installer.desktop "$pkgdir/usr/share/applications/ubports-installer.desktop"
install -Dm755 ubports-installer "$pkgdir/usr/bin/ubports-installer"
cd "$pkgname/build/icons"
@@ -48,10 +54,6 @@ package() {
install -Dm644 "$i" "$pkgdir/usr/share/icons/hicolor/${i%.png}/apps/ubports-installer.png"
done
- cd "$srcdir/$pkgname/dist/linux-unpacked/resources"
-
- install -dm755 "$pkgdir/usr/share/ubports-installer/app.asar.unpacked/node_modules"
- install -m644 app.asar "$pkgdir/usr/share/ubports-installer/app.asar"
- cp -r app.asar.unpacked/node_modules/electron-sudo \
- "$pkgdir/usr/share/ubports-installer/app.asar.unpacked/node_modules"
+ cd "$srcdir/$pkgname/dist/linux-unpacked/resources"
+ install -Dm644 app.asar "$pkgdir/usr/share/ubports-installer/app.asar"
}
diff --git a/rootless.patch b/rootless.patch
new file mode 100644
index 00000000000..9a17aa176e0
--- /dev/null
+++ b/rootless.patch
@@ -0,0 +1,21 @@
+diff -ura package.orig/src/utils.js package.new/src/utils.js
+--- package.orig/src/utils.js 2019-03-02 03:00:07.393462552 +0100
++++ package.new/src/utils.js 2019-03-02 02:59:53.770016930 +0100
+@@ -17,7 +17,6 @@
+ const tmp = require('tmp');
+ const exec = require('child_process').exec;
+ const cp = require('child_process');
+-const sudo = require('electron-sudo');
+ const winston = require('winston');
+ const getos = require('getos');
+ const commandExistsSync = require('command-exists').sync;
+@@ -387,8 +386,7 @@
+ }
+
+ var needRoot = () => {
+- if ((os.platform() === "win32") || isSnap()) return false;
+- return !process.env.SUDO_UID
++ return false
+ }
+
+ var ensureRoot = (m) => {
diff --git a/ubports-installer b/ubports-installer
index 2e451e863b4..c6ba63cb2ca 100755
--- a/ubports-installer
+++ b/ubports-installer
@@ -1,3 +1,3 @@
#!/bin/sh
-exec electron2 /usr/share/ubports-installer/app.asar
+exec electron /usr/share/ubports-installer/app.asar
diff --git a/use-system-electron2.patch b/use-system-electron2.patch
deleted file mode 100644
index 36d264a2e4e..00000000000
--- a/use-system-electron2.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -ura package.orig/buildconfig-generic.json package.new/buildconfig-generic.json
---- package.orig/buildconfig-generic.json 2019-02-28 00:40:58.510966802 +0100
-+++ package.new/buildconfig-generic.json 2019-02-28 00:41:51.931497671 +0100
-@@ -8,5 +8,6 @@
- "node_modules/**/*",
- "platform-tools/${os}/**/*",
- "build/icons/icon.*"
-- ]
-+ ],
-+ "electronDist": "/usr/lib/electron2"
- }