[arch-commits] Commit in (6 files)

Nicola Squartini tensor5 at archlinux.org
Thu Dec 8 09:57:36 UTC 2016


    Date: Thursday, December 8, 2016 @ 09:57:35
  Author: tensor5
Revision: 198455

addpkg: messengerfordesktop 2.0.1-1

Added:
  messengerfordesktop/
  messengerfordesktop/repos/
  messengerfordesktop/trunk/
  messengerfordesktop/trunk/PKGBUILD
  messengerfordesktop/trunk/messengerfordesktop.js
  messengerfordesktop/trunk/use-system-electron.patch

---------------------------+
 PKGBUILD                  |   92 ++++++++++++++++++++++++++++++++++++++++++++
 messengerfordesktop.js    |   29 +++++++++++++
 use-system-electron.patch |   28 +++++++++++++
 3 files changed, 149 insertions(+)

Added: messengerfordesktop/trunk/PKGBUILD
===================================================================
--- messengerfordesktop/trunk/PKGBUILD	                        (rev 0)
+++ messengerfordesktop/trunk/PKGBUILD	2016-12-08 09:57:35 UTC (rev 198455)
@@ -0,0 +1,92 @@
+# $Id$
+# Maintainer: Nicola Squartini <tensor5 at gmail.com>
+
+pkgname=messengerfordesktop
+pkgver=2.0.1
+pkgrel=1
+pkgdesc='A simple & beautiful desktop client for Facebook Messenger'
+arch=('i686' 'x86_64')
+url='https://messengerfordesktop.com/'
+license=('MIT')
+depends=('electron')
+makedepends=('apm' 'npm')
+options=(!emptydirs)
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Aluxian/Messenger-for-Desktop/archive/v${pkgver}.tar.gz"
+        "${pkgname}.js"
+        'use-system-electron.patch')
+sha256sums=('442ff4bb63e4c44fa03c2452ef9533e8c40a70ad99600d54b37cb95398c28997'
+            '55e6da47ddbf383fc8a6ef6e0aae5621b7800c8efe46422c1c352d6c029c1f45'
+            '014ef8a03e38d4e5c5cab49cb6a2e9fbf81de9aecbfc66aeadf124844a541a66')
+
+if [ "${CARCH}" == 'i686' ]; then
+    _target=linux32
+else
+    _target=linux64
+fi
+
+prepare() {
+    cd Messenger-for-Desktop-${pkgver}
+    
+    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 Messenger-for-Desktop-${pkgver}
+    
+    npm install
+    cd src
+    ATOM_HOME="${PWD}" apm install --production
+    cd ..
+
+    ./node_modules/.bin/gulp build:${_target}
+}
+
+package() {
+    cd Messenger-for-Desktop-${pkgver}
+
+    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
+
+    install -Dm755 "${srcdir}"/${pkgname}.js "${pkgdir}"/usr/bin/${pkgname}
+
+    install -Dm644 -t "${pkgdir}"/usr/share/licenses/${pkgname} LICENSE.md
+
+    # 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 '{}' \;
+}


Property changes on: messengerfordesktop/trunk/PKGBUILD
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: messengerfordesktop/trunk/messengerfordesktop.js
===================================================================
--- messengerfordesktop/trunk/messengerfordesktop.js	                        (rev 0)
+++ messengerfordesktop/trunk/messengerfordesktop.js	2016-12-08 09:57:35 UTC (rev 198455)
@@ -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);

Added: messengerfordesktop/trunk/use-system-electron.patch
===================================================================
--- messengerfordesktop/trunk/use-system-electron.patch	                        (rev 0)
+++ messengerfordesktop/trunk/use-system-electron.patch	2016-12-08 09:57:35 UTC (rev 198455)
@@ -0,0 +1,28 @@
+--- 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
+ 



More information about the arch-commits mailing list