Compare commits

...

24 commits
main ... decky

Author SHA1 Message Date
NGnius (Graham) 01d30e59a7 Merge branch 'main' into decky 2024-03-10 22:02:12 -04:00
NGnius (Graham) 13b5f1d8d9 Merge branch 'main' into decky 2024-03-10 21:51:51 -04:00
NGnius (Graham) e464203d9d Merge branch 'main' into decky 2023-12-02 13:35:38 -05:00
NGnius (Graham) 4261792fb8 Update builds for v0.5.0 release, including wasm compile step 2023-11-18 14:03:53 -05:00
NGnius (Graham) 0675f97cbe Merge branch 'main' into decky 2023-11-17 16:27:30 -05:00
NGnius (Graham) 78921cdcf5 I hate pnpm lock files 2023-05-29 22:39:14 -04:00
NGnius (Graham) 197cf56d55 Version bump for lockfile and dfl 2023-05-29 21:45:38 -04:00
NGnius (Graham) 9c77d69e6b Configure USDPL back-end for decky-specific features 2023-03-09 17:09:40 -05:00
NGnius (Graham) 5b92737f9f Merge branch 'main' into decky 2023-02-26 13:02:36 -05:00
NGnius (Graham) c7142c5e3d Update pnpm lock 2023-02-20 22:57:20 -05:00
NGnius (Graham) 638c1a4169 Merge branch 'main' into decky 2023-02-20 22:56:19 -05:00
NGnius (Graham) bdf622dbb1 Merge branch 'main' into decky 2023-01-12 19:50:47 -05:00
NGnius (Graham) f9ce80ca84 Add pnpm lock file for decky CI 2022-12-08 11:31:27 -05:00
NGnius (Graham) f735d9b124 Merge branch 'main' into decky 2022-11-25 20:58:18 -05:00
NGnius (Graham) 40c272e65d Merge branch 'main' into decky 2022-09-18 20:31:23 -04:00
NGnius (Graham) 3ebf62341f Fix some state bugs which caused fan pulsing 2022-09-02 21:08:03 -04:00
NGnius (Graham) d41ee9bbcf Bump version to v0.3.3 2022-09-01 16:44:52 -04:00
NGnius (Graham) b7b50d1104 Update docker scripts for testing 2022-09-01 16:39:34 -04:00
TrainDoctor cac38d9809 Remove sudo from this line 2022-08-23 14:39:10 -07:00
TrainDoctor aaf6802e69 Added separate build-docker.sh 2022-08-23 14:26:05 -07:00
TrainDoctor bed6b096be rustup is installed to root, grab it from there 2022-08-23 14:04:18 -07:00
TrainDoctor cf9e05621c Change to grab toolchain from homedir 2022-08-23 13:30:24 -07:00
TrainDoctor e73ee0f2a1 Changed entrypoint.sh to run cargo rather than cross 2022-08-23 12:26:43 -07:00
TrainDoctor 1b06bdc812 Move backend stuff to backend folder 2022-08-23 11:42:12 -07:00
25 changed files with 419 additions and 351 deletions

3
.gitignore vendored
View file

@ -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

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -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
View 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
View 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
View 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
View 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
View file

@ -0,0 +1,4 @@
#!/bin/bash
# build docker container locally (for testing)
docker build -t fantastic_backend .

8
backend/entrypoint.sh Executable file
View 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
View 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

View file

@ -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",

View file

@ -1,4 +1,4 @@
lockfileVersion: '6.1'
lockfileVersion: '6.0'
settings:
autoInstallPeers: true

10
src/rust/Cargo.lock generated
View file

@ -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",

View file

@ -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"]

View file

@ -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(),