summaryrefslogtreecommitdiff
path: root/git-gui/generate-git-gui.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-29 09:03:01 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-29 09:03:01 -0700
commitfcfe60668e05ffde2610bfef9045797618c145ac (patch)
tree16afb5b7ca43ab64de02c79363b80515ff259e1d /git-gui/generate-git-gui.sh
parent6ab5693aa298f0e3034a1273cf4bf61c31b0e7f0 (diff)
parent61f8788fe9d362efb112f69a58cf0510a7e49ee0 (diff)
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
Diffstat (limited to 'git-gui/generate-git-gui.sh')
-rwxr-xr-xgit-gui/generate-git-gui.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/git-gui/generate-git-gui.sh b/git-gui/generate-git-gui.sh
new file mode 100755
index 0000000000..39dfafdc4a
--- /dev/null
+++ b/git-gui/generate-git-gui.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+
+if test "$#" -ne 4
+then
+ echo >&2 "usage: $0 <INPUT> <OUTPUT> <BUILD_OPTIONS> <VERSION_FILE>"
+ exit 1
+fi
+
+INPUT="$1"
+OUTPUT="$2"
+BUILD_OPTIONS="$3"
+VERSION_FILE="$4"
+
+. "${BUILD_OPTIONS}"
+. "${VERSION_FILE}"
+
+rm -f "$OUTPUT" "$OUTPUT+"
+sed \
+ -e "1s|#!.*/sh|#!$SHELL_PATH|" \
+ -e "s|@@SHELL_PATH@@|$SHELL_PATH|" \
+ -e "1,30s|^ exec wish | exec '$TCLTK_PATH' |" \
+ -e "s|@@GITGUI_VERSION@@|$GITGUI_VERSION|g" \
+ -e "s|@@GITGUI_RELATIVE@@|$GITGUI_RELATIVE|" \
+ -e "${GITGUI_RELATIVE}s|@@GITGUI_LIBDIR@@|$GITGUI_LIBDIR|" \
+ "$INPUT" >"$OUTPUT"+
+chmod +x "$OUTPUT"+
+mv "$OUTPUT"+ "$OUTPUT"