Skip to content

Instantly share code, notes, and snippets.

@ItachiSan
Created January 7, 2019 20:12
Show Gist options
  • Save ItachiSan/4e0b1aedceb1fa7bf772f1fd0a7be5b9 to your computer and use it in GitHub Desktop.
Save ItachiSan/4e0b1aedceb1fa7bf772f1fd0a7be5b9 to your computer and use it in GitHub Desktop.
Franz tweaking and clean-ups
diff --git a/PKGBUILD b/PKGBUILD
index 1e83eb3..603b4b8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,44 +1,55 @@
-# Maintainer: Filipe Laíns (FFY00) <[email protected]>
+# Maintainer: Giovanni 'ItachiSan' Santini <[email protected]>
+# Contributor: Filipe Laíns (FFY00) <[email protected]>
# Contributor: Pieter Goetschalckx <3.14.e.ter <at> gmail <dot> com>
pkgname=franz
-_pkgver=5.0.0-beta.18
-pkgver=${_pkgver//-/_}
+_pkgver=5.0.0-beta.22
+pkgver="${_pkgver//-/_}"
pkgrel=1
pkgdesc="Free messaging app for services like WhatsApp, Slack, Messenger and many more."
-arch=('x86_64' 'i686')
+arch=(x86_64 i686)
url="https://meetfranz.com"
-license=('Apache')
-depends=('electron' 'libx11' 'libxkbfile' 'libxext' 'libxss' 'gconf' 'gtk2' 'alsa-lib' 'nss' 'libxtst')
-makedepends=('yarn' 'npm' 'python2' 'git' 'nodejs-lts-carbon')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/meetfranz/$pkgname/archive/v$_pkgver.tar.gz"
+license=(Apache)
+depends=(electron2)
+makedepends=(git npm python2)
+source=("git+https://github.com/meetfranz/$pkgname#tag=v$_pkgver"
'franz.desktop'
- 'franz.sh')
-sha512sums=('26a7e86d9860138c0dc314c870881509f6a8a0fa9fc5f12cb6e9b03a11698b199d9e23adaf76511f525c7c8803bb8d7d8afc885f8cbae9287d30ee5b6f17662a'
+ 'franz.sh'
+ 'disable-forced-dev-mode.patch')
+sha512sums=('SKIP'
'ef7c06558f60259dd29ead644327a0030c2c26637e51e3ec27a05542efd4752d68a3f4322973f6a90d6658686abce12700a3ad57aff9e517d0c907c952d7a034'
- '8584507cfc2736f4736637925536b2c06063c59cd943346717633564ae88b64c5eea294c8897f1250812478ed493f54a470501e98e99d084a2ff012dff9671f8')
+ '0c784f5b65a5968ddf9e4cfbbe9814592234ec89f556c9bdfc197d4495fd3fed1721d081bc40448433642901a4724415a3d54e3dc66e523e2304e9ee26ed9547'
+ '3894eb1ab82c30555815787a2420cdc0d52049cee930de0c5e39acd4afcd8572fbe6a4c9fe336f3ce21411f40102bafe98d767cadd5c7398e103c18f09e5c6a8')
prepare() {
- # Fix electron-updater version
- sed -i "s|\"electron-updater\":.*|\"electron-updater\": \"^3.0.3\",|g" \
- $pkgname-$_pkgver/package.json
+ ## Fix needed packages versions
+ #sed \
+ # -e 's|"electron":.*|"electron": "^3.0.0",|g' \
+ # -e 's|"electron-builder":.*|"electron-builder": "^20.38.0",|g' \
+ # -e 's|"electron-updater":.*|"electron-updater": "^4.0.0",|g' \
+ # -i "$srcdir/$pkgname/package.json"
+ ## Allow running Franz using system's Electron in normal (non dev) mode
+ patch -Np1 \
+ -d "$srcdir/$pkgname" \
+ -i "$srcdir/disable-forced-dev-mode.patch"
}
build() {
- cd $pkgname-$_pkgver
- yarn install --production --non-interactive
- yarn add 'electron-builder#28.0.0' 'gulpjs/gulp#4.0'
-
# Better configuration for npm cache and calling installed binaries
export npm_config_cache="$srcdir"/npm_cache
- export PATH="$srcdir"/$pkgname-$_pkgver/node_modules/.bin:$PATH
+ export PATH="$srcdir"/$pkgname/node_modules/.bin:$PATH
+
+ cd $pkgname
+ npm install
gulp build
+ # Leave it here... might be useful for the future
+ #electron-builder install-app-deps
electron-builder --linux dir
}
package() {
- cd $pkgname-$_pkgver
+ cd $pkgname
# Install the .asar files
install -dm 755 "$pkgdir"/usr/lib/$pkgname
diff --git a/disable-forced-dev-mode.patch b/disable-forced-dev-mode.patch
new file mode 100644
index 0000000..33e8771
--- /dev/null
+++ b/disable-forced-dev-mode.patch
@@ -0,0 +1,26 @@
+From 0936efbd40380d6c9c78340376bdfd4567111d5c Mon Sep 17 00:00:00 2001
+From: Giovanni Santini <[email protected]>
+Date: Thu, 27 Dec 2018 15:29:44 +0100
+Subject: [PATCH] Use developer mode whenever wanted Without this change,
+ people are forced to use the developer version of the app whenever they
+ directly use Electron for running the app.
+
+---
+ src/environment.js | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/environment.js b/src/environment.js
+index e176212..60ed3f4 100644
+--- a/src/environment.js
++++ b/src/environment.js
+@@ -1,6 +1,6 @@
+ import { LIVE_API, DEV_API, LOCAL_API } from './config';
+
+-export const isDevMode = Boolean(process.execPath.match(/[\\/]electron/));
++export const isDevMode = Boolean(process.execPath.match(/[\\/]electron/)) && Boolean(process.env.FRANZ_DEV);
+ export const useLiveAPI = process.env.LIVE_API;
+ export const useLocalAPI = process.env.LOCAL_API;
+
+--
+2.20.1
+
diff --git a/franz.sh b/franz.sh
index a4a6ab1..2245341 100644
--- a/franz.sh
+++ b/franz.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-electron /usr/lib/franz/resources/app.asar "$@"
+electron2 /usr/lib/franz/resources/app.asar "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment