rust-vl.spec 26 KB

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