summaryrefslogtreecommitdiff
path: root/gui/gtk/scripts/run.sh
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-09 22:45:24 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-09 22:45:24 +0800
commitc9ff9a13735010a6d3937a05e8ce9f00f9fab3ac (patch)
tree77ad04e6db77aa037513e4d22866a89f9cf52403 /gui/gtk/scripts/run.sh
parent25761b5ef0d9d385ac2a371b62913f98350d6f56 (diff)
Add GTK GUI build system for Unix platforms
Diffstat (limited to 'gui/gtk/scripts/run.sh')
-rwxr-xr-xgui/gtk/scripts/run.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/gui/gtk/scripts/run.sh b/gui/gtk/scripts/run.sh
new file mode 100755
index 0000000..e5f60b7
--- /dev/null
+++ b/gui/gtk/scripts/run.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# Butchunker GTK Run Script
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
+BUILD_DIR="$PROJECT_ROOT/build"
+EXECUTABLE="$BUILD_DIR/bin/butckg"
+
+# Check if executable exists
+if [ ! -f "$EXECUTABLE" ]; then
+ exit 1
+fi
+
+# Check if executable is executable
+if [ ! -x "$EXECUTABLE" ]; then
+ chmod +x "$EXECUTABLE"
+fi
+
+# Check if Rust library exists and copy it if needed
+RUST_LIB="$PROJECT_ROOT/../../.temp/target/release/lib_butck.so"
+if [ -f "$RUST_LIB" ]; then
+ # Copy library to executable directory if not already there
+ LIB_DEST="$BUILD_DIR/bin/lib_butck.so"
+ if [ ! -f "$LIB_DEST" ] || [ "$RUST_LIB" -nt "$LIB_DEST" ]; then
+ cp "$RUST_LIB" "$LIB_DEST"
+ fi
+fi
+
+# Set LD_LIBRARY_PATH to include the build directory
+export LD_LIBRARY_PATH="$BUILD_DIR/bin:$LD_LIBRARY_PATH"
+
+# Run the executable
+"$EXECUTABLE"
+
+EXIT_CODE=$?
+exit $EXIT_CODE