Files
git/git-gui/generate-macos-app.sh
Junio C Hamano fcfe60668e Merge branch 'master' of https://github.com/j6t/git-gui
* 'master' of https://github.com/j6t/git-gui:
  git-gui: wire up support for the Meson build system
  git-gui: stop including GIT-VERSION-FILE file
  git-gui: extract script to generate macOS app
  git-gui: extract script to generate macOS wrapper
  git-gui: extract script to generate "tclIndex"
  git-gui: extract script to generate "git-gui"
  git-gui: drop no-op GITGUI_SCRIPT replacement
  git-gui: make output of GIT-VERSION-GEN source'able
  git-gui: prepare GIT-VERSION-GEN for out-of-tree builds
  git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS
2025-05-29 09:03:01 -07:00

31 lines
739 B
Bash
Executable File

#!/bin/sh
set -e
SOURCE_DIR="$1"
OUTPUT="$2"
BUILD_OPTIONS="$3"
VERSION_FILE="$4"
. "$BUILD_OPTIONS"
. "$VERSION_FILE"
rm -rf "$OUTPUT" "$OUTPUT+"
mkdir -p "$OUTPUT+/Contents/MacOS"
mkdir -p "$OUTPUT+/Contents/Resources/Scripts"
cp "$TKEXECUTABLE" "$OUTPUT+/Contents/MacOS"
cp "$SOURCE_DIR/macosx/git-gui.icns" "$OUTPUT+/Contents/Resources"
sed \
-e "s/@@GITGUI_VERSION@@/$GITGUI_VERSION/g" \
-e "s/@@GITGUI_TKEXECUTABLE@@/$(basename "$TKEXECUTABLE")/g" \
"$SOURCE_DIR/macosx/Info.plist" \
>"$OUTPUT+/Contents/Info.plist"
sed \
-e "s|@@gitexecdir@@|$GITGUI_GITEXECDIR|" \
-e "s|@@GITGUI_LIBDIR@@|$GITGUI_LIBDIR|" \
"$SOURCE_DIR/macosx/AppMain.tcl" \
>"$OUTPUT+/Contents/Resources/Scripts/AppMain.tcl"
mv "$OUTPUT+" "$OUTPUT"