diff options
author | zxp19821005 | 2024-09-18 10:18:24 +0800 |
---|---|---|
committer | zxp19821005 | 2024-09-18 10:18:24 +0800 |
commit | 63cc8dfc7870d33631a2ee166cac55263b33c6a1 (patch) | |
tree | 30f40d9ff623413113f5a6c15bdd4c652dedf633 | |
parent | 03e889c24dadc3533a38e00416c4eee3c105dc3d (diff) | |
download | aur-63cc8dfc7870d33631a2ee166cac55263b33c6a1.tar.gz |
update to 1.13.3.r13.g6c3993a
-rw-r--r-- | PKGBUILD | 64 | ||||
-rw-r--r-- | mailspring.sh | 2 |
2 files changed, 35 insertions, 31 deletions
@@ -31,8 +31,10 @@ source=( sha256sums=('SKIP' '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051') pkgver() { - cd "${srcdir}/${pkgname//-/.}" - git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' + cd "${srcdir}/${pkgname%-git}.git" + set -o pipefail + git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" } _ensure_local_nvm() { export NVM_DIR="${srcdir}/.nvm" @@ -41,42 +43,44 @@ _ensure_local_nvm() { nvm use "${_nodeversion}" } build() { - sed -e "s|@electronversion@|${_electronversion}|" \ - -e "s|@appname@|${pkgname%-git}|g" \ - -e "s|@runname@|app.asar|g" \ - -e "s|@cfgdirname@|${_pkgname}|g" \ - -e "s|@options@|--password-store=\"gnome-libsecret\"|g" \ - -i "${srcdir}/${pkgname%-git}.sh" + sed -e " + s/@electronversion@/${_electronversion}/ + s/@appname@/${pkgname%-git}/ + s/@runname@/app.asar/ + s/@cfgdirname@/${_pkgname}/ + s/@options@/env ELECTRON_OZONE_PLATFORM_HINT=auto --password-store=\"gnome-libsecret\"/ + " -i "${srcdir}/${pkgname%-git}.sh" _ensure_local_nvm cd "${srcdir}/${pkgname//-/.}" - export npm_config_build_from_source=true - export npm_config_cache="${srcdir}/.npm_cache" - #export ELECTRON_SKIP_BINARY_DOWNLOAD=1 - #export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')" - #export npm_config_target="${SYSTEM_ELECTRON_VERSION}" - #export ELECTRONVERSION="${_electronversion}" + export ELECTRON_SKIP_BINARY_DOWNLOAD=1 + export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')" HOME="${srcdir}/.electron-gyp" - if [ `curl -s ipinfo.io/country | grep CN | wc -l ` -ge 1 ];then - export npm_config_registry=https://registry.npmmirror.com - export npm_config_disturl=https://registry.npmmirror.com/-/binary/node/ - export npm_config_electron_mirror=https://registry.npmmirror.com/-/binary/electron/ - export npm_config_electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/ - else - echo "Your network is OK." - fi - sed "s|, 'create-rpm-installer'||g" -i app/build/Gruntfile.js - sed "s|execstack --clear-execstack||g" -i app/script/mkdeb - NODE_ENV=development npm install - NODE_ENV=production npm run build - sed "s|${_pkgname}.desktop|${pkgname%-git}.desktop|g" -i app/dist/"${pkgname%-git}".appdata.xml + { + echo -e '\n' + #echo 'build_from_source=true' + echo "cache=${srcdir}/.npm_cache" + if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then + echo 'registry=https://registry.npmmirror.com' + echo 'disturl=https://registry.npmmirror.com/-/binary/node/' + echo 'electron_mirror=https://registry.npmmirror.com/-/binary/electron/' + echo 'electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/' + fi + } >> .npmrc + sed "s/, \'create-rpm-installer\'//" -i app/build/Gruntfile.js + sed "s/execstack --clear-execstack//" -i app/script/mkdeb + sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/" package.json + NODE_ENV=development npm install + NODE_ENV=production npm run build + sed "s/${_pkgname}.desktop/${pkgname%-git}.desktop/" -i app/dist/"${pkgname%-git}".appdata.xml } package() { install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}" install -Dm644 "${srcdir}/${pkgname//-/.}/app/dist/${pkgname%-git}-linux-"*/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname%-git}" cp -r "${srcdir}/${pkgname//-/.}/app/dist/${pkgname%-git}-linux-"*/resources/app.asar.unpacked "${pkgdir}/usr/lib/${pkgname%-git}" - for _icons in 16 32 64 128 256 512;do - install -Dm644 "${srcdir}/${pkgname//-/.}/app/build/resources/linux/icons/${_icons}.png" \ - "${pkgdir}/usr/share/icons/hicolor/${_icons}x${_icons}/apps/${pkgname%-git}.png" + _icon_sizes=(16 32 64 128 256 512) + for _icon_size in "${_icon_size[@]}"; do + install -Dm644 "${srcdir}/${pkgname//-/.}/app/build/resources/linux/icons/${_icon_size}.png" \ + "${pkgdir}/usr/share/icons/hicolor/${_icon_size}x${_icon_size}/apps/${pkgname%-git}.png" done install -Dm644 "${srcdir}/${pkgname//-/.}/app/dist/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-git}.desktop" install -Dm644 "${srcdir}/${pkgname//-/.}/app/dist/${pkgname%-git}.appdata.xml" -t "${pkgdir}/usr/share/appdata" diff --git a/mailspring.sh b/mailspring.sh index 4cfe3ac09dd8..40e422ca2ee7 100644 --- a/mailspring.sh +++ b/mailspring.sh @@ -21,7 +21,7 @@ if [[ -f "${_FLAGS_FILE}" ]]; then fi done < "${_FLAGS_FILE}" fi -cd "${_APPDIR}" +cd "${_APPDIR}" || { echo "Failed to change directory to ${_APPDIR}"; exit 1; } if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@" else |