mirror of
https://github.com/terrapkg/packages.git
synced 2026-06-19 18:10:38 +00:00
add: arrpc (#920)
* add: arrpc * anda.hcl update.rhai * patch? * oops * maybe just don't patch * I don't know * dirty patch method in %prep * fix the dirty sed
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
project pkg {
|
||||
rpm {
|
||||
spec = "arrpc.spec"
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -0,0 +1,53 @@
|
||||
%define debug_package %nil
|
||||
%global commit c6e23e7eb733ad396d3eebc328404cc656fed581
|
||||
|
||||
Name: arrpc
|
||||
Version: 3.3.0
|
||||
Release: 1%?dist
|
||||
Summary: Open Discord RPC server for atypical setups
|
||||
License: MIT
|
||||
URL: https://arrpc.openasar.dev
|
||||
Source0: https://github.com/OpenAsar/arrpc/archive/%commit.tar.gz
|
||||
Source1: arrpc.service
|
||||
Requires: glibc
|
||||
BuildRequires: nodejs-npm systemd-rpm-macros
|
||||
|
||||
%description
|
||||
arRPC is an open source implementation of Discord's half-documented local RPC servers for their desktop client.
|
||||
This open source implementation purely in NodeJS allows it to be used in many places where it is otherwise
|
||||
impossible to do: Discord web and alternative clients like ArmCord/etc. It opens a simple bridge WebSocket
|
||||
server which messages the JSON of exactly what to dispatch with in the client with no extra processing needed,
|
||||
allowing small and simple mods or plugins. arRPC is experimental and a work in progress, so expect bugs, etc.
|
||||
|
||||
%prep
|
||||
%autosetup -n arrpc-%commit
|
||||
# patch for using esbuild
|
||||
sed -i -E 's@const server[^\n]+;@async function main() {\0@' src/index.js
|
||||
sed -i -E 's@server\.on[^\n]+;@\0}\nmain();@' src/index.js
|
||||
|
||||
%build
|
||||
npm i esbuild pkg
|
||||
npx esbuild --bundle --platform=node --target=node18 --outdir=dist ./src/index.js
|
||||
npx pkg -t node18-linux-x64 -o arrpc ./dist/index.js
|
||||
|
||||
%install
|
||||
install -D -m755 arrpc %buildroot%_bindir/arrpc
|
||||
install -D -m644 %SOURCE1 %buildroot%_userunitdir/arrpc.service
|
||||
|
||||
%post
|
||||
%systemd_user_post arrpc.service
|
||||
|
||||
%preun
|
||||
%systemd_user_preun arrpc.service
|
||||
|
||||
%postun
|
||||
%systemd_user_postun_with_restart arrpc.service
|
||||
|
||||
%files
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%_bindir/arrpc
|
||||
%_userunitdir/arrpc.service
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
@@ -0,0 +1,2 @@
|
||||
let md = get("https://raw.githubusercontent.com/OpenAsar/arrpc/main/changelog.md");
|
||||
rpm.version(find("(?m)^## v([\\d.]+)", md, 1));
|
||||
Reference in New Issue
Block a user