diff options
author | Luke Arms | 2022-01-24 23:22:07 +1100 |
---|---|---|
committer | Luke Arms | 2022-01-24 23:22:07 +1100 |
commit | 56dea4e6ef4ef8338fadb4a059408b7b8527d99b (patch) | |
tree | 3c95e8406917472d5cd4e1a1a0490f2943f55f4b | |
parent | 78106bf928ee7495cf7e3077c944639c9e71d127 (diff) | |
download | aur-56dea4e6ef4ef8338fadb4a059408b7b8527d99b.tar.gz |
Mitigate blank/grey screen issue by packaging Electron with Stretchly
-rw-r--r-- | .SRCINFO | 3 | ||||
-rw-r--r-- | PKGBUILD | 43 |
2 files changed, 25 insertions, 21 deletions
@@ -1,6 +1,6 @@ pkgbase = stretchly-git pkgdesc = The break time reminder app - pkgver = 1044.88b2476 + pkgver = 1064.d443d47 pkgrel = 1 url = https://github.com/hovancik/stretchly/ arch = any @@ -19,7 +19,6 @@ pkgbase = stretchly-git depends = util-linux-libs depends = libsecret depends = libappindicator-gtk3 - depends = electron provides = stretchly conflicts = stretchly conflicts = stretchly-bin @@ -2,13 +2,19 @@ pkgname=stretchly-git _pkgname=${pkgname%-git} -pkgver=1044.88b2476 +pkgver=1064.d443d47 pkgrel=1 pkgdesc="The break time reminder app" arch=('any') url="https://github.com/hovancik/stretchly/" license=('BSD') -depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-atk' 'util-linux-libs' 'libsecret' 'libappindicator-gtk3' 'electron') +# 'electron' has been temporarily removed to mitigate an issue where Stretchly +# break windows render without colour or text, so Electron is packaged with +# Stretchly for now. See: +# - https://github.com/hovancik/stretchly/issues/1048 +# - https://github.com/electron/electron/issues/32133 +depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-atk' 'util-linux-libs' 'libsecret' 'libappindicator-gtk3') +#depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-atk' 'util-linux-libs' 'libsecret' 'libappindicator-gtk3' 'electron') makedepends=('git' 'nvm' 'jq' 'python') provides=("$_pkgname") conflicts=("$_pkgname" "${_pkgname}-bin") @@ -40,8 +46,7 @@ prepare() { nvm ls "$_node_version" &>/dev/null || nvm install "$_node_version" || false nvm use "$_node_version" - npm install --no-audit --no-progress --no-fund \ - electron@"$(</usr/lib/electron/version)" + npm install --no-save --no-audit --no-progress --no-fund } build() { @@ -51,30 +56,30 @@ build() { # electron-builder only generates /usr/share/* assets for target package # types 'apk', 'deb', 'freebsd', 'p5p', 'pacman', 'rpm' and 'sh', so build a # pacman package and unpack it - local _outfile _appname _electron _unpackdir=${srcdir}/${_pkgname}.unpacked + local _outfile _appname _unpackdir=${srcdir}/${_pkgname}.unpacked _outfile=dist/$(jq -r '"\(.name)-\(.version)"' package.json).pacman _appname=$(jq -r .name package.json) - _electron=${_unpackdir}/opt/${_appname}/${_pkgname} rm -Rf "${_unpackdir}" mkdir -p "${_unpackdir}" local i686=ia32 x86_64=x64 ./node_modules/.bin/electron-builder build \ --linux pacman \ - --"${!CARCH}" \ - -c.electronDist=/usr/lib/electron \ - -c.electronVersion="$(</usr/lib/electron/version)" + --"${!CARCH}" tar -C "${_unpackdir}" -Jxf "${_outfile}" - echo "Deleting Electron ($(du -h "$_electron" | awk '{print $1}'))..." >&2 - rm -v "$_electron" - # Replace absolute path in desktop entry - sed -Ei "s/^(Exec=).*/\1stretchly/" \ - "${_unpackdir}/usr/share/applications/${_pkgname}.desktop" + #local _electron=${_unpackdir}/opt/${_appname}/${_pkgname} + #echo "Deleting Electron ($(du -h "$_electron" | awk '{print $1}'))..." >&2 + #rm -v "$_electron" + ## Replace absolute path in desktop entry + #sed -Ei "s/^(Exec=).*/\1stretchly/" \ + # "${_unpackdir}/usr/share/applications/${_pkgname}.desktop" # Create /usr/bin/stretchly - install -D -m 0755 /dev/null "${_unpackdir}/usr/bin/stretchly" - cat >"${_unpackdir}/usr/bin/stretchly" <<EOF -#!/bin/sh -exec electron '/opt/$(sed -E "s/'/'\\\\''/g" <<<"${_appname}")/resources/app.asar' "\$@" -EOF + #install -D -m 0755 /dev/null "${_unpackdir}/usr/bin/stretchly" + #cat >"${_unpackdir}/usr/bin/stretchly" <<EOF + ##!/bin/sh + #exec electron '/opt/$(sed -E "s/'/'\\\\''/g" <<<"${_appname}")/resources/app.asar' "\$@" + #EOF + install -d "${_unpackdir}/usr/bin" + ln -s "/opt/${_appname}/stretchly" "${_unpackdir}/usr/bin/stretchly" } package() { |