From 887d57e668e1c45a0c4a9980c28e51ca69f068a0 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Tue, 24 Jun 2025 13:00:26 +0300 Subject: [PATCH] refactor(build): i forgot --- Cargo.toml | 4 ++-- Cross.toml | 2 +- docs/compiling.md | 2 +- misc/build.sh | 9 ++++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d6c8b56..186731c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ homedir = "0.3.4" native-tls = "0.2.14" clap = { version = "4.5.36", features = ["derive"] } serde = { version = "1.0.219", features = ["serde_derive"] } -gtk4 = { version = "0.9.6", features = [ "v4_12" ], optional = true } +gtk4 = { version = "0.9.6", optional = true } chrono = "0.4.40" serde_default = "0.2.0" socks = "0.3.4" @@ -30,4 +30,4 @@ default = ["gtk"] gtk = ["dep:gtk4"] libnotify = ["dep:libnotify", "dep:gdk-pixbuf"] notify-rust = ["dep:notify-rust"] -winapi = ["dep:winapi", "dep:winresource"] \ No newline at end of file +winapi = ["dep:winapi", "dep:winresource"] diff --git a/Cross.toml b/Cross.toml index 9dd41f8..6d92278 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,2 +1,2 @@ [target.x86_64-pc-windows-gnu] -image = "mglolenstine/gtk4-cross:rust-gtk-4.12" \ No newline at end of file +image = "mglolenstine/gtk4-cross:rust-gtk-latest" \ No newline at end of file diff --git a/docs/compiling.md b/docs/compiling.md index da9d80d..fb9f8fa 100644 --- a/docs/compiling.md +++ b/docs/compiling.md @@ -75,7 +75,7 @@ Now, if you'll run with the desktop file, GNotifications will work perfectly. ## From NixOS to Windows ```bash -nix-shell -p rustup gcc cargo-cross +nix-shell -p rustup gcc cargo-cross zip unzip curl rustup toolchain install stable ./misc/build.sh ``` diff --git a/misc/build.sh b/misc/build.sh index 4693a45..198d4ba 100755 --- a/misc/build.sh +++ b/misc/build.sh @@ -3,7 +3,7 @@ echo "Run this script only from repository root!" echo "This script depends on:" echo " - fact that you are on linux x86_64!" -echo " - wine. install it with your distro's package manager" +echo " - zip, unzip, curl. install it with your distro's package manager" echo " - cross crate. to install it, run this: cargo install cross --git https://github.com/cross-rs/cross" echo " - docker, so you should run something like this on your distro: sudo systemctl start docker" read -p "Press enter if you really want to do rm -rf build/" @@ -28,12 +28,15 @@ build_linux() { build_windows() { chmod +x misc/mslink.sh - curl -L https://github.com/wingtk/gvsbuild/releases/download/2025.5.0/GTK4_Gvsbuild_2025.5.0_x64.zip -o build/gvsbuild.zip + curl -L https://github.com/wingtk/gvsbuild/releases/download/2025.5.0/GTK4_Gvsbuild_2025.5.0_x64.zip -o build/gvsbuild.zip # TODO: make this link auto-update unzip build/gvsbuild.zip "bin/*" -d build/windows-x86_64 rm build/gvsbuild.zip cross build --target x86_64-pc-windows-gnu -F notify-rust,winapi -r cp target/x86_64-pc-windows-gnu/release/bRAC.exe build/windows-x86_64/bin - ./misc/mslink.sh -l bin\\bRAC.exe -o build/windows-x86_64/bRAC.lnk + echo "@echo off" > build/windows-x86_64/start.bat + echo "set \"PATH=%CD%\bin;%PATH%\"" >> build/windows-x86_64/start.bat + echo "start \"\" /B \"bin\bRAC.exe\"" >> build/windows-x86_64/start.bat + ./misc/mslink.sh -l "%COMSPEC% /C start start.bat" -o build/windows-x86_64/bRAC.lnk # TODO: fix this lnk cp README.md build/windows-x86_64 curl https://raw.githubusercontent.com/wingtk/gvsbuild/refs/heads/main/COPYING -o build/windows-x86_64/LICENSE zip -r build/bRAC-windows-x86_64.zip build/windows-x86_64