added project structure

I think
This commit is contained in:
Jonas_Jones 2023-04-25 23:22:01 +02:00
parent 756da9d535
commit 0fbf4fd2cd
3 changed files with 33 additions and 4 deletions

28
PKGBUILD Normal file
View file

@ -0,0 +1,28 @@
# Maintainer: Jonas_Jones https://jonasjones.me
pkgname="dayz-linux-gui-launcher-git"
pkgver="0.0.1"
pkgrel=1
pkgdesc="A gui using the dayz-linux-cli-launcher"
arch=('any')
depends=("dayz-linux-cli-launcher")
makedepends=("cargo")
license=("Right to modify")
prepare() {
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release --all-features
}
check() {
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen --all-features
}
package() {
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}

1
run.sh Executable file
View file

@ -0,0 +1 @@
cargo run

View file

@ -10,9 +10,9 @@ use std::fmt;
fn main() -> Result<(), eframe::Error> {
let config_dir = UserDirs::new().unwrap().home_dir().to_str().unwrap().to_string() + "/.config/dayz-linux-gui-launcher";
let local_dir = UserDirs::new().unwrap().home_dir().to_str().unwrap().to_string() + "/.local/share/dayz-linux-gui-launcher";
let dayz_cli_script = "/usr/bin";
// run the setup function
setup(&config_dir, &local_dir);
setup(&config_dir, &dayz_cli_script.to_string());
let options = eframe::NativeOptions {
// Hide the OS-specific "chrome" around the window:
decorated: false,
@ -138,9 +138,9 @@ fn load_profile(config_dir: &String, profile_name: &String) -> (String, String,
fn launch(playername: &String, serverip: &String, serverport: &String, queryport: &String, steamexe: &String, customsteamexe: &String) {
// command structure: ./dayz-launcher.sh --steam <"" if default | flatpak if Flatpak | "/path/to/executable" if custom> --launch --name <playername> --server serverip:serverport --port <queryport>
let local_dir = UserDirs::new().unwrap().home_dir().to_str().unwrap().to_string() + "/.local/share/dayz-linux-gui-launcher";
let dayz_cli_script = "/usr/bin";
// create command
let mut command = Command::new(local_dir + "/dayz-launcher.sh");
let mut command = Command::new(dayz_cli_script.to_string() + "/dayz-launcher");
if steamexe == "default" {
command.arg("\"\"");
} else if steamexe == "flatpak" {