summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Bezerra2017-11-17 11:28:28 -0300
committerRodrigo Bezerra2017-11-17 11:28:28 -0300
commitcd4aa3eba652cd37b283fffd048bd998011b2911 (patch)
tree16331205db863052ea9e3a9eba880018efa1ab35
parentb85fc77aff2ed08319dc26b86542ff6ce8a60968 (diff)
downloadaur-cd4aa3eba652cd37b283fffd048bd998011b2911.tar.gz
Build from source to unbundle ffmpeg and change executable name
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD68
-rw-r--r--chrome-net.downloadhelper.coapp.json17
-rw-r--r--firefox-net.downloadhelper.coapp.json14
-rw-r--r--vdhcoapp-install.hook10
-rw-r--r--vdhcoapp-remove.hook9
-rw-r--r--vdhcoapp.patch27
7 files changed, 93 insertions, 80 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 58d7ccaab1d3..1a47b3819a6c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,23 @@
pkgbase = vdhcoapp
- pkgdesc = Companion application for Video DownloadHelper browser add-on.
+ pkgdesc = Companion application for Video DownloadHelper browser add-on
pkgver = 1.0.7
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/mi-g/vdhcoapp
arch = i686
arch = x86_64
license = GPL2
- source = firefox-net.downloadhelper.coapp.json
- source = chrome-net.downloadhelper.coapp.json
- md5sums = e959d300fbfcf7ff49ce3100a97e18f1
- md5sums = 894202d812000cf1498e5a1a77493126
- sha1sums = f1dcdc8d798d05474ac03ed0b73fc0b971103709
- sha1sums = 9921d68bde6f84c8f53671f1c8a1d36b4415fc01
- source_i686 = https://github.com/mi-g/vdhcoapp/releases/download/v1.0.7/net.downloadhelper.coapp-1.0.7-1_i386.tar.gz
- md5sums_i686 = 2dac02fcddd866902761660feffa1e9c
- sha1sums_i686 = 5dcdd00db1ac1b5f863170b4c39afbb4dbc29989
- source_x86_64 = https://github.com/mi-g/vdhcoapp/releases/download/v1.0.7/net.downloadhelper.coapp-1.0.7-1_amd64.tar.gz
- md5sums_x86_64 = 6e49ae2a1dfd2ac28692c0e5ad8ab449
- sha1sums_x86_64 = 69fb6d34f0ee0041db2ede7c3d2e5dc4c1e566b5
+ makedepends = gulp
+ makedepends = npm
+ depends = ffmpeg
+ options = !strip
+ source = vdhcoapp-1.0.7.tar.gz::https://github.com/mi-g/vdhcoapp/archive/v1.0.7.tar.gz
+ source = vdhcoapp.patch
+ source = vdhcoapp-install.hook
+ source = vdhcoapp-remove.hook
+ sha256sums = ddd39d9ab848b34e49f71625e4a3f71eceafca4e4b2bb0439ab370a62dcd6842
+ sha256sums = b8a1ca51a71c1390f3ad9d725435726390a7009116865fa98c7c4f8ca048cab1
+ sha256sums = 9f8cbe84b2543738390b70d770551259c6db2b67235b7792e9094908cecbc955
+ sha256sums = 448ee36b350b6bcd304d33cf7638c13bda88d5086f2256e823d73ccc22e52ce0
pkgname = vdhcoapp
diff --git a/PKGBUILD b/PKGBUILD
index 86964ca0c7a3..b5408e824d8c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,51 +1,49 @@
# Maintainer: Damien Guihal <dguihal@gmail.com>
+# Maintainer: Rodrigo Bezerra <rodrigobezerra21 at gmail dot com>
+
pkgname=vdhcoapp
pkgver=1.0.7
-pkgrel=1
-pkgdesc="Companion application for Video DownloadHelper browser add-on."
+pkgrel=2
+pkgdesc="Companion application for Video DownloadHelper browser add-on"
arch=('i686' 'x86_64')
url="https://github.com/mi-g/vdhcoapp"
license=('GPL2')
-groups=()
-depends=()
-source=("firefox-net.downloadhelper.coapp.json"
- "chrome-net.downloadhelper.coapp.json")
-source_x86_64=("https://github.com/mi-g/vdhcoapp/releases/download/v${pkgver}/net.downloadhelper.coapp-${pkgver}-1_amd64.tar.gz")
-source_i686=("https://github.com/mi-g/vdhcoapp/releases/download/v${pkgver}/net.downloadhelper.coapp-${pkgver}-1_i386.tar.gz")
-#generate with 'makepkg -g'
-md5sums=('e959d300fbfcf7ff49ce3100a97e18f1'
- '894202d812000cf1498e5a1a77493126')
-md5sums_i686=('2dac02fcddd866902761660feffa1e9c')
-md5sums_x86_64=('6e49ae2a1dfd2ac28692c0e5ad8ab449')
-sha1sums=('f1dcdc8d798d05474ac03ed0b73fc0b971103709'
- '9921d68bde6f84c8f53671f1c8a1d36b4415fc01')
-sha1sums_i686=('5dcdd00db1ac1b5f863170b4c39afbb4dbc29989')
-sha1sums_x86_64=('69fb6d34f0ee0041db2ede7c3d2e5dc4c1e566b5')
+depends=('ffmpeg')
+makedepends=('gulp' 'npm')
+options=(!strip)
+source=($pkgname-$pkgver.tar.gz::https://github.com/mi-g/vdhcoapp/archive/v${pkgver}.tar.gz
+ vdhcoapp.patch
+ vdhcoapp-install.hook
+ vdhcoapp-remove.hook)
+sha256sums=('ddd39d9ab848b34e49f71625e4a3f71eceafca4e4b2bb0439ab370a62dcd6842'
+ 'b8a1ca51a71c1390f3ad9d725435726390a7009116865fa98c7c4f8ca048cab1'
+ '9f8cbe84b2543738390b70d770551259c6db2b67235b7792e9094908cecbc955'
+ '448ee36b350b6bcd304d33cf7638c13bda88d5086f2256e823d73ccc22e52ce0')
+
+prepare() {
+ patch -Np1 -i "${srcdir}/vdhcoapp.patch"
+}
-package() {
- # From setup-linux-system.sh
+build() {
+ cd "${pkgname}-${pkgver}"
- # Firefox
- mkdir -p ${pkgdir}/usr/lib/mozilla/native-messaging-hosts
- install firefox-net.downloadhelper.coapp.json -m 0755 ${pkgdir}/usr/lib/mozilla/native-messaging-hosts/net.downloadhelper.coapp.json
+ npm install
- # Chrome & Chromium
- mkdir -p ${pkgdir}/etc/opt/chrome/native-messaging-hosts
- install chrome-net.downloadhelper.coapp.json -m 0644 ${pkgdir}/etc/opt/chrome/native-messaging-hosts/net.downloadhelper.coapp.json
- mkdir -p ${pkgdir}/etc/chromium/native-messaging-hosts
- install chrome-net.downloadhelper.coapp.json -m 0644 ${pkgdir}/etc/chromium/native-messaging-hosts/net.downloadhelper.coapp.json
+ gulp
+}
- mkdir -p ${pkgdir}/usr/bin
+package() {
+ cd "${pkgname}-${pkgver}"
- cd ${srcdir}/net.downloadhelper.coapp-${pkgver}
+ install -Dm755 bin/net.downloadhelper.coapp-* "${pkgdir}/usr/bin/vdhcoapp"
+ install -Dm644 config.json "${pkgdir}/usr/share/vdhcoapp/config.json"
- if [[ $CARCH == 'i686' ]]; then
- install bin/net.downloadhelper.coapp-linux-32 -m 0755 ${pkgdir}/usr/bin/net.downloadhelper.coapp-linux
- else
- install bin/net.downloadhelper.coapp-linux-64 -m 0755 ${pkgdir}/usr/bin/net.downloadhelper.coapp-linux
- fi
+ install -dm755 "${pkgdir}/usr/lib/mozilla/native-messaging-hosts/"
+ install -dm755 "${pkgdir}/etc/opt/chrome/native-messaging-hosts/"
+ install -dm755 "${pkgdir}/etc/chromium/native-messaging-hosts/"
+ install -Dm644 "${srcdir}/vdhcoapp-install.hook" "${pkgdir}/usr/share/libalpm/hooks/vdhcoapp-install.hook"
+ install -Dm644 "${srcdir}/vdhcoapp-remove.hook" "${pkgdir}/usr/share/libalpm/hooks/vdhcoapp-remove.hook"
}
# vim:set ts=2 sw=2 et:
-
diff --git a/chrome-net.downloadhelper.coapp.json b/chrome-net.downloadhelper.coapp.json
deleted file mode 100644
index 6be6149ff6e4..000000000000
--- a/chrome-net.downloadhelper.coapp.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "net.downloadhelper.coapp",
- "description": "Video DownloadHelper companion app",
- "path": "/usr/bin/net.downloadhelper.coapp-linux",
- "type": "stdio",
- "allowed_origins": [
-
-
- "chrome-extension://ocgbelnknlgoiofcepicgpicjibclfdg/"
-
- ,
- "chrome-extension://lpheobkpibijgligoklmllibbbdhfghg/"
-
- ,
- "chrome-extension://amnobfikmbfolbaeeadnkcppghfdjeke/"
- ]
-} \ No newline at end of file
diff --git a/firefox-net.downloadhelper.coapp.json b/firefox-net.downloadhelper.coapp.json
deleted file mode 100644
index 74ca6b335b4e..000000000000
--- a/firefox-net.downloadhelper.coapp.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "net.downloadhelper.coapp",
- "description": "Video DownloadHelper companion app",
- "path": "/usr/bin/net.downloadhelper.coapp-linux",
- "type": "stdio",
- "allowed_extensions": [
-
-
- "weh-native-test@downloadhelper.net"
-
- ,
- "{b9db16a4-6edc-47ec-a1f4-b86292ed211d}"
- ]
-} \ No newline at end of file
diff --git a/vdhcoapp-install.hook b/vdhcoapp-install.hook
new file mode 100644
index 000000000000..07ac5c712a5a
--- /dev/null
+++ b/vdhcoapp-install.hook
@@ -0,0 +1,10 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = vdhcoapp
+
+[Action]
+Description = Installing JSON configuration file ...
+When = PostTransaction
+Exec = /usr/bin/vdhcoapp install --system
diff --git a/vdhcoapp-remove.hook b/vdhcoapp-remove.hook
new file mode 100644
index 000000000000..ed92db9c712b
--- /dev/null
+++ b/vdhcoapp-remove.hook
@@ -0,0 +1,9 @@
+[Trigger]
+Operation = Remove
+Type = Package
+Target = vdhcoapp
+
+[Action]
+Description = Uninstalling JSON configuration file ...
+When = PreTransaction
+Exec = /usr/bin/vdhcoapp uninstall --system
diff --git a/vdhcoapp.patch b/vdhcoapp.patch
new file mode 100644
index 000000000000..808fe8ad5dd3
--- /dev/null
+++ b/vdhcoapp.patch
@@ -0,0 +1,27 @@
+diff -ura package.orig/vdhcoapp-1.0.7/app/converter.js package.new/vdhcoapp-1.0.7/app/converter.js
+--- package.orig/vdhcoapp-1.0.7/app/converter.js 2017-11-14 08:35:27.000000000 -0300
++++ package.new/vdhcoapp-1.0.7/app/converter.js 2017-11-16 16:46:57.183615000 -0300
+@@ -44,7 +44,7 @@
+ else
+ throw new Error("Unsupported architecture",process.arch);
+
+-const binaryDir = path.join(path.dirname(process.execPath),"..","converter","build",platform,arch);
++const binaryDir = platform == "linux" ? "/usr/bin" : path.join(path.dirname(process.execPath),"..","converter","build",platform,arch);
+ const binaryPath = path.join(binaryDir,"ffmpeg");
+ const probeBinaryPath = path.join(binaryDir,"ffprobe");
+ const playBinaryPath = path.join(binaryDir,"ffplay");
+diff -ura package.orig/vdhcoapp-1.0.7/app/native-autoinstall.js package.new/vdhcoapp-1.0.7/app/native-autoinstall.js
+--- package.orig/vdhcoapp-1.0.7/app/native-autoinstall.js 2017-11-14 08:35:27.000000000 -0300
++++ package.new/vdhcoapp-1.0.7/app/native-autoinstall.js 2017-11-16 17:36:30.888842000 -0300
+@@ -72,7 +72,10 @@
+ mode = "system";
+ var config;
+ try {
+- config = JSON.parse(fs.readFileSync(path.resolve(path.dirname(process.execPath),"../config.json"),"utf8"));
++ if(process.platform == "linux")
++ config = JSON.parse(fs.readFileSync(path.resolve(path.dirname(process.execPath),"../share/vdhcoapp/config.json"),"utf8"));
++ else
++ config = JSON.parse(fs.readFileSync(path.resolve(path.dirname(process.execPath),"../config.json"),"utf8"));
+ } catch(err) {
+ DisplayMessage("Cannot read config file: "+err.message,"Error");
+ process.exit(-1);