diff options
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 56 | ||||
-rwxr-xr-x | balena-etcher-electron.sh | 6 | ||||
-rw-r--r-- | balena-etcher.desktop (renamed from balena-etcher-electron.desktop) | 4 |
4 files changed, 43 insertions, 51 deletions
@@ -1,6 +1,6 @@ pkgbase = balena-etcher pkgdesc = Flash OS images to SD cards & USB drives, safely and easily - pkgver = 1.10.0 + pkgver = 1.19.16 pkgrel = 1 epoch = 2 url = https://balena.io/etcher @@ -9,31 +9,17 @@ pkgbase = balena-etcher arch = armv7h arch = aarch64 license = Apache - makedepends = npm - makedepends = python2 makedepends = git - makedepends = jq - makedepends = patch - makedepends = nodejs - depends = electron12 - depends = gtk3 - depends = libxtst - depends = libxss - depends = nss - depends = alsa-lib - depends = glib2 - depends = polkit - depends = libusb + makedepends = python + makedepends = nvm optdepends = libnotify: for notifications conflicts = etcher conflicts = etcher-git conflicts = etcher-bin options = !strip - source = etcher::git+https://github.com/balena-io/etcher.git#tag=v1.10.0 - source = balena-etcher-electron.sh - source = balena-etcher-electron.desktop - sha256sums = SKIP - sha256sums = 13651534055dd72dd622ff8ac3d56ee818008dfa1f680b5c4ad7f7ef14698800 - sha256sums = c950d9578f9cf60998c920bb60c6617559963f06a4918e7072fdc706b0ef5754 + source = etcher::git+https://github.com/balena-io/etcher.git#tag=v1.19.16 + source = balena-etcher.desktop + sha256sums = 51022d670029b8bfd06d17b3db518375e5c480fd928315c90c72044ed9f77db7 + sha256sums = 6c5fb48aeb636272689c86d7cf9beea4515214636bc617a61c3e8387628b3415 pkgname = balena-etcher @@ -2,9 +2,10 @@ # Contributor: HÃ¥vard Pettersson <mail@haavard.me> # Contributor: Andrew Stubbs <andrew.stubbs@gmail.com> +_nodeversion=20 pkgname=balena-etcher _pkgname=etcher -pkgver=1.10.0 +pkgver=1.19.16 pkgrel=1 epoch=2 pkgdesc='Flash OS images to SD cards & USB drives, safely and easily' @@ -12,8 +13,8 @@ arch=('x86_64' 'i686' 'armv7h' 'aarch64') _github_url='https://github.com/balena-io/etcher' url='https://balena.io/etcher' license=(Apache) -depends=("electron12" "gtk3" "libxtst" "libxss" "nss" "alsa-lib" "glib2" "polkit" "libusb") -makedepends=("npm" "python2" "git" "jq" "patch" "nodejs") +depends=() +makedepends=("git" "python" "nvm") optdepends=("libnotify: for notifications") conflicts=("${_pkgname}" "${_pkgname}-git" @@ -21,47 +22,58 @@ conflicts=("${_pkgname}" ) options=('!strip') source=("etcher::git+https://github.com/balena-io/${_pkgname}.git#tag=v${pkgver}" - "${pkgname}-electron.sh" - "${pkgname}-electron.desktop" + "${pkgname}.desktop" ) -sha256sums=('SKIP' - '13651534055dd72dd622ff8ac3d56ee818008dfa1f680b5c4ad7f7ef14698800' - 'c950d9578f9cf60998c920bb60c6617559963f06a4918e7072fdc706b0ef5754') +sha256sums=('51022d670029b8bfd06d17b3db518375e5c480fd928315c90c72044ed9f77db7' + '6c5fb48aeb636272689c86d7cf9beea4515214636bc617a61c3e8387628b3415') + +_ensure_local_nvm() { + # let's be sure we are starting clean + which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload + export NVM_DIR="${srcdir}/.nvm" + + # The init script returns 3 if version specified + # in ./.nvrc is not (yet) installed in $NVM_DIR + # but nvm itself still gets loaded ok + source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] + nvm install ${_nodeversion} + nvm use "${_nodeversion}" +} prepare() { cd "${_pkgname}" git submodule init git submodule update || cd "${srcdir}/${_pkgname}/scripts/resin" && git checkout -- + _ensure_local_nvm } build() { + _ensure_local_nvm cd "${_pkgname}" - make electron-develop - npm run webpack - npm prune --production + export npm_config_build_from_source=true + export npm_config_cache="${srcdir}/.npm_cache" + export npm_config_disturl=https://electronjs.org/headers + npm install + npm run package } package() { cd "${_pkgname}" - _appdir="${pkgdir}/usr/lib/${pkgname}" + _appdir="${pkgdir}/opt/${pkgname}" install -d "${_appdir}" - install package.json "${_appdir}" - cp -a {lib,generated,node_modules} "${_appdir}" - install -D assets/icon.png "${_appdir}/assets/icon.png" - install -D lib/gui/app/index.html "${_appdir}/lib/gui/app/index.html" + cp -a out/balenaEtcher-linux-*/* "${_appdir}" - install -Dm755 "${srcdir}/${pkgname}-electron.sh" "${pkgdir}/usr/bin/${pkgname}-electron" - install -Dm644 "${srcdir}/${pkgname}-electron.desktop" \ - "${pkgdir}/usr/share/applications/${pkgname}-electron.desktop" + install -d "${pkgdir}/usr/bin" + ln -s /opt/${pkgname}/${pkgname} "${pkgdir}/usr/bin/${pkgname}" + install -Dm644 "${srcdir}/${pkgname}.desktop" \ + "${pkgdir}/usr/share/applications/${pkgname}.desktop" for size in 16x16 32x32 48x48 128x128 256x256 512x512; do install -Dm644 "assets/iconset/${size}.png" \ - "${pkgdir}/usr/share/icons/hicolor/${size}/apps/${pkgname}-electron.png" + "${pkgdir}/usr/share/icons/hicolor/${size}/apps/${pkgname}.png" done - find "${pkgdir}" -name package.json -print0 | xargs -r -0 sed -i '/_where/d' } -# vim:set ts=2 sw=2 et: diff --git a/balena-etcher-electron.sh b/balena-etcher-electron.sh deleted file mode 100755 index 78aa2ece41c3..000000000000 --- a/balena-etcher-electron.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then - exec electron12 /usr/lib/balena-etcher "$@" -else - exec electron12 --no-sandbox /usr/lib/balena-etcher "$@" -fi diff --git a/balena-etcher-electron.desktop b/balena-etcher.desktop index 733335b4573e..1b1f130bfe9d 100644 --- a/balena-etcher-electron.desktop +++ b/balena-etcher.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Name=BalenaEtcher Comment=Flash OS images to SD cards and USB drives, safely and easily. -Exec="/usr/bin/balena-etcher-electron" %U +Exec=balena-etcher %U Terminal=false Type=Application -Icon=balena-etcher-electron +Icon=balena-etcher Categories=Utility; |