--- /dev/null
+# This Makefile snippet defines DEB_*_RUST_TYPE triples based on DEB_*_GNU_TYPE
+
+include /usr/share/dpkg/architecture.mk
+
+rust_cpu = $(subst i586,i686,$(1))
+
+$(foreach machine,BUILD HOST TARGET,\
+ $(eval DEB_$(machine)_RUST_TYPE ?= $(call rust_cpu,$(DEB_$(machine)_GNU_CPU))-unknown-$(DEB_$(machine)_GNU_SYSTEM)))
[ Angus Lees ]
* New upstream release (1.0!)
* Set SONAME when building dylibs
+ * Split out libstd-rust, libstd-rust-dev, rust-gdb, rust-lldb from rustc
+ - libs are now installed into multiarch-friendly locations
+ - rpath is no longer required to use dylibs (but talk to Debian Rust
+ maintainers before building a package that depends on the dylibs)
[ Sylvestre Ledru ]
* Fix the watch file
Angus Lees <gus@debian.org>
Build-Depends: debhelper (>= 9.20141010),
dpkg-dev (>= 1.17.14),
-# rust <!dlstage0>,
autotools-dev,
curl,
python,
libedit-dev,
valgrind,
git,
- ca-certificates,
-# <dlstage0>,
llvm-3.6-dev (>= 1:3.6~+rc4)
# git is necessary for 'make check'
Build-Depends-Indep: pandoc (>=1.9),
-# <!nodoc>,
po4a,
-# <!nodoc>,
texlive-xetex,
-# <!nodoc>,
texlive-latex-base,
-# <!nodoc>,
texlive-generic-recommended,
-# <!nodoc>,
texlive-fonts-recommended,
-# <!nodoc>,
lmodern
-# <!nodoc>
Standards-Version: 3.9.6
Homepage: http://www.rust-lang.org/
Vcs-Git: git://git.debian.org/pkg-rust/rust.git
Vcs-Browser: http://git.debian.org/?p=pkg-rust/rust.git;a=summary
Package: rustc
-Architecture: amd64 i386
+Architecture: any
+Multi-Arch: foreign
Pre-Depends: ${misc:Pre-Depends}
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, libstd-rust-dev (= ${source:Version})
+Recommends: rust-gdb | rust-lldb
Suggests: rust-doc
Description: Rust systems programming language
Rust is a curly-brace, block-structured expression language. It
generic programming and meta-programming, in both static and dynamic
styles.
+Package: libstd-rust-4e7c5e5c
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: multiarch-support, ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Rust standard libraries
+ 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 the standard Rust libraries, built as dylibs.
+
+Package: libstd-rust-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Pre-Depends: multiarch-support
+Depends: ${misc:Depends}, libstd-rust-4e7c5e5c (= ${source:Version})
+Description: Rust standard libraries - development files
+ 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 development files necessary to use the standard
+ Rust libraries.
+
+Package: rust-gdb
+Section: devel
+Architecture: any
+Depends: gdb, ${misc:Depends}
+Description: Rust debugger (gdb)
+ 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 pretty printers and a wrapper script for
+ invoking gdb on rust binaries.
+
+Package: rust-lldb
+Section: devel
+Architecture: any
+Depends: lldb, ${misc:Depends}
+Description: Rust debugger (lldb)
+ 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 pretty printers and a wrapper script for
+ invoking lldb on rust binaries.
+
Package: rust-doc
Section: doc
Architecture: all
generic programming and meta-programming, in both static and dynamic
styles.
.
- This package contains the documentation.
+ This package contains the Rust tutorial, language reference and
+ standard library documentation.
--- /dev/null
+# "libstd" just seemed too generic
+libstd-rust-4e7c5e5c binary: package-name-doesnt-match-sonames
+
+# Rust doesn't use dev shlib symlinks.
+libstd-rust-4e7c5e5c binary: dev-pkg-without-shlib-symlink
+
+# Libraries that use libc symbols (libterm, libstd, etc) *are* linked
+# to libc. Lintian gets upset that some Rust libraries don't need
+# libc, boo hoo.
+libstd-rust-4e7c5e5c binary: library-not-linked-against-libc
--- /dev/null
+usr/lib/rustlib/*/lib/
--- /dev/null
+# I assure you, dear lintian, that "/usr/lib/rustlib/x86_64-unknown-linux-gnu/"
+# is indeed an arch-specific directory.
+libstd-rust-dev binary: arch-dependent-file-not-in-arch-specific-directory
--- /dev/null
+Description: Hardcode GDB python module directory
+ Debian package installs python modules into a fixed directory, so
+ just hardcode path in wrapper script.
+Author: Angus Lees <gus@debian.org>
+Forwarded: not-needed
+
+--- a/src/etc/rust-gdb
++++ b/src/etc/rust-gdb
+@@ -13,11 +13,13 @@
+ set -e
+
+ # Find out where the pretty printer Python module is
+-RUSTC_SYSROOT=`rustc --print=sysroot`
+-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
++#RUSTC_SYSROOT=`rustc --print=sysroot`
++#GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
++# We can just hardcode this on Debian, and remove the rustc dependency
++GDB_PYTHON_MODULE_DIRECTORY="/usr/share/rust-gdb"
+
+ # Run GDB with the additional arguments that load the pretty printers
+-PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" gdb \
++PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec gdb \
+ -d "$GDB_PYTHON_MODULE_DIRECTORY" \
+ -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
+ "$@"
--- /dev/null
+Description: Hardcode LLDB python module directory
+ Debian package installs python modules into a fixed directory, so
+ just hardcode path in wrapper script.
+Author: Angus Lees <gus@debian.org>
+Forwarded: not-needed
+
+--- a/src/etc/rust-lldb
++++ b/src/etc/rust-lldb
+@@ -18,11 +18,8 @@ TMPFILE=`mktemp /tmp/rust-lldb-commands.XXXXXX`
+ # Make sure to delete the tempfile no matter what
+ trap "rm -f $TMPFILE; exit" INT TERM EXIT
+
+-# Find out where to look for the pretty printer Python module
+-RUSTC_SYSROOT=`rustc --print sysroot`
+-
+ # Write the LLDB script to the tempfile
+-echo "command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_rust_formatters.py\"" >> $TMPFILE
++echo "command script import \"/usr/share/rust-lldb/lldb_rust_formatters.py\"" >> $TMPFILE
+ echo "type summary add --no-value --python-function lldb_rust_formatters.print_val -x \".*\" --category Rust" >> $TMPFILE
+ echo "type category enable Rust" >> $TMPFILE
buildflags
+rust-gdb-paths
+rust-lldb-paths
add-soname
RUSTFLAGS = -C link-args="$(LDFLAGS)"
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
+# Defines DEB_*_RUST_TYPE triples
+include debian/architecture.mk
+
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Debhelper clears MAKEFLAGS, so we have to do this again for any
# target where we call $(MAKE) directly. Boo.
DEB_PARALLEL_JOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-DEB_MAKE_PARALLEL = $(if $(DEB_PARALLEL_JOBS),-j$(DEB_PARALLEL_JOBS))
-
-
-# $DEB_VERSION_UPSTREAM is the full upstream version (eg. 1.0.0~alpha)
-
-# This is original/unmangled upstream version (eg. 1.0.0-alpha)
-UPSTREAM_RUST_VERSION := $(subst ~,-,$(DEB_VERSION_UPSTREAM))
-
-# Main (major.minor) upstream version (eg. 1.0)
-MAIN_RUST_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | egrep -o '^[^\.]+\.[^\.]+')
-
-# Upstream version suffix, if any (eg. alpha)
-UPSTREAM_RUST_SUFFIX := $(shell echo $(DEB_VERSION_UPSTREAM) | egrep -o '[^\~]+$$')
-
-# Private dir for rust .so and .rlib
-RUST_PREFIX := usr/lib/$(DEB_HOST_MULTIARCH)/rust/$(MAIN_RUST_VERSION)
+PMAKE = $(MAKE) $(if $(DEB_PARALLEL_JOBS),-j$(DEB_PARALLEL_JOBS))
# Release type (one of beta, stable or nightly)
RELEASE_CHANNEL := beta
DEB_DESTDIR := $(CURDIR)/debian/tmp
-RUST_TMP_PREFIX := $(DEB_DESTDIR)/$(RUST_PREFIX)
+
+RUST_HASH := $(shell sed -n 's/^CFG_FILENAME_EXTRA=//p' mk/main.mk)
+LIBSTD_PKG := libstd-rust-$(RUST_HASH)
# These are the normal build flags
-COMMON_FLAGS = \
+DEB_CONFIGURE_FLAGS = \
+ --host=$(DEB_HOST_RUST_TYPE) \
+ --target=$(DEB_TARGET_RUST_TYPE) \
--disable-manage-submodules \
--release-channel=$(RELEASE_CHANNEL) \
- --mandir=/usr/share/man \
- --enable-rpath \
- --prefix=/$(RUST_PREFIX)
-
-SYSTEM_LLVM = --llvm-root=/usr/lib/llvm-3.6
+ --prefix=/usr
+# Use system LLVM (comment out to use vendored LLVM)
+DEB_CONFIGURE_FLAGS += --llvm-root=/usr/lib/llvm-3.6
ifeq (,$(findstring dlstage0,$(DEB_BUILD_PROFILES)))
# Without these options, a pre-built stage0 will be downloaded from
-# rust-lang.org at build time.
-# DEB_CONFIGURE_EXTRA_FLAGS += --enable-local-rust --local-rust-root=/usr
+# rust-lang.org at build time (or looked for in dl/).
+ #DEB_CONFIGURE_FLAGS += --enable-local-rust --local-rust-root=/usr
endif
BUILD_DOCS = 1
ifneq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
- DEB_CONFIGURE_EXTRA_FLAGS += --disable-docs
+ DEB_CONFIGURE_FLAGS += --disable-docs
BUILD_DOCS =
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- DEB_CONFIGURE_EXTRA_FLAGS += --disable-optimize --disable-optimize-cxx --disable-optimize-llvm
+ DEB_CONFIGURE_FLAGS += --disable-optimize --disable-optimize-cxx --disable-optimize-llvm
endif
# Note: SHELL is not set by dash, but the configure script wants to use it
override_dh_auto_configure:
SHELL=/bin/sh \
- ./configure \
- $(COMMON_FLAGS) \
- $(DEB_CONFIGURE_EXTRA_FLAGS) \
- $(SYSTEM_LLVM)
+ ./configure $(DEB_CONFIGURE_FLAGS)
override_dh_auto_clean:
- [ ! -f Makefile ] || $(MAKE) $(DEB_MAKE_PARALLEL) clean-all
- -$(RM) Makefile
+ set -e; \
+ if [ -f Makefile ]; then \
+ $(PMAKE) clean-all; \
+ $(RM) Makefile config.stamp; \
+ fi
override_dh_auto_build-arch:
dh_auto_build -- all VERBOSE=1
override_dh_auto_build-indep:
$(if $(BUILD_DOCS),dh_auto_build -- docs)
-LD_TMP1 := $(RUST_TMP_PREFIX)/lib
-# TODO improve this stuff to make it dynamic
-LD_TMP_i386 := $(LD_TMP1)/rustlib/i686-unknown-linux-gnu/lib
-LD_TMP_AMD64 := $(LD_TMP1)/rustlib/x86_64-unknown-linux-gnu/lib
-RUST_TMP_LD_PATH := $(LD_TMP1):$(LD_TMP_i386):$(LD_TMP_AMD64)
-
-override_dh_shlibdeps:
- LD_LIBRARY_PATH=$(RUST_TMP_LD_PATH):$(LD_LIBRARY_PATH) \
- dh_shlibdeps -l$(RUST_TMP_LD_PATH)
-
override_dh_auto_install:
dh_auto_install --destdir=$(DEB_DESTDIR)
- dh_link $(RUST_PREFIX)/bin/rustc usr/bin/rustc-$(MAIN_RUST_VERSION)
- dh_link usr/bin/rustc-$(MAIN_RUST_VERSION) usr/bin/rustc
- dh_link $(RUST_PREFIX)/bin/rustdoc usr/bin/rustdoc-$(MAIN_RUST_VERSION)
- dh_link usr/bin/rustdoc-$(MAIN_RUST_VERSION) usr/bin/rustdoc
- dh_link $(RUST_PREFIX)/bin/rust-gdb usr/bin/rust-gdb-$(MAIN_RUST_VERSION)
- dh_link usr/bin/rust-gdb-$(MAIN_RUST_VERSION) usr/bin/rust-gdb
+
+ mkdir -p $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/
+ mv $(DEB_DESTDIR)/usr/lib/lib*.so $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/
# Replace duplicated compile-time/run-time dylibs with symlinks
- for f in $(RUST_TMP_PREFIX)/lib/rustlib/*/lib/lib*.so; do \
- name=$${f##*/}; \
- if [ -f $(RUST_TMP_PREFIX)/lib/$$name ]; then \
- ln -sf ../../../$$name $$f; \
- fi; \
+ @set -e; \
+ for f in $(DEB_DESTDIR)/usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/lib*.so; do \
+ name=$${f##*/}; \
+ if [ -f "$(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/$$name" ]; then \
+ echo "ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f"; \
+ ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f; \
+ fi; \
done
-override_dh_install:
+ifneq (,$(BUILD_DOCS))
# Brute force to remove privacy-breach-logo lintian warning.
# We could have updated the upstream sources but it would complexify
# the rebase
-ifneq (,$(BUILD_DOCS))
- sed -i '/rel="shortcut icon" href="http:\/\/www.rust-lang.org\/favicon.ico"/d' `find $(DEB_DESTDIR) -iname '*.html'`
- rm -f `find $(DEB_DESTDIR) -iname '*.html' -empty` $(DEB_DESTDIR)/usr/share/doc/rust-doc/html/.lock
- ln -sf /usr/share/javascript/jquery/jquery.js $(DEB_DESTDIR)/usr/lib/*/rust/*/share/doc/rust/html/jquery.js
- ln -sf /usr/share/javascript/jquery/jquery.js $(DEB_DESTDIR)/usr/lib/*/rust/*/share/doc/rust/html/style/jquery.js
- ln -sf /usr/share/javascript/jquery/jquery.js $(DEB_DESTDIR)/usr/lib/*/rust/*/share/doc/rust/html/book/jquery.js
+ sed -i '\!rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico"!d' `find $(DEB_DESTDIR) -iname '*.html'`
+
+ find $(DEB_DESTDIR) \( -iname '*.html' -empty -o -name .lock \) -delete
+
+ find $(DEB_DESTDIR)/usr/share/doc -name jquery.js \
+ -exec ln -sf /usr/share/javascript/jquery/jquery.js '{}' \;
endif
+
+override_dh_install:
dh_install
+ dh_install -p$(LIBSTD_PKG) usr/lib/$(DEB_HOST_MULTIARCH)/
+
+ chmod -x \
+ debian/rust-gdb/usr/share/rust-gdb/*.py \
+ debian/rust-lldb/usr/share/rust-lldb/*.py
override_dh_installchangelogs:
dh_installchangelogs RELEASES.md
dh_installdocs -X.tex -X.aux -X.log -X.out -X.toc
override_dh_auto_test:
- # NB: not parallel - there is some race that leads to failures like:
- # note: cc: error: x86_64-unknown-linux-gnu/test/run-pass/generic-default-type-params-cross-crate.stage2-x86_64-unknown-linux-gnulibaux/default_type_params_xc.o: No such file or directory
ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
- $(MAKE) check-notidy
+ $(PMAKE) check-notidy
endif
+
+override_dh_makeshlibs:
+ dh_makeshlibs -V
+
+ # dh_makeshlibs doesn't support our "libfoo-version.so" naming
+ # structure, so we have to do this ourselves.
+ install -o 0 -g 0 -d debian/$(LIBSTD_PKG)/DEBIAN
+ ls debian/$(LIBSTD_PKG)/usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so | \
+ sed -n 's,^.*/\(lib.*\)-\(.\+\)\.so$$,\1 \2,p' | \
+ while read name version; do \
+ echo "$$name $$version $(LIBSTD_PKG) (>= $(DEB_VERSION_UPSTREAM))"; \
+ done > debian/$(LIBSTD_PKG)/DEBIAN/shlibs
+ chmod 644 debian/$(LIBSTD_PKG)/DEBIAN/shlibs
+ chown 0:0 debian/$(LIBSTD_PKG)/DEBIAN/shlibs
+
+override_dh_shlibdeps:
+ dh_shlibdeps -- -x$(LIBSTD_PKG)
-debian/tmp/usr/lib/*/rust/*/share/doc/rust/html
+debian/tmp/usr/share/doc/rust/html
--- /dev/null
+src/etc/rust-gdb usr/bin/
+src/etc/gdb_*.py usr/share/rust-gdb/
--- /dev/null
+src/etc/rust-lldb usr/bin/
+src/etc/lldb_rust_formatters.py usr/share/rust-lldb/
-usr/lib/*/rust/*/bin/
-usr/lib/*/rust/*/lib/
+usr/bin/rustc
+usr/bin/rustdoc
+++ /dev/null
-# Rust uses libraries that are not directly linked to libc.
-# libstd (at least) looks like it uses symbols from libc, so we may
-# need to selectively fix this.
-rustc binary: library-not-linked-against-libc