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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30