diff --git a/misc/create_app_bundle.sh b/misc/create_app_bundle.sh new file mode 100755 index 0000000..762b264 --- /dev/null +++ b/misc/create_app_bundle.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +BUNDLE_NAME="Czkawka.app" +BUNDLE_PATH="$DIR/../target/release/$BUNDLE_NAME" +BINARY_NAME="czkawka_gui" + +# Get the directory of the current script (works even if the script is called from another location) +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Step 1: Build the project +cargo build --release --manifest-path="$DIR/../Cargo.toml" --bin $BINARY_NAME + +# Step 2: Create the application bundle structure +mkdir -p "$BUNDLE_PATH/Contents/MacOS" +mkdir -p "$BUNDLE_PATH/Contents/Resources" + +# Step 3: Copy the binary +cp "$DIR/../target/release/$BINARY_NAME" "$BUNDLE_PATH/Contents/MacOS/" + +# Step 4: Copy the icon and rename as .icns (macOS icon format) +# Note: If you have the icon in .icns format use that directly +cp "$DIR/../data/icons/com.github.qarmin.czkawka.svg" "$BUNDLE_PATH/Contents/Resources/Czkawka.icns" + +# Step 5: Create the Info.plist file +cat <"$BUNDLE_PATH/Contents/Info.plist" + + + + + CFBundleExecutable + $BINARY_NAME + CFBundleIconFile + Czkawka.icns + CFBundleIdentifier + com.github.qarmin.czkawka + CFBundleName + Czkawka + CFBundleVersion + 1.0.0 + CFBundlePackageType + APPL + + +EOF + +echo "Application bundle created at: $BUNDLE_PATH"