]>
Commit | Line | Data |
---|---|---|
be771b38 LB |
1 | #!/usr/bin/make -f |
2 | # -*- makefile -*- | |
3 | ||
b59979d9 | 4 | include /usr/share/dpkg/pkg-info.mk |
6472c211 | 5 | include /usr/share/dpkg/vendor.mk |
d75d48d6 | 6 | include /usr/share/dpkg/architecture.mk |
b5dfb68c XL |
7 | SED_VERSION_SHORT := sed -re 's/([^.]+)\.([^.]+)\..*/\1.\2/' |
8 | RUST_VERSION := $(shell echo '$(DEB_VERSION_UPSTREAM)' | $(SED_VERSION_SHORT)) | |
9 | RUST_LONG_VERSION := $(shell echo '$(DEB_VERSION_UPSTREAM)' | sed -re 's/([^+]+).*/\1/') | |
10 | LIBSTD_PKG := libstd-rust-$(RUST_VERSION) | |
11 | # Sed expression that matches the "rustc" we have in our Build-Depends field | |
12 | SED_RUSTC_BUILDDEP := sed -ne "/^Build-Depends:/,/^[^[:space:]\#]/{/^ *rustc:native .*,/p}" debian/control | |
13 | ||
7d40d3e1 | 14 | include /usr/share/dpkg/buildflags.mk |
4888e768 | 15 | # TODO: more correct to use `[build] rustflags = []` list syntax in Cargo.toml |
9197bf09 | 16 | RUSTFLAGS = $(addprefix -C link-args=,$(LDFLAGS)) |
7d40d3e1 | 17 | export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS |
db30700e | 18 | # set remap-path-prefix for reproducible builds |
9197bf09 XL |
19 | RUSTFLAGS += -Zremap-path-prefix-from=$(CURDIR) -Zremap-path-prefix-to=/usr/src/rustc-$(RUST_LONG_VERSION) |
20 | export RUSTC_BOOTSTRAP = 1 | |
ab330327 XL |
21 | ifneq (,$(filter $(DEB_BUILD_ARCH), sparc64)) |
22 | export CARGO_INCREMENTAL = 0 | |
23 | endif | |
b59979d9 | 24 | |
525ff0f9 AL |
25 | # Defines DEB_*_RUST_TYPE triples |
26 | include debian/architecture.mk | |
693daed7 | 27 | export DEB_HOST_RUST_TYPE |
525ff0f9 | 28 | |
be771b38 LB |
29 | # Uncomment this to turn on verbose mode. |
30 | #export DH_VERBOSE=1 | |
31 | ||
c2a1d9e3 AL |
32 | # src/rt/miniz.c (incorrectly) triggers -Wmisleading-indentation with |
33 | # gcc-6. See bug #811573. | |
34 | CFLAGS += -Wno-misleading-indentation | |
35 | ||
d4357a26 | 36 | # Release type (one of beta, stable or nightly) |
0f9154de | 37 | RELEASE_CHANNEL := stable |
6935ded2 XL |
38 | # See also ./build-preview-dsc.sh for a script that builds a beta/nightly .dsc |
39 | # out of this packaging. Furthermore, if the build breaks after importing a new | |
40 | # upstream stable release, check the do_temporary_fixup function in that file | |
41 | # to see if we already know what fix to make. | |
d4357a26 | 42 | |
8354de7a | 43 | DEB_DESTDIR := $(CURDIR)/debian/tmp |
525ff0f9 | 44 | |
525ff0f9 | 45 | # Use system LLVM (comment out to use vendored LLVM) |
9903f2da XL |
46 | LLVM_VERSION = 6.0 |
47 | OLD_LLVM_VERSION = 4.0 | |
2b7c35b5 XL |
48 | # Make it easier to test against a custom LLVM |
49 | ifneq (,$(LLVM_DESTDIR)) | |
56548b60 XL |
50 | LLVM_LIBRARY_PATH := $(LLVM_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH):$(LLVM_DESTDIR)/usr/lib |
51 | LD_LIBRARY_PATH := $(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):$(LLVM_LIBRARY_PATH),$(LLVM_LIBRARY_PATH)) | |
2b7c35b5 XL |
52 | export LD_LIBRARY_PATH |
53 | endif | |
2b7c35b5 | 54 | |
8e396fda | 55 | RUSTBUILD = RUST_BACKTRACE=1 ./x.py |
3613a4e9 | 56 | RUSTBUILD_FLAGS = --config debian/config.toml -v --on-fail env |
f1b4ffd3 XL |
57 | # TODO: This should simply be "$(RUSTBUILD) test" but unfortunately this causes |
58 | # an insane blow up in the time it takes to run tests. See upstream #37477 for | |
59 | # details. Upstream worked around it in #38984 but in Debian we can't take | |
60 | # advantage of that work-around, because we want as much debuginfo as possible | |
61 | # (so we set debuginfo-lines = true, debuginfo-only-std = false) so we have to | |
62 | # work around it instead by disabling backtrace when running tests. | |
63 | RUSTBUILD_TEST = ./x.py test | |
0d3674eb XL |
64 | # To run a specific test, run something like: |
65 | # $ debian/rules override_dh_auto_test-arch \ | |
66 | # RUSTBUILD_TEST_FLAGS="src/test/run-make --test-args extern-fn-struct" | |
67 | # See src/bootstrap/README.md for more options. | |
68 | RUSTBUILD_TEST_FLAGS = | |
1c8ac2b0 | 69 | |
25f1c2fe XL |
70 | update-version: |
71 | oldver=$(shell $(SED_RUSTC_BUILDDEP) | sed -ne 's/.*(<= \(.*\)).*/\1/gp' | $(SED_VERSION_SHORT)); \ | |
72 | newver=$(RUST_VERSION); \ | |
a4a65e1e | 73 | if [ $$oldver != $$newver ]; then debian/update-version.sh $$oldver $$newver $(CARGO_NEW); fi |
25f1c2fe | 74 | |
427dce5b XL |
75 | # Below we detect how we're supposed to bootstrap the stage0 compiler. See |
76 | # README.Debian for more details of the cases described below. | |
77 | # | |
427dce5b | 78 | PRECONFIGURE_CHECK = : |
75be2bb3 | 79 | HAVE_BINARY_TARBALL := $(shell ls -1 stage0/*/*$(DEB_HOST_RUST_TYPE)* 2>/dev/null | wc -l) |
5861ebac | 80 | DOWNLOAD_BOOTSTRAP := false |
571f0d20 MK |
81 | # allow not using the binary tarball although it exists |
82 | #ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf i386 powerpc ppc64el s390x)) | |
83 | # HAVE_BINARY_TARBALL := 0 | |
84 | #endif | |
85 | ifeq (0,$(HAVE_BINARY_TARBALL)) | |
16dfb283 XL |
86 | # Case A (Building from source): the extracted source tree does not include |
87 | # a bootstrapping tarball for the current architecture e.g. because the | |
88 | # distro already has a rustc for this arch, or the uploader expects that | |
89 | # this requirement be fulfilled in some other way. | |
427dce5b XL |
90 | # |
91 | # Case A-1: the builder did not select the "pkg.rustc.dlstage0" build profile. | |
92 | # In this case, we use the distro's rustc - either the previous or current version. | |
93 | ifeq (,$(findstring pkg.rustc.dlstage0,$(DEB_BUILD_PROFILES))) | |
56548b60 XL |
94 | # Make it easier to test against a custom rustc |
95 | ifneq (,$(RUST_DESTDIR)) | |
96 | RUST_LIBRARY_PATH := $(RUST_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH):$(RUST_DESTDIR)/usr/lib | |
97 | LD_LIBRARY_PATH := $(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):$(RUST_LIBRARY_PATH),$(RUST_LIBRARY_PATH)) | |
98 | export LD_LIBRARY_PATH | |
99 | endif | |
427dce5b XL |
100 | # |
101 | # Case A-2: the builder selected the "dlstage0" build profile. | |
75be2bb3 | 102 | # In this case, the rust build scripts will download a stage0 into stage0/ and use that. |
b9a40c91 | 103 | # We don't need to do anything specific in this build file, so this case is empty. |
5861ebac XL |
104 | else |
105 | DOWNLOAD_BOOTSTRAP := true | |
106 | endif | |
427dce5b | 107 | else |
16dfb283 XL |
108 | # Case B (Bootstrapping a new distro): the extracted source tree does |
109 | # include a bootstrapping tarball for the current architecture; see the | |
75be2bb3 | 110 | # `source_orig-stage0` target below on how to build this. |
427dce5b XL |
111 | # |
112 | # In this case, we'll bootstrap from the stage0 given in that tarball. | |
113 | # To ensure the uploader of the .dsc didn't make a mistake, we first check | |
16dfb283 | 114 | # that rustc isn't a Build-Depends for the current architecture. |
25f1c2fe XL |
115 | ifneq (,$(shell $(SED_RUSTC_BUILDDEP))) |
116 | ifeq (,$(shell $(SED_RUSTC_BUILDDEP) | grep '!$(DEB_HOST_ARCH)')) | |
75be2bb3 | 117 | PRECONFIGURE_CHECK = $(error found matches for stage0/*/*$(DEB_HOST_RUST_TYPE)*, \ |
16dfb283 XL |
118 | but rustc might be a Build-Depends for $(DEB_HOST_ARCH)) |
119 | endif | |
427dce5b | 120 | endif |
1c8ac2b0 SL |
121 | endif |
122 | ||
5861ebac | 123 | BUILD_DOCS := true |
120b4d47 | 124 | ifneq (,$(findstring nodoc,$(DEB_BUILD_PROFILES))) |
5861ebac | 125 | BUILD_DOCS := false |
1c8ac2b0 SL |
126 | endif |
127 | ||
5861ebac | 128 | MAKE_OPTIMISATIONS := true |
1c8ac2b0 | 129 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
5861ebac | 130 | MAKE_OPTIMISATIONS := false |
1c8ac2b0 SL |
131 | endif |
132 | ||
35329365 | 133 | # Build products or non-source files in src/, that shouldn't go in rust-src |
9a2ab7ea | 134 | SRC_CLEAN = src/bootstrap/bootstrap.pyc \ |
35329365 | 135 | src/etc/__pycache__/ |
1c8ac2b0 | 136 | |
170f9149 XL |
137 | # Workaround for linux #865549 |
138 | ifeq (0,$(shell test $$(uname -s) = "Linux" -a $$(getconf PAGESIZE) -gt 4096; echo $$?)) | |
139 | SYSTEM_WORKAROUNDS += ulimit -s $$(expr $$(getconf PAGESIZE) / 1024 '*' 256 + 8192); | |
140 | endif | |
141 | ||
be771b38 | 142 | %: |
170f9149 | 143 | $(SYSTEM_WORKAROUNDS) dh $@ --parallel |
be771b38 | 144 | |
04c12273 XL |
145 | .PHONY: build |
146 | build: | |
170f9149 | 147 | $(SYSTEM_WORKAROUNDS) dh $@ --parallel |
04c12273 | 148 | |
de1de54b | 149 | override_dh_clean: |
cf0b146d XL |
150 | # Upstream contains a lot of these |
151 | dh_clean -XCargo.toml.orig | |
de1de54b | 152 | |
01dc6ef4 XL |
153 | debian/config.toml: debian/config.toml.in |
154 | m4 -DDEB_BUILD_RUST_TYPE="$(DEB_BUILD_RUST_TYPE)" \ | |
155 | -DDEB_HOST_RUST_TYPE="$(DEB_HOST_RUST_TYPE)" \ | |
156 | -DDEB_TARGET_RUST_TYPE="$(DEB_TARGET_RUST_TYPE)" \ | |
157 | -DRELEASE_CHANNEL="$(RELEASE_CHANNEL)" \ | |
5861ebac XL |
158 | -DBUILD_DOCS="$(BUILD_DOCS)" \ |
159 | -DMAKE_OPTIMISATIONS="$(MAKE_OPTIMISATIONS)" \ | |
2b7c35b5 | 160 | -DLLVM_DESTDIR="$(LLVM_DESTDIR)" \ |
666f0397 | 161 | -DLLVM_VERSION="$(LLVM_VERSION)" \ |
5861ebac | 162 | -DRUST_DESTDIR="$(RUST_DESTDIR)" \ |
01dc6ef4 | 163 | "$<" > "$@" |
5861ebac | 164 | ! $(DOWNLOAD_BOOTSTRAP) || sed -i -e '/^rustc = /d' -e '/^cargo = /d' "$@" |
aae6ad1d | 165 | # Work around armhf issue: https://github.com/rust-lang/rust/issues/45854 |
f25948bb XL |
166 | [ $(DEB_BUILD_ARCH) != armhf -a \ |
167 | $(DEB_BUILD_ARCH) != armel ] || sed -i -e '/^debuginfo-only-std = /d' "$@" | |
01dc6ef4 | 168 | |
b5dfb68c XL |
169 | debian/rust-src.%: debian/rust-src.%.in |
170 | m4 -DRUST_LONG_VERSION="$(RUST_LONG_VERSION)" \ | |
171 | "$<" > "$@" | |
172 | ||
01dc6ef4 | 173 | override_dh_auto_configure: debian/config.toml |
5617e1bd | 174 | # fail the build if we have any instances of OLD_LLVM_VERSION in debian, except for debian/changelog |
666f0397 | 175 | ! grep --color=always -i 'll...\?$(subst .,\.,$(OLD_LLVM_VERSION))' --exclude=changelog -R debian |
427dce5b | 176 | $(PRECONFIGURE_CHECK) |
75be2bb3 | 177 | if [ -d stage0 ]; then mkdir -p build && ln -sfT ../stage0 build/cache; fi |
3281855a XL |
178 | # work around #842634 |
179 | if test $$(grep "127.0.0.1\s*localhost" /etc/hosts | wc -l) -gt 1; then \ | |
ed6f7eed | 180 | debian/ensure-patch -N debian/patches/d-host-duplicates.patch; fi |
6b0d97fc | 181 | # We patched mdbook so have to rm the checksums |
81fd74bc | 182 | debian/prune-checksums src/vendor/mdbook/.cargo-checksum.json |
6b0d97fc XL |
183 | # Unfortunately upstream uses a duplicate copy of libbacktrace and wants to |
184 | # compile it again for rust-installer, see #43449 | |
185 | ln -rsf src/libbacktrace -t src/vendor/backtrace-sys/src/ | |
e9a8101d | 186 | debian/prune-checksums src/vendor/backtrace-sys/.cargo-checksum.json |
6b0d97fc XL |
187 | # Link against system liblzma, see https://github.com/alexcrichton/xz2-rs/issues/16 |
188 | echo 'fn main() { println!("cargo:rustc-link-lib=lzma"); }' > src/vendor/lzma-sys/build.rs | |
e9a8101d | 189 | debian/prune-checksums src/vendor/lzma-sys/.cargo-checksum.json |
17c620a5 XL |
190 | # Other partially-excluded vendor crates in d/copyright |
191 | debian/prune-checksums src/vendor/winapi-*/.cargo-checksum.json | |
192 | debian/prune-checksums src/vendor/shlex/.cargo-checksum.json | |
5861ebac XL |
193 | # We don't run ./configure because we use debian/config.toml directly |
194 | ln -sf debian/config.toml config.toml | |
1c8ac2b0 | 195 | |
11c430be | 196 | override_dh_auto_clean: |
f40dfcc0 | 197 | $(RM) -rf ./build ./tmp ./.cargo config.stamp config.mk Makefile |
55792af1 XL |
198 | $(RM) -rf $(TEST_LOG) debian/config.toml debian/rust-src.install debian/rust-src.links |
199 | $(RM) -rf $(SRC_CLEAN) config.toml src/vendor/backtrace-sys/src/libbacktrace | |
11c430be | 200 | |
ea192313 XL |
201 | # upstream bundles this in the source, but in Debian we rebuild everything yo |
202 | generate-sources: | |
9a2ab7ea | 203 | true |
1c8ac2b0 | 204 | |
ea192313 | 205 | override_dh_auto_build-arch: generate-sources |
04c12273 | 206 | $(RUSTBUILD) build $(RUSTBUILD_FLAGS) |
ea192313 | 207 | |
e408bc2c XL |
208 | # note: this is only for buildds that want to do a separate arch:all build; |
209 | # there is no point running this yourself "to save time" since it implicitly | |
210 | # depends on build-arch anyways. | |
ea192313 | 211 | override_dh_auto_build-indep: generate-sources |
5861ebac | 212 | ifeq (true,$(BUILD_DOCS)) |
1fd63ebe XL |
213 | # Rust has a weird way of configuring whether to build docs or not |
214 | sed -i -e 's/^docs = false/docs = true/' debian/config.toml | |
04c12273 XL |
215 | $(RUSTBUILD) doc $(RUSTBUILD_FLAGS) |
216 | endif | |
217 | ||
3a774f0f XL |
218 | TEST_LOG = debian/rustc-tests.log |
219 | FAILURES_ALLOWED = 5 | |
ab330327 XL |
220 | ifneq (,$(filter $(DEB_BUILD_ARCH), s390x)) |
221 | FAILURES_ALLOWED = 15 | |
222 | endif | |
734d072d XL |
223 | ifneq (,$(filter $(DEB_BUILD_ARCH), powerpc powerpcspe sparc64 x32)) |
224 | FAILURES_ALLOWED = 160 | |
225 | endif | |
3a774f0f | 226 | FAILED_TESTS = grep FAILED $(TEST_LOG) | grep -v '^test result' |
7958f3db | 227 | override_dh_auto_test-arch: |
347f6206 XL |
228 | # ensure that rustc_llvm is actually dynamically linked to libLLVM |
229 | set -e; find build/*/stage2/lib/rustlib/* -name '*rustc_llvm*.so' | \ | |
230 | while read x; do \ | |
231 | stat -c '%s %n' "$$x"; \ | |
232 | objdump -p "$$x" | grep -q "NEEDED.*LLVM"; \ | |
233 | test "$$(stat -c %s "$$x")" -lt 6000000; \ | |
234 | done | |
68e7eb97 | 235 | ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES))) |
7958f3db | 236 | ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS))) |
3a774f0f XL |
237 | $(RUSTBUILD_TEST) --no-fail-fast $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS) | tee $(TEST_LOG) |
238 | test -f $(TEST_LOG) | |
239 | echo "Summary of specific test failures:"; \ | |
240 | $(FAILED_TESTS); \ | |
241 | num_failures=$$($(FAILED_TESTS) | wc -l); \ | |
242 | echo -n "$${num_failures} tests failed, $(FAILURES_ALLOWED) maximum allowed. "; \ | |
243 | if test "$${num_failures}" -le $(FAILURES_ALLOWED); then \ | |
244 | echo "Continuing..."; \ | |
245 | else \ | |
246 | echo "Aborting the build."; \ | |
247 | echo "Check the logs further above for details."; \ | |
248 | false; \ | |
249 | fi | |
0d3674eb XL |
250 | # don't continue if RUSTBUILD_TEST_FLAGS is non-empty |
251 | test -z "$(RUSTBUILD_TEST_FLAGS)" | |
e408bc2c | 252 | endif |
68e7eb97 | 253 | endif |
becfe001 | 254 | |
04c12273 | 255 | override_dh_auto_test-indep: |
5861ebac | 256 | ifeq (true,$(BUILD_DOCS)) |
68e7eb97 | 257 | ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES))) |
7958f3db XL |
258 | ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS))) |
259 | # Run all rules that test the docs, i.e. in step.rs that depend on default:doc | |
3a774f0f | 260 | $(RUSTBUILD_TEST) --no-fail-fast src/tools/linkchecker $(RUSTBUILD_FLAGS) |
7958f3db XL |
261 | endif |
262 | endif | |
68e7eb97 | 263 | endif |
04c12273 | 264 | |
bf52bd52 XL |
265 | run_rustbuild: |
266 | DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) $(X_CMD) $(RUSTBUILD_FLAGS) $(X_FLAGS) | |
267 | ||
23d2674b | 268 | override_dh_auto_install: |
6a9e99e9 | 269 | DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) install $(RUSTBUILD_FLAGS) |
525ff0f9 AL |
270 | |
271 | mkdir -p $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/ | |
272 | mv $(DEB_DESTDIR)/usr/lib/lib*.so $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/ | |
6fce0a99 | 273 | |
1261b4b3 | 274 | # Replace duplicated compile-time/run-time dylibs with symlinks |
525ff0f9 AL |
275 | @set -e; \ |
276 | for f in $(DEB_DESTDIR)/usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/lib*.so; do \ | |
277 | name=$${f##*/}; \ | |
278 | if [ -f "$(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/$$name" ]; then \ | |
279 | echo "ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f"; \ | |
280 | ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f; \ | |
281 | fi; \ | |
1261b4b3 AL |
282 | done |
283 | ||
5861ebac | 284 | ifeq (true,$(BUILD_DOCS)) |
6fce0a99 SL |
285 | # Brute force to remove privacy-breach-logo lintian warning. |
286 | # We could have updated the upstream sources but it would complexify | |
287 | # the rebase | |
b556761e AL |
288 | @set -e; \ |
289 | find $(DEB_DESTDIR)/usr/share/doc/rust/html -iname '*.html' | \ | |
1add0b94 | 290 | while read file; do \ |
b556761e | 291 | topdir=$$(echo "$$file" | sed 's,^$(DEB_DESTDIR)/usr/share/doc/rust/html/,,; s,/[^/]*$$,/,; s,^[^/]*$$,,; s,[^/]\+/,../,g'); \ |
92f6ea48 | 292 | sed -i -e "s,https://doc.rust-lang.org/\(favicon.ico\|logos/rust-logo-32x32-blk.png\),$${topdir}rust-logo-32x32-blk.png," \ |
87a30969 | 293 | -e "s,https://www.rust-lang.org/\(favicon.ico\|logos/rust-logo-32x32-blk.png\),$${topdir}rust-logo-32x32-blk.png," "$$file"; \ |
1add0b94 | 294 | done |
b125a683 MO |
295 | find $(DEB_DESTDIR) \( -iname '*.html' -empty -o -name .lock -o -name '*.inc' \) -delete; |
296 | endif | |
297 | ||
cf9ecdde | 298 | override_dh_install-arch: |
6fce0a99 | 299 | dh_install |
525ff0f9 | 300 | dh_install -p$(LIBSTD_PKG) usr/lib/$(DEB_HOST_MULTIARCH)/ |
cd17b70a | 301 | dh_install -plibstd-rust-dev usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/ |
b4ca3996 | 302 | dh_install -prustc usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/codegen-backends/ |
525ff0f9 | 303 | |
b5dfb68c | 304 | override_dh_install-indep: debian/rust-src.install debian/rust-src.links |
a0022868 | 305 | dh_install |
525ff0f9 AL |
306 | chmod -x \ |
307 | debian/rust-gdb/usr/share/rust-gdb/*.py \ | |
308 | debian/rust-lldb/usr/share/rust-lldb/*.py | |
b5dfb68c | 309 | $(RM) -rf $(SRC_CLEAN:%=debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION)/%) |
f40dfcc0 | 310 | # Get rid of lintian warnings |
b5dfb68c | 311 | find debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION) \ |
f40dfcc0 XL |
312 | \( -name .gitignore \ |
313 | -o -name 'LICENSE*' \ | |
314 | -o -name 'LICENCE' \ | |
315 | -o -name 'license' \ | |
316 | -o -name 'COPYING*' \ | |
317 | \) -delete | |
8d3e3cd2 XL |
318 | # Remove files that autoload remote resources, caught by lintian |
319 | $(RM) -rf debian/rust-src/usr/src/rustc-*/src/tools/clippy/util/gh-pages/* | |
320 | $(RM) -rf debian/rust-src/usr/src/rustc-*/src/vendor/cssparser/docs/*.html | |
321 | $(RM) -rf debian/rust-src/usr/src/rustc-*/src/vendor/kuchiki/docs/*.html | |
b83d58fc XL |
322 | $(RM) -rf debian/rust-src/usr/src/rustc-*/src/vendor/url/docs/*.html |
323 | $(RM) -rf debian/rust-src/usr/src/rustc-*/src/vendor/xz2/.gitmodules | |
1c8ac2b0 | 324 | |
bc0aa84e AL |
325 | override_dh_installchangelogs: |
326 | dh_installchangelogs RELEASES.md | |
327 | ||
328 | override_dh_installdocs: | |
329 | dh_installdocs -X.tex -X.aux -X.log -X.out -X.toc | |
330 | ||
5c515547 XL |
331 | override_dh_missing: |
332 | dh_missing --list-missing | |
333 | ||
eef1f4e3 AL |
334 | override_dh_compress: |
335 | dh_compress -X.woff | |
336 | ||
d2456730 XL |
337 | override_dh_strip: |
338 | # Work around #35733, #468333 | |
339 | find debian/libstd-rust-dev/ -name '*.rlib' -execdir mv '{}' '{}.a' \; | |
340 | # This is expected to print out lots of "File format unrecognized" warnings about | |
341 | # rust.metadata.bin and *.deflate but the .o files inside the rlibs should be stripped | |
342 | # Some files are still omitted because of #875780 however. | |
343 | dh_strip -v | |
344 | find debian/libstd-rust-dev/ -name '*.rlib.a' -execdir sh -c 'mv "$$1" "$${1%.a}"' - '{}' \; | |
345 | ||
525ff0f9 AL |
346 | override_dh_makeshlibs: |
347 | dh_makeshlibs -V | |
348 | ||
349 | # dh_makeshlibs doesn't support our "libfoo-version.so" naming | |
350 | # structure, so we have to do this ourselves. | |
351 | install -o 0 -g 0 -d debian/$(LIBSTD_PKG)/DEBIAN | |
33766656 | 352 | LC_ALL=C ls debian/$(LIBSTD_PKG)/usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so | \ |
525ff0f9 AL |
353 | sed -n 's,^.*/\(lib.*\)-\(.\+\)\.so$$,\1 \2,p' | \ |
354 | while read name version; do \ | |
355 | echo "$$name $$version $(LIBSTD_PKG) (>= $(DEB_VERSION_UPSTREAM))"; \ | |
356 | done > debian/$(LIBSTD_PKG)/DEBIAN/shlibs | |
357 | chmod 644 debian/$(LIBSTD_PKG)/DEBIAN/shlibs | |
358 | chown 0:0 debian/$(LIBSTD_PKG)/DEBIAN/shlibs | |
359 | ||
360 | override_dh_shlibdeps: | |
361 | dh_shlibdeps -- -x$(LIBSTD_PKG) | |
427dce5b XL |
362 | |
363 | QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE = x=$$?; if [ $$x = 2 ]; then exit 0; else exit $$x; fi | |
75be2bb3 | 364 | source_orig-stage0: |
16dfb283 XL |
365 | QUILT_PATCHES=debian/patches quilt push -aq; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE) |
366 | $(MAKE) -f debian/rules clean | |
75be2bb3 | 367 | debian/make_orig-stage0_tarball.sh |
16dfb283 XL |
368 | QUILT_PATCHES=debian/patches quilt pop -aq; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE) |
369 | rm -rf .pc | |
15ab0b38 XL |
370 | |
371 | debian/watch-beta: debian/watch-beta.in debian/rules | |
372 | oldver=$(shell echo $(RUST_LONG_VERSION) | sed -e 's/\./\\./g'); \ | |
373 | newver=$(shell echo $(RUST_VERSION) | perl -lpe 's/(\d+)\.(\d+)/$$1 . "." . ($$2+1)/e'); \ | |
374 | m4 -DOLDVER="$$oldver" -DNEWVER="$$newver.0" "$<" > "$@" | |
375 | ||
376 | source_orig-beta: debian/watch-beta | |
377 | uscan $(USCAN_OPTS) --watchfile "$<" |