diff options
author | Renato Molnar | 2022-09-03 12:44:19 +0200 |
---|---|---|
committer | Renato Molnar | 2022-09-03 12:44:19 +0200 |
commit | 95a1c3be3bb2c84d370faa77e75e187bd623ddd3 (patch) | |
tree | bbffd2de1f260f63c8892a3fb2b9a93ddacb69f4 | |
parent | b4a26de79cff11942ecb4cadaee3a4a422195bca (diff) | |
download | aur-95a1c3be3bb2c84d370faa77e75e187bd623ddd3.tar.gz |
Fix for bug where the changes weren't saved
Refactored start script
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 38 | ||||
-rw-r--r-- | notepadpp | 64 |
3 files changed, 69 insertions, 47 deletions
@@ -1,7 +1,7 @@ pkgbase = notepadpp - pkgdesc = A free source code editor for Windows (32-bit) + pkgdesc = A free source code editor for Windows - (32-bit) pkgver = 8.4.4 - pkgrel = 1 + pkgrel = 2 url = https://notepad-plus-plus.org/ arch = i686 arch = x86_64 @@ -13,15 +13,15 @@ pkgbase = notepadpp provides = notepadpp conflicts = notepadpp-win32 conflicts = notepadpp-win64 - noextract = npp.8.4.4.bin.zip - noextract = npp.8.4.4.bin.x64.zip + noextract = npp.8.4.4.32.zip + noextract = npp.8.4.4.64.zip options = !strip source = notepadpp source = notepadpp.desktop source = notepadpp.png - source = https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.4.4/npp.8.4.4.portable.zip - source = https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.4.4/npp.8.4.4.portable.x64.zip - sha256sums = d4352139a459f532b807262b5b1933c98142fc772de713abc39e6073d291b200 + source = npp.8.4.4.32.zip::https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.4.4/npp.8.4.4.portable.zip + source = npp.8.4.4.64.zip::https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.4.4/npp.8.4.4.portable.x64.zip + sha256sums = 3e68329f18c46a240b8c852ccfe291b78ae0c37b692f090a1b2e379892415576 sha256sums = a1c34d444893d56ae165c8457260e11b729ea2afc10bb9e2690bc89e1f523238 sha256sums = 04c8ad254a41350078bba4d56ad54f7b4c0df125029aee021ea0ac632971ebad sha256sums = b6c5c11518a7de1cb3ab095506ceb5a69520b19046e3e864cbfeee329fe8a250 @@ -1,10 +1,19 @@ -# Maintainer: Renato Molnar <m dot renato93 at gmail dot com> +# Maintainer: Renato Molnar <renato dot molnar at posteo dot net> + +# If you want to package the 64bit version, you need to uncomment the following line: +#_arch=x64 + +if [[ "${_arch}" == x64 ]]; then + winarch='64' +else + winarch='32' +fi pkgname=notepadpp _pkgname=notepad-plus-plus pkgver=8.4.4 -pkgrel=1 -pkgdesc="A free source code editor for Windows" +pkgrel=2 +pkgdesc="A free source code editor for Windows - (${winarch}-bit)" arch=('x86_64') url="https://${_pkgname}.org/" license=('GPL2') @@ -16,28 +25,17 @@ conflicts=('notepadpp-win32' 'notepadpp-win64') source=(notepadpp notepadpp.desktop notepadpp.png - "https://github.com/${_pkgname}/${_pkgname}/releases/download/v${pkgver}/npp.${pkgver}.portable.zip" - "https://github.com/${_pkgname}/${_pkgname}/releases/download/v${pkgver}/npp.${pkgver}.portable.x64.zip") + "npp.${pkgver}.32.zip::https://github.com/${_pkgname}/${_pkgname}/releases/download/v${pkgver}/npp.${pkgver}.portable.zip" + "npp.${pkgver}.64.zip::https://github.com/${_pkgname}/${_pkgname}/releases/download/v${pkgver}/npp.${pkgver}.portable.x64.zip") -sha256sums=('d4352139a459f532b807262b5b1933c98142fc772de713abc39e6073d291b200' +sha256sums=('3e68329f18c46a240b8c852ccfe291b78ae0c37b692f090a1b2e379892415576' 'a1c34d444893d56ae165c8457260e11b729ea2afc10bb9e2690bc89e1f523238' '04c8ad254a41350078bba4d56ad54f7b4c0df125029aee021ea0ac632971ebad' 'b6c5c11518a7de1cb3ab095506ceb5a69520b19046e3e864cbfeee329fe8a250' '2a07301ea6fe16cb7d814653239d80722b8b432313249720f6856aec070fded0') -noextract=("npp.${pkgver}.bin.zip" - "npp.${pkgver}.bin.x64.zip") - -# If you want to package the 64bit version, you need to uncomment the following line: -#_arch=x64 - -if [[ "${_arch}" == x64 ]]; then - _arch='.x64' - pkgdesc+=" (64-bit)" -else - _arch='' - pkgdesc+=" (32-bit)" -fi +noextract=("npp.${pkgver}.32.zip" + "npp.${pkgver}.64.zip") options=('!strip') @@ -45,7 +43,7 @@ package() { install -d -m755 "${pkgdir}/usr/share/${pkgname}" - unzip "${srcdir}/npp.${pkgver}.portable${_arch}.zip" -d "${pkgdir}/usr/share/${pkgname}" + unzip "${srcdir}/npp.${pkgver}.${winarch}.zip" -d "${pkgdir}/usr/share/${pkgname}" rm -rf "${pkgdir}/usr/share/${pkgname}/updater" \ "${pkgdir}/usr/share/${pkgname}/license.txt" \ diff --git a/notepadpp b/notepadpp index 0b88812ef070..fda1e16e922c 100644 --- a/notepadpp +++ b/notepadpp @@ -1,39 +1,63 @@ #!/usr/bin/env sh +# vim: syntax=sh -app_name='notepadpp' -exe_name='notepad++.exe' +if [ -n "${SH_TRACE}" ]; then + # shellcheck disable=2016 + PS4="$(printf '%b%s%b:\n' '\033[31m' 'L${LINENO}' '\033[0m')" + export PS4 + set -x +fi -pkgdir="/usr/share/${app_name}" -localdir="${HOME}/.local/share/${app_name}" -configdir="${HOME}/.config/${app_name}" -cachedir="${HOME}/.cache/${app_name}" +readonly appName='notepadpp' +readonly exeName='notepad++.exe' -for folder in "${localdir}" "${cachedir}" "${configdir}"; do - if [ ! -d "${folder}" ]; then - mkdir -p "${folder}" - fi -done +readonly pkgDir="/usr/share/${appName}" +readonly localDir="${HOME}/.local/share/${appName}" +readonly configDir="${HOME}/.config/${appName}" +readonly cacheDir="${HOME}/.cache/${appName}" + +# shellcheck disable=2155 +readonly uid="$(id -u)" +# shellcheck disable=2155 +readonly gid="$(id -g)" cleanup() { - until umount "${localdir}"; do - sleep 5 + while umount "${localDir}" 2>&1 | grep -q 'busy\.$' ; do + sleep 2 done } -if mount | grep -q "${localdir}"; then +# Create necessary directories +for appDir in "${localDir}" "${cacheDir}" "${configDir}"; do + if [ ! -d "${appDir}" ]; then + mkdir -p "${appDir}" + fi +done + +# Unmount fuse-overlayfs just in case +if mount | grep -q "${localDir}"; then cleanup fi -if ! fuse-overlayfs -o lowerdir="${pkgdir}" -o upperdir="${configdir}" -o workdir="${cachedir}" "${localdir}"; then - echo "ERROR: cannot mount fuse-overlayfs for ${app_name}" +# Mount the necessary directories with id mapping +if ! fuse-overlayfs -o squash_to_uid="${uid}" -o squash_to_gid="${gid}" \ + -o lowerdir="${pkgDir}" -o upperdir="${configDir}" -o workdir="${cacheDir}" \ + "${localDir}"; then + print 'Mount failed: cannot mount fuse-overlayfs\n' >&2 exit 1 fi trap 'cleanup' INT TERM EXIT -if [ -n "${1}" ]; then - argpath="Z:\\$(readlink -f "${1}" | sed 's|/|\\\\|g')" +# Use default WINEPREFIX - usually ~/.wine +unset WINEPREFIX +# Don't prompt to wine-mono and wine-gecko install - neither is needed +WINEDLLOVERRIDES="${WINEDLLOVERRIDES};mscoree=d;mshtml=d" +# If WINEDEBUG is explicitly set as env var use it +if [ -z "${WINEDEBUG}" ]; then + WINEDEBUG=-all fi -unset WINEPREFIX -WINEDLLOVERRIDES="${WINEDLLOVERRIDES};mscoree=d;mshtml=d" WINEDEBUG=-all wine "${localdir}/${exe_name}" "${argpath}" +export WINEPREFIX WINEDLLOVERRIDES WINEDEBUG + +wine "${localDir}/${exeName}" "${@}" |