diff --git a/arrpc/arrpc.service b/arrpc/arrpc.service new file mode 100644 index 0000000..335d5b9 --- /dev/null +++ b/arrpc/arrpc.service @@ -0,0 +1,11 @@ +[Unit] +Description=arRPC Discord RPC daemon +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/arrpc +Restart=on-failure + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/arrpc/async.patch b/arrpc/async.patch new file mode 100644 index 0000000..48244fd --- /dev/null +++ b/arrpc/async.patch @@ -0,0 +1,15 @@ +--- index.js 2023-03-10 18:32:51.934337975 -0500 ++++ index.js 2023-03-10 18:34:27.619332243 -0500 +@@ -6,6 +6,9 @@ + import * as Bridge from './bridge.js'; + import Server from './server.js'; + +-const server = await new Server(); ++async function main() { ++ const server = await new Server(); ++ server.on('activity', data => Bridge.send(data)); ++} + +-server.on('activity', data => Bridge.send(data)); +\ No newline at end of file ++main(); \ No newline at end of file diff --git a/arrpc/lure.sh b/arrpc/lure.sh new file mode 100644 index 0000000..d80384a --- /dev/null +++ b/arrpc/lure.sh @@ -0,0 +1,32 @@ +name='arrpc' +version='3.3.1' +release='1' +desc='Open Discord RPC server for atypical setups' +homepage='https://electronjs.org' +maintainer="Евгений Храмов " +architectures=('amd64') +license=('MIT') +provides=('arrpc') +conflicts=('arrpc-git') + +deps=('glibc' 'gcc-libs') +build_deps=('npm' 'git') + +sources=("git+https://github.com/OpenAsar/arrpc.git") +checksums=('SKIP') + +build() { + cd "${srcdir}/arrpc/" + patch ./src/index.js ../async.patch + npm i esbuild pkg + # use node 18 as pkg apparently doesn't support 19 yet + npx esbuild --bundle --platform=node --target=node18 --outdir=dist ./src/index.js + npx pkg -t node18-linux-x64 -o arrpc ./dist/index.js +} + +package() { + cd "${srcdir}/arrpc" + install-binary ./arrpc + install-license ./LICENSE + install-systemd-user ../arrpc.service +} \ No newline at end of file