diff options
author | zxp19821005 | 2023-12-07 10:49:57 +0800 |
---|---|---|
committer | zxp19821005 | 2023-12-07 10:49:57 +0800 |
commit | a43e27354d69a36388a23dc8cb428c22a1b0085a (patch) | |
tree | 588a8f8427a94e41a6d4077dea5c2c4cfb0cdf00 | |
parent | 174d3aabd0c23ff1a19425cd21646f74941f62d1 (diff) | |
download | aur-a43e27354d69a36388a23dc8cb428c22a1b0085a.tar.gz |
fix errors
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 59 | ||||
-rw-r--r-- | autorecord-manager.sh | 14 |
3 files changed, 58 insertions, 29 deletions
@@ -1,20 +1,20 @@ pkgbase = autorecord-manager pkgdesc = 基于 Electron 的多平台直播自动录制软件 pkgver = 4.3.4 - pkgrel = 2 + pkgrel = 3 url = https://github.com/WhiteMinds/LiveAutoRecord arch = any license = LGPL3 makedepends = gendesk - makedepends = nodejs>=16.20.1 - makedepends = npm>=8.19.4 + makedepends = nvm + makedepends = npm makedepends = yarn - depends = bash + makedepends = git depends = electron20 conflicts = autorecord-manager - source = autorecord-manager-4.3.4.zip::https://github.com/WhiteMinds/LiveAutoRecord/archive/refs/tags/v4.3.4.zip + source = autorecord-manager-4.3.4::git+https://github.com/WhiteMinds/LiveAutoRecord.git#tag=v4.3.4 source = autorecord-manager.sh - sha256sums = 5735afafaa1decd62301608d6546dd702b63641775fb839232e191a62fc411b4 - sha256sums = a203712105b67a53b7cef617b4d7d5411280c058171b671a0ec60b600eea7d68 + sha256sums = SKIP + sha256sums = 8915ca75d453698df81f7f3305cce6869f4261d754d90f0c3724b73c7b24ca84 pkgname = autorecord-manager @@ -1,36 +1,59 @@ # Maintainer: zxp19821005 <zxp19821005 at 163 dot com> pkgname=autorecord-manager -_pkgname=LiveAutoRecord +_pkgname="LAR 直播自动录制" pkgver=4.3.4 -pkgrel=2 +_electronversion=20 +pkgrel=3 pkgdesc="基于 Electron 的多平台直播自动录制软件" arch=('any') url="https://github.com/WhiteMinds/LiveAutoRecord" license=('LGPL3') conflicts=("${pkgname}") -depends=('bash' 'electron20') -makedepends=('gendesk' 'nodejs>=16.20.1' 'npm>=8.19.4' 'yarn') -source=("${pkgname}-${pkgver}.zip::${url}/archive/refs/tags/v${pkgver}.zip" - "${pkgname%-bin}.sh") -sha256sums=('5735afafaa1decd62301608d6546dd702b63641775fb839232e191a62fc411b4' - 'a203712105b67a53b7cef617b4d7d5411280c058171b671a0ec60b600eea7d68') -prepare() { - gendesk -f -n -q --categories "Utility" --name "${pkgname}" --exec "${pkgname}" +depends=( + electron${_electronversion} +) +makedepends=( + 'gendesk' + 'nvm' + 'npm' + 'yarn' + 'git' +) +source=( + "${pkgname}-${pkgver}::git+${url}.git#tag=v${pkgver}" + "${pkgname}.sh" +) +sha256sums=('SKIP' + '8915ca75d453698df81f7f3305cce6869f4261d754d90f0c3724b73c7b24ca84') +_ensure_local_nvm() { + export NVM_DIR="${srcdir}/.nvm" + source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] + nvm install 16 + nvm use 16 } build() { - cd "${srcdir}/${_pkgname}-${pkgver}" + sed -e "s|@electronversion@|${_electronversion}|" \ + -e "s|@appname@|${pkgname}|g" \ + -e "s|@appasar@|app.asar|g" \ + -i "${srcdir}/${pkgname}.sh" + _ensure_local_nvm + gendesk -f -n -q --categories "Utility" --name "${_pkgname}" --exec "${pkgname}" + cd "${srcdir}/${pkgname}-${pkgver}" + export npm_config_build_from_source=true + export npm_config_cache="${srcdir}/.npm_cache" sed "s|electron-builder\",|electron-builder --linux AppImage\",|g" -i packages/electron/package.json - yarn - cd "${srcdir}/${_pkgname}-${pkgver}/packages/shared" + yarn install + cd "${srcdir}/${pkgname}-${pkgver}/packages/shared" yarn build - cd "${srcdir}/${_pkgname}-${pkgver}/packages/manager" + cd "${srcdir}/${pkgname}-${pkgver}/packages/manager" yarn build yarn app:build -p never } package() { - install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}" - install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/packages/electron/build/${pkgver}/linux-unpacked/resources/app.asar" -t "${pkgdir}/opt/${pkgname%-bin}/resources" - install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/packages/electron/build/icons/256x256.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png" + install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}" + install -Dm644 "${srcdir}/${pkgname}-${pkgver}/packages/electron/build/${pkgver}/linux-unpacked/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname}" + cp -r "${srcdir}/${pkgname}-${pkgver}/packages/electron/build/${pkgver}/linux-unpacked/resources/app.asar.unpacked" "${pkgdir}/usr/lib/${pkgname}" + install -Dm644 "${srcdir}/${pkgname}-${pkgver}/packages/electron/build/icons/256x256.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png" install -Dm644 "${srcdir}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications" - install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" + install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" }
\ No newline at end of file diff --git a/autorecord-manager.sh b/autorecord-manager.sh index 2cee66c9c7f6..2ec4412e5c4f 100644 --- a/autorecord-manager.sh +++ b/autorecord-manager.sh @@ -1,8 +1,14 @@ #!/bin/bash -_ELECTRON=/usr/bin/electron20 -_ASAR="/opt/autorecord-manager/resources/app.asar" +set -e +_APPDIR="/usr/lib/@appname@" +export PATH="${_APPDIR}:${PATH}" +export ELECTRON_IS_DEV=0 +export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}" +_ASAR="${_APPDIR}/@appasar@" if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then - exec ${_ELECTRON} ${_ASAR} "$@" + cd "${_APPDIR}" + exec electron@electronversion@ "${_ASAR}" "$@" else - exec ${_ELECTRON} ${_ASAR} --no-sandbox "$@" + cd "${_APPDIR}" + exec electron@electronversion@ "${_ASAR}" --no-sandbox "$@" fi
\ No newline at end of file |