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