diff options
author | zxp19821005 | 2025-01-08 15:56:50 +0800 |
---|---|---|
committer | zxp19821005 | 2025-01-08 15:56:50 +0800 |
commit | b5c2b7c2e571bd0d05fd00f4504f5940148f8c6a (patch) | |
tree | a2dea6a73f7b8b2dd368f118bc0a6bcdf987fad0 | |
download | aur-b5c2b7c2e571bd0d05fd00f4504f5940148f8c6a.tar.gz |
update to 2.0.0.r1.ge388630
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 85 | ||||
-rw-r--r-- | titan-rcs.sh | 29 |
3 files changed, 135 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f80477e8f7e7 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = titan-rcs-git + pkgdesc = A desktop application for streamlining your workflow in Revision Control Systems (RCS) like Subversion (SVN).(Use system-wide electron) + pkgver = 2.0.0.r1.ge388630 + pkgrel = 1 + url = https://github.com/ArrushC/Titan + arch = any + license = LicenseRef-unknown + makedepends = gendesk + makedepends = npm + makedepends = nvm + makedepends = git + makedepends = curl + depends = electron33 + provides = titan-rcs=2.0.0 + conflicts = titan-rcs + source = titan-rcs.git::git+https://github.com/ArrushC/Titan.git + source = titan-rcs.sh + sha256sums = SKIP + sha256sums = 291f50480f5a61bc9c68db7d44cd0412071128706baa868a9cb854f8779a1980 + +pkgname = titan-rcs-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..4d88347eba05 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,85 @@ +# Maintainer: zxp19821005 <zxp19821005 at 163 dot com> +_appname=titan +pkgname="${_appname}-rcs-git" +_pkgname=Titan +pkgver=2.0.0.r1.ge388630 +_electronversion=33 +_nodeversion=18 +pkgrel=1 +pkgdesc="A desktop application for streamlining your workflow in Revision Control Systems (RCS) like Subversion (SVN).(Use system-wide electron)" +arch=('any') +url="https://github.com/ArrushC/Titan" +license=('LicenseRef-unknown') +conflicts=("${pkgname%-git}") +provides=("${pkgname%-git}=${pkgver%.r*}") +depends=( + "electron${_electronversion}" +) +makedepends=( + 'gendesk' + 'npm' + 'nvm' + 'git' + 'curl' +) +source=( + "${pkgname%-git}.git::git+${url}.git" + "${pkgname%-git}.sh" +) +sha256sums=('SKIP' + '291f50480f5a61bc9c68db7d44cd0412071128706baa868a9cb854f8779a1980') +pkgver() { + 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() { + local NVM_DIR="${srcdir}/.nvm" + source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] + nvm install "${_nodeversion}" + nvm use "${_nodeversion}" +} +prepare() { + sed -e " + s/@electronversion@/${_electronversion}/g + s/@appname@/${pkgname%-git}/g + s/@runname@/app.asar/g + s/@cfgdirname@/${_appname}/g + s/@options@/env ELECTRON_OZONE_PLATFORM_HINT=auto/g + " -i "${srcdir}/${pkgname%-git}.sh" + _ensure_local_nvm + gendesk -q -f -n --pkgname="${pkgname%-git}" --pkgdesc="${pkgdesc}" --categories="Utility" --name="${pkgname%-git}" --exec="${pkgname%-git} %U" + cd "${srcdir}/${pkgname%-git}.git" + electronDist="/usr/lib/electron${_electronversion}" + export ELECTRON_SKIP_BINARY_DOWNLOAD=1 + export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')" + HOME="${srcdir}/.electron-gyp" + { + echo -e '\n' + #echo 'build_from_source=true' + echo "cache=${srcdir}/.npm_cache" + } >> .npmrc + if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then + { + echo 'registry=https://registry.npmmirror.com' + echo 'electron_mirror=https://registry.npmmirror.com/-/binary/electron/' + echo 'electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/' + } >> .npmrc + find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} + + fi + sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json + NODE_ENV=development npm install --legacy-peer-deps + NODE_ENV=development npm add -D @rollup/rollup-linux-x64-gnu @swc/core +} +build() { + cd "${srcdir}/${pkgname%-git}.git" + NODE_ENV=production npm run client:build + NODE_ENV=production npm exec -c "electron-builder --linux dir -c.electronDist=${electronDist}" +} +package() { + install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}" + install -Dm644 "${srcdir}/${pkgname%-git}.git/release/linux-"*/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname%-git}" + install -Dm644 "${srcdir}/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications" + install -Dm644 "${srcdir}/${pkgname%-git}.git/icons/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png" +}
\ No newline at end of file diff --git a/titan-rcs.sh b/titan-rcs.sh new file mode 100644 index 000000000000..40e422ca2ee7 --- /dev/null +++ b/titan-rcs.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -o pipefail +_APPDIR="/usr/lib/@appname@" +_RUNNAME="${_APPDIR}/@runname@" +_CFGDIR="@cfgdirname@/" +_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}" +export _FLAGS_FILE="${XDG_CONFIG_HOME}/${_CFGDIR}@appname@-flags.conf" +declare -a _USER_FLAGS +if [[ -f "${_FLAGS_FILE}" ]]; then + while read -r line; do + if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then + _USER_FLAGS+=("${line}") + fi + done < "${_FLAGS_FILE}" +fi +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 + exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@" +fi
\ No newline at end of file |