makedeb
Multy-API LLM frontend
Viewing /PKGBUILD
.
Click here to go back to the Git tree for sillytavern.
# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
# Uncomment or export in your build environment,
# to use the central cache instead of the local one
#_LOCALCACHE=0
pkgname=sillytavern
_pkgname=SillyTavern
pkgver=1.12.7
_nodeminver=20.0.0
pkgrel=0
pkgdesc="Multy-API LLM frontend"
# actually onnxruntime-node is amd64 and arm64
arch=("all")
url="https://docs.sillytavern.app/"
license=('AGPL3')
depends=('unionfs-fuse')
# many ways to install nodejs
optmakedepends=("nodejs>=${_nodeminver}: install nodejs from the repo"
'npm: needed with distro repo nodejs'
'nvm: install several versions of nodejs in parallel')
optdepends=("nodejs>=${_nodeminver}"
'nvm')
source=("${pkgname}-$pkgver.tar.gz::https://github.com/SillyTavern/SillyTavern/archive/refs/tags/${pkgver}.tar.gz"
"${pkgname}-wrapper.sh"
"${pkgname}.desktop")
b2sums=('5a73cd2c0e4a7a402863905f1ddf88e2e264dd408d83fa85f874f65d72d6ca23374b0e6914bd7e262c2c85209c5e15391435fbf4645952eafa6a36b1131f18a9'
'6d175c44126429ad83554240b757346ac18d62ad12e5fcbd9fda0d1021a96a7fe2206bc9c4a64125172af5ed4ea37c8a73abc71eea81ac987f803c5e649edb18'
'160572cef639c048310380659d95c7adb277c7a9959c3c617f3d5640585d16bc0e25b90fb12182da43158a4e24cf557330a9246fb3acb881d9565530deaff457')
prepare() {
cd "$srcdir/${_pkgname}-$pkgver"
# Download the nodejs libs in local PKGBUILD cache (or in the general cache)
[ -z "$_LOCALCACHE" ] && npm i --no-audit --cache "${startdir}/${pkgname}-npm-cache" || npm i --no-audit
# readme
mv .github/readme* .
# Cleanup
rm -Rf *.sh *.bat replit.nix Dockerfile docker package-lock.json post-install.js .*
rm -Rf node_modules/onnxruntime-node/bin/napi-v3/{darwin,win32}
}
package() {
cd "$srcdir/${_pkgname}-$pkgver"
_SHAREPREFIX="/usr/share/${pkgname}"
_LIBPREFIX="/usr/lib/${pkgname}"
# Creating Directories
install -dm755 $pkgdir/usr/{bin,share/{${pkgname},doc/${pkgname},applications,icons/hicolor/72x72/apps},lib/${pkgname}}
# doc
ln -s "${_SHAREPREFIX}/LICENSE" "$pkgdir/usr/share/doc/${pkgname}/license"
ln -s "${_SHAREPREFIX}/SECURITY.md" "$pkgdir/usr/share/doc/${pkgname}/security"
mv readme* "$pkgdir/usr/share/doc/${pkgname}/"
# Install
install -Dm755 "$srcdir/${pkgname}-wrapper.sh" -v "$pkgdir/usr/bin/${pkgname}"
mv "$srcdir/${_pkgname}-$pkgver/node_modules" "$pkgdir${_LIBPREFIX}"
mv "$srcdir/${_pkgname}-$pkgver/"* "$pkgdir${_SHAREPREFIX}"
ln -s /usr/lib/sillytavern/node_modules "$pkgdir${_SHAREPREFIX}/"
# Icon and desktop file
ln -s "${_SHAREPREFIX}/public/img/apple-icon-72x72.png" "$pkgdir/usr/share/icons/hicolor/72x72/apps/${pkgname}.png"
install -Dm644 "$srcdir/${pkgname}.desktop" -vt "$pkgdir/usr/share/applications"
}