Update to debhelper 13, simplifying build rules

This commit is contained in:
Ximin Luo 2021-10-22 21:44:31 +01:00
parent 209a135442
commit eede854500
15 changed files with 36 additions and 54 deletions

2
debian/.gitignore vendored
View File

@ -10,8 +10,6 @@
/rust-gdb/
/rust-lldb/
/rust-src/
/rust-src.install
/rust-src.links
/rustc/
/tmp/
/patches/*~

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
rustc (1.56.0+dfsg1-2) UNRELEASED; urgency=medium
* Update to debhelper 13.
-- Ximin Luo <infinity0@debian.org> Fri, 22 Oct 2021 21:39:52 +0100
rustc (1.56.0+dfsg1-1) unstable; urgency=medium
* New upstream release.

2
debian/control vendored
View File

@ -9,7 +9,7 @@ Rules-Requires-Root: no
# :native annotations are to support cross-compiling, see README.Debian
Build-Depends:
debhelper (>= 9),
debhelper-compat (= 12),
debhelper-compat (= 13),
dpkg-dev (>= 1.17.14),
python3:native,
cargo:native (>= 0.40.0) <!pkg.rustc.dlstage0>,

1
debian/libstd-rust-1.56.install vendored Normal file
View File

@ -0,0 +1 @@
usr/lib/${DEB_HOST_MULTIARCH}/

1
debian/libstd-rust-dev-wasm32.install vendored Normal file
View File

@ -0,0 +1 @@
usr/lib/rustlib/wasm32-*/lib/

View File

@ -0,0 +1 @@
usr/lib/rustlib/${env:WINDOWS_ARCH}-pc-windows-gnu/lib/

1
debian/libstd-rust-dev.install vendored Normal file
View File

@ -0,0 +1 @@
usr/lib/rustlib/${env:DEB_HOST_RUST_TYPE}/lib/

39
debian/rules vendored
View File

@ -19,10 +19,11 @@ export CARGO_HOME = $(CURDIR)/debian/cargo
# Defines DEB_*_RUST_TYPE triples
include debian/architecture.mk
# for dh_install substitution variable
export DEB_HOST_RUST_TYPE
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# for dh_install substitution variable
export RUST_LONG_VERSION
DEB_DESTDIR := $(CURDIR)/debian/tmp
@ -140,6 +141,8 @@ else
WINDOWS_ARCH := x86_64
endif
endif
# for dh_install substitution variable
export WINDOWS_ARCH
MAKE_OPTIMISATIONS := true
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@ -198,16 +201,6 @@ ifneq (,$(filter $(DEB_BUILD_ARCH), armhf armel mips mipsel powerpc powerpcspe))
sed -i -e 's/^debuginfo-level = .*/debuginfo-level = 0/g' "$@"
endif
debian/rustc.%: debian/rustc.%.in
m4 -DRUST_LONG_VERSION="$(RUST_LONG_VERSION)" \
-DDEB_HOST_RUST_TYPE="$(DEB_HOST_RUST_TYPE)" \
-DDEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
"$<" > "$@"
debian/rust-src.%: debian/rust-src.%.in
m4 -DRUST_LONG_VERSION="$(RUST_LONG_VERSION)" \
"$<" > "$@"
check-no-old-llvm:
# fail the build if we have any instances of OLD_LLVM_VERSION in debian, except for debian/changelog
! grep --color=always -i '\(clang\|ll\(..\|d\)\)-\?$(subst .,\.,$(OLD_LLVM_VERSION))' --exclude=changelog --exclude=copyright --exclude='*.patch' --exclude-dir='.debhelper' -R debian
@ -245,8 +238,6 @@ endif
override_dh_auto_clean:
$(RM) -rf build tmp .cargo debian/cargo_home config.stamp config.mk Makefile
$(RM) -rf $(TEST_LOG) debian/config.toml debian/*.stamp
$(RM) -rf debian/rust-src.install debian/rust-src.links
$(RM) -rf debian/rustc.install debian/rustc.links
$(RM) -rf $(SRC_CLEAN) config.toml
debian/dh_auto_build.stamp:
@ -394,19 +385,8 @@ ifeq (true,$(BUILD_DOCS))
find $(DEB_DESTDIR) \( -iname '*.html' -empty -o -name .lock -o -name '*.inc' \) -delete;
endif
override_dh_install-arch: debian/rustc.install debian/rustc.links
override_dh_install-indep:
dh_install
dh_install -p$(LIBSTD_PKG) usr/lib/$(DEB_HOST_MULTIARCH)/
dh_install -plibstd-rust-dev usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/
ifeq (true,$(BUILD_WINDOWS))
dh_install -plibstd-rust-dev-windows usr/lib/rustlib/$(WINDOWS_ARCH)-pc-windows-gnu/lib/
endif
override_dh_install-indep: debian/rust-src.install debian/rust-src.links
dh_install
ifeq (true,$(BUILD_WASM))
dh_install -plibstd-rust-dev-wasm32 usr/lib/rustlib/wasm32-*/lib/
endif
$(RM) -rf $(SRC_CLEAN:%=debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION)/%)
# Get rid of lintian warnings
find debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION) \
@ -428,13 +408,6 @@ override_dh_installchangelogs:
override_dh_installdocs:
dh_installdocs -X.tex -X.aux -X.log -X.out -X.toc
override_dh_missing:
# if we did an arch-indep build then these artifacts exist but aren't installed
# so we remove them now to avoid false-positive in dh_missing --fail-missing
rm -rf debian/tmp/usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/
rm -rf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
dh_missing --fail-missing
override_dh_compress:
dh_compress -X.woff

