summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrej Shadura <andrewsh@debian.org>2023-08-31 17:44:13 +0200
committerAndrej Shadura <andrewsh@debian.org>2023-08-31 17:44:46 +0200
commitfcac91891ac28399f6da34049fd871663dfcf3c1 (patch)
tree22a5863325ceb1e297ea132e091969dfadde37dc
parentec33856e704abbc9d1316fd4d3a5df6ca90c3e08 (diff)
Build Rust extension reproduciblydebian/1.90.0-1
-rw-r--r--debian/changelog1
-rwxr-xr-xdebian/rules16
2 files changed, 17 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 0a4e0cd5..158c86a9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ matrix-synapse (1.90.0-1) unstable; urgency=medium
[ Andrej Shadura ]
* New upstream release.
* Update licenses.
+ * Build Rust extension reproducibly.
[ Antonio Russo ]
* Refresh patches.
diff --git a/debian/rules b/debian/rules
index 6cd8c0f6..e474bf7b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,13 +1,29 @@
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
+include /usr/share/rustc/architecture.mk
+
+export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
export PYBUILD_NAME=matrix-synapse
+
+export PATH := /usr/share/cargo/bin:$(PATH)
+
+export CARGO=/usr/share/cargo/bin/cargo
+export CARGO_HOME=$(CURDIR)/debian/cargo_home
+
+export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
+
%:
dh $@ --buildsystem=pybuild
execute_before_dh_auto_configure:
sed -i '/common/s/~=/>=/' pyproject.toml
+ $(CARGO) prepare-debian debian/cargo_registry --link-from-system
+
+execute_after_dh_auto_clean:
+ rm -rf debian/cargo_registry
override_dh_auto_install:
dh_auto_install