summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Wieczorek2017-04-03 13:43:08 +0200
committerMarcin Wieczorek2017-04-03 13:43:08 +0200
commitf73d065f9e98a456c882f1c22a25dc7dbfdf6676 (patch)
tree0846bbbfe0314336a415b725ea31431ce9261a87
parent09ccc98f9a0dcee4507a577cd95be2ceb34eab6c (diff)
downloadaur-f73d065f9e98a456c882f1c22a25dc7dbfdf6676.tar.gz
Updates from community repository
-rw-r--r--.SRCINFO27
-rw-r--r--.gitignore1
-rwxr-xr-xPKGBUILD103
-rw-r--r--messengerfordesktop.js29
-rwxr-xr-xstart.sh14
-rw-r--r--use-system-electron.patch27
6 files changed, 143 insertions, 58 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6f373a928b8..106588bce25 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,29 +1,24 @@
pkgbase = messengerfordesktop-git
pkgdesc = Beautiful desktop client for Facebook Messenger. Git version.
- pkgver = 1.5.0.beta.1.r0.g810e70d
+ pkgver = 2.0.9.r0.g19a9000
pkgrel = 1
url = http://messengerfordesktop.com/
arch = i686
arch = x86_64
license = MIT
- makedepends = git
- makedepends = gulp
+ makedepends = apm
makedepends = npm
- depends = libxtst
- depends = alsa-lib
- depends = gtk2
- depends = gconf
- depends = libnotify
- depends = nss
- depends = xorg-xprop
- depends = xorg-xwininfo
+ makedepends = git
+ depends = electron
conflicts = messengerfordesktop
conflicts = messengerfordesktop-bin
- options = !strip
- source = messengerfordesktop-git::git+https://github.com/Aluxian/Facebook-Messenger-Desktop.git#branch=V1.5.X
- source = start.sh
- md5sums = SKIP
- md5sums = 31abbecf99328b1b77ee1bdb1e2d981f
+ options = !emptydirs
+ source = messengerfordesktop-git::git+https://github.com/Aluxian/Facebook-Messenger-Desktop.git
+ source = messengerfordesktop.js
+ source = use-system-electron.patch
+ sha256sums = SKIP
+ sha256sums = 55e6da47ddbf383fc8a6ef6e0aae5621b7800c8efe46422c1c352d6c029c1f45
+ sha256sums = 42c8639fb69f636cd818da550b64469c755ead1885ee22063774fb2192963207
pkgname = messengerfordesktop-git
diff --git a/.gitignore b/.gitignore
index f708ad910fa..2399fdc0ce1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ src/
pkg/
messengerfordesktop-git/
*.pkg.tar.xz
+*.pkg.tar.xz.sig
diff --git a/PKGBUILD b/PKGBUILD
index 7e8ec8b719d..0fcb7c51ada 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,52 +1,99 @@
# Maintainer: Marcin Wieczorek <marcin@marcin.co>
+# Contributor: Nicola Squartini <tensor5@gmail.com>
pkgname=messengerfordesktop-git
-pkgver=1.5.0.beta.1.r0.g810e70d
+_pkgname=${pkgname/-git/}
+pkgver=2.0.9.r0.g19a9000
pkgrel=1
pkgdesc="Beautiful desktop client for Facebook Messenger. Git version."
arch=('i686' 'x86_64')
url="http://messengerfordesktop.com/"
license=('MIT')
conflicts=('messengerfordesktop' 'messengerfordesktop-bin')
-options=(!strip)
-depends=('libxtst' 'alsa-lib' 'gtk2' 'gconf' 'libnotify' 'nss' 'xorg-xprop' 'xorg-xwininfo')
-makedepends=('git' 'gulp' 'npm')
-source=("${pkgname}::git+https://github.com/Aluxian/Facebook-Messenger-Desktop.git#branch=V1.5.X"
- "start.sh")
+depends=('electron')
+makedepends=('apm' 'npm' 'git')
+options=(!emptydirs)
+source=("${pkgname}::git+https://github.com/Aluxian/Facebook-Messenger-Desktop.git"
+ "${_pkgname}.js"
+ 'use-system-electron.patch')
+sha256sums=('SKIP'
+ '55e6da47ddbf383fc8a6ef6e0aae5621b7800c8efe46422c1c352d6c029c1f45'
+ '42c8639fb69f636cd818da550b64469c755ead1885ee22063774fb2192963207')
-md5sums=('SKIP'
- '31abbecf99328b1b77ee1bdb1e2d981f')
-
-if [ ${CARCH} == x86_64 ]; then
- _arch="64"
+if [ "${CARCH}" == 'i686' ]; then
+ _target=linux32
else
- _arch="32"
+ _target=linux64
fi
pkgver() {
- cd ${pkgname}
- git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+ cd ${pkgname}
+ git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd ${pkgname}
+
+ patch -Np1 -i "${srcdir}"/use-system-electron.patch
+ sed -e 's|/opt/{{ name }}/||' \
+ -i resources/linux/app.desktop \
+ -i resources/linux/startup.desktop
}
build() {
- cd "${srcdir}/${pkgname}"
- npm install
- gulp build:linux${_arch}
+ cd ${pkgname}
+
+ npm install
+ cd src
+ ATOM_HOME="${PWD}" apm install --production
+ cd ..
+
+ ./node_modules/.bin/gulp build:${_target}
}
package() {
- mkdir -p "${pkgdir}/usr/share/messengerfordesktop/"
+ cd ${pkgname}
+
+ appdir=/usr/lib/${_pkgname}
+
+ install -dm755 "${pkgdir}"${appdir}
+ cp -r build/${_target}/opt/${_pkgname}/resources/app/* "${pkgdir}"${appdir}
+
+ cp -r build/${_target}/usr/share "${pkgdir}"/usr
- cd "${srcdir}/messengerfordesktop-git/build/Messenger/linux${_arch}"
- for file in `find . -type f`; do
- install -D -m644 "${file}" "${pkgdir}/usr/share/messengerfordesktop/${file}"
- done;
+ install -Dm755 "${srcdir}"/${pkgname}.js "${pkgdir}"/usr/bin/${_pkgname}
- install -D -m755 "${srcdir}/start.sh" "${pkgdir}/usr/bin/messengerfordesktop"
- install -D -m755 "${srcdir}/messengerfordesktop-git/build/Messenger/linux${_arch}/Messenger" "${pkgdir}/usr/share/messengerfordesktop/Messenger"
- install -D -m644 "${srcdir}/messengerfordesktop-git/assets-linux/messengerfordesktop.desktop" "${pkgdir}/usr/share/applications/messengerfordesktop.desktop"
- install -D -m644 "${srcdir}/messengerfordesktop-git/assets-linux/icons/256/messengerfordesktop.png" "${pkgdir}/usr/share/pixmaps/messengerfordesktop.png"
- install -D -m644 "${srcdir}/messengerfordesktop-git/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm644 -t "${pkgdir}"/usr/share/licenses/${_pkgname} LICENSE.md
- sed -i '6s/.*/Exec=sh \/usr\/bin\/messengerfordesktop/' "${pkgdir}/usr/share/applications/messengerfordesktop.desktop"
+ # Clean up
+ find "${pkgdir}"${appdir}/node_modules \
+ -name 'package.json' \
+ -exec sed -e "s|${srcdir}/Messenger-for-Desktop-${pkgver}/src|${appdir}|" \
+ -i {} \; \
+ -or -name '.*' -prune -exec rm -r '{}' \; \
+ -or -name '*.a' -exec rm '{}' \; \
+ -or -name '*.cc' -exec rm '{}' \; \
+ -or -name '*.h' -exec rm '{}' \; \
+ -or -name '*.gyp' -exec rm '{}' \; \
+ -or -name '*.gypi' -exec rm '{}' \; \
+ -or -name '*.Makefile' -exec rm '{}' \; \
+ -or -name '*.mk' -exec rm '{}' \; \
+ -or -name '*.mm' -exec rm '{}' \; \
+ -or -name 'appveyor.yml' -exec rm '{}' \; \
+ -or -name 'benchmark' -prune -exec rm -r '{}' \; \
+ -or -name 'bin' -prune -exec rm -r '{}' \; \
+ -or -name 'bin.js' -exec rm '{}' \; \
+ -or -name 'build.js' -exec rm '{}' \; \
+ -or -name 'cli.js' -exec rm '{}' \; \
+ -or -name 'deps' -prune -exec rm -r '{}' \; \
+ -or -name 'doc' -prune -exec rm -r '{}' \; \
+ -or -name 'docs' -prune -exec rm -r '{}' \; \
+ -or -name 'example' -prune -exec rm -r '{}' \; \
+ -or -name 'examples' -prune -exec rm -r '{}' \; \
+ -or -name 'hunspell' -prune -exec rm -r '{}' \; \
+ -or -name 'Makefile' -exec rm '{}' \; \
+ -or -name 'obj.target' -prune -exec rm -r '{}' \; \
+ -or -name 'test' -prune -exec rm -r '{}' \; \
+ -or -name 'tests' -prune -exec rm -r '{}' \; \
+ -or -name 'tools' -prune -exec rm -r '{}' \;
}
diff --git a/messengerfordesktop.js b/messengerfordesktop.js
new file mode 100644
index 00000000000..514d453bddc
--- /dev/null
+++ b/messengerfordesktop.js
@@ -0,0 +1,29 @@
+#!/usr/bin/electron
+
+const name = 'messengerfordesktop';
+
+const {app} = require('electron');
+const fs = require('fs');
+const path = require('path');
+
+// Change command name.
+const fd = fs.openSync('/proc/self/comm', fs.constants.O_WRONLY);
+fs.writeSync(fd, name);
+fs.closeSync(fd);
+
+// Remove first command line argument (/usr/bin/electron).
+process.argv.splice(0, 1);
+
+// Set application paths.
+const appPath = path.join(path.dirname(__dirname), 'lib', name);
+const packageJson = require(path.join(appPath, 'package.json'));
+const productName = packageJson.productName;
+app.setAppPath(appPath);
+app.setDesktopName(name + '.desktop');
+app.setName(productName);
+app.setPath('userCache', path.join(app.getPath('cache'), productName));
+app.setPath('userData', path.join(app.getPath('appData'), productName));
+app.setVersion(packageJson.version);
+
+// Run the application.
+require('module')._load(appPath, module, true);
diff --git a/start.sh b/start.sh
deleted file mode 100755
index f5d62bab7ba..00000000000
--- a/start.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-EXEC="/usr/share/messengerfordesktop/Messenger"
-
-exec -a "$0" "$EXEC" $params &
-pid=$!
-
-while [ -z $winid ]
-do
- winid=$(xwininfo -name "Messenger" 2> /dev/null | grep "Window id:" | grep -Eio "0x[a-z0-9]+")
-done
-xprop -id ${winid} -f WM_CLASS 8s -set WM_CLASS "MessengerForDesktop"
-
-wait $pid
diff --git a/use-system-electron.patch b/use-system-electron.patch
new file mode 100644
index 00000000000..6b325e6837e
--- /dev/null
+++ b/use-system-electron.patch
@@ -0,0 +1,27 @@
+--- a/tasks/build.coffee
++++ b/tasks/build.coffee
+@@ -74,14 +74,6 @@
+ ['linux32', 'linux64'].forEach (dist) ->
+ gulp.task 'build:' + dist, ['resources:linux', 'compile:' + dist, 'clean:build:' + dist, 'changelog:linux'], (done) ->
+ async.series [
+- # Rename the executable
+- (callback) ->
+- exeDir = './build/' + dist + '/opt/' + manifest.name + '/'
+- fromPath = exeDir + 'electron'
+- toPath = exeDir + manifest.name
+-
+- fs.rename fromPath, toPath, utils.log callback, fromPath, '=>', toPath
+-
+ # Move the app's .desktop file
+ (callback) ->
+ fromPath = './build/resources/linux/app.desktop'
+--- a/tasks/clean.coffee
++++ b/tasks/clean.coffee
+@@ -15,7 +15,7 @@
+
+ # Remove the default_app folder inside the linux builds
+ ['linux32', 'linux64'].forEach (dist) ->
+- gulp.task 'clean:build:' + dist, ['download:' + dist], ->
++ gulp.task 'clean:build:' + dist, ->
+ del './build/' + dist + '/opt/' + manifest.name + '/resources/default_app.asar'
+ .then (result) -> console.log result