Compare commits
24 commits
Author | SHA1 | Date | |
---|---|---|---|
01d30e59a7 | |||
13b5f1d8d9 | |||
e464203d9d | |||
4261792fb8 | |||
0675f97cbe | |||
78921cdcf5 | |||
197cf56d55 | |||
9c77d69e6b | |||
5b92737f9f | |||
c7142c5e3d | |||
638c1a4169 | |||
bdf622dbb1 | |||
f9ce80ca84 | |||
f735d9b124 | |||
40c272e65d | |||
3ebf62341f | |||
d41ee9bbcf | |||
b7b50d1104 | |||
|
cac38d9809 | ||
|
aaf6802e69 | ||
|
bed6b096be | ||
|
cf9e05621c | ||
|
e73ee0f2a1 | ||
|
1b06bdc812 |
25 changed files with 419 additions and 351 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -42,8 +42,9 @@ yalc.lock
|
||||||
|
|
||||||
# ignore Rust compiler files
|
# ignore Rust compiler files
|
||||||
/backend-rs/target
|
/backend-rs/target
|
||||||
backend
|
|
||||||
/bin/backend
|
/bin/backend
|
||||||
|
/backend/target
|
||||||
|
/backend/out
|
||||||
/src/rust/target
|
/src/rust/target
|
||||||
|
|
||||||
# packaged teasers
|
# packaged teasers
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#cargo build --release --target x86_64-unknown-linux-musl
|
|
||||||
#cargo build --target x86_64-unknown-linux-musl
|
|
||||||
#cross build --release
|
|
||||||
cargo build
|
|
||||||
|
|
||||||
mkdir -p ../bin
|
|
||||||
#cp --preserve=mode ./target/x86_64-unknown-linux-musl/release/fantastic-rs ../bin/backend
|
|
||||||
#cp --preserve=mode ./target/x86_64-unknown-linux-musl/debug/fantastic-rs ../bin/backend
|
|
||||||
#cp --preserve=mode ./target/release/fantastic-rs ../bin/backend
|
|
||||||
cp --preserve=mode ./target/debug/fantastic-rs ../bin/backend
|
|
||||||
|
|
653
backend-rs/Cargo.lock → backend/Cargo.lock
generated
653
backend-rs/Cargo.lock → backend/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "fantastic-rs"
|
name = "fantastic-rs"
|
||||||
version = "0.5.1-alpha1"
|
version = "0.5.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["NGnius (Graham) <ngniusness@gmail.com>"]
|
authors = ["NGnius (Graham) <ngniusness@gmail.com>"]
|
||||||
description = "Backend (superuser) functionality for Fantastic"
|
description = "Backend (superuser) functionality for Fantastic"
|
||||||
|
@ -11,22 +11,22 @@ readme = "../README.md"
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
usdpl-back = { version = "0.11", features = ["blocking"], path = "../../usdpl-rs/usdpl-back"}
|
usdpl-back = { version = "0.11", features = ["blocking", "decky"]}
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
||||||
nrpc = { version = "0.10", path = "../../nRPC/nrpc" }
|
nrpc = { version = "0.10", default-features = false }
|
||||||
prost = "0.11"
|
prost = "0.11"
|
||||||
tokio = { version = "1", features = ["sync", "rt"] }
|
tokio = { version = "1", features = ["sync", "rt"] }
|
||||||
|
|
||||||
sysfuss = { version = "0.3", features = ["derive"], path = "../../sysfs-nav" }
|
sysfuss = { version = "0.3", features = ["derive"] }
|
||||||
|
|
||||||
# logging
|
# logging
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
simplelog = "0.12"
|
simplelog = "0.12"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
usdpl-build = { version = "0.11", path = "../../usdpl-rs/usdpl-build" }
|
usdpl-build = { version = "0.11" }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
debug = false
|
debug = false
|
7
backend/Dockerfile
Normal file
7
backend/Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FROM ghcr.io/steamdeckhomebrew/holo-toolchain-rust:latest
|
||||||
|
|
||||||
|
#RUN pacman -S --noconfirm cmake make clang git
|
||||||
|
# for building Rust wasm frontend
|
||||||
|
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/backend/entrypoint.sh" ]
|
14
backend/Makefile
Normal file
14
backend/Makefile
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# This is the default target, which will be built when
|
||||||
|
# you invoke make
|
||||||
|
.PHONY: all
|
||||||
|
all: hello
|
||||||
|
|
||||||
|
# This rule tells make how to build hello from hello.cpp
|
||||||
|
hello:
|
||||||
|
mkdir -p ./out
|
||||||
|
gcc -o ./out/hello ./src/main.c
|
||||||
|
|
||||||
|
# This rule tells make to delete hello and hello.o
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -f hello
|
22
backend/build-docker.sh
Executable file
22
backend/build-docker.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "--- Rust version info ---"
|
||||||
|
rustup --version
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
|
||||||
|
echo "--- Building plugin backend ---"
|
||||||
|
cargo build --release
|
||||||
|
#mkdir -p out
|
||||||
|
cp target/release/fantastic-rs out/backend
|
||||||
|
|
||||||
|
echo "--- Building plugin frontend (wasm) ---"
|
||||||
|
# this only builds the webassembly part, while the actual frontend task builds the rest of it
|
||||||
|
cd /plugin/src/rust
|
||||||
|
./build.sh decky
|
||||||
|
cargo clean
|
||||||
|
cd /backend
|
||||||
|
|
||||||
|
echo " --- Cleaning up ---"
|
||||||
|
# remove root-owned target folder
|
||||||
|
cargo clean
|
5
backend/build.sh
Executable file
5
backend/build.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cargo build --target x86_64-unknown-linux-musl --release
|
||||||
|
mkdir -p ../bin
|
||||||
|
cp ./target/x86_64-unknown-linux-musl/release/fantastic-rs ../bin/backend
|
4
backend/create_docker_img.sh
Executable file
4
backend/create_docker_img.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# build docker container locally (for testing)
|
||||||
|
|
||||||
|
docker build -t fantastic_backend .
|
8
backend/entrypoint.sh
Executable file
8
backend/entrypoint.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Container's IP address: `awk 'END{print $1}' /etc/hosts`"
|
||||||
|
|
||||||
|
cd /backend
|
||||||
|
|
||||||
|
sudo bash build-docker.sh
|
7
backend/run_docker_img.sh
Executable file
7
backend/run_docker_img.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# run docker container locally (for testing)
|
||||||
|
# assumes you're running in the backend/ dir of the project
|
||||||
|
|
||||||
|
docker run -i --entrypoint /backend/entrypoint.sh -v $PWD:/backend fantastic_backend
|
||||||
|
mkdir -p ../bin
|
||||||
|
cp ./out/backend ../bin
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Fantastic",
|
"name": "Fantastic",
|
||||||
"version": "0.5.1-alpha1",
|
"version": "0.5.1",
|
||||||
"description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack",
|
"description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "shx rm -rf dist && rollup -c",
|
"build": "shx rm -rf dist && rollup -c",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
lockfileVersion: '6.1'
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
settings:
|
settings:
|
||||||
autoInstallPeers: true
|
autoInstallPeers: true
|
||||||
|
|
10
src/rust/Cargo.lock
generated
10
src/rust/Cargo.lock
generated
|
@ -430,6 +430,8 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nrpc"
|
name = "nrpc"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "eb8807391415c7f5673c2431e723597bbf6a5c2f510aab30dc8d48d0c76f5d26"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
@ -440,6 +442,8 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nrpc-build"
|
name = "nrpc-build"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d6d47eea1ccd03b060da4b19bec6ac8addcd0129c03b15905a158cd20389d6a4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nrpc",
|
"nrpc",
|
||||||
"prettyplease 0.2.12",
|
"prettyplease 0.2.12",
|
||||||
|
@ -804,6 +808,8 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "usdpl-build"
|
name = "usdpl-build"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b732dfafa3876eb2acc3ff17ffc8ed370662e68de3bdf541fbbddaa71ebf52be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nrpc-build",
|
"nrpc-build",
|
||||||
"prettyplease 0.2.12",
|
"prettyplease 0.2.12",
|
||||||
|
@ -817,6 +823,8 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "usdpl-core"
|
name = "usdpl-core"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dad1ff724f8214657706c4c877181d68d65a4db1c782e0a08a74402fe7c480f5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
]
|
]
|
||||||
|
@ -824,6 +832,8 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "usdpl-front"
|
name = "usdpl-front"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a9e7ab9901d3db914e70594d94b2bd05c6c2c9d528937c8f466be581e0b79e8f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
"futures",
|
"futures",
|
||||||
|
|
|
@ -13,12 +13,12 @@ readme = "../../README.md"
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
usdpl-front = { version = "0.11", path = "../../../usdpl-rs/usdpl-front" }
|
usdpl-front = { version = "0.11" }
|
||||||
nrpc = { version = "0.10", path = "../../../nRPC/nrpc", default-features = false }
|
nrpc = { version = "0.10", default-features = false }
|
||||||
prost = "0.11"
|
prost = "0.11"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
usdpl-build = { version = "0.11", path = "../../../usdpl-rs/usdpl-build" }
|
usdpl-build = { version = "0.11" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
debug = ["usdpl-front/debug"]
|
debug = ["usdpl-front/debug"]
|
||||||
|
|
|
@ -2,12 +2,12 @@ fn main() {
|
||||||
println!("CWD: {}", std::env::current_dir().unwrap().display());
|
println!("CWD: {}", std::env::current_dir().unwrap().display());
|
||||||
usdpl_build::front::build(
|
usdpl_build::front::build(
|
||||||
[format!(
|
[format!(
|
||||||
"{}/../../backend-rs/protos/fantastic.proto",
|
"{}/../../backend/protos/fantastic.proto",
|
||||||
std::env::current_dir().unwrap().display()
|
std::env::current_dir().unwrap().display()
|
||||||
)]
|
)]
|
||||||
.into_iter(),
|
.into_iter(),
|
||||||
[format!(
|
[format!(
|
||||||
"{}/../../backend-rs/protos/",
|
"{}/../../backend/protos/",
|
||||||
std::env::current_dir().unwrap().display()
|
std::env::current_dir().unwrap().display()
|
||||||
)]
|
)]
|
||||||
.into_iter(),
|
.into_iter(),
|
||||||
|
|
Loading…
Reference in a new issue