diff options
author | zxp19821005 | 2024-05-08 18:54:41 +0800 |
---|---|---|
committer | zxp19821005 | 2024-05-08 18:54:41 +0800 |
commit | bc68e33d6155cd7f527f78ee476c7b54863ee8bc (patch) | |
tree | c9a3a32c0f8632be2744c819f9ecefb86b8344d1 | |
download | aur-bc68e33d6155cd7f527f78ee476c7b54863ee8bc.tar.gz |
update to 2.0.0.r0.g6befc61
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 66 | ||||
-rw-r--r-- | out-of-mind.sh | 29 |
3 files changed, 116 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..00772d745408 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = out-of-mind-git + pkgdesc = A tiny timer to keep you focused. Write down what you want to work on, then start the timer! + pkgver = 2.0.0.r0.g6befc61 + pkgrel = 1 + url = https://github.com/0916dhkim/out-of-mind + arch = any + license = MIT + makedepends = npm + makedepends = git + makedepends = curl + makedepends = gendesk + depends = electron30 + depends = nodejs + provides = out-of-mind=2.0.0 + conflicts = out-of-mind + source = out-of-mind.git::git+https://github.com/0916dhkim/out-of-mind.git + source = out-of-mind.sh + sha256sums = SKIP + sha256sums = 05762c556c85a4423b28600ccbbe7b7dcdd3d1be526ef4a588a510671fa6c62a + +pkgname = out-of-mind-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..bc4c4a09b1b5 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: zxp19821005 <zxp19821005 at 163 dot com> +pkgname=out-of-mind-git +_pkgname="Out of Mind" +pkgver=2.0.0.r0.g6befc61 +_electronversion=30 +pkgrel=1 +pkgdesc="A tiny timer to keep you focused. Write down what you want to work on, then start the timer!" +arch=('any') +url="https://github.com/0916dhkim/out-of-mind" +license=("MIT") +conflicts=("${pkgname%-git}") +provides=("${pkgname%-git}=${pkgver%.r*}") +depends=( + "electron${_electronversion}" + 'nodejs' +) +makedepends=( + 'npm' + 'git' + 'curl' + 'gendesk' +) +source=( + "${pkgname%-git}.git::git+${url}.git" + "${pkgname%-git}.sh") +sha256sums=('SKIP' + '05762c556c85a4423b28600ccbbe7b7dcdd3d1be526ef4a588a510671fa6c62a') +pkgver() { + cd "${srcdir}/${pkgname%-git}.git" + git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' +} +build() { + sed -e "s|@electronversion@|${_electronversion}|" \ + -e "s|@appname@|${pkgname%-git}|g" \ + -e "s|@runname@|app.asar|g" \ + -e "s|@options@|env ELECTRON_OZONE_PLATFORM_HINT=auto|g" \ + -i "${srcdir}/${pkgname%-git}.sh" + gendesk -q -f -n --categories="Utility" --name="${_pkgname}" --exec="${pkgname%-git} %U" + cd "${srcdir}/${pkgname%-git}.git" + 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}" + 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|\/\${version}||g;s|AppImage|dir|g" -i electron-builder.json5 + npm install + npm run build +} +package() { + install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}" + install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}" + cp -r "${srcdir}/${pkgname%-git}.git/release/linux-"*/resources/app "${pkgdir}/usr/lib/${pkgname%-git}" + install -Dm644 "${srcdir}/${pkgname%-git}.git/build/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png" + install -Dm644 "${srcdir}/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications" + install -Dm644 "${srcdir}/${pkgname%-git}.git/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" +}
\ No newline at end of file diff --git a/out-of-mind.sh b/out-of-mind.sh new file mode 100644 index 000000000000..5594e5380ba2 --- /dev/null +++ b/out-of-mind.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e +_APPDIR="/usr/lib/@appname@" +_RUNNAME="${_APPDIR}/@runname@" +_OPTIONS="@options@" +export PATH="${_APPDIR}:${PATH}" +export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}" +export ELECTRON_IS_DEV=0 +export ELECTRON_FORCE_IS_PACKAGED=true +export ELECTRON_DISABLE_SECURITY_WARNINGS=true +export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@" +export NODE_ENV=production +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +_FLAGS_FILE="${XDG_CONFIG_HOME}/@appname@-flags.conf" +declare -a flags +if [[ -f "${_FLAGS_FILE}" ]]; then + mapfile -t < "${_FLAGS_FILE}" +fi +for line in "${MAPFILE[@]}"; do + if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then + flags+=("${line}") + fi +done +cd "${_APPDIR}" +if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "${_USER_FLAGS}" "$@" || exit $? +else + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "${_USER_FLAGS}" "$@" || exit $? +fi
\ No newline at end of file |