mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-03 20:07:21 +00:00
81 lines
2.5 KiB
Makefile
Executable File
81 lines
2.5 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
# -*- makefile -*-
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
#export DH_VERBOSE=1
|
|
|
|
# When using sudo pbuilder, this will cause mk/install.mk to run sudo,
|
|
# but we don't need sudo as a build-dep for the package if we unexport
|
|
# the SUDO_USER variable.
|
|
unexport SUDO_USER
|
|
|
|
UPSTREAM_RUST_VERSION := \
|
|
$(shell dpkg-parsechangelog | \
|
|
egrep '^Version:' | \
|
|
cut -f 2 -d ' ' | \
|
|
cut -f 1 -d '-' | \
|
|
tr '~' -)
|
|
DEBIAN_RUST_VERSION := \
|
|
$(shell echo $(UPSTREAM_RUST_VERSION) | \
|
|
cut -f 1 -d '-' | cut -f 1-2 -d .)
|
|
DEBIAN_RUST_VERSION_TYPE := \
|
|
$(shell echo $(UPSTREAM_RUST_VERSION) | cut -f 2 -d '-')
|
|
RUST_PREFIX := usr/lib/$(DEB_HOST_MULTIARCH)/rust/$(DEBIAN_RUST_VERSION)
|
|
DEB_DESTDIR := $(CURDIR)/debian/rust
|
|
RUST_TMP_PREFIX := $(DEB_DESTDIR)/$(RUST_PREFIX)
|
|
|
|
# These are the normal build flags
|
|
COMMON_FLAGS = \
|
|
--disable-manage-submodules \
|
|
--mandir=/usr/share/man \
|
|
--prefix=/$(RUST_PREFIX)
|
|
|
|
# TODO
|
|
# These flags will be used to avoid external
|
|
# stage0 bootstrap binaries
|
|
SELF_BOOTSTRAP = \
|
|
--enable-local-rust \
|
|
--local-rust-root=/usr
|
|
|
|
# TODO
|
|
# These flags will enable the system-wide LLVM
|
|
SYSTEM_LLVM = --llvm-root=/usr
|
|
|
|
%:
|
|
dh $@ --parallel
|
|
|
|
# Note: SHELL is not set by dash, but the configure script wants to use it
|
|
override_dh_auto_configure:
|
|
mkdir -p $(CURDIR)/dl
|
|
cp $(CURDIR)/debian/dl/*.tar.bz2 $(CURDIR)/dl
|
|
SHELL=/bin/sh \
|
|
./configure \
|
|
$(COMMON_FLAGS) \
|
|
# TODO
|
|
# $(SELF_BOOTSTRAP)
|
|
# $(SYSTEM_LLVM)
|
|
|
|
# Skip test since it fails on rust 0.12
|
|
override_dh_auto_test:
|
|
true
|
|
|
|
LD_TMP1 := $(RUST_TMP_PREFIX)/lib
|
|
LD_TMP2 := $(LD_TMP1)/rustlib/i686-unknown-linux-gnu/lib
|
|
LD_TMP3 := $(LD_TMP1)/rustlib/x86_64-unknown-linux-gnu/lib
|
|
RUST_TMP_LD_PATH := $(LD_TMP1):$(LD_TMP2):$(LD_TMP3)
|
|
|
|
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
|
|
dh_link $(RUST_PREFIX)/bin/rustc usr/bin/rustc-$(DEBIAN_RUST_VERSION)
|
|
dh_link usr/bin/rustc-$(DEBIAN_RUST_VERSION) usr/bin/rustc
|
|
dh_link usr/share/man/man1/rustc.1 usr/share/man/man1/rustc-$(DEBIAN_RUST_VERSION).1
|
|
dh_link $(RUST_PREFIX)/bin/rustdoc usr/bin/rustdoc-$(DEBIAN_RUST_VERSION)
|
|
dh_link usr/bin/rustdoc-$(DEBIAN_RUST_VERSION) usr/bin/rustdoc
|
|
dh_link usr/share/man/man1/rustdoc.1 usr/share/man/man1/rustdoc-$(DEBIAN_RUST_VERSION).1
|
|
dh_link $(RUST_PREFIX)/bin/rust-gdb usr/bin/rust-gdb-$(DEBIAN_RUST_VERSION)
|
|
dh_link usr/bin/rust-gdb-$(DEBIAN_RUST_VERSION) usr/bin/rust-gdb
|