]> git.proxmox.com Git - rustc.git/commitdiff
Simpler way of doing the rust-src package
authorXimin Luo <infinity0@debian.org>
Mon, 15 May 2017 23:23:25 +0000 (01:23 +0200)
committerXimin Luo <infinity0@debian.org>
Mon, 15 May 2017 23:23:25 +0000 (01:23 +0200)
debian/control
debian/libstd-rust-src.install [deleted file]
debian/rules
debian/rust-src.install [new file with mode: 0644]
debian/rust-src.links [new file with mode: 0644]

index e36b7f1ada5ff3367382545e4586454d3a6143a1..d3742f540e2c9c50f6c5a50ee41c45f48451d81d 100644 (file)
@@ -173,11 +173,10 @@ Description: Rust systems programming language - Documentation
  This package contains the Rust tutorial, language reference and
  standard library documentation.
 
-Package: libstd-rust-src
+Package: rust-src
 Section: devel
 Architecture: all
-Build-Profiles: <!pkg.rust.nosrc>
-Description: Rust systems programming language - Documentation
+Description: Rust systems programming language - source code
  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
@@ -190,4 +189,5 @@ Description: Rust systems programming language - Documentation
  generic programming and meta-programming, in both static and dynamic
  styles.
  .
- This package contains sources of the rust standard library.
+ This package contains sources of the Rust compiler and standard
+ libraries, useful for IDEs and code analysis tools such as Racer.
diff --git a/debian/libstd-rust-src.install b/debian/libstd-rust-src.install
deleted file mode 100644 (file)
index ffd24b5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-usr/src/rust
index 4a5ca19cb20f1000a0c6316321ca4aeef1126e5a..120ba7f6012d160f22c305069002140917ff45a4 100755 (executable)
@@ -108,12 +108,6 @@ 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
@@ -124,6 +118,11 @@ ifneq (,$(findstring powerpc64le,$(DEB_TARGET_RUST_TYPE)))
   DEB_CONFIGURE_FLAGS += --disable-optimize --disable-optimize-cxx --disable-optimize-llvm
 endif
 
+# Build products or non-source files in src/, that shouldn't go in rust-src
+SRC_CLEAN = src/rt/hoedown/src/html_blocks.c \
+       src/bootstrap/bootstrap.pyc \
+       src/bootstrap/config.toml \
+       src/etc/__pycache__/
 
 %:
        dh $@ --parallel
@@ -143,9 +142,8 @@ override_dh_auto_configure:
            ./configure $(DEB_CONFIGURE_FLAGS)
 
 override_dh_auto_clean:
-       $(RM) -rf ./build ./tmp ./.cargo src/etc/__pycache__/ config.stamp config.mk Makefile ./cargo
-       $(RM) src/rt/hoedown/src/html_blocks.c # clean up after building this ourselves
-       $(RM) src/bootstrap/bootstrap.pyc src/bootstrap/config.toml
+       $(RM) -rf ./build ./tmp ./.cargo config.stamp config.mk Makefile ./cargo
+       $(RM) -rf $(SRC_CLEAN)
 
 # upstream bundles this in the source, but in Debian we rebuild everything yo
 generate-sources:
@@ -214,12 +212,6 @@ ifneq (,$(BUILD_DOCS))
        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:
        dh_install
        dh_install -p$(LIBSTD_PKG) usr/lib/$(DEB_HOST_MULTIARCH)/
@@ -229,6 +221,7 @@ override_dh_install-indep:
        chmod -x \
          debian/rust-gdb/usr/share/rust-gdb/*.py \
          debian/rust-lldb/usr/share/rust-lldb/*.py
+       $(RM) -rf $(SRC_CLEAN:%=debian/rust-src/usr/src/rust/%)
 
 override_dh_installchangelogs:
        dh_installchangelogs RELEASES.md
diff --git a/debian/rust-src.install b/debian/rust-src.install
new file mode 100644 (file)
index 0000000..1e19b6d
--- /dev/null
@@ -0,0 +1,12 @@
+# from src/bootstrap/dist.rs:370 onwards
+COPYRIGHT       usr/src/rust
+LICENSE-APACHE  usr/src/rust
+LICENSE-MIT     usr/src/rust
+CONTRIBUTING.md usr/src/rust
+README.md       usr/src/rust
+RELEASES.md     usr/src/rust
+configure       usr/src/rust
+x.py            usr/src/rust
+man             usr/src/rust
+src             usr/src/rust
+cargo           usr/src/rust
diff --git a/debian/rust-src.links b/debian/rust-src.links
new file mode 100644 (file)
index 0000000..1a3314e
--- /dev/null
@@ -0,0 +1 @@
+usr/src/rust usr/lib/rustlib/src/rust