From 60a70baa48997ee5fade9c34006101c4b84f66d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=A5=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=B2?= Date: Sun, 21 Apr 2024 15:11:59 +0300 Subject: [PATCH] arrpc --- arrpc/arrpc.service | 11 +++++++++++ arrpc/async.patch | 15 +++++++++++++++ arrpc/lure.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 arrpc/arrpc.service create mode 100644 arrpc/async.patch create mode 100644 arrpc/lure.sh 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