diff options
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | .editorconfig | 8 | ||||
-rw-r--r-- | .gitignore | 14 | ||||
-rw-r--r-- | PKGBUILD | 183 | ||||
-rw-r--r-- | ferdi.desktop | 9 | ||||
-rw-r--r-- | ferdi.sh | 3 | ||||
-rw-r--r-- | fix-autostart-path.diff | 13 |
7 files changed, 171 insertions, 89 deletions
@@ -1,25 +1,27 @@ pkgbase = ferdi-git - pkgdesc = Ferdi is a messaging browser that allows you to combine your favorite messaging services into one application. - pkgver = 5.4.0 + pkgdesc = A messaging browser that allows you to combine your favorite messaging services into one application - git version + pkgver = 5.7.0.r0.g094d3762 pkgrel = 1 - url = https://getferdi.com/ + url = https://getferdi.com arch = x86_64 arch = i686 + arch = armv7h + arch = aarch64 license = Apache - makedepends = expac makedepends = git - makedepends = npm - makedepends = python2 - depends = electron + makedepends = nodejs-lts-gallium + makedepends = npm>=8.1.0 + makedepends = pnpm + makedepends = python + depends = electron15 + depends = libxkbfile + provides = ferdi conflicts = ferdi - source = git://github.com/getferdi/ferdi.git - source = git://github.com/getferdi/recipes.git - source = ferdi.desktop - source = ferdi.sh + source = ferdi-git::git+https://github.com/getferdi/ferdi + source = ferdi-git-recipes::git+https://github.com/getferdi/recipes + source = fix-autostart-path.diff sha512sums = SKIP sha512sums = SKIP - sha512sums = 501ff4d6c653823bf3321500bf7b1a4e3fa412e30c9884f6860656f816ca90c3f37610435d591c4b9444b491e7f8fe0c0dcad33be97c345ffccf46fd30e1eb65 - sha512sums = 6313c50e4226a144303c5a0055f08312009ea14e45de227c163aaeb528a49c796704bbd3b8cfa2cce49840e54dbd5e25cf8a241e619f2bf9b1a4ff79b80b78eb + sha512sums = 5263a9e1f4f9e4435f857181e67eb6b3ed254a18371ab5430bdf614821831aea2474f385b3860e783119fed5eb0c5f0cc94c74b1510e2ae29da524cd0d77fee3 pkgname = ferdi-git - diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..a467ee9a97a6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +tab_width = 4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..82b3c183d5d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# from https://github.com/github/gitignore/blob/master/ArchLinuxPackages.gitignore +*.tar +*.tar.* +*.rpm +*.jar +*.exe +*.msi +*.zip +*.tgz +*.log +*.log.* +*.sig + +*/ @@ -1,80 +1,137 @@ -# Maintainer: Christoph Mohr <christoph.mohr@gmail.com> -# Contributor: Giovanni 'ItachiSan' Santini <giovannisantini93@yahoo.it> +# Maintainer: Daniel Peukert <daniel@peukert.cc> +# Contributor: Christoph Mohr <christoph.mohr@gmail.com> +# Contributor: Giovanni 'ItachiSan' Santini <giovannisantini93@yahoo.it> # Contributor: Filipe LaĆns (FFY00) <lains@archlinux.org> # Contributor: Pieter Goetschalckx <3.14.e.ter <at> gmail <dot> com> - -pkgname=ferdi-git -_pkgver=5.4.0 -pkgver=${_pkgver//-/_} -pkgrel=1 -pkgdesc='Ferdi is a messaging browser that allows you to combine your favorite messaging services into one application.' -arch=(x86_64 i686) -url='https://getferdi.com/' -license=(Apache) -conflicts=('ferdi') -depends=(electron) -makedepends=(expac git npm python2) -source=('git://github.com/getferdi/ferdi.git' - 'git://github.com/getferdi/recipes.git' - 'ferdi.desktop' - 'ferdi.sh') +_pkgname='ferdi' +pkgname="$_pkgname-git" +pkgver='5.7.0.r0.g094d3762' +pkgrel='1' +pkgdesc='A messaging browser that allows you to combine your favorite messaging services into one application - git version' +arch=('x86_64' 'i686' 'armv7h' 'aarch64') +url="https://get$_pkgname.com" +license=('Apache') +_electronpkg='electron15' +depends=("$_electronpkg" 'libxkbfile') +# We're depending on node v16 until https://github.com/nodejs/node-gyp/issues/2534 is fixed +makedepends=('git' 'nodejs-lts-gallium' 'npm>=8.1.0' 'pnpm' 'python') +provides=("$_pkgname") +conflicts=("$_pkgname") +source=( + "$pkgname::git+https://github.com/get$_pkgname/$_pkgname" + "$pkgname-recipes::git+https://github.com/get$_pkgname/recipes" + 'fix-autostart-path.diff' +) sha512sums=('SKIP' 'SKIP' - '501ff4d6c653823bf3321500bf7b1a4e3fa412e30c9884f6860656f816ca90c3f37610435d591c4b9444b491e7f8fe0c0dcad33be97c345ffccf46fd30e1eb65' - '6313c50e4226a144303c5a0055f08312009ea14e45de227c163aaeb528a49c796704bbd3b8cfa2cce49840e54dbd5e25cf8a241e619f2bf9b1a4ff79b80b78eb') + '5263a9e1f4f9e4435f857181e67eb6b3ed254a18371ab5430bdf614821831aea2474f385b3860e783119fed5eb0c5f0cc94c74b1510e2ae29da524cd0d77fee3') + +_sourcedirectory="$pkgname" + +case "$CARCH" in + i686) + _electronbuilderarch='ia32' + ;; + armv7h) + _electronbuilderarch='armv7l' + ;; + aarch64) + _electronbuilderarch='arm64' + ;; + *) + _electronbuilderarch='x64' + ;; +esac prepare() { - # Prepare Python 2 for later - mkdir python2_path - ln -s `which python2` python2_path/python - - # Small patching - cd ferdi/recipes - git submodule init - git config submodule.recipes.url $srcdir/recipes - - git submodule update --init --recursive - - cd .. - - # Prevent ferdi from being launched in dev mode - sed -i "s|export const isDevMode = .*|export const isDevMode = false;|g" \ - src/environment.js - sed -i "s|import isDevMode from 'electron-is-dev'|export const isDevMode = false|g" \ - src/index.js - - # Adjust node-sass version to avoid build issues - npm install "node-sass@4.12.0" + cd "$srcdir/$_sourcedirectory/" + + # Provide git submodules + git submodule init + git config submodule.recipes.url "$srcdir/$pkgname-recipes" + git submodule update --init --recursive + + # Set system Electron version for ABI compatibility + sed -E -i 's|("electron": ").*"|\1'"$(cat "/usr/lib/$_electronpkg/version")"'"|' 'package.json' + + # Loosen node version restriction + sed -E -i 's|("node": ").*"|\1'"$(node --version | sed 's/^v//')"'"|' 'package.json' + + # Specify path for autostart file + patch --forward -p1 < '../fix-autostart-path.diff' + + # Prepare recipes + cd "$srcdir/$_sourcedirectory/recipes/" + + # Disable the prepare script for recipes as we don't want husky to run + sed -E -i 's|"prepare": ".*"|"prepare": ""|' 'package.json' + + # Build recipe archives + pnpm install + pnpm run package + + # Prepare ferdi dependencies + cd "$srcdir/$_sourcedirectory/" + + # Disable the prepare script for ferdi itself as we don't want husky to run + sed -E -i 's|"prepare": ".*"|"prepare": ""|' 'package.json' + + # Install ferdi dependencies + npm install +} + +pkgver() { + cd "$srcdir/$_sourcedirectory/" + git describe --long --tags | sed -e 's/^v//' -e 's/-\([^-]*-g[^-]*\)$/-r\1/' -e 's/-/./g' } build() { - cd ferdi + cd "$srcdir/$_sourcedirectory/" - # Better configuration for npm cache and calling installed binaries - export npm_config_cache="$srcdir"/npm_cache - export PATH="$srcdir/ferdi/node_modules/.bin:$srcdir/python2_path:$PATH" + # Run pre-build tasks: prepare build info, run gulp + npm run prebuild - npm install lerna - lerna bootstrap + # Use npmrc from the root folder for npm>=6 compatibility + cp '.npmrc' 'build/.npmrc' - gulp build - electron-builder --linux dir + # Build the actual application + NODE_ENV='production' ./node_modules/.bin/electron-builder --linux dir "--$_electronbuilderarch" -c.electronDist="/usr/lib/$_electronpkg" -c.electronVersion="$(cat "/usr/lib/$_electronpkg/version")" } package() { - cd ferdi - # Install the .asar files - install -Dm 755 out/linux-unpacked/resources/app.asar "$pkgdir"/usr/lib/ferdi/resources/app.asar - install -dm755 "$pkgdir"/usr/lib/ferdi/resources/app.asar.unpacked/recipes/ - cp -dr --no-preserve=ownership "$srcdir"/recipes "$pkgdir"/usr/lib/ferdi/resources/app.asar.unpacked/ - chmod -R 755 "$pkgdir"/usr/lib/ferdi/resources/app.asar.unpacked/ - - # Install icon - install -Dm 644 "$srcdir"/ferdi.desktop "$pkgdir"/usr/share/applications/ferdi.desktop - install -Dm 644 build-helpers/images/icon.png "$pkgdir"/usr/share/icons/ferdi.png - - # Install run script - install -Dm 755 "$srcdir"/ferdi.sh "$pkgdir"/usr/bin/ferdi -} + cd "$srcdir/$_sourcedirectory/" + + local _outpath='out/linux' + if [ "$_electronbuilderarch" != 'x64' ]; then + _outpath="$_outpath-$_electronbuilderarch" + fi + _outpath="$_outpath-unpacked" + + install -Dm644 "$_outpath/resources/app.asar" "$pkgdir/usr/lib/$_pkgname/app.asar" + cp -r --no-preserve=ownership --preserve=mode "$_outpath/resources/app.asar.unpacked/" "$pkgdir/usr/lib/$_pkgname/app.asar.unpacked/" + install -dm755 "$pkgdir/usr/bin/" + cat << EOF > "$pkgdir/usr/bin/$_pkgname" +#!/bin/sh +NODE_ENV=production ELECTRON_IS_DEV=0 exec $_electronpkg '/usr/lib/$_pkgname/app.asar' "\$@" +EOF + chmod +x "$pkgdir/usr/bin/$_pkgname" + install -dm755 "$pkgdir/usr/share/applications/" + cat << EOF > "$pkgdir/usr/share/applications/$_pkgname.desktop" +[Desktop Entry] +Name=${_pkgname^} +Exec=/usr/bin/$_pkgname %U +Terminal=false +Type=Application +Icon=$_pkgname +StartupWMClass=${_pkgname^} +Comment=Ferdi is your messaging app / former Emperor of Austria and combines chat & messaging services into one application. Ferdi currently supports Slack, WhatsApp, WeChat, HipChat, Facebook Messenger, Telegram, Google Hangouts, GroupMe, Skype and many more. You can download Ferdi for free for Mac & Windows. +MimeType=x-scheme-handler/ferdi; +Categories=Network;InstantMessaging; +EOF + + for _size in 16 24 32 48 64 96 128 256 512 1024; do + install -Dm644 "build-helpers/images/icons/${_size}x${_size}.png" "$pkgdir/usr/share/icons/hicolor/${_size}x${_size}/apps/$_pkgname.png" + done +} diff --git a/ferdi.desktop b/ferdi.desktop deleted file mode 100644 index 86d2bfab5420..000000000000 --- a/ferdi.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Application -Version=5.3.4-git -Name=Ferdi -Comment=A free messaging app for services like WhatsApp, Slack, Messenger and many more. -Icon=ferdi -Exec=/usr/bin/ferdi %U -Terminal=false -Categories=Network;InstantMessaging; diff --git a/ferdi.sh b/ferdi.sh deleted file mode 100644 index 1e01e7298c55..000000000000 --- a/ferdi.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -electron /usr/lib/ferdi/resources/app.asar "$@" diff --git a/fix-autostart-path.diff b/fix-autostart-path.diff new file mode 100644 index 000000000000..9aa3cc0416c4 --- /dev/null +++ b/fix-autostart-path.diff @@ -0,0 +1,13 @@ +diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js +index 81cef377..737b24a7 100644 +--- a/src/stores/AppStore.js ++++ b/src/stores/AppStore.js +@@ -33,7 +33,7 @@ const debug = require('debug')('Ferdi:AppStore'); + + const mainWindow = getCurrentWindow(); + +-const executablePath = isMac ? remoteProcess.execPath : process.execPath; ++const executablePath = '/usr/bin/ferdi'; + const autoLauncher = new AutoLaunch({ + name: 'Ferdi', + path: executablePath, |