diff --git a/README.md b/README.md index 13d5f4c..c0678fa 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ and you can just run it by doing : ``` babylonia-terminal-cli ``` +If you have any issue installing it on Steam deck or any other distro, [go check the wiki](https://github.com/ALEZ-DEV/Babylonia-terminal/wiki) ## Special thank diff --git a/babylonia_terminal_launcher/native/hub/src/game.rs b/babylonia_terminal_launcher/native/hub/src/game.rs index 6b85438..ce53786 100644 --- a/babylonia_terminal_launcher/native/hub/src/game.rs +++ b/babylonia_terminal_launcher/native/hub/src/game.rs @@ -49,12 +49,9 @@ pub async fn listen_game_installation() { .unwrap() .block_on(async { if GameState::get_game_dir().await.is_none() { - if let Err(e) = GameState::set_game_dir(Some( - GameState::get_config_directory() + if let Err(e) = + GameState::set_game_dir(Some(GameState::get_config_directory().await)) .await - .join("babylonia-terminal-config"), - )) - .await { ReportError { error_message: format!("Failed to set new path : {}", e), diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..e77c5b9 --- /dev/null +++ b/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +while true; do + read -p "Are you on steam deck? (y/n): " confirm + if [[ $confirm =~ ^yes$|^y$|^Y$|^no$|^n$|^N$ ]]; then + if [[ $confirm =~ ^yes$|^y$|^Y$ ]]; then + isSteamdeck=true + else + isSteamdeck=false + fi + break + fi +done + +if $isSteamdeck; then + sudo steamos-readonly disable +fi + +if ! command -v distrobox &>/dev/null; then + curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh +fi + +if $isSteamdeck; then + sudo steamos-readonly enable +fi + +xhost +si:localuser:$USER >/dev/null + +distroname="babylonia-terminal-image" +distrobox create --image registry.fedoraproject.org/fedora-toolbox:38 -Y --name $distroname +distrobox enter --name $distroname -- sudo dnf install -y pkg-config openssl-devel llvm-devel gcc-c++.x86_64 +distrobox enter --name $distroname -- rustup update +distrobox enter --name $distroname -- rustup toolchain install 1.78.0 +distrobox enter --name $distroname -- cargo install --git https://github.com/ALEZ-DEV/Babylonia-terminal --bin diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..52608d7 --- /dev/null +++ b/shell.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {} }: +pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + rustup + rustfmt + clippy + gcc + pkg-config + ]; + + buildInputs = with pkgs; [ + openssl + cabextract + ]; + + shellHook = '' + export OPENSSL_DIR="${pkgs.openssl.dev}" + export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig" + export OPENSSL_NO_VENDOR=1 + export OPENSSL_LIB_DIR="${pkgs.lib.getLib pkgs.openssl}/lib" + ''; +}