Show More
@@ -0,0 +1,15 b'' | |||||
|
1 | FROM centos:centos8 | |||
|
2 | ||||
|
3 | RUN groupadd -g %GID% build && \ | |||
|
4 | useradd -u %UID% -g %GID% -s /bin/bash -d /build -m build | |||
|
5 | ||||
|
6 | RUN yum install -y \ | |||
|
7 | gcc \ | |||
|
8 | gettext \ | |||
|
9 | make \ | |||
|
10 | python3-devel \ | |||
|
11 | python3-docutils \ | |||
|
12 | rpm-build | |||
|
13 | ||||
|
14 | # For creating repo meta data | |||
|
15 | RUN yum install -y createrepo |
@@ -1,255 +1,257 b'' | |||||
1 | # If you want to change PREFIX, do not just edit it below. The changed |
|
1 | # If you want to change PREFIX, do not just edit it below. The changed | |
2 | # value wont get passed on to recursive make calls. You should instead |
|
2 | # value wont get passed on to recursive make calls. You should instead | |
3 | # override the variable on the command like: |
|
3 | # override the variable on the command like: | |
4 | # |
|
4 | # | |
5 | # % make PREFIX=/opt/ install |
|
5 | # % make PREFIX=/opt/ install | |
6 |
|
6 | |||
7 | export PREFIX=/usr/local |
|
7 | export PREFIX=/usr/local | |
8 | PYTHON?=python |
|
8 | PYTHON?=python | |
9 | $(eval HGROOT := $(shell pwd)) |
|
9 | $(eval HGROOT := $(shell pwd)) | |
10 | HGPYTHONS ?= $(HGROOT)/build/pythons |
|
10 | HGPYTHONS ?= $(HGROOT)/build/pythons | |
11 | PURE= |
|
11 | PURE= | |
12 | PYFILESCMD=find mercurial hgext doc -name '*.py' |
|
12 | PYFILESCMD=find mercurial hgext doc -name '*.py' | |
13 | PYFILES:=$(shell $(PYFILESCMD)) |
|
13 | PYFILES:=$(shell $(PYFILESCMD)) | |
14 | DOCFILES=mercurial/help/*.txt |
|
14 | DOCFILES=mercurial/help/*.txt | |
15 | export LANGUAGE=C |
|
15 | export LANGUAGE=C | |
16 | export LC_ALL=C |
|
16 | export LC_ALL=C | |
17 | TESTFLAGS ?= $(shell echo $$HGTESTFLAGS) |
|
17 | TESTFLAGS ?= $(shell echo $$HGTESTFLAGS) | |
18 | OSXVERSIONFLAGS ?= $(shell echo $$OSXVERSIONFLAGS) |
|
18 | OSXVERSIONFLAGS ?= $(shell echo $$OSXVERSIONFLAGS) | |
19 | CARGO = cargo |
|
19 | CARGO = cargo | |
20 |
|
20 | |||
21 | # Set this to e.g. "mingw32" to use a non-default compiler. |
|
21 | # Set this to e.g. "mingw32" to use a non-default compiler. | |
22 | COMPILER= |
|
22 | COMPILER= | |
23 |
|
23 | |||
24 | COMPILERFLAG_tmp_ = |
|
24 | COMPILERFLAG_tmp_ = | |
25 | COMPILERFLAG_tmp_${COMPILER} ?= -c $(COMPILER) |
|
25 | COMPILERFLAG_tmp_${COMPILER} ?= -c $(COMPILER) | |
26 | COMPILERFLAG=${COMPILERFLAG_tmp_${COMPILER}} |
|
26 | COMPILERFLAG=${COMPILERFLAG_tmp_${COMPILER}} | |
27 |
|
27 | |||
28 | help: |
|
28 | help: | |
29 | @echo 'Commonly used make targets:' |
|
29 | @echo 'Commonly used make targets:' | |
30 | @echo ' all - build program and documentation' |
|
30 | @echo ' all - build program and documentation' | |
31 | @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))' |
|
31 | @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))' | |
32 | @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))' |
|
32 | @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))' | |
33 | @echo ' local - build for inplace usage' |
|
33 | @echo ' local - build for inplace usage' | |
34 | @echo ' tests - run all tests in the automatic test suite' |
|
34 | @echo ' tests - run all tests in the automatic test suite' | |
35 | @echo ' test-foo - run only specified tests (e.g. test-merge1.t)' |
|
35 | @echo ' test-foo - run only specified tests (e.g. test-merge1.t)' | |
36 | @echo ' dist - run all tests and create a source tarball in dist/' |
|
36 | @echo ' dist - run all tests and create a source tarball in dist/' | |
37 | @echo ' clean - remove files created by other targets' |
|
37 | @echo ' clean - remove files created by other targets' | |
38 | @echo ' (except installed files or dist source tarball)' |
|
38 | @echo ' (except installed files or dist source tarball)' | |
39 | @echo ' update-pot - update i18n/hg.pot' |
|
39 | @echo ' update-pot - update i18n/hg.pot' | |
40 | @echo |
|
40 | @echo | |
41 | @echo 'Example for a system-wide installation under /usr/local:' |
|
41 | @echo 'Example for a system-wide installation under /usr/local:' | |
42 | @echo ' make all && su -c "make install" && hg version' |
|
42 | @echo ' make all && su -c "make install" && hg version' | |
43 | @echo |
|
43 | @echo | |
44 | @echo 'Example for a local installation (usable in this directory):' |
|
44 | @echo 'Example for a local installation (usable in this directory):' | |
45 | @echo ' make local && ./hg version' |
|
45 | @echo ' make local && ./hg version' | |
46 |
|
46 | |||
47 | all: build doc |
|
47 | all: build doc | |
48 |
|
48 | |||
49 | local: |
|
49 | local: | |
50 | $(PYTHON) setup.py $(PURE) \ |
|
50 | $(PYTHON) setup.py $(PURE) \ | |
51 | build_py -c -d . \ |
|
51 | build_py -c -d . \ | |
52 | build_ext $(COMPILERFLAG) -i \ |
|
52 | build_ext $(COMPILERFLAG) -i \ | |
53 | build_hgexe $(COMPILERFLAG) -i \ |
|
53 | build_hgexe $(COMPILERFLAG) -i \ | |
54 | build_mo |
|
54 | build_mo | |
55 | env HGRCPATH= $(PYTHON) hg version |
|
55 | env HGRCPATH= $(PYTHON) hg version | |
56 |
|
56 | |||
57 | build: |
|
57 | build: | |
58 | $(PYTHON) setup.py $(PURE) build $(COMPILERFLAG) |
|
58 | $(PYTHON) setup.py $(PURE) build $(COMPILERFLAG) | |
59 |
|
59 | |||
60 | wheel: |
|
60 | wheel: | |
61 | FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG) |
|
61 | FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG) | |
62 |
|
62 | |||
63 | doc: |
|
63 | doc: | |
64 | $(MAKE) -C doc |
|
64 | $(MAKE) -C doc | |
65 |
|
65 | |||
66 | cleanbutpackages: |
|
66 | cleanbutpackages: | |
67 | -$(PYTHON) setup.py clean --all # ignore errors from this command |
|
67 | -$(PYTHON) setup.py clean --all # ignore errors from this command | |
68 | find contrib doc hgext hgext3rd i18n mercurial tests hgdemandimport \ |
|
68 | find contrib doc hgext hgext3rd i18n mercurial tests hgdemandimport \ | |
69 | \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';' |
|
69 | \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';' | |
70 | rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err |
|
70 | rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err | |
71 | rm -f mercurial/__modulepolicy__.py |
|
71 | rm -f mercurial/__modulepolicy__.py | |
72 | if test -d .hg; then rm -f mercurial/__version__.py; fi |
|
72 | if test -d .hg; then rm -f mercurial/__version__.py; fi | |
73 | rm -rf build mercurial/locale |
|
73 | rm -rf build mercurial/locale | |
74 | $(MAKE) -C doc clean |
|
74 | $(MAKE) -C doc clean | |
75 | $(MAKE) -C contrib/chg distclean |
|
75 | $(MAKE) -C contrib/chg distclean | |
76 | rm -rf rust/target |
|
76 | rm -rf rust/target | |
77 | rm -f mercurial/rustext.so |
|
77 | rm -f mercurial/rustext.so | |
78 |
|
78 | |||
79 | clean: cleanbutpackages |
|
79 | clean: cleanbutpackages | |
80 | rm -rf packages |
|
80 | rm -rf packages | |
81 |
|
81 | |||
82 | install: install-bin install-doc |
|
82 | install: install-bin install-doc | |
83 |
|
83 | |||
84 | install-bin: build |
|
84 | install-bin: build | |
85 | $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force |
|
85 | $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force | |
86 |
|
86 | |||
87 | install-doc: doc |
|
87 | install-doc: doc | |
88 | cd doc && $(MAKE) $(MFLAGS) install |
|
88 | cd doc && $(MAKE) $(MFLAGS) install | |
89 |
|
89 | |||
90 | install-home: install-home-bin install-home-doc |
|
90 | install-home: install-home-bin install-home-doc | |
91 |
|
91 | |||
92 | install-home-bin: build |
|
92 | install-home-bin: build | |
93 | $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force |
|
93 | $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force | |
94 |
|
94 | |||
95 | install-home-doc: doc |
|
95 | install-home-doc: doc | |
96 | cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install |
|
96 | cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install | |
97 |
|
97 | |||
98 | MANIFEST-doc: |
|
98 | MANIFEST-doc: | |
99 | $(MAKE) -C doc MANIFEST |
|
99 | $(MAKE) -C doc MANIFEST | |
100 |
|
100 | |||
101 | MANIFEST.in: MANIFEST-doc |
|
101 | MANIFEST.in: MANIFEST-doc | |
102 | hg manifest | sed -e 's/^/include /' > MANIFEST.in |
|
102 | hg manifest | sed -e 's/^/include /' > MANIFEST.in | |
103 | echo include mercurial/__version__.py >> MANIFEST.in |
|
103 | echo include mercurial/__version__.py >> MANIFEST.in | |
104 | sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in |
|
104 | sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in | |
105 |
|
105 | |||
106 | dist: tests dist-notests |
|
106 | dist: tests dist-notests | |
107 |
|
107 | |||
108 | dist-notests: doc MANIFEST.in |
|
108 | dist-notests: doc MANIFEST.in | |
109 | TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist |
|
109 | TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist | |
110 |
|
110 | |||
111 | check: tests |
|
111 | check: tests | |
112 |
|
112 | |||
113 | tests: |
|
113 | tests: | |
114 | # Run Rust tests if cargo is installed |
|
114 | # Run Rust tests if cargo is installed | |
115 | if command -v $(CARGO) >/dev/null 2>&1; then \ |
|
115 | if command -v $(CARGO) >/dev/null 2>&1; then \ | |
116 | $(MAKE) rust-tests; \ |
|
116 | $(MAKE) rust-tests; \ | |
117 | fi |
|
117 | fi | |
118 | cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) |
|
118 | cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) | |
119 |
|
119 | |||
120 | test-%: |
|
120 | test-%: | |
121 | cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@ |
|
121 | cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@ | |
122 |
|
122 | |||
123 | testpy-%: |
|
123 | testpy-%: | |
124 | @echo Looking for Python $* in $(HGPYTHONS) |
|
124 | @echo Looking for Python $* in $(HGPYTHONS) | |
125 | [ -e $(HGPYTHONS)/$*/bin/python ] || ( \ |
|
125 | [ -e $(HGPYTHONS)/$*/bin/python ] || ( \ | |
126 | cd $$(mktemp --directory --tmpdir) && \ |
|
126 | cd $$(mktemp --directory --tmpdir) && \ | |
127 | $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python ) |
|
127 | $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python ) | |
128 | cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS) |
|
128 | cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS) | |
129 |
|
129 | |||
130 | rust-tests: py_feature = $(shell $(PYTHON) -c \ |
|
130 | rust-tests: py_feature = $(shell $(PYTHON) -c \ | |
131 | 'import sys; print(["python27-bin", "python3-bin"][sys.version_info[0] >= 3])') |
|
131 | 'import sys; print(["python27-bin", "python3-bin"][sys.version_info[0] >= 3])') | |
132 | rust-tests: |
|
132 | rust-tests: | |
133 | cd $(HGROOT)/rust/hg-cpython \ |
|
133 | cd $(HGROOT)/rust/hg-cpython \ | |
134 | && $(CARGO) test --quiet --all \ |
|
134 | && $(CARGO) test --quiet --all \ | |
135 | --no-default-features --features "$(py_feature)" |
|
135 | --no-default-features --features "$(py_feature)" | |
136 |
|
136 | |||
137 | check-code: |
|
137 | check-code: | |
138 | hg manifest | xargs python contrib/check-code.py |
|
138 | hg manifest | xargs python contrib/check-code.py | |
139 |
|
139 | |||
140 | format-c: |
|
140 | format-c: | |
141 | clang-format --style file -i \ |
|
141 | clang-format --style file -i \ | |
142 | `hg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"'` |
|
142 | `hg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"'` | |
143 |
|
143 | |||
144 | update-pot: i18n/hg.pot |
|
144 | update-pot: i18n/hg.pot | |
145 |
|
145 | |||
146 | i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext |
|
146 | i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext | |
147 | $(PYTHON) i18n/hggettext mercurial/commands.py \ |
|
147 | $(PYTHON) i18n/hggettext mercurial/commands.py \ | |
148 | hgext/*.py hgext/*/__init__.py \ |
|
148 | hgext/*.py hgext/*/__init__.py \ | |
149 | mercurial/fileset.py mercurial/revset.py \ |
|
149 | mercurial/fileset.py mercurial/revset.py \ | |
150 | mercurial/templatefilters.py \ |
|
150 | mercurial/templatefilters.py \ | |
151 | mercurial/templatefuncs.py \ |
|
151 | mercurial/templatefuncs.py \ | |
152 | mercurial/templatekw.py \ |
|
152 | mercurial/templatekw.py \ | |
153 | mercurial/filemerge.py \ |
|
153 | mercurial/filemerge.py \ | |
154 | mercurial/hgweb/webcommands.py \ |
|
154 | mercurial/hgweb/webcommands.py \ | |
155 | mercurial/util.py \ |
|
155 | mercurial/util.py \ | |
156 | $(DOCFILES) > i18n/hg.pot.tmp |
|
156 | $(DOCFILES) > i18n/hg.pot.tmp | |
157 | # All strings marked for translation in Mercurial contain |
|
157 | # All strings marked for translation in Mercurial contain | |
158 | # ASCII characters only. But some files contain string |
|
158 | # ASCII characters only. But some files contain string | |
159 | # literals like this '\037\213'. xgettext thinks it has to |
|
159 | # literals like this '\037\213'. xgettext thinks it has to | |
160 | # parse them even though they are not marked for translation. |
|
160 | # parse them even though they are not marked for translation. | |
161 | # Extracting with an explicit encoding of ISO-8859-1 will make |
|
161 | # Extracting with an explicit encoding of ISO-8859-1 will make | |
162 | # xgettext "parse" and ignore them. |
|
162 | # xgettext "parse" and ignore them. | |
163 | $(PYFILESCMD) | xargs \ |
|
163 | $(PYFILESCMD) | xargs \ | |
164 | xgettext --package-name "Mercurial" \ |
|
164 | xgettext --package-name "Mercurial" \ | |
165 | --msgid-bugs-address "<mercurial-devel@mercurial-scm.org>" \ |
|
165 | --msgid-bugs-address "<mercurial-devel@mercurial-scm.org>" \ | |
166 | --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \ |
|
166 | --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \ | |
167 | --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \ |
|
167 | --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \ | |
168 | -d hg -p i18n -o hg.pot.tmp |
|
168 | -d hg -p i18n -o hg.pot.tmp | |
169 | $(PYTHON) i18n/posplit i18n/hg.pot.tmp |
|
169 | $(PYTHON) i18n/posplit i18n/hg.pot.tmp | |
170 | # The target file is not created before the last step. So it never is in |
|
170 | # The target file is not created before the last step. So it never is in | |
171 | # an intermediate state. |
|
171 | # an intermediate state. | |
172 | mv -f i18n/hg.pot.tmp i18n/hg.pot |
|
172 | mv -f i18n/hg.pot.tmp i18n/hg.pot | |
173 |
|
173 | |||
174 | %.po: i18n/hg.pot |
|
174 | %.po: i18n/hg.pot | |
175 | # work on a temporary copy for never having a half completed target |
|
175 | # work on a temporary copy for never having a half completed target | |
176 | cp $@ $@.tmp |
|
176 | cp $@ $@.tmp | |
177 | msgmerge --no-location --update $@.tmp $^ |
|
177 | msgmerge --no-location --update $@.tmp $^ | |
178 | mv -f $@.tmp $@ |
|
178 | mv -f $@.tmp $@ | |
179 |
|
179 | |||
180 | # Packaging targets |
|
180 | # Packaging targets | |
181 |
|
181 | |||
182 | packaging_targets := \ |
|
182 | packaging_targets := \ | |
183 | centos5 \ |
|
183 | centos5 \ | |
184 | centos6 \ |
|
184 | centos6 \ | |
185 | centos7 \ |
|
185 | centos7 \ | |
|
186 | centos8 \ | |||
186 | deb \ |
|
187 | deb \ | |
187 | docker-centos5 \ |
|
188 | docker-centos5 \ | |
188 | docker-centos6 \ |
|
189 | docker-centos6 \ | |
189 | docker-centos7 \ |
|
190 | docker-centos7 \ | |
|
191 | docker-centos8 \ | |||
190 | docker-debian-jessie \ |
|
192 | docker-debian-jessie \ | |
191 | docker-debian-stretch \ |
|
193 | docker-debian-stretch \ | |
192 | docker-fedora \ |
|
194 | docker-fedora \ | |
193 | docker-ubuntu-trusty \ |
|
195 | docker-ubuntu-trusty \ | |
194 | docker-ubuntu-trusty-ppa \ |
|
196 | docker-ubuntu-trusty-ppa \ | |
195 | docker-ubuntu-xenial \ |
|
197 | docker-ubuntu-xenial \ | |
196 | docker-ubuntu-xenial-ppa \ |
|
198 | docker-ubuntu-xenial-ppa \ | |
197 | docker-ubuntu-artful \ |
|
199 | docker-ubuntu-artful \ | |
198 | docker-ubuntu-artful-ppa \ |
|
200 | docker-ubuntu-artful-ppa \ | |
199 | docker-ubuntu-bionic \ |
|
201 | docker-ubuntu-bionic \ | |
200 | docker-ubuntu-bionic-ppa \ |
|
202 | docker-ubuntu-bionic-ppa \ | |
201 | fedora \ |
|
203 | fedora \ | |
202 | linux-wheels \ |
|
204 | linux-wheels \ | |
203 | linux-wheels-x86_64 \ |
|
205 | linux-wheels-x86_64 \ | |
204 | linux-wheels-i686 \ |
|
206 | linux-wheels-i686 \ | |
205 | ppa |
|
207 | ppa | |
206 |
|
208 | |||
207 | # Forward packaging targets for convenience. |
|
209 | # Forward packaging targets for convenience. | |
208 | $(packaging_targets): |
|
210 | $(packaging_targets): | |
209 | $(MAKE) -C contrib/packaging $@ |
|
211 | $(MAKE) -C contrib/packaging $@ | |
210 |
|
212 | |||
211 | osx: |
|
213 | osx: | |
212 | rm -rf build/mercurial |
|
214 | rm -rf build/mercurial | |
213 | /usr/bin/python2.7 setup.py install --optimize=1 \ |
|
215 | /usr/bin/python2.7 setup.py install --optimize=1 \ | |
214 | --root=build/mercurial/ --prefix=/usr/local/ \ |
|
216 | --root=build/mercurial/ --prefix=/usr/local/ \ | |
215 | --install-lib=/Library/Python/2.7/site-packages/ |
|
217 | --install-lib=/Library/Python/2.7/site-packages/ | |
216 | make -C doc all install DESTDIR="$(PWD)/build/mercurial/" |
|
218 | make -C doc all install DESTDIR="$(PWD)/build/mercurial/" | |
217 | # Place a bogon .DS_Store file in the target dir so we can be |
|
219 | # Place a bogon .DS_Store file in the target dir so we can be | |
218 | # sure it doesn't get included in the final package. |
|
220 | # sure it doesn't get included in the final package. | |
219 | touch build/mercurial/.DS_Store |
|
221 | touch build/mercurial/.DS_Store | |
220 | # install zsh completions - this location appears to be |
|
222 | # install zsh completions - this location appears to be | |
221 | # searched by default as of macOS Sierra. |
|
223 | # searched by default as of macOS Sierra. | |
222 | install -d build/mercurial/usr/local/share/zsh/site-functions/ |
|
224 | install -d build/mercurial/usr/local/share/zsh/site-functions/ | |
223 | install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg |
|
225 | install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg | |
224 | # install bash completions - there doesn't appear to be a |
|
226 | # install bash completions - there doesn't appear to be a | |
225 | # place that's searched by default for bash, so we'll follow |
|
227 | # place that's searched by default for bash, so we'll follow | |
226 | # the lead of Apple's git install and just put it in a |
|
228 | # the lead of Apple's git install and just put it in a | |
227 | # location of our own. |
|
229 | # location of our own. | |
228 | install -d build/mercurial/usr/local/hg/contrib/ |
|
230 | install -d build/mercurial/usr/local/hg/contrib/ | |
229 | install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash |
|
231 | install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash | |
230 | make -C contrib/chg \ |
|
232 | make -C contrib/chg \ | |
231 | HGPATH=/usr/local/bin/hg \ |
|
233 | HGPATH=/usr/local/bin/hg \ | |
232 | PYTHON=/usr/bin/python2.7 \ |
|
234 | PYTHON=/usr/bin/python2.7 \ | |
233 | HGEXTDIR=/Library/Python/2.7/site-packages/hgext \ |
|
235 | HGEXTDIR=/Library/Python/2.7/site-packages/hgext \ | |
234 | DESTDIR=../../build/mercurial \ |
|
236 | DESTDIR=../../build/mercurial \ | |
235 | PREFIX=/usr/local \ |
|
237 | PREFIX=/usr/local \ | |
236 | clean install |
|
238 | clean install | |
237 | mkdir -p $${OUTPUTDIR:-dist} |
|
239 | mkdir -p $${OUTPUTDIR:-dist} | |
238 | HGVER=$$(python contrib/genosxversion.py $(OSXVERSIONFLAGS) build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py) && \ |
|
240 | HGVER=$$(python contrib/genosxversion.py $(OSXVERSIONFLAGS) build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py) && \ | |
239 | OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \ |
|
241 | OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \ | |
240 | pkgbuild --filter \\.DS_Store --root build/mercurial/ \ |
|
242 | pkgbuild --filter \\.DS_Store --root build/mercurial/ \ | |
241 | --identifier org.mercurial-scm.mercurial \ |
|
243 | --identifier org.mercurial-scm.mercurial \ | |
242 | --version "$${HGVER}" \ |
|
244 | --version "$${HGVER}" \ | |
243 | build/mercurial.pkg && \ |
|
245 | build/mercurial.pkg && \ | |
244 | productbuild --distribution contrib/packaging/macosx/distribution.xml \ |
|
246 | productbuild --distribution contrib/packaging/macosx/distribution.xml \ | |
245 | --package-path build/ \ |
|
247 | --package-path build/ \ | |
246 | --version "$${HGVER}" \ |
|
248 | --version "$${HGVER}" \ | |
247 | --resources contrib/packaging/macosx/ \ |
|
249 | --resources contrib/packaging/macosx/ \ | |
248 | "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg |
|
250 | "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg | |
249 |
|
251 | |||
250 | .PHONY: help all local build doc cleanbutpackages clean install install-bin \ |
|
252 | .PHONY: help all local build doc cleanbutpackages clean install install-bin \ | |
251 | install-doc install-home install-home-bin install-home-doc \ |
|
253 | install-doc install-home install-home-bin install-home-doc \ | |
252 | dist dist-notests check tests rust-tests check-code format-c \ |
|
254 | dist dist-notests check tests rust-tests check-code format-c \ | |
253 | update-pot \ |
|
255 | update-pot \ | |
254 | $(packaging_targets) \ |
|
256 | $(packaging_targets) \ | |
255 | osx |
|
257 | osx |
@@ -1,135 +1,136 b'' | |||||
1 | $(eval HGROOT := $(shell cd ../..; pwd)) |
|
1 | $(eval HGROOT := $(shell cd ../..; pwd)) | |
2 |
|
2 | |||
3 | DEBIAN_CODENAMES := \ |
|
3 | DEBIAN_CODENAMES := \ | |
4 | stretch \ |
|
4 | stretch \ | |
5 | buster \ |
|
5 | buster \ | |
6 | bullseye |
|
6 | bullseye | |
7 |
|
7 | |||
8 | UBUNTU_CODENAMES := \ |
|
8 | UBUNTU_CODENAMES := \ | |
9 | xenial \ |
|
9 | xenial \ | |
10 | bionic \ |
|
10 | bionic \ | |
11 | cosmic \ |
|
11 | cosmic \ | |
12 | disco |
|
12 | disco | |
13 |
|
13 | |||
14 | FEDORA_RELEASE := 31 |
|
14 | FEDORA_RELEASE := 31 | |
15 |
|
15 | |||
16 | CENTOS_RELEASES := \ |
|
16 | CENTOS_RELEASES := \ | |
17 | 5 \ |
|
17 | 5 \ | |
18 | 6 \ |
|
18 | 6 \ | |
19 | 7 |
|
19 | 7 \ | |
|
20 | 8 | |||
20 |
|
21 | |||
21 | # Build a Python for these CentOS releases. |
|
22 | # Build a Python for these CentOS releases. | |
22 | CENTOS_WITH_PYTHON_RELEASES := 5 6 |
|
23 | CENTOS_WITH_PYTHON_RELEASES := 5 6 | |
23 | CENTOS_WITH_NONVERSIONED_PYTHON := 5 6 7 |
|
24 | CENTOS_WITH_NONVERSIONED_PYTHON := 5 6 7 | |
24 |
|
25 | |||
25 | help: |
|
26 | help: | |
26 | @echo 'Packaging Make Targets' |
|
27 | @echo 'Packaging Make Targets' | |
27 | @echo '' |
|
28 | @echo '' | |
28 | @echo 'docker-centos{$(strip $(CENTOS_RELEASES))}' |
|
29 | @echo 'docker-centos{$(strip $(CENTOS_RELEASES))}' | |
29 | @echo ' Build an RPM for a specific CentOS version using Docker.' |
|
30 | @echo ' Build an RPM for a specific CentOS version using Docker.' | |
30 | @echo '' |
|
31 | @echo '' | |
31 | @echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}' |
|
32 | @echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}' | |
32 | @echo ' Build Debian packages specific to a Debian distro using Docker.' |
|
33 | @echo ' Build Debian packages specific to a Debian distro using Docker.' | |
33 | @echo '' |
|
34 | @echo '' | |
34 | @echo 'docker-fedora' |
|
35 | @echo 'docker-fedora' | |
35 | @echo ' Build an RPM for a Fedora $(FEDORA_RELEASE) using Docker.' |
|
36 | @echo ' Build an RPM for a Fedora $(FEDORA_RELEASE) using Docker.' | |
36 | @echo '' |
|
37 | @echo '' | |
37 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}' |
|
38 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}' | |
38 | @echo ' Build Debian package specific to an Ubuntu distro using Docker.' |
|
39 | @echo ' Build Debian package specific to an Ubuntu distro using Docker.' | |
39 | @echo '' |
|
40 | @echo '' | |
40 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}-ppa' |
|
41 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}-ppa' | |
41 | @echo ' Build a source-only Debian package specific to an Ubuntu distro' |
|
42 | @echo ' Build a source-only Debian package specific to an Ubuntu distro' | |
42 | @echo ' using Docker.' |
|
43 | @echo ' using Docker.' | |
43 | @echo '' |
|
44 | @echo '' | |
44 | @echo 'linux-wheels' |
|
45 | @echo 'linux-wheels' | |
45 | @echo ' Build Linux manylinux wheels using Docker.' |
|
46 | @echo ' Build Linux manylinux wheels using Docker.' | |
46 | @echo '' |
|
47 | @echo '' | |
47 | @echo 'linux-wheels-{x86_64, i686}' |
|
48 | @echo 'linux-wheels-{x86_64, i686}' | |
48 | @echo ' Build Linux manylinux wheels for a specific architecture using Docker' |
|
49 | @echo ' Build Linux manylinux wheels for a specific architecture using Docker' | |
49 | @echo '' |
|
50 | @echo '' | |
50 | @echo 'deb' |
|
51 | @echo 'deb' | |
51 | @echo ' Build a Debian package locally targeting the current system' |
|
52 | @echo ' Build a Debian package locally targeting the current system' | |
52 | @echo '' |
|
53 | @echo '' | |
53 | @echo 'ppa' |
|
54 | @echo 'ppa' | |
54 | @echo ' Build a Debian source package locally targeting the current system' |
|
55 | @echo ' Build a Debian source package locally targeting the current system' | |
55 | @echo '' |
|
56 | @echo '' | |
56 | @echo 'centos{$(strip $(CENTOS_RELEASES))}' |
|
57 | @echo 'centos{$(strip $(CENTOS_RELEASES))}' | |
57 | @echo ' Build an RPM for a specific CentOS version locally' |
|
58 | @echo ' Build an RPM for a specific CentOS version locally' | |
58 | @echo '' |
|
59 | @echo '' | |
59 | @echo 'fedora' |
|
60 | @echo 'fedora' | |
60 | @echo ' Build an RPM for Fedora $(FEDORA_RELEASE) locally' |
|
61 | @echo ' Build an RPM for Fedora $(FEDORA_RELEASE) locally' | |
61 |
|
62 | |||
62 | .PHONY: help |
|
63 | .PHONY: help | |
63 |
|
64 | |||
64 | .PHONY: deb |
|
65 | .PHONY: deb | |
65 | deb: |
|
66 | deb: | |
66 | ./builddeb |
|
67 | ./builddeb | |
67 |
|
68 | |||
68 | .PHONY: ppa |
|
69 | .PHONY: ppa | |
69 | ppa: |
|
70 | ppa: | |
70 | ./builddeb --source-only |
|
71 | ./builddeb --source-only | |
71 |
|
72 | |||
72 | # Debian targets. |
|
73 | # Debian targets. | |
73 | define debian_targets = |
|
74 | define debian_targets = | |
74 | .PHONY: docker-debian-$(1) |
|
75 | .PHONY: docker-debian-$(1) | |
75 | docker-debian-$(1): |
|
76 | docker-debian-$(1): | |
76 | ./dockerdeb debian $(1) |
|
77 | ./dockerdeb debian $(1) | |
77 |
|
78 | |||
78 | endef |
|
79 | endef | |
79 |
|
80 | |||
80 | $(foreach codename,$(DEBIAN_CODENAMES),$(eval $(call debian_targets,$(codename)))) |
|
81 | $(foreach codename,$(DEBIAN_CODENAMES),$(eval $(call debian_targets,$(codename)))) | |
81 |
|
82 | |||
82 | # Ubuntu targets. |
|
83 | # Ubuntu targets. | |
83 | define ubuntu_targets = |
|
84 | define ubuntu_targets = | |
84 | .PHONY: docker-ubuntu-$(1) |
|
85 | .PHONY: docker-ubuntu-$(1) | |
85 | docker-ubuntu-$(1): |
|
86 | docker-ubuntu-$(1): | |
86 | ./dockerdeb ubuntu $(1) |
|
87 | ./dockerdeb ubuntu $(1) | |
87 |
|
88 | |||
88 | .PHONY: docker-ubuntu-$(1)-ppa |
|
89 | .PHONY: docker-ubuntu-$(1)-ppa | |
89 | docker-ubuntu-$(1)-ppa: |
|
90 | docker-ubuntu-$(1)-ppa: | |
90 | ./dockerdeb ubuntu $(1) --source-only |
|
91 | ./dockerdeb ubuntu $(1) --source-only | |
91 |
|
92 | |||
92 | endef |
|
93 | endef | |
93 |
|
94 | |||
94 | $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename)))) |
|
95 | $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename)))) | |
95 |
|
96 | |||
96 | # Fedora targets. |
|
97 | # Fedora targets. | |
97 | .PHONY: fedora |
|
98 | .PHONY: fedora | |
98 | fedora: |
|
99 | fedora: | |
99 | mkdir -p $(HGROOT)/packages/fedora$(FEDORA_RELEASE) |
|
100 | mkdir -p $(HGROOT)/packages/fedora$(FEDORA_RELEASE) | |
100 | ./buildrpm |
|
101 | ./buildrpm | |
101 | cp $(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE) |
|
102 | cp $(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE) | |
102 | cp $(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE) |
|
103 | cp $(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE) | |
103 | rm -rf $(HGROOT)/rpmbuild |
|
104 | rm -rf $(HGROOT)/rpmbuild | |
104 |
|
105 | |||
105 | .PHONY: docker-fedora |
|
106 | .PHONY: docker-fedora | |
106 | docker-fedora: |
|
107 | docker-fedora: | |
107 | ./dockerrpm fedora$(FEDORA_RELEASE) |
|
108 | ./dockerrpm fedora$(FEDORA_RELEASE) | |
108 |
|
109 | |||
109 | # CentOS targets. |
|
110 | # CentOS targets. | |
110 | define centos_targets |
|
111 | define centos_targets | |
111 | .PHONY: centos$(1) |
|
112 | .PHONY: centos$(1) | |
112 | centos$(1): |
|
113 | centos$(1): | |
113 | mkdir -p $$(HGROOT)/packages/centos$(1) |
|
114 | mkdir -p $$(HGROOT)/packages/centos$(1) | |
114 | ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,)) |
|
115 | ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,)) | |
115 | cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1) |
|
116 | cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1) | |
116 | cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1) |
|
117 | cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1) | |
117 |
|
118 | |||
118 | .PHONY: docker-centos$(1) |
|
119 | .PHONY: docker-centos$(1) | |
119 | docker-centos$(1): |
|
120 | docker-centos$(1): | |
120 | ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,)) |
|
121 | ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,)) | |
121 |
|
122 | |||
122 | endef |
|
123 | endef | |
123 |
|
124 | |||
124 | $(foreach release,$(CENTOS_RELEASES),$(eval $(call centos_targets,$(release)))) |
|
125 | $(foreach release,$(CENTOS_RELEASES),$(eval $(call centos_targets,$(release)))) | |
125 |
|
126 | |||
126 | .PHONY: linux-wheels |
|
127 | .PHONY: linux-wheels | |
127 | linux-wheels: linux-wheels-x86_64 linux-wheels-i686 |
|
128 | linux-wheels: linux-wheels-x86_64 linux-wheels-i686 | |
128 |
|
129 | |||
129 | .PHONY: linux-wheels-x86_64 |
|
130 | .PHONY: linux-wheels-x86_64 | |
130 | linux-wheels-x86_64: |
|
131 | linux-wheels-x86_64: | |
131 | docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/packaging/build-linux-wheels.sh |
|
132 | docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/packaging/build-linux-wheels.sh | |
132 |
|
133 | |||
133 | .PHONY: linux-wheels-i686 |
|
134 | .PHONY: linux-wheels-i686 | |
134 | linux-wheels-i686: |
|
135 | linux-wheels-i686: | |
135 | docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/packaging/build-linux-wheels.sh |
|
136 | docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/packaging/build-linux-wheels.sh |
General Comments 0
You need to be logged in to leave comments.
Login now