1
0
Fork 0
mirror of synced 2024-05-03 03:52:58 +12:00

fix paths, add icon (template)

This commit is contained in:
Petr Korolev 2024-03-24 11:04:52 +07:00
parent 788aa77639
commit 53ba212860

View file

@ -1,12 +1,12 @@
#!/bin/bash
# Get the directory of the current script (works even if the script is called from another location)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PARENT_DIR="$(dirname "$DIR")"
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
@ -15,11 +15,12 @@ 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/"
cp "$PARENT_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"
# Replace 'myicon.icns' with the actual name of your .icns file
ICON_NAME="Czkawka.icns"
cp "$PARENT_DIR/data/icons/com.github.qarmin.czkawka.svg" "$BUNDLE_PATH/Contents/Resources/$ICON_NAME"
# Step 5: Create the Info.plist file
cat <<EOF >"$BUNDLE_PATH/Contents/Info.plist"
@ -30,7 +31,7 @@ cat <<EOF >"$BUNDLE_PATH/Contents/Info.plist"
<key>CFBundleExecutable</key>
<string>$BINARY_NAME</string>
<key>CFBundleIconFile</key>
<string>Czkawka.icns</string>
<string>$ICON_NAME</string>
<key>CFBundleIdentifier</key>
<string>com.github.qarmin.czkawka</string>
<key>CFBundleName</key>
@ -43,4 +44,4 @@ cat <<EOF >"$BUNDLE_PATH/Contents/Info.plist"
</plist>
EOF
echo "Application bundle created at: $BUNDLE_PATH"
echo "Application bundle created at: $BUNDLE_PATH"