]> git.proxmox.com Git - rustc.git/blame - debian/rules
verbose mode
[rustc.git] / debian / rules
CommitLineData
be771b38
LB
1#!/usr/bin/make -f
2# -*- makefile -*-
3
4# Uncomment this to turn on verbose mode.
5#export DH_VERBOSE=1
6
03b69fec
JJ
7# When using sudo pbuilder, this will cause mk/install.mk to run sudo,
8# but we don't need sudo as a build-dep for the package if we unexport
9# the SUDO_USER variable.
10unexport SUDO_USER
11
18700249
JJ
12UPSTREAM_RUST_VERSION := \
13 $(shell dpkg-parsechangelog | \
14 egrep '^Version:' | \
15 cut -f 2 -d ' ' | \
16 cut -f 1 -d '-' | \
17 tr '~' -)
18DEBIAN_RUST_VERSION := \
19 $(shell echo $(UPSTREAM_RUST_VERSION) | \
20 cut -f 1 -d '-' | cut -f 1-2 -d .)
21DEBIAN_RUST_VERSION_TYPE := \
22 $(shell echo $(UPSTREAM_RUST_VERSION) | cut -f 2 -d '-')
23RUST_PREFIX := usr/lib/$(DEB_HOST_MULTIARCH)/rust/$(DEBIAN_RUST_VERSION)
02b74708
JJ
24DEB_DESTDIR := $(CURDIR)/debian/rust
25RUST_TMP_PREFIX := $(DEB_DESTDIR)/$(RUST_PREFIX)
26
be771b38
LB
27# These are the normal build flags
28COMMON_FLAGS = \
29 --disable-manage-submodules \
c92744c0 30 --mandir=/usr/share/man \
ac9de7b6 31 --enable-rpath \
02b74708 32 --prefix=/$(RUST_PREFIX)
be771b38
LB
33
34# TODO
35# These flags will be used to avoid external
36# stage0 bootstrap binaries
37SELF_BOOTSTRAP = \
38 --enable-local-rust \
39 --local-rust-root=/usr
40
41# TODO
42# These flags will enable the system-wide LLVM
43SYSTEM_LLVM = --llvm-root=/usr
44
45%:
2679d355 46 dh $@ --parallel
be771b38 47
7a06551f 48# Note: SHELL is not set by dash, but the configure script wants to use it
be771b38 49override_dh_auto_configure:
f588d68d
JJ
50 mkdir -p $(CURDIR)/dl
51 cp $(CURDIR)/debian/dl/*.tar.bz2 $(CURDIR)/dl
7a06551f 52 SHELL=/bin/sh \
be771b38
LB
53 ./configure \
54 $(COMMON_FLAGS) \
55 # TODO
56 # $(SELF_BOOTSTRAP)
57 # $(SYSTEM_LLVM)
ef102071 58
becfe001
SL
59override_dh_auto_build:
60 make VERBOSE=1
61
ef102071
JJ
62# Skip test since it fails on rust 0.12
63override_dh_auto_test:
64 true
23d2674b 65
0f729e31 66LD_TMP1 := $(RUST_TMP_PREFIX)/lib
7bdffa5b
SL
67# TODO improve this stuff to make it dynamic
68LD_TMP_i386 := $(LD_TMP1)/rustlib/i686-unknown-linux-gnu/lib
69LD_TMP_AMD64 := $(LD_TMP1)/rustlib/x86_64-unknown-linux-gnu/lib
70RUST_TMP_LD_PATH := $(LD_TMP1):$(LD_TMP_i386):$(LD_TMP_AMD64)
0f729e31 71
c92744c0 72override_dh_shlibdeps:
0f729e31
JJ
73 LD_LIBRARY_PATH=$(RUST_TMP_LD_PATH):$(LD_LIBRARY_PATH) \
74 dh_shlibdeps -l$(RUST_TMP_LD_PATH)
c92744c0 75
23d2674b
JJ
76override_dh_auto_install:
77 dh_auto_install
18700249
JJ
78 dh_link $(RUST_PREFIX)/bin/rustc usr/bin/rustc-$(DEBIAN_RUST_VERSION)
79 dh_link usr/bin/rustc-$(DEBIAN_RUST_VERSION) usr/bin/rustc
80 dh_link usr/share/man/man1/rustc.1 usr/share/man/man1/rustc-$(DEBIAN_RUST_VERSION).1
81 dh_link $(RUST_PREFIX)/bin/rustdoc usr/bin/rustdoc-$(DEBIAN_RUST_VERSION)
82 dh_link usr/bin/rustdoc-$(DEBIAN_RUST_VERSION) usr/bin/rustdoc
83 dh_link usr/share/man/man1/rustdoc.1 usr/share/man/man1/rustdoc-$(DEBIAN_RUST_VERSION).1
a97d69b7
JJ
84 dh_link $(RUST_PREFIX)/bin/rust-gdb usr/bin/rust-gdb-$(DEBIAN_RUST_VERSION)
85 dh_link usr/bin/rust-gdb-$(DEBIAN_RUST_VERSION) usr/bin/rust-gdb