]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'master' of https://github.com/j6t/git-gui
authorJunio C Hamano <gitster@pobox.com>
Thu, 29 May 2025 16:03:01 +0000 (09:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 May 2025 16:03:01 +0000 (09:03 -0700)
* '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

12 files changed:
1  2 
git-gui/.gitattributes
git-gui/.gitignore
git-gui/GIT-GUI-BUILD-OPTIONS.in
git-gui/GIT-VERSION-GEN
git-gui/Makefile
git-gui/generate-git-gui.sh
git-gui/generate-macos-app.sh
git-gui/generate-macos-wrapper.sh
git-gui/generate-tclindex.sh
git-gui/lib/meson.build
git-gui/meson.build
git-gui/po/meson.build

index 118d56cfbdcb9070ab107c19210523afcb1e889c,0000000000000000000000000000000000000000..889d58257fb3c8ba1835f088daa94aaec1a3d80f
mode 100644,000000..100644
--- /dev/null
@@@ -1,6 -1,0 +1,7 @@@
 +*           whitespace=indent-with-non-tab,trailing-space,space-before-tab,tabwidth=4
 +*           encoding=US-ASCII
 +git-gui.sh  encoding=UTF-8
 +/po/*.po    encoding=UTF-8
 +/GIT-VERSION-GEN eol=lf
 +Makefile    whitespace=!indent,trail,space
++meson.build whitespace=space
index 6483b21cbfc73601602d628a2c609d3ca84f9e53,0000000000000000000000000000000000000000..ff6e0be4b4126cf804dde11d37d762a4d1d1a817
mode 100644,000000..100644
--- /dev/null
@@@ -1,8 -1,0 +1,8 @@@
- GIT-GUI-VARS
 +.DS_Store
 +config.mak
 +Git Gui.app*
 +git-gui.tcl
++GIT-GUI-BUILD-OPTIONS
 +GIT-VERSION-FILE
 +git-gui
 +lib/tclIndex
index 0000000000000000000000000000000000000000,5fd885c2bf73e93988285d9bfa47c8444b702b1f..5fd885c2bf73e93988285d9bfa47c8444b702b1f
mode 000000,100644..100644
--- /dev/null
index 92373d251a84f448bd673bbb8dd888a64fd2f777,0000000000000000000000000000000000000000..c2767b4136cbbf85fa2c70a558030d7fd47c176a
mode 100755,000000..100755
--- /dev/null
@@@ -1,80 -1,0 +1,94 @@@
- GVF=GIT-VERSION-FILE
 +#!/bin/sh
 +
-       for p in $(git rev-list --parents --max-count=1 $head 2>/dev/null)
 +DEF_VER=0.21.GITGUI
 +
 +LF='
 +'
 +
++if test "$#" -ne 2
++then
++      echo >&2 "usage: $0 <SOURCE_DIR> <OUTPUT>"
++      exit 1
++fi
++
++SOURCE_DIR="$1"
++OUTPUT="$2"
++
++# Protect us from reading Git version information outside of the Git directory
++# in case it is not a repository itself, but embedded in an unrelated
++# repository.
++GIT_CEILING_DIRECTORIES="$SOURCE_DIR/.."
++export GIT_CEILING_DIRECTORIES
++
 +tree_search ()
 +{
 +      head=$1
 +      tree=$2
-               test $tree = $(git rev-parse $p^{tree} 2>/dev/null) &&
-               vn=$(git describe --abbrev=4 $p 2>/dev/null) &&
++      for p in $(git -C "$SOURCE_DIR" rev-list --parents --max-count=1 $head 2>/dev/null)
 +      do
- if test -f version &&
-    VN=$(cat version)
++              test $tree = $(git -C "$SOURCE_DIR" rev-parse $p^{tree} 2>/dev/null) &&
++              vn=$(git -C "$SOURCE_DIR" describe --abbrev=4 $p 2>/dev/null) &&
 +              case "$vn" in
 +              gitgui-[0-9]*) echo $vn; break;;
 +              esac
 +      done
 +}
 +
 +# Always use the tarball version file if found, just
 +# in case we are somehow contained in a larger git
 +# repository that doesn't actually track our state.
 +# (At least one package manager is doing this.)
 +#
 +# We may be a subproject, so try looking for the merge
 +# commit that supplied this directory content if we are
 +# not at the toplevel.  We probably will always be the
 +# second parent in the commit, but we shouldn't rely on
 +# that fact.
 +#
 +# If we are at the toplevel or the merge assumption fails
 +# try looking for a gitgui-* tag.
 +
- elif prefix="$(git rev-parse --show-prefix 2>/dev/null)"
++if test -f "$SOURCE_DIR"/version &&
++   VN=$(cat "$SOURCE_DIR"/version)
 +then
 +      : happy
-    head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) &&
-    tree=$(git rev-parse --verify "HEAD:$prefix" 2>/dev/null) &&
++elif prefix="$(git -C "$SOURCE_DIR" rev-parse --show-prefix 2>/dev/null)"
 +   test -n "$prefix" &&
- elif VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
++   head=$(git -C "$SOURCE_DIR" rev-list --max-count=1 HEAD -- . 2>/dev/null) &&
++   tree=$(git -C "$SOURCE_DIR" rev-parse --verify "HEAD:$prefix" 2>/dev/null) &&
 +   VN=$(tree_search $head $tree)
 +   case "$VN" in
 +   gitgui-[0-9]*) : happy ;;
 +   *) (exit 1) ;;
 +   esac
 +then
 +      VN=$(echo "$VN" | sed -e 's/^gitgui-//;s/-/./g');
- dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty=
++elif VN=$(git -C "$SOURCE_DIR" describe --abbrev=4 HEAD 2>/dev/null) &&
 +   case "$VN" in
 +   gitgui-[0-9]*) : happy ;;
 +   *) (exit 1) ;;
 +   esac
 +then
 +      VN=$(echo "$VN" | sed -e 's/^gitgui-//;s/-/./g');
 +else
 +      VN="$DEF_VER"
 +fi
 +
- if test -r $GVF
++dirty=$(git -C "$SOURCE_DIR" diff-index --name-only HEAD 2>/dev/null) || dirty=
 +case "$dirty" in
 +'')
 +      ;;
 +*)
 +      VN="$VN-dirty" ;;
 +esac
 +
-       VC=$(sed -e 's/^GITGUI_VERSION = //' <$GVF)
++if test -r "$OUTPUT"
 +then
-       echo >&2 "GITGUI_VERSION = $VN"
-       echo "GITGUI_VERSION = $VN" >$GVF
++      VC=$(sed -e 's/^GITGUI_VERSION=//' <"$OUTPUT")
 +else
 +      VC=unset
 +fi
 +test "$VN" = "$VC" || {
++      echo >&2 "GITGUI_VERSION=$VN"
++      echo "GITGUI_VERSION=$VN" >"$OUTPUT"
 +}
index e3b4f324b6881de3de481eb351506c57f3683cc7,0000000000000000000000000000000000000000..8672dd2d6bd7f78514afaa90815b97af61be4a37
mode 100644,000000..100644
--- /dev/null
@@@ -1,335 -1,0 +1,278 @@@
-       @$(SHELL_PATH) ./GIT-VERSION-GEN
- ifneq ($(MAKECMDGOALS),clean)
- -include GIT-VERSION-FILE
- endif
 +# The default target of this Makefile is...
 +all::
 +
 +# Define V=1 to have a more verbose compile.
 +#
 +# Define NO_MSGFMT if you do not have msgfmt from the GNU gettext
 +# package and want to use our rough pure Tcl po->msg translator.
 +# TCL_PATH must be valid for this to work.
 +#
 +
 +GIT-VERSION-FILE: FORCE
-       QUIET_2DEVNULL = 2>/dev/null
++      @$(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')
 +uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
 +
 +SCRIPT_SH = git-gui.sh
 +GITGUI_MAIN := git-gui
 +GITGUI_BUILT_INS = git-citool
 +ALL_LIBFILES = $(wildcard lib/*.tcl)
 +PRELOAD_FILES = lib/class.tcl
 +NONTCL_LIBFILES = \
 +      lib/git-gui.ico \
 +      $(wildcard lib/win32_*.js) \
 +#end NONTCL_LIBFILES
 +
 +ifndef SHELL_PATH
 +      SHELL_PATH = /bin/sh
 +endif
 +
 +ifndef gitexecdir
 +      gitexecdir := $(shell git --exec-path)
 +endif
 +
 +ifndef sharedir
 +ifeq (git-core,$(notdir $(gitexecdir)))
 +      sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share
 +else
 +      sharedir := $(dir $(gitexecdir))share
 +endif
 +endif
 +
 +ifndef INSTALL
 +      INSTALL = install
 +endif
 +
 +RM_RF     ?= rm -rf
 +RMDIR     ?= rmdir
 +
 +INSTALL_D0 = $(INSTALL) -d -m 755 # space is required here
 +INSTALL_D1 =
 +INSTALL_R0 = $(INSTALL) -m 644 # space is required here
 +INSTALL_R1 =
 +INSTALL_X0 = $(INSTALL) -m 755 # space is required here
 +INSTALL_X1 =
 +INSTALL_A0 = find # space is required here
 +INSTALL_A1 = | cpio -pud
 +INSTALL_L0 = rm -f # space is required here
 +INSTALL_L1 = && ln # space is required here
 +INSTALL_L2 =
 +INSTALL_L3 =
 +
 +REMOVE_D0  = $(RMDIR) # space is required here
 +REMOVE_D1  = || true
 +REMOVE_F0  = $(RM_RF) # space is required here
 +REMOVE_F1  =
 +CLEAN_DST  = true
 +
 +ifndef V
 +      QUIET          = @
 +      QUIET_GEN      = $(QUIET)echo '   ' GEN '$@' &&
 +      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'
-       TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app)
 +
 +      INSTALL_D0 = dir=
 +      INSTALL_D1 = && echo ' ' DEST $$dir && $(INSTALL) -d -m 755 "$$dir"
 +      INSTALL_R0 = src=
 +      INSTALL_R1 = && echo '   ' INSTALL 644 `basename $$src` && $(INSTALL) -m 644 $$src
 +      INSTALL_X0 = src=
 +      INSTALL_X1 = && echo '   ' INSTALL 755 `basename $$src` && $(INSTALL) -m 755 $$src
 +      INSTALL_A0 = src=
 +      INSTALL_A1 = && echo '   ' INSTALL '   ' `basename "$$src"` && find "$$src" | cpio -pud
 +
 +      INSTALL_L0 = dst=
 +      INSTALL_L1 = && src=
 +      INSTALL_L2 = && dst=
 +      INSTALL_L3 = && echo '   ' 'LINK       ' `basename "$$dst"` '->' `basename "$$src"` && rm -f "$$dst" && ln "$$src" "$$dst"
 +
 +      CLEAN_DST = echo ' ' UNINSTALL
 +      REMOVE_D0 = dir=
 +      REMOVE_D1 = && echo ' ' REMOVE $$dir && test -d "$$dir" && $(RMDIR) "$$dir" || true
 +      REMOVE_F0 = dst=
 +      REMOVE_F1 = && echo '   ' REMOVE `basename "$$dst"` && $(RM_RF) "$$dst"
 +endif
 +
 +TCLTK_PATH ?= wish
 +ifeq (./,$(dir $(TCLTK_PATH)))
 +      TCL_PATH ?= $(subst wish,tclsh,$(TCLTK_PATH))
 +else
 +      TCL_PATH ?= $(dir $(TCLTK_PATH))$(notdir $(subst wish,tclsh,$(TCLTK_PATH)))
 +endif
 +
 +ifeq ($(uname_S),Darwin)
 +      TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
 +        ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n)
 +              TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish.app
 +                ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n)
 +                      TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
 +                endif
 +        endif
- TCLTK_PATH_SED = $(subst ','\'',$(subst \,\\,$(TCLTK_PATH)))
++      TKEXECUTABLE = $(TKFRAMEWORK)/Contents/MacOS/$(shell basename "$(TKFRAMEWORK)" .app)
++      TKEXECUTABLE_SQ = $(subst ','\'',$(TKEXECUTABLE))
 +endif
 +
 +ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s)
 +QUIET_GEN =
 +endif
 +
 +-include config.mak
 +
 +DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 +gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
 +SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 +TCL_PATH_SQ = $(subst ','\'',$(TCL_PATH))
 +TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
- libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir_sed_in)))
 +
 +gg_libdir ?= $(sharedir)/git-gui/lib
 +libdir_SQ  = $(subst ','\'',$(gg_libdir))
- GITGUI_SCRIPT   := $$0
 +exedir     = $(dir $(gitexecdir))share/git-gui/lib
 +
- gg_libdir_sed_in := $(gg_libdir)
 +GITGUI_RELATIVE :=
 +GITGUI_MACOSXAPP :=
 +
 +ifeq ($(exedir),$(gg_libdir))
 +      GITGUI_RELATIVE := 1
 +endif
- 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 \
 +ifeq ($(uname_S),Darwin)
 +        ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y)
 +              GITGUI_MACOSXAPP := YesPlease
 +        endif
 +endif
 +ifneq (,$(findstring MINGW,$(uname_S)))
 +ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
 +      NO_MSGFMT=1
 +endif
 +      GITGUI_WINDOWS_WRAPPER := YesPlease
 +      GITGUI_RELATIVE := 1
 +endif
 +
 +ifdef GITGUI_MACOSXAPP
 +GITGUI_MAIN := git-gui.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 '$@'+ '$@'
++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 \
- $(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 $@+ $@
++              $(TKEXECUTABLE)
++      $(QUIET_GEN)$(SHELL_PATH) generate-macos-app.sh . "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE
 +endif
 +
 +ifdef GITGUI_WINDOWS_WRAPPER
 +GITGUI_MAIN := git-gui.tcl
 +
 +git-gui: windows/git-gui.sh
 +      cp $< $@
 +endif
 +
- 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; \
-       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
++$(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
 +      MSGFMT ?= $(TCL_PATH) po/po2msg.sh
 +else
 +      MSGFMT ?= msgfmt
 +        ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
 +              MSGFMT := $(TCL_PATH) po/po2msg.sh
 +        endif
 +endif
 +
 +msgsdir     = $(gg_libdir)/msgs
 +msgsdir_SQ  = $(subst ','\'',$(msgsdir))
 +PO_TEMPLATE = po/git-gui.pot
 +ALL_POFILES = $(wildcard po/*.po)
 +ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
 +
 +$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
 +      $(XGETTEXT) -kmc -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
 +update-po:: $(PO_TEMPLATE)
 +      $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
 +$(ALL_MSGFILES): %.msg : %.po
 +      $(QUIET_MSGFMT0)$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $< $(QUIET_MSGFMT1)
 +
- dist-version:
++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
 +endif
 +ifdef GITGUI_WINDOWS_WRAPPER
 +all:: git-gui
 +endif
 +all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES)
 +
 +install: all
 +      $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
 +      $(QUIET)$(INSTALL_X0)git-gui $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 +      $(QUIET)$(INSTALL_X0)git-gui--askpass $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 +      $(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(INSTALL_L0)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L1)'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' $(INSTALL_L2)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L3) &&) true
 +ifdef GITGUI_WINDOWS_WRAPPER
 +      $(QUIET)$(INSTALL_R0)git-gui.tcl $(INSTALL_R1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 +endif
 +      $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
 +      $(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
 +ifdef GITGUI_MACOSXAPP
 +      $(QUIET)$(INSTALL_A0)'Git Gui.app' $(INSTALL_A1) '$(DESTDIR_SQ)$(libdir_SQ)'
 +      $(QUIET)$(INSTALL_X0)git-gui.tcl $(INSTALL_X1) '$(DESTDIR_SQ)$(libdir_SQ)'
 +endif
 +      $(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
 +      $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
 +      $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
 +
 +uninstall:
 +      $(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 +      $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui $(REMOVE_F1)
 +      $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askpass $(REMOVE_F1)
 +      $(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/$p $(REMOVE_F1) &&) true
 +ifdef GITGUI_WINDOWS_WRAPPER
 +      $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui.tcl $(REMOVE_F1)
 +endif
 +      $(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(libdir_SQ)'
 +      $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/tclIndex $(REMOVE_F1)
 +ifdef GITGUI_MACOSXAPP
 +      $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)/Git Gui.app' $(REMOVE_F1)
 +      $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/git-gui.tcl $(REMOVE_F1)
 +endif
 +      $(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
 +      $(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(msgsdir_SQ)'
 +      $(QUIET)$(foreach p,$(ALL_MSGFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
 +      $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(REMOVE_D1)
 +      $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(REMOVE_D1)
 +      $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1)
 +      $(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1)
 +
-       @echo $(GITGUI_VERSION) > $(TARDIR)/version
++dist-version: GIT-VERSION-FILE
 +      @mkdir -p $(TARDIR)
-       $(RM_RF) GIT-VERSION-FILE GIT-GUI-VARS
++      @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-BUILD-OPTIONS
 +ifdef GITGUI_MACOSXAPP
 +      $(RM_RF) 'Git Gui.app'* git-gui
 +endif
 +ifdef GITGUI_WINDOWS_WRAPPER
 +      $(RM_RF) git-gui
 +endif
 +
 +.PHONY: all install uninstall dist-version clean
 +.PHONY: FORCE
index 0000000000000000000000000000000000000000,39dfafdc4adc141355aa9f59fb533ea6ec9afce6..39dfafdc4adc141355aa9f59fb533ea6ec9afce6
mode 000000,100755..100755
--- /dev/null
index 0000000000000000000000000000000000000000,71b9fa67a4be7f7011c8e45dd03570f5dd03812e..71b9fa67a4be7f7011c8e45dd03570f5dd03812e
mode 000000,100755..100755
--- /dev/null
index 0000000000000000000000000000000000000000,0304937f41e169b947539c2a80dcfec955e4be61..0304937f41e169b947539c2a80dcfec955e4be61
mode 000000,100755..100755
--- /dev/null
index 0000000000000000000000000000000000000000,36e3a0bd90eefa56469b004acceab02bc18e5278..36e3a0bd90eefa56469b004acceab02bc18e5278
mode 000000,100755..100755
--- /dev/null
index 0000000000000000000000000000000000000000,4b9efab774dc97546f41158ba56b19d20291acfb..4b9efab774dc97546f41158ba56b19d20291acfb
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..cdae85e4b9dce71bbc8bfa2437af4aa47eca419d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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')
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..00cae7433859ad8bc025b8c425b70f78c328a2f3
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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