mirror of
https://github.com/git/git.git
synced 2026-01-11 21:33:13 +09:00
git-gui: extract script to generate "git-gui"
Extract script to generate "git-gui". This change allows us to reuse the build logic with the Meson build system. Signed-off-by: Patrick Steinhardt <ps@pks.im>
This commit is contained in:
parent
3e656a4356
commit
854e88335a
12
Makefile
12
Makefile
@ -127,7 +127,6 @@ gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
|
||||
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
|
||||
TCL_PATH_SQ = $(subst ','\'',$(TCL_PATH))
|
||||
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
|
||||
TCLTK_PATH_SED = $(subst ','\'',$(subst \,\\,$(TCLTK_PATH)))
|
||||
|
||||
gg_libdir ?= $(sharedir)/git-gui/lib
|
||||
libdir_SQ = $(subst ','\'',$(gg_libdir))
|
||||
@ -202,16 +201,7 @@ git-gui: windows/git-gui.sh
|
||||
endif
|
||||
|
||||
$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS
|
||||
$(QUIET_GEN)rm -f $@ $@+ && \
|
||||
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
||||
-e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \
|
||||
-e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \
|
||||
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
|
||||
-e 's|@@GITGUI_RELATIVE@@|$(GITGUI_RELATIVE)|' \
|
||||
-e '$(GITGUI_RELATIVE)s|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \
|
||||
git-gui.sh >$@+ && \
|
||||
chmod +x $@+ && \
|
||||
mv $@+ $@
|
||||
$(QUIET_GEN)$(SHELL_PATH) generate-git-gui.sh "$<" "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE
|
||||
|
||||
XGETTEXT ?= xgettext
|
||||
ifdef NO_MSGFMT
|
||||
|
||||
29
generate-git-gui.sh
Executable file
29
generate-git-gui.sh
Executable file
@ -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"
|
||||
Loading…
x
Reference in New Issue
Block a user