Show More
@@ -1,261 +1,262 | |||||
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 | deb \ |
|
186 | deb \ | |
187 | docker-centos5 \ |
|
187 | docker-centos5 \ | |
188 | docker-centos6 \ |
|
188 | docker-centos6 \ | |
189 | docker-centos7 \ |
|
189 | docker-centos7 \ | |
190 | docker-debian-jessie \ |
|
190 | docker-debian-jessie \ | |
191 | docker-debian-stretch \ |
|
191 | docker-debian-stretch \ | |
192 | docker-fedora20 \ |
|
192 | docker-fedora20 \ | |
193 | docker-fedora21 \ |
|
193 | docker-fedora21 \ | |
194 | docker-fedora28 \ |
|
194 | docker-fedora28 \ | |
195 | docker-fedora29 \ |
|
195 | docker-fedora29 \ | |
196 | docker-ubuntu-trusty \ |
|
196 | docker-ubuntu-trusty \ | |
197 | docker-ubuntu-trusty-ppa \ |
|
197 | docker-ubuntu-trusty-ppa \ | |
198 | docker-ubuntu-xenial \ |
|
198 | docker-ubuntu-xenial \ | |
199 | docker-ubuntu-xenial-ppa \ |
|
199 | docker-ubuntu-xenial-ppa \ | |
200 | docker-ubuntu-artful \ |
|
200 | docker-ubuntu-artful \ | |
201 | docker-ubuntu-artful-ppa \ |
|
201 | docker-ubuntu-artful-ppa \ | |
202 | docker-ubuntu-bionic \ |
|
202 | docker-ubuntu-bionic \ | |
203 | docker-ubuntu-bionic-ppa \ |
|
203 | docker-ubuntu-bionic-ppa \ | |
204 | fedora20 \ |
|
204 | fedora20 \ | |
205 | fedora21 \ |
|
205 | fedora21 \ | |
206 | fedora28 \ |
|
206 | fedora28 \ | |
207 | fedora29 \ |
|
207 | fedora29 \ | |
208 | linux-wheels \ |
|
208 | linux-wheels \ | |
209 | linux-wheels-x86_64 \ |
|
209 | linux-wheels-x86_64 \ | |
210 | linux-wheels-i686 \ |
|
210 | linux-wheels-i686 \ | |
211 | ppa |
|
211 | ppa \ | |
|
212 | rpm | |||
212 |
|
213 | |||
213 | # Forward packaging targets for convenience. |
|
214 | # Forward packaging targets for convenience. | |
214 | $(packaging_targets): |
|
215 | $(packaging_targets): | |
215 | $(MAKE) -C contrib/packaging $@ |
|
216 | $(MAKE) -C contrib/packaging $@ | |
216 |
|
217 | |||
217 | osx: |
|
218 | osx: | |
218 | rm -rf build/mercurial |
|
219 | rm -rf build/mercurial | |
219 | /usr/bin/python2.7 setup.py install --optimize=1 \ |
|
220 | /usr/bin/python2.7 setup.py install --optimize=1 \ | |
220 | --root=build/mercurial/ --prefix=/usr/local/ \ |
|
221 | --root=build/mercurial/ --prefix=/usr/local/ \ | |
221 | --install-lib=/Library/Python/2.7/site-packages/ |
|
222 | --install-lib=/Library/Python/2.7/site-packages/ | |
222 | make -C doc all install DESTDIR="$(PWD)/build/mercurial/" |
|
223 | make -C doc all install DESTDIR="$(PWD)/build/mercurial/" | |
223 | # Place a bogon .DS_Store file in the target dir so we can be |
|
224 | # Place a bogon .DS_Store file in the target dir so we can be | |
224 | # sure it doesn't get included in the final package. |
|
225 | # sure it doesn't get included in the final package. | |
225 | touch build/mercurial/.DS_Store |
|
226 | touch build/mercurial/.DS_Store | |
226 | # install zsh completions - this location appears to be |
|
227 | # install zsh completions - this location appears to be | |
227 | # searched by default as of macOS Sierra. |
|
228 | # searched by default as of macOS Sierra. | |
228 | install -d build/mercurial/usr/local/share/zsh/site-functions/ |
|
229 | install -d build/mercurial/usr/local/share/zsh/site-functions/ | |
229 | install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg |
|
230 | install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg | |
230 | # install bash completions - there doesn't appear to be a |
|
231 | # install bash completions - there doesn't appear to be a | |
231 | # place that's searched by default for bash, so we'll follow |
|
232 | # place that's searched by default for bash, so we'll follow | |
232 | # the lead of Apple's git install and just put it in a |
|
233 | # the lead of Apple's git install and just put it in a | |
233 | # location of our own. |
|
234 | # location of our own. | |
234 | install -d build/mercurial/usr/local/hg/contrib/ |
|
235 | install -d build/mercurial/usr/local/hg/contrib/ | |
235 | install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash |
|
236 | install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash | |
236 | make -C contrib/chg \ |
|
237 | make -C contrib/chg \ | |
237 | HGPATH=/usr/local/bin/hg \ |
|
238 | HGPATH=/usr/local/bin/hg \ | |
238 | PYTHON=/usr/bin/python2.7 \ |
|
239 | PYTHON=/usr/bin/python2.7 \ | |
239 | HGEXTDIR=/Library/Python/2.7/site-packages/hgext \ |
|
240 | HGEXTDIR=/Library/Python/2.7/site-packages/hgext \ | |
240 | DESTDIR=../../build/mercurial \ |
|
241 | DESTDIR=../../build/mercurial \ | |
241 | PREFIX=/usr/local \ |
|
242 | PREFIX=/usr/local \ | |
242 | clean install |
|
243 | clean install | |
243 | mkdir -p $${OUTPUTDIR:-dist} |
|
244 | mkdir -p $${OUTPUTDIR:-dist} | |
244 | HGVER=$$(python contrib/genosxversion.py $(OSXVERSIONFLAGS) build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py) && \ |
|
245 | HGVER=$$(python contrib/genosxversion.py $(OSXVERSIONFLAGS) build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py) && \ | |
245 | OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \ |
|
246 | OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \ | |
246 | pkgbuild --filter \\.DS_Store --root build/mercurial/ \ |
|
247 | pkgbuild --filter \\.DS_Store --root build/mercurial/ \ | |
247 | --identifier org.mercurial-scm.mercurial \ |
|
248 | --identifier org.mercurial-scm.mercurial \ | |
248 | --version "$${HGVER}" \ |
|
249 | --version "$${HGVER}" \ | |
249 | build/mercurial.pkg && \ |
|
250 | build/mercurial.pkg && \ | |
250 | productbuild --distribution contrib/packaging/macosx/distribution.xml \ |
|
251 | productbuild --distribution contrib/packaging/macosx/distribution.xml \ | |
251 | --package-path build/ \ |
|
252 | --package-path build/ \ | |
252 | --version "$${HGVER}" \ |
|
253 | --version "$${HGVER}" \ | |
253 | --resources contrib/packaging/macosx/ \ |
|
254 | --resources contrib/packaging/macosx/ \ | |
254 | "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg |
|
255 | "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg | |
255 |
|
256 | |||
256 | .PHONY: help all local build doc cleanbutpackages clean install install-bin \ |
|
257 | .PHONY: help all local build doc cleanbutpackages clean install install-bin \ | |
257 | install-doc install-home install-home-bin install-home-doc \ |
|
258 | install-doc install-home install-home-bin install-home-doc \ | |
258 | dist dist-notests check tests rust-tests check-code format-c \ |
|
259 | dist dist-notests check tests rust-tests check-code format-c \ | |
259 | update-pot \ |
|
260 | update-pot \ | |
260 | $(packaging_targets) \ |
|
261 | $(packaging_targets) \ | |
261 | osx |
|
262 | osx |
@@ -1,145 +1,156 | |||||
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_RELEASES := \ |
|
14 | FEDORA_RELEASES := \ | |
15 | 20 \ |
|
15 | 20 \ | |
16 | 21 \ |
|
16 | 21 \ | |
17 | 28 \ |
|
17 | 28 \ | |
18 | 29 |
|
18 | 29 | |
19 |
|
19 | |||
20 | CENTOS_RELEASES := \ |
|
20 | CENTOS_RELEASES := \ | |
21 | 5 \ |
|
21 | 5 \ | |
22 | 6 \ |
|
22 | 6 \ | |
23 | 7 |
|
23 | 7 | |
24 |
|
24 | |||
25 | # Build a Python for these CentOS releases. |
|
25 | # Build a Python for these CentOS releases. | |
26 | CENTOS_WITH_PYTHON_RELEASES := 5 6 |
|
26 | CENTOS_WITH_PYTHON_RELEASES := 5 6 | |
27 |
|
27 | |||
28 | help: |
|
28 | help: | |
29 | @echo 'Packaging Make Targets' |
|
29 | @echo 'Packaging Make Targets' | |
30 | @echo '' |
|
30 | @echo '' | |
31 | @echo 'docker-centos{$(strip $(CENTOS_RELEASES))}' |
|
31 | @echo 'docker-centos{$(strip $(CENTOS_RELEASES))}' | |
32 | @echo ' Build an RPM for a specific CentOS version using Docker.' |
|
32 | @echo ' Build an RPM for a specific CentOS version using Docker.' | |
33 | @echo '' |
|
33 | @echo '' | |
34 | @echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}' |
|
34 | @echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}' | |
35 | @echo ' Build Debian packages specific to a Debian distro using Docker.' |
|
35 | @echo ' Build Debian packages specific to a Debian distro using Docker.' | |
36 | @echo '' |
|
36 | @echo '' | |
37 | @echo 'docker-fedora{$(strip $(FEDORA_RELEASES))}' |
|
37 | @echo 'docker-fedora{$(strip $(FEDORA_RELEASES))}' | |
38 | @echo ' Build an RPM for a specific Fedora version using Docker.' |
|
38 | @echo ' Build an RPM for a specific Fedora version using Docker.' | |
39 | @echo '' |
|
39 | @echo '' | |
40 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}' |
|
40 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}' | |
41 | @echo ' Build Debian package specific to an Ubuntu distro using Docker.' |
|
41 | @echo ' Build Debian package specific to an Ubuntu distro using Docker.' | |
42 | @echo '' |
|
42 | @echo '' | |
43 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}-ppa' |
|
43 | @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}-ppa' | |
44 | @echo ' Build a source-only Debian package specific to an Ubuntu distro' |
|
44 | @echo ' Build a source-only Debian package specific to an Ubuntu distro' | |
45 | @echo ' using Docker.' |
|
45 | @echo ' using Docker.' | |
46 | @echo '' |
|
46 | @echo '' | |
47 | @echo 'linux-wheels' |
|
47 | @echo 'linux-wheels' | |
48 | @echo ' Build Linux manylinux wheels using Docker.' |
|
48 | @echo ' Build Linux manylinux wheels using Docker.' | |
49 | @echo '' |
|
49 | @echo '' | |
50 | @echo 'linux-wheels-{x86_64, i686}' |
|
50 | @echo 'linux-wheels-{x86_64, i686}' | |
51 | @echo ' Build Linux manylinux wheels for a specific architecture using Docker' |
|
51 | @echo ' Build Linux manylinux wheels for a specific architecture using Docker' | |
52 | @echo '' |
|
52 | @echo '' | |
53 | @echo 'deb' |
|
53 | @echo 'deb' | |
54 | @echo ' Build a Debian package locally targeting the current system' |
|
54 | @echo ' Build a Debian package locally targeting the current system' | |
55 | @echo '' |
|
55 | @echo '' | |
56 | @echo 'ppa' |
|
56 | @echo 'ppa' | |
57 | @echo ' Build a Debian source package locally targeting the current system' |
|
57 | @echo ' Build a Debian source package locally targeting the current system' | |
58 | @echo '' |
|
58 | @echo '' | |
|
59 | @echo 'rpm' | |||
|
60 | @echo ' Build a RPM targeting the current system using Python 3' | |||
|
61 | @echo '' | |||
59 | @echo 'centos{$(strip $(CENTOS_RELEASES))}' |
|
62 | @echo 'centos{$(strip $(CENTOS_RELEASES))}' | |
60 | @echo ' Build an RPM for a specific CentOS version locally' |
|
63 | @echo ' Build an RPM for a specific CentOS version locally' | |
61 | @echo '' |
|
64 | @echo '' | |
62 | @echo 'fedora{$(strip $(FEDORA_RELEASES))}' |
|
65 | @echo 'fedora{$(strip $(FEDORA_RELEASES))}' | |
63 | @echo ' Build an RPM for a specific Fedora version locally' |
|
66 | @echo ' Build an RPM for a specific Fedora version locally' | |
64 |
|
67 | |||
65 | .PHONY: help |
|
68 | .PHONY: help | |
66 |
|
69 | |||
67 | .PHONY: deb |
|
70 | .PHONY: deb | |
68 | deb: |
|
71 | deb: | |
69 | ./builddeb |
|
72 | ./builddeb | |
70 |
|
73 | |||
71 | .PHONY: ppa |
|
74 | .PHONY: ppa | |
72 | ppa: |
|
75 | ppa: | |
73 | ./builddeb --source-only |
|
76 | ./builddeb --source-only | |
74 |
|
77 | |||
75 | # Debian targets. |
|
78 | # Debian targets. | |
76 | define debian_targets = |
|
79 | define debian_targets = | |
77 | .PHONY: docker-debian-$(1) |
|
80 | .PHONY: docker-debian-$(1) | |
78 | docker-debian-$(1): |
|
81 | docker-debian-$(1): | |
79 | ./dockerdeb debian $(1) |
|
82 | ./dockerdeb debian $(1) | |
80 |
|
83 | |||
81 | endef |
|
84 | endef | |
82 |
|
85 | |||
83 | $(foreach codename,$(DEBIAN_CODENAMES),$(eval $(call debian_targets,$(codename)))) |
|
86 | $(foreach codename,$(DEBIAN_CODENAMES),$(eval $(call debian_targets,$(codename)))) | |
84 |
|
87 | |||
85 | # Ubuntu targets. |
|
88 | # Ubuntu targets. | |
86 | define ubuntu_targets = |
|
89 | define ubuntu_targets = | |
87 | .PHONY: docker-ubuntu-$(1) |
|
90 | .PHONY: docker-ubuntu-$(1) | |
88 | docker-ubuntu-$(1): |
|
91 | docker-ubuntu-$(1): | |
89 | ./dockerdeb ubuntu $(1) |
|
92 | ./dockerdeb ubuntu $(1) | |
90 |
|
93 | |||
91 | .PHONY: docker-ubuntu-$(1)-ppa |
|
94 | .PHONY: docker-ubuntu-$(1)-ppa | |
92 | docker-ubuntu-$(1)-ppa: |
|
95 | docker-ubuntu-$(1)-ppa: | |
93 | ./dockerdeb ubuntu $(1) --source-only |
|
96 | ./dockerdeb ubuntu $(1) --source-only | |
94 |
|
97 | |||
95 | endef |
|
98 | endef | |
96 |
|
99 | |||
97 | $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename)))) |
|
100 | $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename)))) | |
98 |
|
101 | |||
|
102 | # Generic RPM target, mainly for Fedora/CentOS/RHEL. | |||
|
103 | rpm: | |||
|
104 | mkdir -p $$(HGROOT)/packages/rpm | |||
|
105 | ./buildrpm --python3 | |||
|
106 | cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/rpm | |||
|
107 | cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/rpm | |||
|
108 | rm -rf $(HGROOT)/rpmbuild | |||
|
109 | ||||
99 | # Fedora targets. |
|
110 | # Fedora targets. | |
100 | define fedora_targets |
|
111 | define fedora_targets | |
101 | .PHONY: fedora$(1) |
|
112 | .PHONY: fedora$(1) | |
102 | fedora$(1): |
|
113 | fedora$(1): | |
103 | mkdir -p $$(HGROOT)/packages/fedora$(1) |
|
114 | mkdir -p $$(HGROOT)/packages/fedora$(1) | |
104 | ./buildrpm |
|
115 | ./buildrpm | |
105 | cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/fedora$(1) |
|
116 | cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/fedora$(1) | |
106 | cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/fedora$(1) |
|
117 | cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/fedora$(1) | |
107 | rm -rf $(HGROOT)/rpmbuild |
|
118 | rm -rf $(HGROOT)/rpmbuild | |
108 |
|
119 | |||
109 | .PHONY: docker-fedora$(1) |
|
120 | .PHONY: docker-fedora$(1) | |
110 | docker-fedora$(1): |
|
121 | docker-fedora$(1): | |
111 | mkdir -p $$(HGROOT)/packages/fedora$(1) |
|
122 | mkdir -p $$(HGROOT)/packages/fedora$(1) | |
112 | ./dockerrpm fedora$(1) |
|
123 | ./dockerrpm fedora$(1) | |
113 |
|
124 | |||
114 | endef |
|
125 | endef | |
115 |
|
126 | |||
116 | $(foreach release,$(FEDORA_RELEASES),$(eval $(call fedora_targets,$(release)))) |
|
127 | $(foreach release,$(FEDORA_RELEASES),$(eval $(call fedora_targets,$(release)))) | |
117 |
|
128 | |||
118 | # CentOS targets. |
|
129 | # CentOS targets. | |
119 | define centos_targets |
|
130 | define centos_targets | |
120 | .PHONY: centos$(1) |
|
131 | .PHONY: centos$(1) | |
121 | centos$(1): |
|
132 | centos$(1): | |
122 | mkdir -p $$(HGROOT)/packages/centos$(1) |
|
133 | mkdir -p $$(HGROOT)/packages/centos$(1) | |
123 | ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython) |
|
134 | ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython) | |
124 | cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1) |
|
135 | cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1) | |
125 | cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1) |
|
136 | cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1) | |
126 |
|
137 | |||
127 | .PHONY: docker-centos$(1) |
|
138 | .PHONY: docker-centos$(1) | |
128 | docker-centos$(1): |
|
139 | docker-centos$(1): | |
129 | mkdir -p $$(HGROOT)/packages/centos$(1) |
|
140 | mkdir -p $$(HGROOT)/packages/centos$(1) | |
130 | ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython) |
|
141 | ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython) | |
131 |
|
142 | |||
132 | endef |
|
143 | endef | |
133 |
|
144 | |||
134 | $(foreach release,$(CENTOS_RELEASES),$(eval $(call centos_targets,$(release)))) |
|
145 | $(foreach release,$(CENTOS_RELEASES),$(eval $(call centos_targets,$(release)))) | |
135 |
|
146 | |||
136 | .PHONY: linux-wheels |
|
147 | .PHONY: linux-wheels | |
137 | linux-wheels: linux-wheels-x86_64 linux-wheels-i686 |
|
148 | linux-wheels: linux-wheels-x86_64 linux-wheels-i686 | |
138 |
|
149 | |||
139 | .PHONY: linux-wheels-x86_64 |
|
150 | .PHONY: linux-wheels-x86_64 | |
140 | linux-wheels-x86_64: |
|
151 | linux-wheels-x86_64: | |
141 | 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 |
|
152 | 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 | |
142 |
|
153 | |||
143 | .PHONY: linux-wheels-i686 |
|
154 | .PHONY: linux-wheels-i686 | |
144 | linux-wheels-i686: |
|
155 | linux-wheels-i686: | |
145 | 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 |
|
156 | 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