Skip to content

Commit f9164fb

Browse files
committed
Update Cygwin build
1 parent 6777f17 commit f9164fb

File tree

6 files changed

+71
-47
lines changed

6 files changed

+71
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ test/tmp
3434
tig-*.tar.gz
3535
tig-*.tar.gz.sha256
3636
tig.spec
37+
tig.cygport
3738
tools/doc-gen
3839
tig.dSYM

INSTALL.adoc

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ The latest version is:
99
https://github.com/jonas/tig/releases/download/tig-2.6.0/tig-2.6.0.tar.gz[tig-2.6.0]
1010
https://github.com/jonas/tig/releases/download/tig-2.6.0/tig-2.6.0.tar.gz.sha256[(sha256)]
1111

12-
*Note:* Do not use the tar.gz file for version 2.0 because it will fail
13-
to compile due to issue https://github.com/jonas/tig/pull/283[#283] and
14-
https://github.com/jonas/tig/issues/337[#337]
15-
1612
The quick and simple way to install Tig is:
1713

1814
$ make
@@ -78,24 +74,6 @@ You can use link:https://brew.sh[Homebrew] to install Tig on macOS and Linux:
7874

7975
$ brew install tig
8076

81-
Note, for older installations of Tig, Homebrew does not automatically
82-
update the system-wide `tigrc` file when upgrading Tig and the
83-
link:https://github.com/Homebrew/homebrew-core/commit/5600463d68620d68c9745acc490af7f8a16a75cb[behavior]
84-
was changed in 2015 to install the system-wide `tigrc` in the
85-
`/usr/local/share/tig/examples` directory so Tig always uses the
86-
defaults compiled into the binary.
87-
88-
If you see warnings when starting Tig after upgrading, e.g.:
89-
90-
tig warning: Errors while loading /usr/local/etc/tigrc
91-
92-
It means you either need to manually update `/usr/local/etc/tigrc` with
93-
changes from `/usr/local/share/tig/examples` rename the file if you
94-
never made any changes to it.
95-
96-
$ mv /usr/local/etc/tigrc{,.old}
97-
98-
9977
Installation using Nix
10078
----------------------
10179
@@ -123,17 +101,19 @@ You can use link:https://man.freebsd.org/pkg/8[pkg] to install Tig on FreeBSD:
123101
Installation on Windows
124102
-----------------------
125103

126-
Easiest way is to install link:https://gitforwindows.org/[Git-for-Windows]. As
127-
of version `2.14.2`, it comes bundled with `tig`.
104+
Easiest way is to install link:https://gitforwindows.org/[Git-for-Windows],
105+
it comes bundled with `tig`.
106+
107+
Alternatively, you can also use it by installing link:https://www.cygwin.com/[Cygwin].
128108

129-
Alternatively, you can also use it by installing link:https://www.cygwin.com/[cygwin].
130-
You must then install the packages `git`, `gcc-core`, `make`, `libiconv-devel`
131-
and `libncurses-devel`. Extract the tarball and install by using `configure`
132-
as explained above.
109+
If you want to install from the sources, you must then install the packages `git`,
110+
`gcc-core`, `make`, `sed`, `libiconv-devel` and `libncurses-devel`, and optionally
111+
`libreadline-devel` and `libpcre2-devel`. Use `cygport` or extract the tarball and
112+
install by using `configure` as explained above.
133113

134-
If you want to install from the sources, then you will also need the `automake`
135-
package (which will also install `autoconf`). Then run `make configure` and install
136-
by using `configure` as explained above.
114+
If you want to install from the Git repository, then you will also need the
115+
`automake` and `autoconf` packages. Then run `make configure` and install by
116+
using `configure` as explained above.
137117

138118
Build configuration
139119
-------------------
@@ -204,9 +184,9 @@ configure script and building documentation:
204184
|Tool |Description
205185
|readline |Adds support for completion and history in
206186
search and command prompts.
207-
|PCRE |Adds support for Perl Compatible Regular
187+
|PCRE / PCRE2 |Adds support for Perl Compatible Regular
208188
Expressions in searches.
209-
|autoconf |Contains autoreconf for generating configure
189+
|automake and autoconf |Contains autoreconf for generating configure
210190
from configure.ac.
211191
|asciidoc (>= 8.4) |Generates HTML and (DocBook) XML from text.
212192
|xmlto |Generates manpages and chunked HTML from XML.

