From b125a683df37fd4c42e390a05f7e23e09dac87e9 Mon Sep 17 00:00:00 2001 From: Matthijs van Otterdijk Date: Sun, 14 May 2017 02:46:06 +0200 Subject: [PATCH] rust standard library source package --- debian/TODO.Debian | 1 - debian/control | 21 ++++++++++++++++++++- debian/libstd-rust-src.install | 1 + debian/rules | 15 ++++++++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 debian/libstd-rust-src.install diff --git a/debian/TODO.Debian b/debian/TODO.Debian index c1ee6ffe65..b152c96508 100644 --- a/debian/TODO.Debian +++ b/debian/TODO.Debian @@ -1,4 +1,3 @@ -- add -src package - upload to experimental, check arch tests - get cross-building working - rm or re-fix dlstage0, update docs diff --git a/debian/control b/debian/control index 506029a76e..285bc9ef80 100644 --- a/debian/control +++ b/debian/control @@ -54,7 +54,7 @@ Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libstd-rust-dev (= ${binary:Version}), gcc, libc-dev, libjs-jquery, binutils (>= 2.26) Recommends: rust-gdb | rust-lldb -Suggests: rust-doc +Suggests: rust-doc, rust-src Description: Rust systems programming language Rust is a curly-brace, block-structured expression language. It visually resembles the C language family, but differs significantly @@ -172,3 +172,22 @@ Description: Rust systems programming language - Documentation . This package contains the Rust tutorial, language reference and standard library documentation. + +Package: libstd-rust-src +Section: devel +Architecture: all +Build-Profiles: +Description: Rust systems programming language - Documentation + Rust is a curly-brace, block-structured expression language. It + visually resembles the C language family, but differs significantly + in syntactic and semantic details. Its design is oriented toward + concerns of "programming in the large", that is, of creating and + maintaining boundaries - both abstract and operational - that + preserve large-system integrity, availability and concurrency. + . + It supports a mixture of imperative procedural, concurrent actor, + object-oriented and pure functional styles. Rust also supports + generic programming and meta-programming, in both static and dynamic + styles. + . + This package contains sources of the rust standard library. diff --git a/debian/libstd-rust-src.install b/debian/libstd-rust-src.install new file mode 100644 index 0000000000..ffd24b5be1 --- /dev/null +++ b/debian/libstd-rust-src.install @@ -0,0 +1 @@ +usr/src/rust diff --git a/debian/rules b/debian/rules index c63230b928..4a5ca19cb2 100755 --- a/debian/rules +++ b/debian/rules @@ -40,6 +40,7 @@ RELEASE_CHANNEL := stable DEB_DESTDIR := $(CURDIR)/debian/tmp RUST_VERSION := $(shell dpkg-parsechangelog --show-field Version | sed -re 's/([^.]+)\.([^.]+)\..*/\1.\2/') +RUST_LONG_VERSION := $(shell dpkg-parsechangelog --show-field Version | sed -re 's/([^+]+).*/\1/') LIBSTD_PKG := libstd-rust-$(RUST_VERSION) # These are the normal build flags @@ -107,6 +108,12 @@ ifneq (,$(findstring nodoc,$(DEB_BUILD_PROFILES))) BUILD_DOCS = endif +BUILD_SRC = 1 +ifneq (,$(findstring pkg.rust.nosrc,$(DEB_BUILD_PROFILES))) + DEB_CONFIGURE_FLAGS += --disable-dist-src + BUILD_SRC = +endif + ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) DEB_CONFIGURE_FLAGS += --disable-optimize --disable-optimize-cxx --disable-optimize-llvm endif @@ -204,7 +211,13 @@ ifneq (,$(BUILD_DOCS)) sed -i -e "s,https://doc.rust-lang.org/\(favicon.ico\|logos/rust-logo-32x32-blk.png\),$${topdir}rust-logo-32x32-blk.png," \ -e "s,https://www.rust-lang.org/\(favicon.ico\|logos/rust-logo-32x32-blk.png\),$${topdir}rust-logo-32x32-blk.png," "$$file"; \ done - find $(DEB_DESTDIR) \( -iname '*.html' -empty -o -name .lock -o -name '*.inc' \) -delete + find $(DEB_DESTDIR) \( -iname '*.html' -empty -o -name .lock -o -name '*.inc' \) -delete; +endif + +ifneq (,$(BUILD_SRC)) + # extract library source + mkdir -p $(DEB_DESTDIR)/usr/src; + tar --strip-components=5 -xzf $(CURDIR)/build/dist/rust-src-$(RUST_LONG_VERSION).tar.gz -C $(DEB_DESTDIR)/usr/src endif override_dh_install-arch: