-
Notifications
You must be signed in to change notification settings - Fork 17
Support for the Meson build system #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pks-t
wants to merge
10
commits into
j6t:master
Choose a base branch
from
pks-t:pks-meson-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+453
−102
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3271d2e
git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS
pks-t 3ef470f
git-gui: prepare GIT-VERSION-GEN for out-of-tree builds
pks-t caf5fbe
git-gui: make output of GIT-VERSION-GEN source'able
pks-t 3e656a4
git-gui: drop no-op GITGUI_SCRIPT replacement
pks-t 854e883
git-gui: extract script to generate "git-gui"
pks-t 2cc5b0f
git-gui: extract script to generate "tclIndex"
pks-t 743e1cb
git-gui: extract script to generate macOS wrapper
pks-t 28a8e5c
git-gui: extract script to generate macOS app
pks-t d821fc6
git-gui: stop including GIT-VERSION-FILE file
pks-t 8bf062d
git-gui: wire up support for the Meson build system
pks-t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
config.mak | ||
Git Gui.app* | ||
git-gui.tcl | ||
GIT-GUI-BUILD-OPTIONS | ||
GIT-VERSION-FILE | ||
GIT-GUI-VARS | ||
git-gui | ||
lib/tclIndex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
GITGUI_GITEXECDIR=@GITGUI_GITEXECDIR@ | ||
GITGUI_LIBDIR=@GITGUI_LIBDIR@ | ||
GITGUI_RELATIVE=@GITGUI_RELATIVE@ | ||
SHELL_PATH=@SHELL_PATH@ | ||
TCLTK_PATH=@TCLTK_PATH@ | ||
TCL_PATH=@TCL_PATH@ | ||
TKEXECUTABLE=@TKEXECUTABLE@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,7 @@ all:: | |
# | ||
|
||
GIT-VERSION-FILE: FORCE | ||
@$(SHELL_PATH) ./GIT-VERSION-GEN | ||
ifneq ($(MAKECMDGOALS),clean) | ||
-include GIT-VERSION-FILE | ||
endif | ||
@$(SHELL_PATH) ./GIT-VERSION-GEN . $@ | ||
|
||
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') | ||
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') | ||
|
@@ -75,7 +72,6 @@ ifndef V | |
QUIET_INDEX = $(QUIET)echo ' ' INDEX $(dir $@) && | ||
QUIET_MSGFMT0 = $(QUIET)printf ' MSGFMT %12s ' $@ && v=` | ||
QUIET_MSGFMT1 = 2>&1` && echo "$$v" | sed -e 's/fuzzy translations/fuzzy/' | sed -e 's/ messages*//g' | ||
QUIET_2DEVNULL = 2>/dev/null | ||
|
||
INSTALL_D0 = dir= | ||
INSTALL_D1 = && echo ' ' DEST $$dir && $(INSTALL) -d -m 755 "$$dir" | ||
|
@@ -113,7 +109,8 @@ ifeq ($(uname_S),Darwin) | |
TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app | ||
endif | ||
endif | ||
TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app) | ||
TKEXECUTABLE = $(TKFRAMEWORK)/Contents/MacOS/$(shell basename "$(TKFRAMEWORK)" .app) | ||
TKEXECUTABLE_SQ = $(subst ','\'',$(TKEXECUTABLE)) | ||
endif | ||
|
||
ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s) | ||
|
@@ -127,21 +124,17 @@ 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)) | ||
libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir_sed_in))) | ||
exedir = $(dir $(gitexecdir))share/git-gui/lib | ||
|
||
GITGUI_SCRIPT := $$0 | ||
GITGUI_RELATIVE := | ||
GITGUI_MACOSXAPP := | ||
|
||
ifeq ($(exedir),$(gg_libdir)) | ||
GITGUI_RELATIVE := 1 | ||
endif | ||
gg_libdir_sed_in := $(gg_libdir) | ||
ifeq ($(uname_S),Darwin) | ||
ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y) | ||
GITGUI_MACOSXAPP := YesPlease | ||
|
@@ -158,41 +151,15 @@ endif | |
ifdef GITGUI_MACOSXAPP | ||
GITGUI_MAIN := git-gui.tcl | ||
|
||
git-gui: GIT-VERSION-FILE GIT-GUI-VARS | ||
$(QUIET_GEN)rm -f $@ $@+ && \ | ||
echo '#!$(SHELL_PATH_SQ)' >$@+ && \ | ||
echo 'if test "z$$*" = zversion ||' >>$@+ && \ | ||
echo ' test "z$$*" = z--version' >>$@+ && \ | ||
echo then >>$@+ && \ | ||
echo ' 'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \ | ||
echo else >>$@+ && \ | ||
echo ' libdir="$${GIT_GUI_LIB_DIR:-$(libdir_SQ)}"' >>$@+ && \ | ||
echo ' 'exec \"'$$libdir/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\" \ | ||
'"$$0" "$$@"' >>$@+ && \ | ||
echo fi >>$@+ && \ | ||
chmod +x $@+ && \ | ||
mv $@+ $@ | ||
|
||
Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-VARS \ | ||
git-gui: generate-macos-wrapper.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS | ||
$(QUIET_GEN)$(SHELL_PATH) generate-macos-wrapper.sh "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE | ||
|
||
Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS \ | ||
macosx/Info.plist \ | ||
macosx/git-gui.icns \ | ||
macosx/AppMain.tcl \ | ||
$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE) | ||
$(QUIET_GEN)rm -rf '$@' '$@'+ && \ | ||
mkdir -p '$@'+/Contents/MacOS && \ | ||
mkdir -p '$@'+/Contents/Resources/Scripts && \ | ||
cp '$(subst ','\'',$(subst \,,$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)))' \ | ||
'$@'+/Contents/MacOS && \ | ||
cp macosx/git-gui.icns '$@'+/Contents/Resources && \ | ||
sed -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \ | ||
-e 's/@@GITGUI_TKEXECUTABLE@@/$(TKEXECUTABLE)/g' \ | ||
macosx/Info.plist \ | ||
>'$@'+/Contents/Info.plist && \ | ||
sed -e 's|@@gitexecdir@@|$(gitexecdir_SQ)|' \ | ||
-e 's|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \ | ||
macosx/AppMain.tcl \ | ||
>'$@'+/Contents/Resources/Scripts/AppMain.tcl && \ | ||
mv '$@'+ '$@' | ||
$(TKEXECUTABLE) | ||
$(QUIET_GEN)$(SHELL_PATH) generate-macos-app.sh . "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE | ||
endif | ||
|
||
ifdef GITGUI_WINDOWS_WRAPPER | ||
|
@@ -202,18 +169,8 @@ git-gui: windows/git-gui.sh | |
cp $< $@ | ||
endif | ||
|
||
$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS | ||
$(QUIET_GEN)rm -f $@ $@+ && \ | ||
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ | ||
-e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \ | ||
-e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \ | ||
-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 $@+ $@ | ||
$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS | ||
$(QUIET_GEN)$(SHELL_PATH) generate-git-gui.sh "$<" "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE | ||
|
||
XGETTEXT ?= xgettext | ||
ifdef NO_MSGFMT | ||
|
@@ -238,35 +195,21 @@ update-po:: $(PO_TEMPLATE) | |
$(ALL_MSGFILES): %.msg : %.po | ||
$(QUIET_MSGFMT0)$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $< $(QUIET_MSGFMT1) | ||
|
||
lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VARS | ||
$(QUIET_INDEX)if echo \ | ||
$(foreach p,$(PRELOAD_FILES),source $p\;) \ | ||
auto_mkindex lib $(patsubst lib/%,%,$(sort $(ALL_LIBFILES))) \ | ||
| $(TCL_PATH) $(QUIET_2DEVNULL); then : ok; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This removal obsoletes Makefile variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, fixed. |
||
else \ | ||
echo >&2 " * $(TCL_PATH) failed; using unoptimized loading"; \ | ||
rm -f $@ ; \ | ||
echo '# Autogenerated by git-gui Makefile' >$@ && \ | ||
echo >>$@ && \ | ||
$(foreach p,$(PRELOAD_FILES) $(sort $(ALL_LIBFILES)),echo '$(subst lib/,,$p)' >>$@ &&) \ | ||
echo >>$@ ; \ | ||
fi | ||
|
||
TRACK_VARS = \ | ||
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \ | ||
$(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \ | ||
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \ | ||
$(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \ | ||
$(subst ','\'',gg_libdir='$(libdir_SQ)') \ | ||
GITGUI_MACOSXAPP=$(GITGUI_MACOSXAPP) \ | ||
#end TRACK_VARS | ||
|
||
GIT-GUI-VARS: FORCE | ||
@VARS='$(TRACK_VARS)'; \ | ||
if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ | ||
echo >&2 " * new locations or Tcl/Tk interpreter"; \ | ||
echo >$@ "$$VARS"; \ | ||
fi | ||
lib/tclIndex: $(ALL_LIBFILES) generate-tclindex.sh GIT-GUI-BUILD-OPTIONS | ||
$(QUIET_INDEX)$(SHELL_PATH) generate-tclindex.sh . ./GIT-GUI-BUILD-OPTIONS $(ALL_LIBFILES) | ||
|
||
GIT-GUI-BUILD-OPTIONS: FORCE | ||
@sed \ | ||
-e 's|@GITGUI_GITEXECDIR@|$(gitexecdir_SQ)|' \ | ||
-e 's|@GITGUI_LIBDIR@|$(libdir_SQ)|' \ | ||
-e 's|@GITGUI_RELATIVE@|$(GITGUI_RELATIVE)|' \ | ||
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ | ||
-e 's|@TCLTK_PATH@|$(TCLTK_PATH_SQ)|' \ | ||
-e 's|@TCL_PATH@|$(TCL_PATH_SQ)|' \ | ||
-e 's|@TKEXECUTABLE@|$(TKEXECUTABLE_SQ)|' \ | ||
$@.in >$@+ | ||
@if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi | ||
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi | ||
|
||
ifdef GITGUI_MACOSXAPP | ||
all:: git-gui Git\ Gui.app | ||
|
@@ -316,13 +259,13 @@ endif | |
$(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1) | ||
$(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1) | ||
|
||
dist-version: | ||
dist-version: GIT-VERSION-FILE | ||
@mkdir -p $(TARDIR) | ||
@echo $(GITGUI_VERSION) > $(TARDIR)/version | ||
@sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version | ||
|
||
clean:: | ||
$(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg $(PO_TEMPLATE) | ||
$(RM_RF) GIT-VERSION-FILE GIT-GUI-VARS | ||
$(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS | ||
ifdef GITGUI_MACOSXAPP | ||
$(RM_RF) 'Git Gui.app'* git-gui | ||
endif | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if test "$#" -ne 3 | ||
then | ||
echo >&2 "usage: $0 <OUTPUT> <BUILD_OPTIONS> <VERSION_FILE>" | ||
exit 1 | ||
fi | ||
|
||
OUTPUT="$1" | ||
BUILD_OPTIONS="$2" | ||
VERSION_FILE="$3" | ||
|
||
. "$BUILD_OPTIONS" | ||
|
||
rm -f "$OUTPUT" "$OUTPUT+" | ||
|
||
( | ||
echo "#!$SHELL_PATH" | ||
cat "$BUILD_OPTIONS" "$VERSION_FILE" | ||
cat <<-'EOF' | ||
if test "z$*" = zversion || | ||
test "z$*" = z--version | ||
then | ||
echo "git-gui version $GITGUI_VERSION" | ||
else | ||
libdir="${GIT_GUI_LIB_DIR:-$GITGUI_LIBDIR}" | ||
exec "$libdir/Git Gui.app/Contents/MacOS/$(basename "$TKEXECUTABLE")" "$0" "$@" | ||
fi | ||
EOF | ||
) >"$OUTPUT+" | ||
|
||
chmod +x "$OUTPUT+" | ||
mv "$OUTPUT+" "$OUTPUT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
if test "$#" -lt 3 | ||
then | ||
echo >&2 "usage: $0 <BUILD_DIR> <BUILD_OPTIONS> <LIBFILE> [<LIBFILE>...]" | ||
exit 1 | ||
fi | ||
|
||
BUILD_DIR="$1" | ||
BUILD_OPTIONS="$2" | ||
shift 2 | ||
LIBFILES="$(echo "$@" | sort | sed 's|lib/||g')" | ||
|
||
. "$BUILD_OPTIONS" | ||
|
||
cd "$BUILD_DIR" | ||
|
||
if { | ||
echo "source lib/class.tcl;" | ||
echo "auto_mkindex lib $LIBFILES" | ||
} | "$TCL_PATH" | ||
then | ||
: ok | ||
else | ||
echo >&2 " * $TCL_PATH failed; using unoptimized loading" | ||
rm -f $@ | ||
echo '# Autogenerated by git-gui Makefile' >lib/tclIndex | ||
echo >>lib/tclIndex | ||
echo "class.tcl" >>lib/tclIndex | ||
printf "%s\n" $LIBFILES >>lib/tclIndex | ||
echo >>lib/tclIndex | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
libfiles = [ | ||
'about.tcl', | ||
'blame.tcl', | ||
'branch_checkout.tcl', | ||
'branch_create.tcl', | ||
'branch_delete.tcl', | ||
'branch_rename.tcl', | ||
'branch.tcl', | ||
'browser.tcl', | ||
'checkout_op.tcl', | ||
'choose_font.tcl', | ||
'choose_repository.tcl', | ||
'choose_rev.tcl', | ||
'chord.tcl', | ||
'class.tcl', | ||
'commit.tcl', | ||
'console.tcl', | ||
'database.tcl', | ||
'date.tcl', | ||
'diff.tcl', | ||
'encoding.tcl', | ||
'error.tcl', | ||
'index.tcl', | ||
'line.tcl', | ||
'logo.tcl', | ||
'merge.tcl', | ||
'mergetool.tcl', | ||
'option.tcl', | ||
'remote_add.tcl', | ||
'remote_branch_delete.tcl', | ||
'remote.tcl', | ||
'search.tcl', | ||
'shortcut.tcl', | ||
'spellcheck.tcl', | ||
'sshkey.tcl', | ||
'status_bar.tcl', | ||
'themed.tcl', | ||
'tools_dlg.tcl', | ||
'tools.tcl', | ||
'transport.tcl', | ||
'win32.tcl', | ||
] | ||
|
||
nontcl_libfiles = [ | ||
'git-gui.ico', | ||
'win32_shortcut.js', | ||
] | ||
|
||
foreach file : libfiles + nontcl_libfiles | ||
configure_file( | ||
input: file, | ||
output: file, | ||
copy: true, | ||
install: true, | ||
install_dir: get_option('datadir') / 'git-gui/lib', | ||
) | ||
endforeach | ||
|
||
custom_target( | ||
output: 'tclIndex', | ||
command: [ | ||
shell, | ||
meson.project_source_root() / 'generate-tclindex.sh', | ||
meson.project_build_root(), | ||
meson.project_build_root() / 'GIT-GUI-BUILD-OPTIONS', | ||
libfiles, | ||
], | ||
depend_files: [ | ||
libfiles, | ||
build_options, | ||
], | ||
install: true, | ||
install_dir: get_option('datadir') / 'git-gui/lib', | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
project('git-gui', | ||
meson_version: '>=0.61.0', | ||
) | ||
|
||
fs = import('fs') | ||
|
||
shell = find_program('sh') | ||
tclsh = find_program('tclsh') | ||
wish = find_program('wish') | ||
|
||
build_options_config = configuration_data() | ||
if target_machine.system() == 'windows' | ||
build_options_config.set('GITGUI_RELATIVE', '1') | ||
else | ||
build_options_config.set('GITGUI_RELATIVE', '') | ||
endif | ||
build_options_config.set_quoted('GITGUI_GITEXECDIR', get_option('prefix') / get_option('libexecdir') / 'git-core') | ||
build_options_config.set_quoted('GITGUI_LIBDIR', get_option('prefix') / get_option('datadir') / 'git-gui/lib') | ||
build_options_config.set_quoted('SHELL_PATH', fs.as_posix(shell.full_path())) | ||
build_options_config.set_quoted('TCLTK_PATH', fs.as_posix(wish.full_path())) | ||
build_options_config.set_quoted('TCL_PATH', fs.as_posix(tclsh.full_path())) | ||
if target_machine.system() == 'darwin' | ||
tkexecutables = [ | ||
'/Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish', | ||
'/System/Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish', | ||
'/System/Library/Frameworks/Tk.framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell', | ||
] | ||
tkexecutable = find_program(tkexecutables) | ||
build_options_config.set_quoted('TKEXECUTABLE', tkexecutable.full_path()) | ||
else | ||
build_options_config.set('TKEXECUTABLE', '') | ||
endif | ||
|
||
build_options = configure_file( | ||
input: 'GIT-GUI-BUILD-OPTIONS.in', | ||
output: 'GIT-GUI-BUILD-OPTIONS', | ||
configuration: build_options_config, | ||
) | ||
|
||
version_file = custom_target( | ||
input: 'GIT-VERSION-GEN', | ||
output: 'GIT-VERSION-FILE', | ||
command: [ | ||
shell, | ||
'@INPUT@', | ||
meson.current_source_dir(), | ||
'@OUTPUT@', | ||
], | ||
build_always_stale: true, | ||
) | ||
|
||
configure_file( | ||
input: 'git-gui--askpass', | ||
output: 'git-gui--askpass', | ||
copy: true, | ||
install: true, | ||
install_dir: get_option('libexecdir') / 'git-core', | ||
) | ||
|
||
gitgui_main = 'git-gui' | ||
gitgui_main_install_dir = get_option('libexecdir') / 'git-core' | ||
|
||
if target_machine.system() == 'windows' | ||
gitgui_main = 'git-gui.tcl' | ||
|
||
configure_file( | ||
input: 'windows/git-gui.sh', | ||
output: 'git-gui', | ||
copy: true, | ||
install: true, | ||
install_dir: get_option('libexecdir') / 'git-core', | ||
) | ||
elif target_machine.system() == 'darwin' | ||
gitgui_main = 'git-gui.tcl' | ||
gitgui_main_install_dir = get_option('datadir') / 'git-gui/lib' | ||
|
||
custom_target( | ||
output: 'git-gui', | ||
command: [ | ||
shell, | ||
meson.current_source_dir() / 'generate-macos-wrapper.sh', | ||
'@OUTPUT@', | ||
meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', | ||
meson.current_build_dir() / 'GIT-VERSION-FILE', | ||
], | ||
depends: [ | ||
version_file, | ||
], | ||
depend_files: [ | ||
build_options, | ||
], | ||
install: true, | ||
install_dir: get_option('libexecdir') / 'git-core', | ||
) | ||
|
||
custom_target( | ||
output: 'Git Gui.app', | ||
command: [ | ||
shell, | ||
meson.current_source_dir() / 'generate-macos-app.sh', | ||
meson.current_source_dir(), | ||
meson.current_build_dir() / 'Git Gui.app', | ||
meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', | ||
meson.current_build_dir() / 'GIT-VERSION-FILE', | ||
], | ||
depends: [ | ||
version_file, | ||
], | ||
depend_files: [ | ||
build_options, | ||
'macosx/AppMain.tcl', | ||
'macosx/Info.plist', | ||
'macosx/git-gui.icns', | ||
], | ||
build_by_default: true, | ||
install: true, | ||
install_dir: get_option('datadir') / 'git-gui/lib', | ||
) | ||
endif | ||
|
||
custom_target( | ||
input: 'git-gui.sh', | ||
output: gitgui_main, | ||
command: [ | ||
shell, | ||
meson.current_source_dir() / 'generate-git-gui.sh', | ||
'@INPUT@', | ||
'@OUTPUT@', | ||
meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', | ||
meson.current_build_dir() / 'GIT-VERSION-FILE', | ||
], | ||
depends: [ | ||
version_file, | ||
], | ||
depend_files: [ | ||
build_options, | ||
], | ||
install: true, | ||
install_dir: gitgui_main_install_dir, | ||
) | ||
|
||
install_symlink('git-citool', | ||
install_dir: get_option('libexecdir') / 'git-core', | ||
pointing_to: 'git-gui', | ||
) | ||
|
||
subdir('lib') | ||
subdir('po') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
languages = [ | ||
'bg', | ||
'de', | ||
'el', | ||
'fr', | ||
'hu', | ||
'it', | ||
'ja', | ||
'nb', | ||
'pt_br', | ||
'pt_pt', | ||
'ru', | ||
'sv', | ||
'vi', | ||
'zh_cn', | ||
] | ||
|
||
msgfmt = find_program('msgfmt', required: false) | ||
if not msgfmt.found() | ||
subdir_done() | ||
endif | ||
|
||
foreach language : languages | ||
custom_target( | ||
input: language + '.po', | ||
output: language + '.msg', | ||
command: [ | ||
msgfmt, | ||
'--statistics', | ||
'--tcl', | ||
'--locale=' + language, | ||
'-d', meson.current_build_dir(), | ||
'@INPUT@', | ||
], | ||
install: true, | ||
install_dir: get_option('datadir') / 'git-gui/lib/msgs', | ||
) | ||
endforeach |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a good time to put all
"$OUTPUT"
in double-quotes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, makes sense indeed.