-
Notifications
You must be signed in to change notification settings - Fork 7
/
rustc.spec
161 lines (127 loc) · 4.43 KB
/
rustc.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#
# This is currently not suitable for Fedora, as llvm is compiled with additional patches
# This is planned to change in future, when the llvm patches are upstreamed
#
# Issues
# - Custom LLVM - use --llvm-root=?
# - Hardcoded libdir
# - libuv is included
#
# Wiki page: https://github.com/mozilla/rust/wiki/Note-packaging
#
%bcond_without bootstrap
%bcond_with nightly
Name: rustc
Version: 1.0.0
Release: 0.1.beta3%{?dist}
Summary: The Rust Programming Language
License: ASL 2.0, MIT
URL: http://www.rust-lang.org
%if %with nightly
Source0: http://static.rust-lang.org/dist/%{name}-nightly.tar.gz
%else
Source0: http://static.rust-lang.org/dist/rustc-%{version}-beta.3-src.tar.gz
%endif
%if %with bootstrap
Source1: http://static.rust-lang.org/stage0-snapshots/rust-stage0-2015-03-27-5520801-linux-x86_64-ef2154372e97a3cb687897d027fd51c8f2c5f349.tar.bz2
#Source2: http://static.rust-lang.org/stage0-snapshots/rust-stage0-2014-03-28-b8601a3-linux-i386-3bef5684fd0582fbd4ddebd4514182d4f72924f7.tar.bz2
%endif
BuildRequires: make
BuildRequires: llvm-devel
BuildRequires: clang-devel
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: python
BuildRequires: perl
BuildRequires: curl
#BuildRequires: pandoc
BuildRequires: chrpath
BuildRequires: git
%if %without bootstrap
BuildRequires: rust
%endif
# LLVM features are only present in x86
ExclusiveArch: x86_64 i686
%filter_from_requires /%{_target_cpu}-unknown-linux-gnu/d
%filter_requires_in -P bin/(rust|cargo).*
%filter_setup
%description
This is a compiler for Rust, including standard libraries, tools and
documentation.
%prep
%if %with nightly
%setup -q -n %{name}-nightly
%else
%setup -q -n rustc-%{version}-beta.3
%endif
%if %with bootstrap
mkdir -p dl/
cp %{SOURCE1} dl/
%endif
# Prevent custom configure from failing
sed -i "/^.*is not recog.*/ s/.*/echo configure: Argument \"'\$arg'\" is not recognized and ignored./" configure
%build
%define _triple_override %{_target_cpu}-unknown-linux-gnu
%configure \
--build=%{_triple_override} --host=%{_triple_override} --target=%{_triple_override} \
--llvm-root=/usr \
%if %with bootstrap
# nothing
%else
--enable-local-rust
%endif
# LD_LIBRARY_PATH is passed to tell the linker were to find the different libraries,
# this is needed because the rpaths were removed in prep
make %{?_smp_mflags} \
LD_LIBRARY_PATH=%{_target_cpu}-unknown-linux-gnu/stage0/lib/:%{_target_cpu}-unknown-linux-gnu/stage1/lib/:%{_target_cpu}-unknown-linux-gnu/stage2/lib/:%{_target_cpu}-unknown-linux-gnu/stage3/lib/
%install
make install DESTDIR=%{buildroot}
#mv %{buildroot}/%{_prefix}/lib %{buildroot}/%{_libdir}
# Create ld.so.conf file
mkdir -p %{buildroot}/%{_sysconfdir}/ld.so.conf.d
cat <<EOF >/%{buildroot}/%{_sysconfdir}/ld.so.conf.d/rust-%{_target_cpu}.conf
%{_prefix}/lib/rustc/
%{_prefix}/lib/rustc/%{_target_cpu}-unknown-linux-gnu/lib/
EOF
# Remove rpaths
{ find %{buildroot}/usr/bin -type f ; find %{buildroot} -type f -name \*.so ; } | xargs chrpath --delete
# Remove buildroot from manifest
sed -i "s#^%{buildroot}##" %{buildroot}/%{_libdir}/rustlib/manifest
%check
make check
%post -p /sbin/ldconfig
%files
%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md
%{_sysconfdir}/ld.so.conf.d/rust-*.conf
%{_bindir}/rust*
%{_libdir}/lib*
%{_libdir}/rustlib/*
%{_datadir}/man/*
%changelog
* Thu Jun 03 2014 Fabian Deutsch <[email protected]> - 0.11-1
- Update to 0.11
- Add support for nightly builds
* Wed May 07 2014 Lubomir Rintel <[email protected]> - 0.10-2
- Use ExclusiveArch to limit supported architectures instead of forcing
it with BuildArch
- Enable i686
- Add bootstrap sources, so that build won't access Internet
- Make it possible to build without bootstrapoing with bundled LLVM
- BuildRequire git
* Fri Apr 25 2014 Fabian Deutsch <[email protected]> - 0.10-1
- Update to 0.10
* Mon Jan 13 2014 Fabian Deutsch <[email protected]> - 0.9-1
- Update to 0.9
* Tue Oct 01 2013 Fabian Deutsch <[email protected]> - 0.8-2
- Rebuild for copr
* Fri Sep 27 2013 Fabian Deutsch <[email protected]> - 0.8-1
- Update to 0.8
* Thu Jul 04 2013 Fabian Deutsch <[email protected]> - 0.7-1
- Update to 0.7
- Introduce libextra
* Fri Apr 19 2013 Fabian Deutsch <[email protected]> - 0.6-2
- Update to rust-0.6
- Remove cargo
- Fix rpath issues differently (chrpath)
* Fri Mar 01 2013 Fabian Deutsch <[email protected]> - 0.6-1
- Initial package