[11321] | 1 | %bcond_with bootstrap |
---|
[11972] | 2 | %bcond_with test |
---|
[11321] | 3 | |
---|
[11972] | 4 | # Some sub-packages are versioned independently of the rust compiler and runtime itself. |
---|
| 5 | # Also beware that if any of these are not changed in a version bump, then the release |
---|
| 6 | # number should still increase, not be reset to 1! |
---|
| 7 | %global rustc_version 1.30.1 |
---|
| 8 | %global cargo_version 1.30.0 |
---|
| 9 | %global rustfmt_version 0.99.4 |
---|
| 10 | %global rls_version 0.130.5 |
---|
| 11 | %global clippy_version 0.0.212 |
---|
| 12 | |
---|
[11321] | 13 | %define _unpackaged_files_terminate_build 1 |
---|
| 14 | |
---|
| 15 | # Only x86_64 and i686 are Tier 1 platforms at this time. |
---|
| 16 | # https://forge.rust-lang.org/platform-support.html |
---|
| 17 | %global rust_arches x86_64 i686 |
---|
| 18 | |
---|
| 19 | # The channel can be stable, beta, or nightly |
---|
| 20 | %{!?channel: %global channel stable} |
---|
| 21 | |
---|
| 22 | # To bootstrap from scratch, set the channel and date from src/stage0.txt |
---|
| 23 | # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 |
---|
| 24 | # or nightly wants some beta-YYYY-MM-DD |
---|
[11972] | 25 | %global bootstrap_rust 1.30.1 |
---|
| 26 | %global bootstrap_cargo 1.30.0 |
---|
[11321] | 27 | %global bootstrap_channel %{bootstrap_rust} |
---|
| 28 | |
---|
| 29 | # Only the specified arches will use bootstrap binaries. |
---|
| 30 | %if %{with bootstrap} |
---|
| 31 | %global bootstrap_arches %%{rust_arches} |
---|
| 32 | %endif |
---|
| 33 | |
---|
| 34 | # We generally don't want llvm-static present at all, since llvm-config will |
---|
| 35 | # make us link statically. But we can opt in, e.g. to aid LLVM rebases. |
---|
| 36 | # FIXME: LLVM 3.9 prefers shared linking now! Which is good, but next time we |
---|
| 37 | # *want* static we'll have to force it with "llvm-config --link-static". |
---|
| 38 | # See also https://github.com/rust-lang/rust/issues/36854 |
---|
| 39 | # The new rustbuild accepts `--enable-llvm-link-shared`, else links static. |
---|
| 40 | %bcond_with llvm_static |
---|
| 41 | |
---|
| 42 | # We can also choose to just use Rust's bundled LLVM, in case the system LLVM |
---|
| 43 | # is insufficient. Rust currently requires LLVM 3.7+. |
---|
| 44 | %bcond_with bundled_llvm |
---|
| 45 | |
---|
| 46 | # LLDB only works on some architectures |
---|
| 47 | %ifarch %{arm} aarch64 %{ix86} x86_64 |
---|
| 48 | # LLDB isn't available everywhere... |
---|
| 49 | %bcond_without lldb |
---|
| 50 | %else |
---|
| 51 | %bcond_with lldb |
---|
| 52 | %endif |
---|
| 53 | |
---|
| 54 | Name: rust |
---|
[11972] | 55 | Version: 1.30.1 |
---|
[11321] | 56 | Release: 1%{?_dist_release} |
---|
| 57 | Summary: The Rust Programming Language |
---|
| 58 | License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) |
---|
| 59 | # ^ written as: (rust itself) and (bundled libraries) |
---|
| 60 | URL: https://www.rust-lang.org |
---|
| 61 | ExclusiveArch: %{rust_arches} |
---|
| 62 | |
---|
[11972] | 63 | Vendor: Project Vine |
---|
| 64 | Distribution: Vine Linux |
---|
| 65 | |
---|
[11321] | 66 | %if "%{channel}" == "stable" |
---|
| 67 | %global rustc_package rustc-%{version}-src |
---|
| 68 | %else |
---|
| 69 | %global rustc_package rustc-%{channel}-src |
---|
| 70 | %endif |
---|
| 71 | Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.gz |
---|
| 72 | |
---|
| 73 | # Get the Rust triple for any arch. |
---|
| 74 | %{lua: function rust_triple(arch) |
---|
| 75 | local abi = "gnu" |
---|
| 76 | if arch == "armv7hl" then |
---|
| 77 | arch = "armv7" |
---|
| 78 | abi = "gnueabihf" |
---|
| 79 | elseif arch == "ppc64" then |
---|
| 80 | arch = "powerpc64" |
---|
| 81 | elseif arch == "ppc64le" then |
---|
| 82 | arch = "powerpc64le" |
---|
| 83 | end |
---|
| 84 | return arch.."-unknown-linux-"..abi |
---|
| 85 | end} |
---|
| 86 | |
---|
| 87 | %global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} |
---|
| 88 | |
---|
| 89 | %if %defined bootstrap_arches |
---|
| 90 | # For each bootstrap arch, add an additional binary Source. |
---|
| 91 | # Also define bootstrap_source just for the current target. |
---|
| 92 | %{lua: do |
---|
| 93 | local bootstrap_arches = {} |
---|
| 94 | for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do |
---|
| 95 | table.insert(bootstrap_arches, arch) |
---|
| 96 | end |
---|
[11972] | 97 | local base = rpm.expand("https://static.rust-lang.org/dist" |
---|
[11321] | 98 | .."/rust-%{bootstrap_channel}") |
---|
| 99 | local target_arch = rpm.expand("%{_target_cpu}") |
---|
| 100 | for i, arch in ipairs(bootstrap_arches) do |
---|
| 101 | print(string.format("Source%d: %s-%s.tar.gz\n", |
---|
| 102 | i, base, rust_triple(arch))) |
---|
| 103 | if arch == target_arch then |
---|
| 104 | rpm.define("bootstrap_source "..i) |
---|
| 105 | end |
---|
| 106 | end |
---|
| 107 | end} |
---|
| 108 | %endif |
---|
| 109 | |
---|
| 110 | %ifarch %{bootstrap_arches} |
---|
| 111 | %global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple} |
---|
| 112 | %global local_rust_root %{_builddir}/%{bootstrap_root}/usr |
---|
| 113 | Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} |
---|
| 114 | %else |
---|
| 115 | BuildRequires: cargo >= %{bootstrap_cargo} |
---|
| 116 | BuildRequires: %{name} >= %{bootstrap_rust} |
---|
| 117 | BuildConflicts: %{name} > %{version} |
---|
| 118 | %global local_rust_root %{_prefix} |
---|
| 119 | %endif |
---|
| 120 | |
---|
| 121 | BuildRequires: cmake |
---|
| 122 | BuildRequires: make |
---|
| 123 | BuildRequires: gcc |
---|
| 124 | BuildRequires: gcc-c++ |
---|
[11972] | 125 | BuildRequires: libgit2-devel |
---|
| 126 | BuildRequires: libssh2-devel |
---|
[11321] | 127 | BuildRequires: ncurses-devel |
---|
[11972] | 128 | BuildRequires: openssl-devel |
---|
[11321] | 129 | BuildRequires: zlib-devel |
---|
| 130 | BuildRequires: python |
---|
| 131 | BuildRequires: curl |
---|
| 132 | |
---|
| 133 | %if %{with bundled_llvm} |
---|
| 134 | BuildRequires: cmake |
---|
| 135 | Provides: bundled(llvm) = 4.0 |
---|
| 136 | %else |
---|
| 137 | %if %defined llvm |
---|
| 138 | %global llvm_root %{_libdir}/%{llvm} |
---|
| 139 | %else |
---|
| 140 | %global llvm llvm |
---|
| 141 | %global llvm_root %{_prefix} |
---|
| 142 | %endif |
---|
[11972] | 143 | BuildRequires: %{llvm}-devel >= 7.0.0 |
---|
[11321] | 144 | %if %{with llvm_static} |
---|
| 145 | BuildRequires: %{llvm}-static |
---|
| 146 | BuildRequires: libffi-devel |
---|
| 147 | %else |
---|
| 148 | # Make sure llvm-config doesn't see it. |
---|
| 149 | BuildConflicts: %{llvm}-static |
---|
| 150 | %endif |
---|
| 151 | %endif |
---|
| 152 | |
---|
| 153 | # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs |
---|
| 154 | BuildRequires: procps |
---|
| 155 | |
---|
| 156 | # debuginfo-gdb tests need gdb |
---|
| 157 | BuildRequires: gdb |
---|
| 158 | |
---|
| 159 | # TODO: work on unbundling these! |
---|
| 160 | Provides: bundled(jquery) = 2.1.4 |
---|
| 161 | Provides: bundled(libbacktrace) = 6.1.0 |
---|
| 162 | Provides: bundled(miniz) = 1.14 |
---|
| 163 | |
---|
| 164 | # Virtual provides for folks who attempt "dnf install rustc" |
---|
| 165 | Provides: rustc = %{version}-%{release} |
---|
| 166 | Provides: rustc%{?_isa} = %{version}-%{release} |
---|
| 167 | |
---|
| 168 | # Always require our exact standard library |
---|
| 169 | Requires: %{name}-std-static%{?_isa} = %{version}-%{release} |
---|
| 170 | |
---|
| 171 | # The C compiler is needed at runtime just for linking. Someday rustc might |
---|
| 172 | # invoke the linker directly, and then we'll only need binutils. |
---|
| 173 | # https://github.com/rust-lang/rust/issues/11937 |
---|
| 174 | Requires: /usr/bin/cc |
---|
| 175 | |
---|
| 176 | # ALL Rust libraries are private, because they don't keep an ABI. |
---|
| 177 | %global _privatelibs lib.*-[[:xdigit:]]*[.]so.* |
---|
| 178 | %global __provides_exclude ^(%{_privatelibs})$ |
---|
| 179 | %global __requires_exclude ^(%{_privatelibs})$ |
---|
| 180 | %global __provides_exclude_from ^%{_docdir}/.*$ |
---|
| 181 | %global __requires_exclude_from ^%{_docdir}/.*$ |
---|
| 182 | |
---|
| 183 | # While we don't want to encourage dynamic linking to Rust shared libraries, as |
---|
| 184 | # there's no stable ABI, we still need the unallocated metadata (.rustc) to |
---|
| 185 | # support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is |
---|
| 186 | # very eager by default, so we have to limit it to -g, only debugging symbols. |
---|
| 187 | %if 0%{?fedora} >= 27 |
---|
| 188 | # Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 |
---|
| 189 | %global _find_debuginfo_opts --keep-section .rustc |
---|
| 190 | %else |
---|
| 191 | %global _find_debuginfo_opts -g |
---|
| 192 | %undefine _include_minidebuginfo |
---|
| 193 | %endif |
---|
| 194 | |
---|
| 195 | # Use hardening ldflags. |
---|
| 196 | %global rustflags -Clink-arg=-Wl,-z,relro,-z,now |
---|
| 197 | |
---|
| 198 | %if %{without bundled_llvm} && "%{llvm_root}" != "%{_prefix}" |
---|
| 199 | # https://github.com/rust-lang/rust/issues/40717 |
---|
| 200 | %global library_path $(%{llvm_root}/bin/llvm-config --libdir) |
---|
| 201 | %endif |
---|
| 202 | |
---|
| 203 | %description |
---|
| 204 | Rust is a systems programming language that runs blazingly fast, prevents |
---|
| 205 | segfaults, and guarantees thread safety. |
---|
| 206 | |
---|
| 207 | This package includes the Rust compiler and documentation generator. |
---|
| 208 | |
---|
| 209 | |
---|
| 210 | %package std-static |
---|
| 211 | Summary: Standard library for Rust |
---|
| 212 | |
---|
| 213 | %description std-static |
---|
| 214 | This package includes the standard libraries for building applications |
---|
| 215 | written in Rust. |
---|
| 216 | |
---|
| 217 | |
---|
| 218 | %package debugger-common |
---|
| 219 | Summary: Common debugger pretty printers for Rust |
---|
| 220 | BuildArch: noarch |
---|
| 221 | |
---|
| 222 | %description debugger-common |
---|
| 223 | This package includes the common functionality for %{name}-gdb and %{name}-lldb. |
---|
| 224 | |
---|
| 225 | |
---|
| 226 | %package gdb |
---|
| 227 | Summary: GDB pretty printers for Rust |
---|
| 228 | BuildArch: noarch |
---|
| 229 | Requires: gdb |
---|
| 230 | Requires: %{name}-debugger-common = %{version}-%{release} |
---|
| 231 | |
---|
| 232 | %description gdb |
---|
| 233 | This package includes the rust-gdb script, which allows easier debugging of Rust |
---|
| 234 | programs. |
---|
| 235 | |
---|
| 236 | |
---|
| 237 | %if %{with lldb} |
---|
| 238 | |
---|
| 239 | %package lldb |
---|
| 240 | Summary: LLDB pretty printers for Rust |
---|
| 241 | |
---|
| 242 | # It could be noarch, but lldb has limited availability |
---|
| 243 | #BuildArch: noarch |
---|
| 244 | |
---|
| 245 | Requires: lldb |
---|
| 246 | Requires: python-lldb |
---|
| 247 | Requires: %{name}-debugger-common = %{version}-%{release} |
---|
| 248 | |
---|
| 249 | %description lldb |
---|
| 250 | This package includes the rust-lldb script, which allows easier debugging of Rust |
---|
| 251 | programs. |
---|
| 252 | |
---|
| 253 | %endif |
---|
| 254 | |
---|
| 255 | |
---|
| 256 | %package doc |
---|
| 257 | Summary: Documentation for Rust |
---|
| 258 | # NOT BuildArch: noarch |
---|
| 259 | # Note, while docs are mostly noarch, some things do vary by target_arch. |
---|
| 260 | # Koji will fail the build in rpmdiff if two architectures build a noarch |
---|
| 261 | # subpackage differently, so instead we have to keep its arch. |
---|
| 262 | |
---|
| 263 | %description doc |
---|
| 264 | This package includes HTML documentation for the Rust programming language and |
---|
| 265 | its standard library. |
---|
| 266 | |
---|
| 267 | |
---|
[11972] | 268 | %package -n cargo |
---|
| 269 | Summary: Rust's package manager and build tool |
---|
| 270 | Version: %{cargo_version} |
---|
| 271 | # For tests: |
---|
| 272 | BuildRequires: git |
---|
| 273 | # Cargo is not much use without Rust |
---|
| 274 | Requires: rust |
---|
| 275 | |
---|
| 276 | %description -n cargo |
---|
| 277 | Cargo is a tool that allows Rust projects to declare their various dependencies |
---|
| 278 | and ensure that you'll always get a repeatable build. |
---|
| 279 | |
---|
| 280 | |
---|
| 281 | %package -n cargo-doc |
---|
| 282 | Summary: Documentation for Cargo |
---|
| 283 | Version: %{cargo_version} |
---|
| 284 | BuildArch: noarch |
---|
| 285 | # Cargo no longer builds its own documentation |
---|
| 286 | # https://github.com/rust-lang/cargo/pull/4904 |
---|
| 287 | Requires: rust-doc = %{rustc_version}-%{release} |
---|
| 288 | |
---|
| 289 | %description -n cargo-doc |
---|
| 290 | This package includes HTML documentation for Cargo. |
---|
| 291 | |
---|
| 292 | |
---|
| 293 | %package -n rustfmt-preview |
---|
| 294 | Summary: Tool to find and fix Rust formatting issues |
---|
| 295 | Version: %{rustfmt_version} |
---|
| 296 | Requires: cargo |
---|
| 297 | |
---|
| 298 | # Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9. |
---|
| 299 | # It's expected to stay "preview" until it's released as 1.0. |
---|
| 300 | Obsoletes: rustfmt <= 0.9.0 |
---|
| 301 | Provides: rustfmt = %{rustfmt_version} |
---|
| 302 | |
---|
| 303 | %description -n rustfmt-preview |
---|
| 304 | A tool for formatting Rust code according to style guidelines. |
---|
| 305 | |
---|
| 306 | |
---|
| 307 | %package -n rls-preview |
---|
| 308 | Summary: Rust Language Server for IDE integration |
---|
| 309 | Version: %{rls_version} |
---|
| 310 | Provides: rls = %{rls_version} |
---|
| 311 | Requires: rust-analysis |
---|
| 312 | # /usr/bin/rls is dynamically linked against internal rustc libs |
---|
| 313 | Requires: %{name} = %{rustc_version}-%{release} |
---|
| 314 | |
---|
| 315 | %description -n rls-preview |
---|
| 316 | The Rust Language Server provides a server that runs in the background, |
---|
| 317 | providing IDEs, editors, and other tools with information about Rust programs. |
---|
| 318 | It supports functionality such as 'goto definition', symbol search, |
---|
| 319 | reformatting, and code completion, and enables renaming and refactorings. |
---|
| 320 | |
---|
| 321 | |
---|
| 322 | %package -n clippy-preview |
---|
| 323 | Summary: Lints to catch common mistakes and improve your Rust code |
---|
| 324 | Version: %{clippy_version} |
---|
| 325 | License: MPLv2.0 |
---|
| 326 | Provides: clippy = %{clippy_version} |
---|
| 327 | Requires: cargo |
---|
| 328 | # /usr/bin/clippy-driver is dynamically linked against internal rustc libs |
---|
| 329 | Requires: %{name} = %{rustc_version}-%{release} |
---|
| 330 | |
---|
| 331 | %description -n clippy-preview |
---|
| 332 | A collection of lints to catch common mistakes and improve your Rust code. |
---|
| 333 | |
---|
| 334 | |
---|
[11321] | 335 | %package src |
---|
| 336 | Summary: Sources for the Rust standard library |
---|
| 337 | BuildArch: noarch |
---|
| 338 | |
---|
| 339 | %description src |
---|
| 340 | This package includes source files for the Rust standard library. It may be |
---|
| 341 | useful as a reference for code completion tools in various editors. |
---|
| 342 | |
---|
| 343 | |
---|
[11972] | 344 | %package analysis |
---|
| 345 | Summary: Compiler analysis data for the Rust standard library |
---|
| 346 | Requires: rust-std-static = %{rustc_version}-%{release} |
---|
| 347 | |
---|
| 348 | %description analysis |
---|
| 349 | This package contains analysis data files produced with rustc's -Zsave-analysis |
---|
| 350 | feature for the Rust standard library. The RLS (Rust Language Server) uses this |
---|
| 351 | data to provide information about the Rust standard library. |
---|
| 352 | |
---|
| 353 | |
---|
[11321] | 354 | %prep |
---|
| 355 | |
---|
| 356 | %ifarch %{bootstrap_arches} |
---|
| 357 | %setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} |
---|
| 358 | ./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \ |
---|
| 359 | --prefix=%{local_rust_root} --disable-ldconfig |
---|
| 360 | test -f '%{local_rust_root}/bin/cargo' |
---|
| 361 | test -f '%{local_rust_root}/bin/rustc' |
---|
| 362 | %endif |
---|
| 363 | |
---|
| 364 | %setup -q -n %{rustc_package} |
---|
| 365 | |
---|
| 366 | # We're disabling jemalloc, but rust-src still wants it. |
---|
| 367 | # rm -rf src/jemalloc/ |
---|
| 368 | |
---|
| 369 | %if %without bundled_llvm |
---|
| 370 | rm -rf src/llvm/ |
---|
| 371 | %endif |
---|
| 372 | |
---|
[11972] | 373 | # We never enable emscripten. |
---|
| 374 | rm -rf src/llvm-emscripten/ |
---|
| 375 | |
---|
| 376 | # We never enable other LLVM tools. |
---|
| 377 | rm -rf src/tools/clang |
---|
| 378 | rm -rf src/tools/lld |
---|
| 379 | rm -rf src/tools/lldb |
---|
| 380 | |
---|
[11321] | 381 | # extract bundled licenses for packaging |
---|
| 382 | sed -e '/*\//q' src/libbacktrace/backtrace.h \ |
---|
| 383 | >src/libbacktrace/LICENSE-libbacktrace |
---|
| 384 | |
---|
| 385 | %if %{with bundled_llvm} && 0%{?epel} |
---|
| 386 | mkdir -p cmake-bin |
---|
| 387 | ln -s /usr/bin/cmake cmake-bin/cmake |
---|
| 388 | %global cmake_path $PWD/cmake-bin |
---|
| 389 | %endif |
---|
| 390 | |
---|
| 391 | %if %{without bundled_llvm} && %{with llvm_static} |
---|
| 392 | # Static linking to distro LLVM needs to add -lffi |
---|
| 393 | # https://github.com/rust-lang/rust/issues/34486 |
---|
| 394 | sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ |
---|
| 395 | src/librustc_llvm/lib.rs |
---|
| 396 | %endif |
---|
| 397 | |
---|
| 398 | # The configure macro will modify some autoconf-related files, which upsets |
---|
| 399 | # cargo when it tries to verify checksums in those files. If we just truncate |
---|
| 400 | # that file list, cargo won't have anything to complain about. |
---|
| 401 | find src/vendor -name .cargo-checksum.json \ |
---|
| 402 | -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' |
---|
| 403 | |
---|
| 404 | %build |
---|
| 405 | |
---|
[11972] | 406 | export LIBGIT2_SYS_USE_PKG_CONFIG=1 |
---|
| 407 | export LIBSSH2_SYS_USE_PKG_CONFIG=1 |
---|
| 408 | |
---|
[11321] | 409 | %{?cmake_path:export PATH=%{cmake_path}:$PATH} |
---|
| 410 | %{?library_path:export LIBRARY_PATH="%{library_path}"} |
---|
| 411 | %{?rustflags:export RUSTFLAGS="%{rustflags}"} |
---|
| 412 | |
---|
| 413 | # We're going to override --libdir when configuring to get rustlib into a |
---|
| 414 | # common path, but we'll fix the shared libraries during install. |
---|
| 415 | %global common_libdir %{_prefix}/lib |
---|
| 416 | %global rustlibdir %{common_libdir}/rustlib |
---|
| 417 | |
---|
[11972] | 418 | #%ifarch x86_64 |
---|
| 419 | %define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines |
---|
| 420 | #%else |
---|
| 421 | #%define enable_debuginfo --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines |
---|
| 422 | #%endif |
---|
[11321] | 423 | |
---|
| 424 | %configure \ |
---|
| 425 | --disable-option-checking \ |
---|
| 426 | --libdir=%{common_libdir} \ |
---|
| 427 | --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ |
---|
| 428 | --enable-local-rust --local-rust-root=%{local_rust_root} \ |
---|
| 429 | %{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \ |
---|
| 430 | %{!?with_llvm_static: --enable-llvm-link-shared } } \ |
---|
| 431 | --disable-jemalloc \ |
---|
| 432 | --disable-rpath \ |
---|
| 433 | %{enable_debuginfo} \ |
---|
[11972] | 434 | --enable-extended \ |
---|
[11321] | 435 | --enable-vendor \ |
---|
[11972] | 436 | --enable-verbose-tests \ |
---|
[11321] | 437 | --release-channel=%{channel} |
---|
| 438 | |
---|
| 439 | RUST_BACKTRACE=1 ./x.py build |
---|
| 440 | ./x.py doc |
---|
| 441 | |
---|
| 442 | |
---|
| 443 | %install |
---|
[11972] | 444 | rm -rf %{buildroot} |
---|
| 445 | |
---|
[11321] | 446 | %{?cmake_path:export PATH=%{cmake_path}:$PATH} |
---|
| 447 | %{?library_path:export LIBRARY_PATH="%{library_path}"} |
---|
| 448 | %{?rustflags:export RUSTFLAGS="%{rustflags}"} |
---|
| 449 | |
---|
| 450 | DESTDIR=%{buildroot} ./x.py install |
---|
[11972] | 451 | #DESTDIR=%{buildroot} ./x.py install src |
---|
[11321] | 452 | |
---|
| 453 | |
---|
| 454 | # Make sure the shared libraries are in the proper libdir |
---|
| 455 | %if "%{_libdir}" != "%{common_libdir}" |
---|
| 456 | mkdir -p %{buildroot}%{_libdir} |
---|
| 457 | find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \ |
---|
| 458 | -exec mv -v -t %{buildroot}%{_libdir} '{}' '+' |
---|
| 459 | %endif |
---|
| 460 | |
---|
| 461 | # The shared libraries should be executable for debuginfo extraction. |
---|
| 462 | find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \ |
---|
| 463 | -exec chmod -v +x '{}' '+' |
---|
| 464 | |
---|
| 465 | # The libdir libraries are identical to those under rustlib/. It's easier on |
---|
| 466 | # library loading if we keep them in libdir, but we do need them in rustlib/ |
---|
| 467 | # to support dynamic linking for compiler plugins, so we'll symlink. |
---|
| 468 | (cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" && |
---|
[11972] | 469 | find ../../../../%{_lib} -maxdepth 1 -name '*.so' | |
---|
| 470 | while read lib; do |
---|
| 471 | # make sure they're actually identical! |
---|
| 472 | cmp "$lib" "${lib##*/}" |
---|
| 473 | ln -v -f -s -t . "$lib" |
---|
| 474 | done) |
---|
| 475 | |
---|
[11321] | 476 | # Remove installer artifacts (manifests, uninstall scripts, etc.) |
---|
| 477 | find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+' |
---|
| 478 | |
---|
[11972] | 479 | # Remove backup files from %%configure munging |
---|
| 480 | find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+' |
---|
| 481 | |
---|
| 482 | # https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error |
---|
| 483 | # We don't actually need to ship any of those python scripts in rust-src anyway. |
---|
| 484 | |
---|
| 485 | find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+' |
---|
| 486 | |
---|
[11321] | 487 | # FIXME: __os_install_post will strip the rlibs |
---|
| 488 | # -- should we find a way to preserve debuginfo? |
---|
| 489 | |
---|
| 490 | # Remove unwanted documentation files (we already package them) |
---|
[11972] | 491 | # Remove unwanted documentation files (we already package them) |
---|
[11321] | 492 | rm -f %{buildroot}%{_docdir}/%{name}/README.md |
---|
| 493 | rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT |
---|
[11972] | 494 | rm -f %{buildroot}%{_docdir}/%{name}/LICENSE |
---|
[11321] | 495 | rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE |
---|
| 496 | rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT |
---|
[11972] | 497 | rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY |
---|
| 498 | rm -f %{buildroot}%{_docdir}/%{name}/*.old |
---|
[11321] | 499 | |
---|
| 500 | # Sanitize the HTML documentation |
---|
| 501 | find %{buildroot}%{_docdir}/%{name}/html -empty -delete |
---|
| 502 | find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+' |
---|
| 503 | |
---|
[11972] | 504 | # Create the path for crate-devel packages |
---|
| 505 | mkdir -p %{buildroot}%{_datadir}/cargo/registry |
---|
| 506 | |
---|
| 507 | # Cargo no longer builds its own documentation |
---|
| 508 | # https://github.com/rust-lang/cargo/pull/4904 |
---|
| 509 | mkdir -p %{buildroot}%{_docdir}/cargo |
---|
| 510 | ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html |
---|
| 511 | |
---|
[11321] | 512 | %if %{without lldb} |
---|
| 513 | rm -f %{buildroot}%{_bindir}/rust-lldb |
---|
| 514 | rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* |
---|
| 515 | %endif |
---|
| 516 | |
---|
| 517 | |
---|
| 518 | %check |
---|
[11972] | 519 | %if %{with test} |
---|
[11321] | 520 | %{?cmake_path:export PATH=%{cmake_path}:$PATH} |
---|
| 521 | %{?library_path:export LIBRARY_PATH="%{library_path}"} |
---|
| 522 | %{?rustflags:export RUSTFLAGS="%{rustflags}"} |
---|
| 523 | |
---|
| 524 | # The results are not stable on koji, so mask errors and just log it. |
---|
[11972] | 525 | %{__python} ./x.py test --no-fail-fast || : |
---|
| 526 | %{__python} ./x.py test --no-fail-fast cargo || : |
---|
| 527 | %{__python} ./x.py test --no-fail-fast clippy || : |
---|
| 528 | %{__python} ./x.py test --no-fail-fast rls || : |
---|
| 529 | %{__python} ./x.py test --no-fail-fast rustfmt || : |
---|
| 530 | %endif |
---|
[11321] | 531 | |
---|
| 532 | |
---|
| 533 | %post -p /sbin/ldconfig |
---|
| 534 | %postun -p /sbin/ldconfig |
---|
| 535 | |
---|
| 536 | |
---|
| 537 | %files |
---|
| 538 | %license COPYRIGHT LICENSE-APACHE LICENSE-MIT |
---|
| 539 | %license src/libbacktrace/LICENSE-libbacktrace |
---|
| 540 | %doc README.md |
---|
| 541 | %{_bindir}/rustc |
---|
| 542 | %{_bindir}/rustdoc |
---|
| 543 | %{_libdir}/*.so |
---|
| 544 | %{_mandir}/man1/rustc.1* |
---|
| 545 | %{_mandir}/man1/rustdoc.1* |
---|
| 546 | %dir %{rustlibdir} |
---|
| 547 | %dir %{rustlibdir}/%{rust_triple} |
---|
| 548 | %dir %{rustlibdir}/%{rust_triple}/lib |
---|
| 549 | %{rustlibdir}/%{rust_triple}/lib/*.so |
---|
[11972] | 550 | %{rustlibdir}/%{rust_triple}/codegen-backends/ |
---|
[11321] | 551 | |
---|
| 552 | |
---|
| 553 | %files std-static |
---|
| 554 | %dir %{rustlibdir} |
---|
| 555 | %dir %{rustlibdir}/%{rust_triple} |
---|
| 556 | %dir %{rustlibdir}/%{rust_triple}/lib |
---|
| 557 | %{rustlibdir}/%{rust_triple}/lib/*.rlib |
---|
| 558 | |
---|
| 559 | |
---|
| 560 | %files debugger-common |
---|
| 561 | %dir %{rustlibdir} |
---|
| 562 | %dir %{rustlibdir}/etc |
---|
| 563 | %{rustlibdir}/etc/debugger_*.py* |
---|
| 564 | |
---|
| 565 | |
---|
| 566 | %files gdb |
---|
| 567 | %{_bindir}/rust-gdb |
---|
| 568 | %{rustlibdir}/etc/gdb_*.py* |
---|
| 569 | |
---|
| 570 | |
---|
| 571 | %if %with lldb |
---|
| 572 | %files lldb |
---|
| 573 | %{_bindir}/rust-lldb |
---|
| 574 | %{rustlibdir}/etc/lldb_*.py* |
---|
| 575 | %endif |
---|
| 576 | |
---|
| 577 | |
---|
| 578 | %files doc |
---|
| 579 | %docdir %{_docdir}/%{name} |
---|
| 580 | %dir %{_docdir}/%{name} |
---|
| 581 | %dir %{_docdir}/%{name}/html |
---|
| 582 | %{_docdir}/%{name}/html/*/ |
---|
| 583 | %{_docdir}/%{name}/html/*.html |
---|
| 584 | %{_docdir}/%{name}/html/*.css |
---|
| 585 | %{_docdir}/%{name}/html/*.js |
---|
[11972] | 586 | %{_docdir}/%{name}/html/*.svg |
---|
[11321] | 587 | %{_docdir}/%{name}/html/*.woff |
---|
| 588 | %license %{_docdir}/%{name}/html/*.txt |
---|
| 589 | |
---|
| 590 | |
---|
[11972] | 591 | %files -n cargo |
---|
| 592 | %license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY |
---|
| 593 | %doc src/tools/cargo/README.md |
---|
| 594 | %{_bindir}/cargo |
---|
| 595 | %{_mandir}/man1/cargo*.1* |
---|
| 596 | %dir %{_sysconfdir}/bash_completion.d |
---|
| 597 | %{_sysconfdir}/bash_completion.d/cargo |
---|
| 598 | %dir %{_datadir}/zsh |
---|
| 599 | %dir %{_datadir}/zsh/site-functions |
---|
| 600 | %{_datadir}/zsh/site-functions/_cargo |
---|
| 601 | %dir %{_datadir}/cargo |
---|
| 602 | %dir %{_datadir}/cargo/registry |
---|
| 603 | |
---|
| 604 | |
---|
| 605 | %files -n cargo-doc |
---|
| 606 | %docdir %{_docdir}/cargo |
---|
| 607 | %dir %{_docdir}/cargo |
---|
| 608 | %{_docdir}/cargo/html |
---|
| 609 | |
---|
| 610 | |
---|
| 611 | %files -n rustfmt-preview |
---|
| 612 | %{_bindir}/rustfmt |
---|
| 613 | %{_bindir}/cargo-fmt |
---|
| 614 | %doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md |
---|
| 615 | %license src/tools/rustfmt/LICENSE-{APACHE,MIT} |
---|
| 616 | |
---|
| 617 | |
---|
| 618 | %files -n rls-preview |
---|
| 619 | %{_bindir}/rls |
---|
| 620 | %doc src/tools/rls/{README.md,COPYRIGHT,debugging.md} |
---|
| 621 | %license src/tools/rls/LICENSE-{APACHE,MIT} |
---|
| 622 | |
---|
| 623 | |
---|
| 624 | %files -n clippy-preview |
---|
| 625 | %{_bindir}/cargo-clippy |
---|
| 626 | %{_bindir}/clippy-driver |
---|
| 627 | %doc src/tools/clippy/{README.md,CHANGELOG.md} |
---|
| 628 | %license src/tools/clippy/LICENSE |
---|
| 629 | |
---|
| 630 | |
---|
[11321] | 631 | %files src |
---|
| 632 | %dir %{rustlibdir} |
---|
| 633 | %{rustlibdir}/src |
---|
| 634 | |
---|
| 635 | |
---|
[11972] | 636 | %files analysis |
---|
| 637 | %{rustlibdir}/%{rust_triple}/analysis/ |
---|
| 638 | |
---|
[11321] | 639 | %changelog |
---|
[11972] | 640 | * Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.30.1-1 |
---|
| 641 | - new upstream release. |
---|
| 642 | - dropped Patch1. |
---|
| 643 | - added subpackages cargo, cargo-doc, rustformat-preview, rls-preview, clippy-preview and rust-analysis. |
---|
| 644 | |
---|
[11321] | 645 | * Fri Jan 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.23.0-1 |
---|
| 646 | - Update to 1.23.0 (stable). |
---|
| 647 | |
---|
| 648 | * Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.23.0-0.beta1 |
---|
| 649 | - initial build for Vine Linux. |
---|
| 650 | - Update to 1.23.0-beta. |
---|
| 651 | - built a bootstrap rpm. |
---|
| 652 | |
---|
| 653 | * Thu Nov 23 2017 Josh Stone <jistone@redhat.com> - 1.22.1-1 |
---|
| 654 | - Update to 1.22.1. |
---|
| 655 | |
---|
| 656 | * Thu Oct 12 2017 Josh Stone <jistone@redhat.com> - 1.21.0-1 |
---|
| 657 | - Update to 1.21.0. |
---|
| 658 | |
---|
| 659 | * Mon Sep 11 2017 Josh Stone <jistone@redhat.com> - 1.20.0-2 |
---|
| 660 | - ABI fixes for ppc64 and s390x. |
---|
| 661 | |
---|
| 662 | * Thu Aug 31 2017 Josh Stone <jistone@redhat.com> - 1.20.0-1 |
---|
| 663 | - Update to 1.20.0. |
---|
| 664 | - Add a rust-src subpackage. |
---|
| 665 | |
---|
| 666 | * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.19.0-4 |
---|
| 667 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild |
---|
| 668 | |
---|
| 669 | * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.19.0-3 |
---|
| 670 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild |
---|
| 671 | |
---|
| 672 | * Mon Jul 24 2017 Josh Stone <jistone@redhat.com> - 1.19.0-2 |
---|
| 673 | - Use find-debuginfo.sh --keep-section .rustc |
---|
| 674 | |
---|
| 675 | * Thu Jul 20 2017 Josh Stone <jistone@redhat.com> - 1.19.0-1 |
---|
| 676 | - Update to 1.19.0. |
---|
| 677 | |
---|
| 678 | * Thu Jun 08 2017 Josh Stone <jistone@redhat.com> - 1.18.0-1 |
---|
| 679 | - Update to 1.18.0. |
---|
| 680 | |
---|
| 681 | * Mon May 08 2017 Josh Stone <jistone@redhat.com> - 1.17.0-2 |
---|
| 682 | - Move shared libraries back to libdir and symlink in rustlib |
---|
| 683 | |
---|
| 684 | * Thu Apr 27 2017 Josh Stone <jistone@redhat.com> - 1.17.0-1 |
---|
| 685 | - Update to 1.17.0. |
---|
| 686 | |
---|
| 687 | * Mon Mar 20 2017 Josh Stone <jistone@redhat.com> - 1.16.0-3 |
---|
| 688 | - Make rust-lldb arch-specific to deal with lldb deps |
---|
| 689 | |
---|
| 690 | * Fri Mar 17 2017 Josh Stone <jistone@redhat.com> - 1.16.0-2 |
---|
| 691 | - Limit rust-lldb arches |
---|
| 692 | |
---|
| 693 | * Thu Mar 16 2017 Josh Stone <jistone@redhat.com> - 1.16.0-1 |
---|
| 694 | - Update to 1.16.0. |
---|
| 695 | - Use rustbuild instead of the old makefiles. |
---|
| 696 | - Update bootstrapping to include rust-std and cargo. |
---|
| 697 | - Add a rust-lldb subpackage. |
---|
| 698 | |
---|
| 699 | * Thu Feb 09 2017 Josh Stone <jistone@redhat.com> - 1.15.1-1 |
---|
| 700 | - Update to 1.15.1. |
---|
| 701 | - Require rust-rpm-macros for new crate packaging. |
---|
| 702 | - Keep shared libraries under rustlib/, only debug-stripped. |
---|
| 703 | - Merge and clean up conditionals for epel7. |
---|
| 704 | |
---|
| 705 | * Fri Dec 23 2016 Josh Stone <jistone@redhat.com> - 1.14.0-2 |
---|
| 706 | - Rebuild without bootstrap binaries. |
---|
| 707 | |
---|
| 708 | * Thu Dec 22 2016 Josh Stone <jistone@redhat.com> - 1.14.0-1 |
---|
| 709 | - Update to 1.14.0. |
---|
| 710 | - Rewrite bootstrap logic to target specific arches. |
---|
| 711 | - Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!) |
---|
| 712 | |
---|
| 713 | * Thu Nov 10 2016 Josh Stone <jistone@redhat.com> - 1.13.0-1 |
---|
| 714 | - Update to 1.13.0. |
---|
| 715 | - Use hardening flags for linking. |
---|
| 716 | - Split the standard library into its own package |
---|
| 717 | - Centralize rustlib/ under /usr/lib/ for multilib integration. |
---|
| 718 | |
---|
| 719 | * Thu Oct 20 2016 Josh Stone <jistone@redhat.com> - 1.12.1-1 |
---|
| 720 | - Update to 1.12.1. |
---|
| 721 | |
---|
| 722 | * Fri Oct 14 2016 Josh Stone <jistone@redhat.com> - 1.12.0-7 |
---|
| 723 | - Rebuild with LLVM 3.9. |
---|
| 724 | - Add ncurses-devel for llvm-config's -ltinfo. |
---|
| 725 | |
---|
| 726 | * Thu Oct 13 2016 Josh Stone <jistone@redhat.com> - 1.12.0-6 |
---|
| 727 | - Rebuild with llvm-static, preparing for 3.9 |
---|
| 728 | |
---|
| 729 | * Fri Oct 07 2016 Josh Stone <jistone@redhat.com> - 1.12.0-5 |
---|
| 730 | - Rebuild with fixed eu-strip (rhbz1380961) |
---|
| 731 | |
---|
| 732 | * Fri Oct 07 2016 Josh Stone <jistone@redhat.com> - 1.12.0-4 |
---|
| 733 | - Rebuild without bootstrap binaries. |
---|
| 734 | |
---|
| 735 | * Thu Oct 06 2016 Josh Stone <jistone@redhat.com> - 1.12.0-3 |
---|
| 736 | - Bootstrap aarch64. |
---|
| 737 | - Use jemalloc's MALLOC_CONF to work around #36944. |
---|
| 738 | - Apply pr36933 to really disable armv7hl NEON. |
---|
| 739 | |
---|
| 740 | * Sat Oct 01 2016 Josh Stone <jistone@redhat.com> - 1.12.0-2 |
---|
| 741 | - Protect .rustc from rpm stripping. |
---|
| 742 | |
---|
| 743 | * Fri Sep 30 2016 Josh Stone <jistone@redhat.com> - 1.12.0-1 |
---|
| 744 | - Update to 1.12.0. |
---|
| 745 | - Always use --local-rust-root, even for bootstrap binaries. |
---|
| 746 | - Remove the rebuild conditional - the build system now figures it out. |
---|
| 747 | - Let minidebuginfo do its thing, since metadata is no longer a note. |
---|
| 748 | - Let rust build its own compiler-rt builtins again. |
---|
| 749 | |
---|
| 750 | * Sat Sep 03 2016 Josh Stone <jistone@redhat.com> - 1.11.0-3 |
---|
| 751 | - Rebuild without bootstrap binaries. |
---|
| 752 | |
---|
| 753 | * Fri Sep 02 2016 Josh Stone <jistone@redhat.com> - 1.11.0-2 |
---|
| 754 | - Bootstrap armv7hl, with backported no-neon patch. |
---|
| 755 | |
---|
| 756 | * Wed Aug 24 2016 Josh Stone <jistone@redhat.com> - 1.11.0-1 |
---|
| 757 | - Update to 1.11.0. |
---|
| 758 | - Drop the backported patches. |
---|
| 759 | - Patch get-stage0.py to trust existing bootstrap binaries. |
---|
| 760 | - Use libclang_rt.builtins from compiler-rt, dodging llvm-static issues. |
---|
| 761 | - Use --local-rust-root to make sure the right bootstrap is used. |
---|
| 762 | |
---|
| 763 | * Sat Aug 13 2016 Josh Stone <jistone@redhat.com> 1.10.0-4 |
---|
| 764 | - Rebuild without bootstrap binaries. |
---|
| 765 | |
---|
| 766 | * Fri Aug 12 2016 Josh Stone <jistone@redhat.com> - 1.10.0-3 |
---|
| 767 | - Initial import into Fedora (#1356907), bootstrapped |
---|
| 768 | - Format license text as suggested in review. |
---|
| 769 | - Note how the tests already run in parallel. |
---|
| 770 | - Undefine _include_minidebuginfo, because it duplicates ".note.rustc". |
---|
| 771 | - Don't let checks fail the whole build. |
---|
| 772 | - Note that -doc can't be noarch, as rpmdiff doesn't allow variations. |
---|
| 773 | |
---|
| 774 | * Tue Jul 26 2016 Josh Stone <jistone@redhat.com> - 1.10.0-2 |
---|
| 775 | - Update -doc directory ownership, and mark its licenses. |
---|
| 776 | - Package and declare licenses for libbacktrace and hoedown. |
---|
| 777 | - Set bootstrap_base as a global. |
---|
| 778 | - Explicitly require python2. |
---|
| 779 | |
---|
| 780 | * Thu Jul 14 2016 Josh Stone <jistone@fedoraproject.org> - 1.10.0-1 |
---|
| 781 | - Initial package, bootstrapped |
---|