15
debian/rust-src.install vendored Normal file
View File

@ -0,0 +1,15 @@
debian/patches usr/src/rustc-${env:RUST_LONG_VERSION}/debian
# from src/bootstrap/dist.rs:370 onwards
COPYRIGHT usr/src/rustc-${env:RUST_LONG_VERSION}
LICENSE-APACHE usr/src/rustc-${env:RUST_LONG_VERSION}
LICENSE-MIT usr/src/rustc-${env:RUST_LONG_VERSION}
CONTRIBUTING.md usr/src/rustc-${env:RUST_LONG_VERSION}
README.md usr/src/rustc-${env:RUST_LONG_VERSION}
RELEASES.md usr/src/rustc-${env:RUST_LONG_VERSION}
configure usr/src/rustc-${env:RUST_LONG_VERSION}
x.py usr/src/rustc-${env:RUST_LONG_VERSION}
config.toml.example usr/src/rustc-${env:RUST_LONG_VERSION}
Cargo.toml usr/src/rustc-${env:RUST_LONG_VERSION}
src usr/src/rustc-${env:RUST_LONG_VERSION}
library usr/src/rustc-${env:RUST_LONG_VERSION}
compiler usr/src/rustc-${env:RUST_LONG_VERSION}

View File

@ -1,15 +0,0 @@
debian/patches usr/src/rustc-RUST_LONG_VERSION/debian
# from src/bootstrap/dist.rs:370 onwards
COPYRIGHT usr/src/rustc-RUST_LONG_VERSION
LICENSE-APACHE usr/src/rustc-RUST_LONG_VERSION
LICENSE-MIT usr/src/rustc-RUST_LONG_VERSION
CONTRIBUTING.md usr/src/rustc-RUST_LONG_VERSION
README.md usr/src/rustc-RUST_LONG_VERSION
RELEASES.md usr/src/rustc-RUST_LONG_VERSION
configure usr/src/rustc-RUST_LONG_VERSION
x.py usr/src/rustc-RUST_LONG_VERSION
config.toml.example usr/src/rustc-RUST_LONG_VERSION
Cargo.toml usr/src/rustc-RUST_LONG_VERSION
src usr/src/rustc-RUST_LONG_VERSION
library usr/src/rustc-RUST_LONG_VERSION
compiler usr/src/rustc-RUST_LONG_VERSION

1
debian/rust-src.links vendored Normal file
View File

@ -0,0 +1 @@
usr/src/rustc-${env:RUST_LONG_VERSION} usr/lib/rustlib/src/rust

View File

@ -1 +0,0 @@
usr/src/rustc-RUST_LONG_VERSION usr/lib/rustlib/src/rust

View File

@ -2,5 +2,5 @@ usr/bin/lld-13 usr/bin/rust-lld
usr/bin/clang-13 usr/bin/rust-clang
usr/bin/llvm-dwp-13 usr/bin/rust-llvm-dwp
# for -Z gcc-ld=lld, see compiler/rustc_codegen_ssa/src/back/link.rs for logic
usr/bin/rust-lld usr/lib/rustlib/DEB_HOST_RUST_TYPE/bin/gcc-ld/ld
usr/bin/rust-lld usr/lib/rustlib/DEB_HOST_RUST_TYPE/bin/gcc-ld/ld64
usr/bin/rust-lld usr/lib/rustlib/${env:DEB_HOST_RUST_TYPE}/bin/gcc-ld/ld
usr/bin/rust-lld usr/lib/rustlib/${env:DEB_HOST_RUST_TYPE}/bin/gcc-ld/ld64

View File

@ -49,6 +49,7 @@ if [ "$WASI_COMMIT" != "$WASI_COMMIT_OLD" ]; then
fi
if [ "$NEW" != "$ORIG" ]; then
git mv libstd-rust-$ORIG.install libstd-rust-$NEW.install
git mv libstd-rust-$ORIG.lintian-overrides libstd-rust-$NEW.lintian-overrides
fi
sed -i -e "s|libstd-rust-${ORIG_R}|libstd-rust-$NEW|g" libstd-rust-$NEW.lintian-overrides