summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD57
-rwxr-xr-xubports-installer3
-rw-r--r--ubports-installer.desktop7
-rw-r--r--use-system-electron2.patch11
5 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..9d382cfeae3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = ubports-installer-git
+ pkgdesc = A simple tool to install Ubuntu Touch on UBports devices
+ pkgver = 0.1.21_beta.r23.ga569e6b
+ pkgrel = 1
+ url = https://github.com/ubports/ubports-installer
+ arch = any
+ license = GPL3
+ makedepends = git
+ makedepends = npm
+ depends = android-tools
+ depends = electron2
+ 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
+ sha512sums = SKIP
+ sha512sums = 55bba31095b0d38b3571e274be585abd426cfb30bbda42244dcb11ebc183d87bf8db040884f46072e4e66a682fe828d9983e5cefc20c46ddbd49ba047121287f
+ sha512sums = 5370dae98ea52ef6d1a6d35cc15774687457836cc7a74538d32279617db329f215989863f15ed46d3aba7e384d703161a1cf6ae92101d88c8efa1445464bea59
+ sha512sums = c380783750dddfb67f0f26b34981f345cc0366643f6d0a04c970d357ed2586e748acc10352e96982f7353553e120ee1156e7b55d8765c765997e38f7284f0f55
+
+pkgname = ubports-installer-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..ea3f4386206
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,57 @@
+# Maintainer: Matthias Lisin <ml@visu.li>
+pkgname=ubports-installer-git
+pkgver=0.1.21_beta.r23.ga569e6b
+pkgrel=1
+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')
+provides=('ubports-installer')
+conflicts=('ubports-installer')
+source=("$pkgname::git+${url}.git"
+ ubports-installer
+ ubports-installer.desktop
+ use-system-electron2.patch)
+sha512sums=('SKIP'
+ '55bba31095b0d38b3571e274be585abd426cfb30bbda42244dcb11ebc183d87bf8db040884f46072e4e66a682fe828d9983e5cefc20c46ddbd49ba047121287f'
+ '5370dae98ea52ef6d1a6d35cc15774687457836cc7a74538d32279617db329f215989863f15ed46d3aba7e384d703161a1cf6ae92101d88c8efa1445464bea59'
+ 'c380783750dddfb67f0f26b34981f345cc0366643f6d0a04c970d357ed2586e748acc10352e96982f7353553e120ee1156e7b55d8765c765997e38f7284f0f55')
+
+pkgver() {
+ cd "$pkgname"
+ git describe --long --tags | sed 's/-/_/;s/-/.r/;s/-/./'
+}
+
+prepare() {
+ local cache="$srcdir/npm-cache"
+
+ # this will be very useful in near future
+ #patch -p1 -d "$pkgname" < use-system-electron2.patch
+
+ cd "$pkgname"
+ npm install --cache "$cache" "electron@$(sed 's/^v//' </usr/lib/electron2/version)"
+ npm install --cache "$cache"
+}
+
+build() {
+ cd "$pkgname"
+ node build.js --build-to-dir --linux --no-platform-tools
+}
+
+package() {
+ install -Dm755 ubports-installer "$pkgdir/usr/bin/ubports-installer"
+
+ cd "$pkgname/build/icons"
+ for i in *x*.png; do
+ 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"
+}
diff --git a/ubports-installer b/ubports-installer
new file mode 100755
index 00000000000..2e451e863b4
--- /dev/null
+++ b/ubports-installer
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec electron2 /usr/share/ubports-installer/app.asar
diff --git a/ubports-installer.desktop b/ubports-installer.desktop
new file mode 100644
index 00000000000..515a608eece
--- /dev/null
+++ b/ubports-installer.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=ubports-installer
+Comment=UBports Installer
+Exec=ubports-installer
+Terminal=false
+Type=Application
+Icon=ubports-installer
diff --git a/use-system-electron2.patch b/use-system-electron2.patch
new file mode 100644
index 00000000000..36d264a2e4e
--- /dev/null
+++ b/use-system-electron2.patch
@@ -0,0 +1,11 @@
+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"
+ }