Makefile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ VERSION = 2.6.0
77
all:
88

99
# Include kernel specific configuration
10-
kernel_name := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')
10+
kernel_name := $(shell sh -c 'uname -s 2>/dev/null || echo unknown' | sed 's/\(CYGWIN_NT\)-.*/\1/')
1111
-include contrib/config.make-$(kernel_name)
1212

1313
# Include setting from the configure script
@@ -25,7 +25,7 @@ prefix ?= $(HOME)
2525
bindir ?= $(prefix)/bin
2626
datarootdir ?= $(prefix)/share
2727
sysconfdir ?= $(prefix)/etc
28-
docdir ?= $(datarootdir)/doc
28+
docdir ?= $(datarootdir)/doc/tig
2929
mandir ?= $(datarootdir)/man
3030
# DESTDIR=
3131

@@ -153,7 +153,7 @@ install-release-doc-man:
153153

154154
install-doc-html: doc-html
155155
$(Q)$(foreach doc, $(HTMLDOC), \
156-
$(QUIET_INSTALL_EACH)tools/install.sh data $(doc) "$(DESTDIR)$(docdir)/tig";)
156+
$(QUIET_INSTALL_EACH)tools/install.sh data $(doc) "$(DESTDIR)$(docdir)";)
157157

158158
install-release-doc-html:
159159
GIT_INDEX_FILE=.tmp-doc-index git read-tree origin/release
@@ -174,7 +174,7 @@ uninstall:
174174
$(Q)$(foreach doc, $(filter %.7, $(MANDOC:doc/%=%)), \
175175
$(QUIET_UNINSTALL_EACH)tools/uninstall.sh "$(DESTDIR)$(mandir)/man7/$(doc)";)
176176
$(Q)$(foreach doc, $(HTMLDOC:doc/%=%), \
177-
$(QUIET_UNINSTALL_EACH)tools/uninstall.sh "$(DESTDIR)$(docdir)/tig/$(doc)";)
177+
$(QUIET_UNINSTALL_EACH)tools/uninstall.sh "$(DESTDIR)$(docdir)/$(doc)";)
178178

179179
clean: clean-test clean-coverage
180180
$(Q)$(RM) -r $(TARNAME) tig-*.tar.gz tig-*.tar.gz.sha256 .deps _book node_modules
@@ -188,7 +188,7 @@ distclean: clean
188188
$(RM) config.h config.log config.make config.status config.h.in~
189189

190190
veryclean: distclean
191-
$(RM) tig.spec $(ALLDOC) aclocal.m4 configure config.h.in
191+
$(RM) tig.spec tig.cygport $(ALLDOC) aclocal.m4 configure config.h.in
192192

193193
spell-check:
194194
for file in $(TXTDOC) src/tig.c; do \
@@ -217,9 +217,9 @@ update-docs: tools/doc-gen
217217
$(SED) -n '/endif::DOC_GEN_ACTIONS/,$$p' < "$$doc" >> "$$doc.gen" ; \
218218
mv "$$doc.gen" "$$doc"
219219

220-
dist: configure config.h.in aclocal.m4 tig.spec
220+
dist: configure config.h.in aclocal.m4 tig.spec tig.cygport
221221
$(Q)mkdir -p $(TARNAME) && \
222-
cp Makefile tig.spec configure config.h.in aclocal.m4 $(TARNAME) && \
222+
cp Makefile tig.spec tig.cygport configure config.h.in aclocal.m4 $(TARNAME) && \
223223
$(SED) -i "s/VERSION\s\+=\s\+[0-9]\+\([.][0-9]\+\)\+/VERSION = $(VERSION)/" $(TARNAME)/Makefile
224224
git archive --format=tar --prefix=$(TARNAME)/ HEAD | \
225225
$(TAR) --delete $(TARNAME)/Makefile > $(TARNAME).tar && \
@@ -393,20 +393,19 @@ DEPS_CFLAGS ?= -MMD -MP -MF .deps/$*.d
393393
src/builtin-config.c: tigrc tools/make-builtin-config.sh
394394
$(QUIET_GEN)tools/make-builtin-config.sh $< > $@
395395

396-
tig.spec: contrib/tig.spec.in
396+
%: contrib/%.in
397397
$(QUIET_GEN)$(SED) -e 's/@@VERSION@@/$(RPM_VERSION)/g' \
398398
-e 's/@@RELEASE@@/$(RPM_RELEASE)/g' < $< > $@
399399

