rust-vl.spec 32 KB

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