/[packages]/cauldron/rust/current/SPECS/rust.spec
ViewVC logotype

Annotation of /cauldron/rust/current/SPECS/rust.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1308362 - (hide annotations) (download)
Thu Sep 27 11:47:39 2018 UTC (5 years, 6 months ago) by akien
File size: 21682 byte(s)
- Sync with Fedora: Tue Sep 25 2018 Josh Stone <jistone@redhat.com> - 1.29.1-2
  o Update to 1.29.1.
  o Security fix for str::repeat (pending CVE).
  o Update to 1.29.0.
  o Add a clippy-preview subpackage

1 akien 1085562 # (akien) This package is synced with Fedora / Josh Stone's spec.
2 akien 1057871 # The aim is to work with them on a rust packaging policy we could share,
3     # so that we can ensure a good packaging and share the workload.
4 thatsamguy 617730
5 thatsamguy 494699
6 akien 1076532 # Only x86_64 and i686 are Tier 1 platforms at this time.
7     # https://forge.rust-lang.org/platform-support.html
8 akien 1192969 %global rust_arches x86_64 i686 i586 armv7hl aarch64 ppc64 ppc64le s390x
9 akien 1076532
10 akien 1057871 # The channel can be stable, beta, or nightly
11     %{!?channel: %global channel stable}
12 thatsamguy 494699
13 akien 1057871 # To bootstrap from scratch, set the channel and date from src/stage0.txt
14     # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
15     # or nightly wants some beta-YYYY-MM-DD
16 akien 1239841 # Note that cargo matches the program version here, not its crate version.
17 akien 1308362 %global bootstrap_rust 1.28.0
18     %global bootstrap_cargo 1.28.0
19 akien 1093561 %global bootstrap_channel %{bootstrap_rust}
20 akien 1308362 %global bootstrap_date 2018-08-02
21 akien 1057871
22 akien 1076532 # Only the specified arches will use bootstrap binaries.
23     #global bootstrap_arches %%{rust_arches}
24    
25 akien 1215099 # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases.
26 akien 1062905 %bcond_with llvm_static
27    
28 akien 1085562 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
29 akien 1308362 # is insufficient. Rust currently requires LLVM 5.0+.
30 akien 1208625 %if 0%{?rhel} && !0%{?epel}
31 akien 1085562 %bcond_without bundled_llvm
32     %else
33     %bcond_with bundled_llvm
34     %endif
35 akien 1076532
36 akien 1239841 # libgit2-sys expects to use its bundled library, which is sometimes just a
37     # snapshot of libgit2's master branch. This can mean the FFI declarations
38     # won't match our released libgit2.so, e.g. having changed struct fields.
39     # So, tread carefully if you toggle this...
40 akien 1228274 %bcond_without bundled_libgit2
41    
42 akien 1308362 %if 0%{?rhel}
43     %bcond_without bundled_libssh2
44     %else
45     %bcond_with bundled_libssh2
46     %endif
47    
48 akien 1098716 # LLDB only works on some architectures
49     %ifarch %{arm} aarch64 %{ix86} x86_64
50 akien 1093561 # LLDB isn't available everywhere...
51 akien 1098716 %if !0%{?rhel}
52     %bcond_without lldb
53     %else
54 akien 1093561 %bcond_with lldb
55 akien 1098716 %endif
56 akien 1093561 %else
57 akien 1098716 %bcond_with lldb
58 akien 1093561 %endif
59 akien 1085562
60 akien 1228274 # Some sub-packages are versioned independently of the rust compiler and runtime itself.
61 akien 1239841 # Also beware that if any of these are not changed in a version bump, then the release
62     # number should still increase, not be reset to 1!
63 akien 1308362 %global rustc_version 1.29.1
64     %global cargo_version 1.29.0
65     %global rustfmt_version 0.99.1
66     %global rls_version 0.130.0
67     %global clippy_version 0.0.212
68 akien 1093561
69 akien 1057871 Name: rust
70 akien 1228274 Version: %{rustc_version}
71 akien 1308362 Release: %mkrel 1
72 akien 1057871 Summary: The Rust Programming Language
73 akien 1085562 %if 0%{?mageia}
74 akien 1076533 Group: Development/Other
75 akien 1085562 %endif
76 akien 1228274 License: (ASL 2.0 or MIT) and (BSD and MIT)
77 akien 1057871 # ^ written as: (rust itself) and (bundled libraries)
78     URL: https://www.rust-lang.org
79 akien 1076532 ExclusiveArch: %{rust_arches}
80 akien 1057871
81     %if "%{channel}" == "stable"
82 akien 1228274 %global rustc_package rustc-%{rustc_version}-src
83 akien 1057871 %else
84 akien 1085562 %global rustc_package rustc-%{channel}-src
85 akien 1057871 %endif
86 akien 1130315 Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
87 akien 1057871
88 akien 1251113 # https://github.com/rust-lang/rust/pull/52876
89 akien 1308362 Patch1: rust-52876-const-endianess.patch
90 akien 1239841
91 akien 1308362 # https://github.com/rust-lang/rust/pull/53436
92     Patch2: 0001-std-stop-backtracing-when-the-frames-are-full.patch
93    
94     # https://github.com/rust-lang/rust/pull/53437
95     Patch3: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch
96    
97 akien 1076532 # Get the Rust triple for any arch.
98     %{lua: function rust_triple(arch)
99     local abi = "gnu"
100     if arch == "armv7hl" then
101     arch = "armv7"
102     abi = "gnueabihf"
103     elseif arch == "ppc64" then
104     arch = "powerpc64"
105     elseif arch == "ppc64le" then
106     arch = "powerpc64le"
107 akien 1192969 elseif arch == "i586" then
108     arch = "i686"
109 akien 1076532 end
110     return arch.."-unknown-linux-"..abi
111     end}
112 pterjan 1058164
113 akien 1076532 %global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))}
114    
115     %if %defined bootstrap_arches
116     # For each bootstrap arch, add an additional binary Source.
117     # Also define bootstrap_source just for the current target.
118     %{lua: do
119     local bootstrap_arches = {}
120     for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do
121     table.insert(bootstrap_arches, arch)
122     end
123     local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}"
124 akien 1093561 .."/rust-%{bootstrap_channel}")
125 akien 1076532 local target_arch = rpm.expand("%{_target_cpu}")
126     for i, arch in ipairs(bootstrap_arches) do
127 akien 1151630 print(string.format("Source%d: %s-%s.tar.xz\n",
128 akien 1076532 i, base, rust_triple(arch)))
129     if arch == target_arch then
130     rpm.define("bootstrap_source "..i)
131     end
132     end
133     end}
134 akien 1057871 %endif
135    
136 akien 1076532 %ifarch %{bootstrap_arches}
137 akien 1093561 %global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple}
138 akien 1107392 %global local_rust_root %{_builddir}/%{bootstrap_root}/usr
139 akien 1093561 Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust}
140 akien 1057871 %else
141 akien 1093561 BuildRequires: cargo >= %{bootstrap_cargo}
142 akien 1215099 %if 0%{?fedora} >= 27
143 akien 1228274 BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{rustc_version})
144 akien 1215099 %else
145 akien 1093561 BuildRequires: %{name} >= %{bootstrap_rust}
146 akien 1228274 BuildConflicts: %{name} > %{rustc_version}
147 akien 1215099 %endif
148 akien 1076532 %global local_rust_root %{_prefix}
149 akien 1057871 %endif
150    
151     BuildRequires: make
152     BuildRequires: gcc
153     BuildRequires: gcc-c++
154 akien 1151628 BuildRequires: ncurses-devel
155 akien 1057871 BuildRequires: curl
156 akien 1228274 BuildRequires: pkgconfig(libcurl)
157     BuildRequires: pkgconfig(liblzma)
158     BuildRequires: pkgconfig(openssl)
159     BuildRequires: pkgconfig(zlib)
160 akien 1057871
161 akien 1308362 %if %without bundled_libgit2
162     BuildRequires: pkgconfig(libgit2) >= 0.27
163     %endif
164    
165     %if %without bundled_libssh2
166     # needs libssh2_userauth_publickey_frommemory
167     BuildRequires: pkgconfig(libssh2) >= 1.6.0
168     %endif
169    
170 akien 1208625 %if 0%{?rhel} && 0%{?rhel} <= 7
171     %global python python2
172     %else
173     %global python python3
174     %endif
175     BuildRequires: %{python}
176    
177 akien 1098716 %if %with bundled_llvm
178 akien 1193979 BuildRequires: cmake3 >= 3.4.3
179 akien 1308362 Provides: bundled(llvm) = 7.0
180 akien 1085562 %else
181 akien 1239841 BuildRequires: cmake >= 2.8.11
182 akien 1215099 %if 0%{?epel}
183 akien 1208625 %global llvm llvm5.0
184 akien 1179950 %endif
185     %if %defined llvm
186 akien 1098716 %global llvm_root %{_libdir}/%{llvm}
187     %else
188     %global llvm llvm
189     %global llvm_root %{_prefix}
190     %endif
191 akien 1308362 BuildRequires: %{llvm}-devel >= 5.0
192 akien 1062905 %if %with llvm_static
193 akien 1098716 BuildRequires: %{llvm}-static
194 akien 1062905 BuildRequires: libffi-devel
195     %endif
196 akien 1085562 %endif
197 akien 1062905
198 akien 1058123 # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs
199 akien 1057887 BuildRequires: procps-ng
200 akien 1057871
201 akien 1093561 # debuginfo-gdb tests need gdb
202     BuildRequires: gdb
203    
204 akien 1057871 # TODO: work on unbundling these!
205 akien 1251113 Provides: bundled(libbacktrace) = 8.1.0
206 akien 1208625 Provides: bundled(miniz) = 1.16~beta+r1
207 akien 1057871
208 akien 1066912 # Virtual provides for folks who attempt "dnf install rustc"
209 akien 1228274 Provides: rustc = %{rustc_version}-%{release}
210     Provides: rustc%{?_isa} = %{rustc_version}-%{release}
211 akien 1066912
212     # Always require our exact standard library
213 akien 1228274 Requires: %{name}-std-static%{?_isa} = %{rustc_version}-%{release}
214 akien 1066912
215 akien 1057871 # The C compiler is needed at runtime just for linking. Someday rustc might
216     # invoke the linker directly, and then we'll only need binutils.
217     # https://github.com/rust-lang/rust/issues/11937
218 akien 1151630 %if 0%{?mageia}
219 akien 1057871 Requires: gcc
220 akien 1151630 %else
221     Requires: /usr/bin/cc
222     %endif
223 akien 1057871
224     # ALL Rust libraries are private, because they don't keep an ABI.
225 akien 1308362 %global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.*
226 akien 1057871 %global __provides_exclude ^(%{_privatelibs})$
227     %global __requires_exclude ^(%{_privatelibs})$
228 akien 1251113 %global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
229     %global __requires_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
230 akien 1057871
231 akien 1085562 # While we don't want to encourage dynamic linking to Rust shared libraries, as
232     # there's no stable ABI, we still need the unallocated metadata (.rustc) to
233     # support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is
234     # very eager by default, so we have to limit it to -g, only debugging symbols.
235 akien 1172054 %if 0%{?fedora} >= 27 || 0%{?mageia} >= 7
236 akien 1151628 # Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997
237     %global _find_debuginfo_opts --keep-section .rustc
238     %else
239 akien 1085562 %global _find_debuginfo_opts -g
240     %undefine _include_minidebuginfo
241 akien 1151628 %endif
242 akien 1085562
243 akien 1098716 # Use hardening ldflags.
244     %global rustflags -Clink-arg=-Wl,-z,relro,-z,now
245    
246     %if %{without bundled_llvm} && "%{llvm_root}" != "%{_prefix}"
247     # https://github.com/rust-lang/rust/issues/40717
248 akien 1107392 %global library_path $(%{llvm_root}/bin/llvm-config --libdir)
249 akien 1098716 %endif
250    
251 thatsamguy 494699 %description
252 akien 1057871 Rust is a systems programming language that runs blazingly fast, prevents
253     segfaults, and guarantees thread safety.
254 thatsamguy 494699
255 akien 1066912 This package includes the Rust compiler and documentation generator.
256 thatsamguy 494699
257 akien 1057871
258 akien 1066912 %package std-static
259     Summary: Standard library for Rust
260    
261     %description std-static
262     This package includes the standard libraries for building applications
263     written in Rust.
264    
265    
266 akien 1098716 %package debugger-common
267     Summary: Common debugger pretty printers for Rust
268     BuildArch: noarch
269    
270     %description debugger-common
271     This package includes the common functionality for %{name}-gdb and %{name}-lldb.
272    
273 akien 1239841
274 akien 1057871 %package gdb
275     Summary: GDB pretty printers for Rust
276     BuildArch: noarch
277     Requires: gdb
278 akien 1228274 Requires: %{name}-debugger-common = %{rustc_version}-%{release}
279 akien 1057871
280 akien 1085562 %if 0%{?mageia} == 6
281 akien 1057888 # (akien) Handle moved files between our old Mageia package and this Fedora-based one
282     Conflicts: rust < 1.11.0-3
283 akien 1085562 %endif
284 akien 1057888
285 akien 1098861 %description gdb
286     This package includes the rust-gdb script, which allows easier debugging of Rust
287     programs.
288 akien 1057871
289 akien 1098861
290 akien 1093561 %if %with lldb
291    
292     %package lldb
293     Summary: LLDB pretty printers for Rust
294 akien 1093562
295 akien 1098716 # It could be noarch, but lldb has limited availability
296     #BuildArch: noarch
297    
298 akien 1093561 Requires: lldb
299 akien 1208625 %if 0%{?mageia} == 6
300 akien 1093562 Requires: python-lldb
301 akien 1208625 %else
302     Requires: python2-lldb
303     %endif
304 akien 1228274 Requires: %{name}-debugger-common = %{rustc_version}-%{release}
305 akien 1093561
306     %description lldb
307     This package includes the rust-lldb script, which allows easier debugging of Rust
308     programs.
309    
310     %endif
311    
312    
313 shlomif 990941 %package doc
314 akien 1057871 Summary: Documentation for Rust
315     # NOT BuildArch: noarch
316     # Note, while docs are mostly noarch, some things do vary by target_arch.
317     # Koji will fail the build in rpmdiff if two architectures build a noarch
318     # subpackage differently, so instead we have to keep its arch.
319 thatsamguy 494699
320 shlomif 990941 %description doc
321 akien 1057871 This package includes HTML documentation for the Rust programming language and
322     its standard library.
323 thatsamguy 494699
324 akien 1057871
325 akien 1228274 %package -n cargo
326     Summary: Rust's package manager and build tool
327     Version: %{cargo_version}
328     %if %with bundled_libgit2
329 akien 1239841 Provides: bundled(libgit2) = 0.27
330 akien 1228274 %endif
331 akien 1308362 %if %with bundled_libssh2
332     Provides: bundled(libssh2) = 1.8.1
333     %endif
334 akien 1228274 # For tests:
335     BuildRequires: git
336     # Cargo is not much use without Rust
337     Requires: rust
338    
339 akien 1228276 %if 0%{?mageia}
340     Obsoletes: cargo < 1.26.0-1
341     %endif
342    
343 akien 1228274 %description -n cargo
344     Cargo is a tool that allows Rust projects to declare their various dependencies
345     and ensure that you'll always get a repeatable build.
346    
347    
348     %package -n cargo-doc
349     Summary: Documentation for Cargo
350     Version: %{cargo_version}
351     BuildArch: noarch
352     # Cargo no longer builds its own documentation
353     # https://github.com/rust-lang/cargo/pull/4904
354 akien 1308362 Requires: rust-doc = %{rustc_version}-%{release}
355 akien 1228274
356 akien 1228276 %if 0%{?mageia}
357     Obsoletes: cargo-doc < 1.26.0-1
358     %endif
359    
360 akien 1228274 %description -n cargo-doc
361     This package includes HTML documentation for Cargo.
362    
363    
364 akien 1215099 %package -n rustfmt-preview
365     Summary: Tool to find and fix Rust formatting issues
366 akien 1228274 Version: %{rustfmt_version}
367 akien 1215099 Requires: cargo
368    
369     # Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9.
370     # It's expected to stay "preview" until it's released as 1.0.
371     Obsoletes: rustfmt <= 0.9.0
372 akien 1228274 Provides: rustfmt = %{rustfmt_version}
373 akien 1215099
374     %description -n rustfmt-preview
375     A tool for formatting Rust code according to style guidelines.
376    
377    
378 akien 1228274 %package -n rls-preview
379     Summary: Rust Language Server for IDE integration
380     Version: %{rls_version}
381     Provides: rls = %{rls_version}
382     %if %with bundled_libgit2
383 akien 1239841 Provides: bundled(libgit2) = 0.27
384 akien 1228274 %endif
385 akien 1308362 %if %with bundled_libssh2
386     Provides: bundled(libssh2) = 1.8.1
387     %endif
388 akien 1228274 Requires: rust-analysis
389     # /usr/bin/rls is dynamically linked against internal rustc libs
390     Requires: %{name}%{?_isa} = %{rustc_version}-%{release}
391    
392     %description -n rls-preview
393     The Rust Language Server provides a server that runs in the background,
394     providing IDEs, editors, and other tools with information about Rust programs.
395     It supports functionality such as 'goto definition', symbol search,
396     reformatting, and code completion, and enables renaming and refactorings.
397    
398    
399 akien 1308362 %package -n clippy-preview
400     Summary: Lints to catch common mistakes and improve your Rust code
401     Version: %{clippy_version}
402     License: MPLv2.0
403     Provides: clippy = %{clippy_version}
404     Requires: cargo
405     # /usr/bin/clippy-driver is dynamically linked against internal rustc libs
406     Requires: %{name}%{?_isa} = %{rustc_version}-%{release}
407    
408     %description -n clippy-preview
409     A collection of lints to catch common mistakes and improve your Rust code.
410    
411    
412 akien 1151630 %package src
413     Summary: Sources for the Rust standard library
414     BuildArch: noarch
415    
416     %description src
417     This package includes source files for the Rust standard library. It may be
418     useful as a reference for code completion tools in various editors.
419    
420    
421 akien 1228274 %package analysis
422     Summary: Compiler analysis data for the Rust standard library
423     Requires: rust-std-static%{?_isa} = %{rustc_version}-%{release}
424    
425     %description analysis
426     This package contains analysis data files produced with rustc's -Zsave-analysis
427     feature for the Rust standard library. The RLS (Rust Language Server) uses this
428     data to provide information about the Rust standard library.
429    
430    
431 thatsamguy 494699 %prep
432    
433 akien 1076532 %ifarch %{bootstrap_arches}
434     %setup -q -n %{bootstrap_root} -T -b %{bootstrap_source}
435 akien 1093561 ./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \
436 akien 1107392 --prefix=%{local_rust_root} --disable-ldconfig
437 akien 1093561 test -f '%{local_rust_root}/bin/cargo'
438 akien 1058123 test -f '%{local_rust_root}/bin/rustc'
439     %endif
440 akien 1057871
441 akien 1076532 %setup -q -n %{rustc_package}
442 akien 1058123
443 akien 1228274 %patch1 -p1
444 pterjan 1237705 %patch2 -p1
445 akien 1308362 %patch3 -p1
446 akien 1208625
447     %if "%{python}" == "python3"
448     sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
449     %endif
450    
451 akien 1151630 # We're disabling jemalloc, but rust-src still wants it.
452     # rm -rf src/jemalloc/
453 akien 1156429
454 akien 1085562 %if %without bundled_llvm
455 akien 1058123 rm -rf src/llvm/
456 akien 1085562 %endif
457 akien 1057871
458 akien 1215099 # We never enable emscripten.
459     rm -rf src/llvm-emscripten/
460    
461 akien 1057871 # extract bundled licenses for packaging
462     sed -e '/*\//q' src/libbacktrace/backtrace.h \
463     >src/libbacktrace/LICENSE-libbacktrace
464    
465 akien 1130315 # This tests a problem of exponential growth, which seems to be less-reliably
466     # fixed when running on older LLVM and/or some arches. Just skip it for now.
467     sed -i.ignore -e '1i // ignore-test may still be exponential...' \
468     src/test/run-pass/issue-41696.rs
469    
470 akien 1098716 %if %{with bundled_llvm} && 0%{?epel}
471 akien 1093561 mkdir -p cmake-bin
472     ln -s /usr/bin/cmake3 cmake-bin/cmake
473     %global cmake_path $PWD/cmake-bin
474 akien 1085562 %endif
475    
476     %if %{without bundled_llvm} && %{with llvm_static}
477 akien 1062905 # Static linking to distro LLVM needs to add -lffi
478     # https://github.com/rust-lang/rust/issues/34486
479     sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
480     src/librustc_llvm/lib.rs
481     %endif
482 akien 1057871
483 akien 1130315 # The configure macro will modify some autoconf-related files, which upsets
484     # cargo when it tries to verify checksums in those files. If we just truncate
485     # that file list, cargo won't have anything to complain about.
486     find src/vendor -name .cargo-checksum.json \
487     -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
488 akien 1093561
489 akien 1130315
490 thatsamguy 494699 %build
491 akien 1060081
492 akien 1228274 %if %without bundled_libgit2
493     # convince libgit2-sys to use the distro libgit2
494     export LIBGIT2_SYS_USE_PKG_CONFIG=1
495     %endif
496    
497 akien 1308362 %if %without bundled_libssh2
498     # convince libssh2-sys to use the distro libssh2
499     export LIBSSH2_SYS_USE_PKG_CONFIG=1
500     %endif
501    
502 akien 1093561 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
503 akien 1107392 %{?library_path:export LIBRARY_PATH="%{library_path}"}
504     %{?rustflags:export RUSTFLAGS="%{rustflags}"}
505 akien 1066912
506 akien 1076532 # We're going to override --libdir when configuring to get rustlib into a
507 akien 1085562 # common path, but we'll fix the shared libraries during install.
508 akien 1076532 %global common_libdir %{_prefix}/lib
509     %global rustlibdir %{common_libdir}/rustlib
510 akien 1066912
511 akien 1239841 %ifarch %{arm} %{ix86}
512 akien 1179950 # full debuginfo is exhausting memory; just do libstd for now
513     # https://github.com/rust-lang/rust/issues/45854
514 akien 1228274 %define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
515 akien 1179950 %else
516 akien 1228274 %define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
517 akien 1179950 %endif
518    
519 akien 1057871 %configure --disable-option-checking \
520 akien 1066912 --libdir=%{common_libdir} \
521 akien 1057871 --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
522 akien 1215099 --local-rust-root=%{local_rust_root} \
523 akien 1098716 %{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \
524 akien 1085562 %{!?with_llvm_static: --enable-llvm-link-shared } } \
525 akien 1057871 --disable-jemalloc \
526     --disable-rpath \
527 akien 1179950 %{enable_debuginfo} \
528 akien 1228274 --enable-extended \
529 akien 1093561 --enable-vendor \
530 akien 1251113 --enable-verbose-tests \
531 akien 1208625 --release-channel=%{channel}
532 thatsamguy 494699
533 akien 1208625 %{python} ./x.py build
534     %{python} ./x.py doc
535 thatsamguy 494699
536 akien 1057871
537 thatsamguy 494699 %install
538 akien 1093561 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
539 akien 1107392 %{?library_path:export LIBRARY_PATH="%{library_path}"}
540     %{?rustflags:export RUSTFLAGS="%{rustflags}"}
541 thatsamguy 494699
542 akien 1208625 DESTDIR=%{buildroot} %{python} ./x.py install
543 akien 1093561
544 akien 1107389 # Make sure the shared libraries are in the proper libdir
545     %if "%{_libdir}" != "%{common_libdir}"
546     mkdir -p %{buildroot}%{_libdir}
547     find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \
548     -exec mv -v -t %{buildroot}%{_libdir} '{}' '+'
549     %endif
550 akien 1066912
551 akien 1107389 # The shared libraries should be executable for debuginfo extraction.
552     find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
553     -exec chmod -v +x '{}' '+'
554    
555     # The libdir libraries are identical to those under rustlib/. It's easier on
556     # library loading if we keep them in libdir, but we do need them in rustlib/
557     # to support dynamic linking for compiler plugins, so we'll symlink.
558     (cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" &&
559 akien 1208625 find ../../../../%{_lib} -maxdepth 1 -name '*.so' |
560     while read lib; do
561     # make sure they're actually identical!
562     cmp "$lib" "${lib##*/}"
563     ln -v -f -s -t . "$lib"
564     done)
565 akien 1107389
566 akien 1057871 # Remove installer artifacts (manifests, uninstall scripts, etc.)
567 akien 1085562 find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
568 akien 1057871
569 akien 1251113 # Remove backup files from %%configure munging
570     find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
571    
572 akien 1308362 # https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
573     # We don't actually need to ship any of those python scripts in rust-src anyway.
574     find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
575    
576 akien 1057871 # FIXME: __os_install_post will strip the rlibs
577     # -- should we find a way to preserve debuginfo?
578    
579     # Remove unwanted documentation files (we already package them)
580 akien 1085562 rm -f %{buildroot}%{_docdir}/%{name}/README.md
581     rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
582 akien 1308362 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
583 akien 1085562 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
584     rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
585 akien 1228274 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY
586 akien 1215099 rm -f %{buildroot}%{_docdir}/%{name}/*.old
587 akien 1057871
588     # Sanitize the HTML documentation
589 akien 1085562 find %{buildroot}%{_docdir}/%{name}/html -empty -delete
590     find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
591 akien 1057871
592 akien 1228274 # Create the path for crate-devel packages
593     mkdir -p %{buildroot}%{_datadir}/cargo/registry
594    
595     # Cargo no longer builds its own documentation
596     # https://github.com/rust-lang/cargo/pull/4904
597 akien 1308362 mkdir -p %{buildroot}%{_docdir}/cargo
598     ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html
599 akien 1228274
600 akien 1093561 %if %without lldb
601     rm -f %{buildroot}%{_bindir}/rust-lldb
602     rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
603     %endif
604 akien 1057871
605 akien 1093561
606 akien 1057871 %check
607 akien 1093561 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
608 akien 1107392 %{?library_path:export LIBRARY_PATH="%{library_path}"}
609     %{?rustflags:export RUSTFLAGS="%{rustflags}"}
610 akien 1093561
611 akien 1057871 # The results are not stable on koji, so mask errors and just log it.
612 akien 1208625 %{python} ./x.py test --no-fail-fast || :
613 akien 1228274 %{python} ./x.py test --no-fail-fast cargo || :
614 akien 1308362 %{python} ./x.py test --no-fail-fast clippy || :
615 akien 1228274 %{python} ./x.py test --no-fail-fast rls || :
616     %{python} ./x.py test --no-fail-fast rustfmt || :
617 akien 1057871
618    
619 akien 1208625 %if ! 0%{?mageia}
620     %ldconfig_scriptlets
621     %endif
622 akien 1085562
623    
624 thatsamguy 494699 %files
625 akien 1057871 %license COPYRIGHT LICENSE-APACHE LICENSE-MIT
626     %license src/libbacktrace/LICENSE-libbacktrace
627     %doc README.md
628 thatsamguy 494699 %{_bindir}/rustc
629     %{_bindir}/rustdoc
630 akien 1107389 %{_libdir}/*.so
631 akien 1057871 %{_mandir}/man1/rustc.1*
632     %{_mandir}/man1/rustdoc.1*
633 akien 1085562 %dir %{rustlibdir}
634     %dir %{rustlibdir}/%{rust_triple}
635     %dir %{rustlibdir}/%{rust_triple}/lib
636     %{rustlibdir}/%{rust_triple}/lib/*.so
637 akien 1215099 %{rustlibdir}/%{rust_triple}/codegen-backends/
638 thatsamguy 494699
639 akien 1057871
640 akien 1066912 %files std-static
641     %dir %{rustlibdir}
642     %dir %{rustlibdir}/%{rust_triple}
643     %dir %{rustlibdir}/%{rust_triple}/lib
644     %{rustlibdir}/%{rust_triple}/lib/*.rlib
645    
646    
647 akien 1098716 %files debugger-common
648 akien 1066912 %dir %{rustlibdir}
649     %dir %{rustlibdir}/etc
650 akien 1093561 %{rustlibdir}/etc/debugger_*.py*
651 akien 1098716
652    
653     %files gdb
654     %{_bindir}/rust-gdb
655 akien 1093561 %{rustlibdir}/etc/gdb_*.py*
656 akien 1057871
657    
658 akien 1093561 %if %with lldb
659     %files lldb
660     %{_bindir}/rust-lldb
661     %{rustlibdir}/etc/lldb_*.py*
662     %endif
663    
664    
665 shlomif 990941 %files doc
666 akien 1098716 %docdir %{_docdir}/%{name}
667 akien 1057871 %dir %{_docdir}/%{name}
668 akien 1098716 %dir %{_docdir}/%{name}/html
669     %{_docdir}/%{name}/html/*/
670     %{_docdir}/%{name}/html/*.html
671     %{_docdir}/%{name}/html/*.css
672     %{_docdir}/%{name}/html/*.js
673 akien 1215099 %{_docdir}/%{name}/html/*.svg
674 akien 1098716 %{_docdir}/%{name}/html/*.woff
675     %license %{_docdir}/%{name}/html/*.txt
676 akien 1151630
677    
678 akien 1228274 %files -n cargo
679     %license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY
680     %doc src/tools/cargo/README.md
681     %{_bindir}/cargo
682     %{_mandir}/man1/cargo*.1*
683     %{_sysconfdir}/bash_completion.d/cargo
684     %{_datadir}/zsh/site-functions/_cargo
685     %dir %{_datadir}/cargo
686     %dir %{_datadir}/cargo/registry
687    
688    
689     %files -n cargo-doc
690 akien 1308362 %docdir %{_docdir}/cargo
691     %dir %{_docdir}/cargo
692 akien 1228274 %{_docdir}/cargo/html
693    
694    
695 akien 1215099 %files -n rustfmt-preview
696     %{_bindir}/rustfmt
697     %{_bindir}/cargo-fmt
698     %doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
699     %license src/tools/rustfmt/LICENSE-{APACHE,MIT}
700    
701    
702 akien 1228274 %files -n rls-preview
703     %{_bindir}/rls
704     %doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
705     %license src/tools/rls/LICENSE-{APACHE,MIT}
706    
707    
708 akien 1308362 %files -n clippy-preview
709     %{_bindir}/cargo-clippy
710     %{_bindir}/clippy-driver
711     %doc src/tools/clippy/{README.md,CHANGELOG.md}
712     %license src/tools/clippy/LICENSE
713    
714    
715 akien 1151630 %files src
716     %dir %{rustlibdir}
717     %{rustlibdir}/src
718 akien 1228274
719    
720     %files analysis
721     %{rustlibdir}/%{rust_triple}/analysis/

  ViewVC Help
Powered by ViewVC 1.1.30