400-
doc/manual.html: doc/manual.toc
401-
doc/manual.html: ASCIIDOC_FLAGS += -ainclude-manual-toc
402-
%.toc: %.adoc
403-
$(QUIET_GEN)$(SED) -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
400+
doc/manual.html: doc/manual.adoc doc/asciidoc.conf
401+
@$(SED) -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
404402
case "$$line" in \
405403
"----"*) echo ". <<$$ref>>"; ref= ;; \
406404
"~~~~"*) echo "- <<$$ref>>"; ref= ;; \
407405
"[["*"]]") ref="$$line" ;; \
408406
*) ref="$$ref, $$line" ;; \
409-
esac; done | $(SED) 's/\[\[\(.*\)\]\]/\1/' > $@
407+
esac; done | $(SED) 's/\[\[\(.*\)\]\]/\1/' > $(<:%.adoc=%.toc)
408+
$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article -ainclude-manual-toc -n $<
410409

411410
README.html: README.adoc doc/asciidoc.conf
412411
$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article -a readme $<

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ environment:
55

66
install:
77
- appveyor DownloadFile https://cygwin.com/setup-%ARCH%.exe -FileName C:\%TARGET%\setup-%ARCH%.exe
8-
- cmd: C:\%TARGET%\setup-%ARCH%.exe -qgnNdO -l C:\%TARGET%\var\cache\setup -R C:\%TARGET% -s https://cygwin.mirror.constant.com -P git -P gcc-code -P make -P automake -P libiconv-devel -P libncurses-devel
8+
- cmd: C:\%TARGET%\setup-%ARCH%.exe -qgnNdO -l C:\%TARGET%\var\cache\setup -R C:\%TARGET% -s https://cygwin.mirror.constant.com -P git -P gcc-core -P make -P sed -P automake -P autoconf -P libncurses-devel -P libreadline-devel -P libpcre2-devel
99
- cmd: SET PATH=C:\%TARGET%\bin;%PATH%
1010
- git config --global --add safe.directory /cygdrive/c/projects/tig
1111

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,18 @@ TIG_NCURSES = $(NCURSESW_LIBS)
1717
TIG_LDLIBS = -liconv
1818
TIG_CPPFLAGS = -DHAVE_NCURSESW_CURSES_H
1919

20+
HAS_READLINE = $(shell test -e "/usr/include/readline/readline.h" && echo true)
21+
22+
ifeq ($(HAS_READLINE),true)
23+
TIG_LDLIBS += -lreadline
24+
TIG_CPPFLAGS += -DHAVE_READLINE
25+
endif
26+
27+
HAS_PCRE2 = $(shell test -e "/usr/include/pcre2posix.h" && echo true)
28+
29+
ifeq ($(HAS_PCRE2),true)
30+
TIG_LDLIBS += -lpcre2-posix -lpcre2-8
31+
TIG_CPPFLAGS += -DHAVE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
32+
endif
33+
2034
# vim: ft=make:

contrib/tig.cygport.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME="tig"
2+
VERSION=@@VERSION@@
3+
RELEASE=@@RELEASE@@
4+
CATEGORY="Devel"
5+
SUMMARY="Tig: text-mode interface for git"
6+
DESCRIPTION="Tig is a git repository browser that additionally can act as a pager
7+
for output from various git commands.
8+
9+
When browsing repositories, it uses the underlying git commands to
10+
present the user with various views, such as summarized revision log
11+
and showing the commit with the log message, diffstat, and the diff.
12+
13+
Using it as a pager, it will display input from stdin and colorize it."
14+
HOMEPAGE="https://github.com/jonas/tig"
15+
LICENSE="GPL-2.0-or-later"
16+
SRC_URI="https://github.com/jonas/tig/releases/download/tig-${VERSION}/tig-${VERSION}.tar.gz"
17+
BUILD_REQUIRES="gcc-core make sed libiconv-devel libncurses-devel libreadline-devel libpcre2-devel"
18+
REQUIRES="git libiconv2 libncursesw10 libreadline7 libpcre2-posix3 libpcre2_8_0"
19+
20+
src_compile() {
21+
lndirs
22+
cd ${B}
23+
cygconf
24+
cygmake
25+
}
26+
27+
src_install() {
28+
cd ${B}
29+
cyginstall install install-doc
30+
}

0 commit comments

Comments
 (0)