Compare commits
24 commits
Author | SHA1 | Date | |
---|---|---|---|
NGnius (Graham) | 01d30e59a7 | ||
NGnius (Graham) | 13b5f1d8d9 | ||
NGnius (Graham) | e464203d9d | ||
NGnius (Graham) | 4261792fb8 | ||
NGnius (Graham) | 0675f97cbe | ||
NGnius (Graham) | 78921cdcf5 | ||
NGnius (Graham) | 197cf56d55 | ||
NGnius (Graham) | 9c77d69e6b | ||
NGnius (Graham) | 5b92737f9f | ||
NGnius (Graham) | c7142c5e3d | ||
NGnius (Graham) | 638c1a4169 | ||
NGnius (Graham) | bdf622dbb1 | ||
NGnius (Graham) | f9ce80ca84 | ||
NGnius (Graham) | f735d9b124 | ||
NGnius (Graham) | 40c272e65d | ||
NGnius (Graham) | 3ebf62341f | ||
NGnius (Graham) | d41ee9bbcf | ||
NGnius (Graham) | b7b50d1104 | ||
cac38d9809 | |||
aaf6802e69 | |||
bed6b096be | |||
cf9e05621c | |||
e73ee0f2a1 | |||
1b06bdc812 |
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -42,8 +42,9 @@ yalc.lock
|
|||
|
||||
# ignore Rust compiler files
|
||||
/backend-rs/target
|
||||
backend
|
||||
/bin/backend
|
||||
/backend/target
|
||||
/backend/out
|
||||
/src/rust/target
|
||||
|
||||
# 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]
|
||||
name = "fantastic-rs"
|
||||
version = "0.5.1-alpha1"
|
||||
version = "0.5.1"
|
||||
edition = "2021"
|
||||
authors = ["NGnius (Graham) <ngniusness@gmail.com>"]
|
||||
description = "Backend (superuser) functionality for Fantastic"
|
||||
|
@ -11,22 +11,22 @@ readme = "../README.md"
|
|||
|
||||
|
||||
[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_json = "1.0"
|
||||
|
||||
nrpc = { version = "0.10", path = "../../nRPC/nrpc" }
|
||||
nrpc = { version = "0.10", default-features = false }
|
||||
prost = "0.11"
|
||||
tokio = { version = "1", features = ["sync", "rt"] }
|
||||
|
||||
sysfuss = { version = "0.3", features = ["derive"], path = "../../sysfs-nav" }
|
||||
sysfuss = { version = "0.3", features = ["derive"] }
|
||||
|
||||
# logging
|
||||
log = "0.4"
|
||||
simplelog = "0.12"
|
||||
|
||||
[build-dependencies]
|
||||
usdpl-build = { version = "0.11", path = "../../usdpl-rs/usdpl-build" }
|
||||
usdpl-build = { version = "0.11" }
|
||||
|
||||
[profile.release]
|
||||
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",
|
||||
"version": "0.5.1-alpha1",
|
||||
"version": "0.5.1",
|
||||
"description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack",
|
||||
"scripts": {
|
||||
"build": "shx rm -rf dist && rollup -c",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
lockfileVersion: '6.1'
|
||||
lockfileVersion: '6.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
|
|
10
src/rust/Cargo.lock
generated
10
src/rust/Cargo.lock
generated
|
@ -430,6 +430,8 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
|
|||
[[package]]
|
||||
name = "nrpc"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eb8807391415c7f5673c2431e723597bbf6a5c2f510aab30dc8d48d0c76f5d26"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
|
@ -440,6 +442,8 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "nrpc-build"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6d47eea1ccd03b060da4b19bec6ac8addcd0129c03b15905a158cd20389d6a4"
|
||||
dependencies = [
|
||||
"nrpc",
|
||||
"prettyplease 0.2.12",
|
||||
|
@ -804,6 +808,8 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
|||
[[package]]
|
||||
name = "usdpl-build"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b732dfafa3876eb2acc3ff17ffc8ed370662e68de3bdf541fbbddaa71ebf52be"
|
||||
dependencies = [
|
||||
"nrpc-build",
|
||||
"prettyplease 0.2.12",
|
||||
|
@ -817,6 +823,8 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "usdpl-core"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dad1ff724f8214657706c4c877181d68d65a4db1c782e0a08a74402fe7c480f5"
|
||||
dependencies = [
|
||||
"base64",
|
||||
]
|
||||
|
@ -824,6 +832,8 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "usdpl-front"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9e7ab9901d3db914e70594d94b2bd05c6c2c9d528937c8f466be581e0b79e8f"
|
||||
dependencies = [
|
||||
"console_error_panic_hook",
|
||||
"futures",
|
||||
|
|
|
@ -13,12 +13,12 @@ readme = "../../README.md"
|
|||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
usdpl-front = { version = "0.11", path = "../../../usdpl-rs/usdpl-front" }
|
||||
nrpc = { version = "0.10", path = "../../../nRPC/nrpc", default-features = false }
|
||||
usdpl-front = { version = "0.11" }
|
||||
nrpc = { version = "0.10", default-features = false }
|
||||
prost = "0.11"
|
||||
|
||||
[build-dependencies]
|
||||
usdpl-build = { version = "0.11", path = "../../../usdpl-rs/usdpl-build" }
|
||||
usdpl-build = { version = "0.11" }
|
||||
|
||||
[features]
|
||||
debug = ["usdpl-front/debug"]
|
||||
|
|
|
@ -2,12 +2,12 @@ fn main() {
|
|||
println!("CWD: {}", std::env::current_dir().unwrap().display());
|
||||
usdpl_build::front::build(
|
||||
[format!(
|
||||
"{}/../../backend-rs/protos/fantastic.proto",
|
||||
"{}/../../backend/protos/fantastic.proto",
|
||||
std::env::current_dir().unwrap().display()
|
||||
)]
|
||||
.into_iter(),
|
||||
[format!(
|
||||
"{}/../../backend-rs/protos/",
|
||||
"{}/../../backend/protos/",
|
||||
std::env::current_dir().unwrap().display()
|
||||
)]
|
||||
.into_iter(),
|
||||
|
|
Loading…
Reference in a new issue