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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1215423 by tv, Thu Apr 5 08:38:48 2018 UTC revision 1228274 by akien, Fri May 11 06:49:54 2018 UTC
# Line 13  Line 13 
13  # To bootstrap from scratch, set the channel and date from src/stage0.txt  # To bootstrap from scratch, set the channel and date from src/stage0.txt
14  # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24  # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
15  # or nightly wants some beta-YYYY-MM-DD  # or nightly wants some beta-YYYY-MM-DD
16  %global bootstrap_rust 1.24.0  %global bootstrap_rust 1.25.0
17  %global bootstrap_cargo 0.25.0  %global bootstrap_cargo 0.26.0
18  %global bootstrap_channel %{bootstrap_rust}  %global bootstrap_channel %{bootstrap_rust}
19  %global bootstrap_date 2018-02-15  %global bootstrap_date 2018-03-29
20    
21  # Only the specified arches will use bootstrap binaries.  # Only the specified arches will use bootstrap binaries.
22  #global bootstrap_arches %%{rust_arches}  #global bootstrap_arches %%{rust_arches}
# Line 32  Line 32 
32  %bcond_with bundled_llvm  %bcond_with bundled_llvm
33  %endif  %endif
34    
35    # Some targets don't have libgit2
36    %if 0%{?rhel} && !0%{?epel}
37    %bcond_without bundled_libgit2
38    %else
39    %bcond_with bundled_libgit2
40    %endif
41    
42  # LLDB only works on some architectures  # LLDB only works on some architectures
43  %ifarch %{arm} aarch64 %{ix86} x86_64  %ifarch %{arm} aarch64 %{ix86} x86_64
44  # LLDB isn't available everywhere...  # LLDB isn't available everywhere...
# Line 44  Line 51 
51  %bcond_with lldb  %bcond_with lldb
52  %endif  %endif
53    
54    # Some sub-packages are versioned independently of the rust compiler and runtime itself.
55    %global rustc_version 1.26.0
56    %global cargo_version %{rustc_version}
57    %global rustfmt_version 0.4.1
58    %global rls_version 0.126.0
59    
60  Name:           rust  Name:           rust
61  Version:        1.25.0  Version:        %{rustc_version}
62  Release:        %mkrel 2  Release:        %mkrel 1
63  Summary:        The Rust Programming Language  Summary:        The Rust Programming Language
64  %if 0%{?mageia}  %if 0%{?mageia}
65  Group:          Development/Other  Group:          Development/Other
66  %endif  %endif
67  License:        (ASL 2.0 or MIT) and (BSD and ISC and MIT)  License:        (ASL 2.0 or MIT) and (BSD and MIT)
68  # ^ written as: (rust itself) and (bundled libraries)  # ^ written as: (rust itself) and (bundled libraries)
69  URL:            https://www.rust-lang.org  URL:            https://www.rust-lang.org
70  ExclusiveArch:  %{rust_arches}  ExclusiveArch:  %{rust_arches}
71    
72  %if "%{channel}" == "stable"  %if "%{channel}" == "stable"
73  %global rustc_package rustc-%{version}-src  %global rustc_package rustc-%{rustc_version}-src
74  %else  %else
75  %global rustc_package rustc-%{channel}-src  %global rustc_package rustc-%{channel}-src
76  %endif  %endif
77  Source0:        https://static.rust-lang.org/dist/%{rustc_package}.tar.xz  Source0:        https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
78    
79  # https://github.com/rust-lang/rust/pull/49290  # rustbuild: allow building tools with debuginfo
80  Patch1:         0001-Allow-installing-rustfmt-without-config.extended.patch  # https://github.com/rust-lang/rust/pull/49959
81    Patch1:         pull-49959.patch
 # https://github.com/rust-lang/rust/pull/49484  
 Patch2:         0001-Ignore-stack-probes-tests-on-powerpc-s390x-too.patch  
82    
83  # Get the Rust triple for any arch.  # Get the Rust triple for any arch.
84  %{lua: function rust_triple(arch)  %{lua: function rust_triple(arch)
# Line 117  Provides:       bundled(%{name}-bootstra Line 126  Provides:       bundled(%{name}-bootstra
126  %else  %else
127  BuildRequires:  cargo >= %{bootstrap_cargo}  BuildRequires:  cargo >= %{bootstrap_cargo}
128  %if 0%{?fedora} >= 27  %if 0%{?fedora} >= 27
129  BuildRequires:  (%{name} >= %{bootstrap_rust} with %{name} <= %{version})  BuildRequires:  (%{name} >= %{bootstrap_rust} with %{name} <= %{rustc_version})
130  %else  %else
131  BuildRequires:  %{name} >= %{bootstrap_rust}  BuildRequires:  %{name} >= %{bootstrap_rust}
132  BuildConflicts: %{name} > %{version}  BuildConflicts: %{name} > %{rustc_version}
133  %endif  %endif
134  %global local_rust_root %{_prefix}  %global local_rust_root %{_prefix}
135  %endif  %endif
# Line 129  BuildRequires:  make Line 138  BuildRequires:  make
138  BuildRequires:  gcc  BuildRequires:  gcc
139  BuildRequires:  gcc-c++  BuildRequires:  gcc-c++
140  BuildRequires:  ncurses-devel  BuildRequires:  ncurses-devel
 BuildRequires:  zlib-devel  
141  BuildRequires:  curl  BuildRequires:  curl
142    BuildRequires:  pkgconfig(libcurl)
143    BuildRequires:  pkgconfig(liblzma)
144    BuildRequires:  pkgconfig(libssh2)
145    BuildRequires:  pkgconfig(openssl)
146    BuildRequires:  pkgconfig(zlib)
147    
148  %if 0%{?rhel} && 0%{?rhel} <= 7  %if 0%{?rhel} && 0%{?rhel} <= 7
149  %global python python2  %global python python2
# Line 167  BuildRequires:  procps-ng Line 180  BuildRequires:  procps-ng
180  BuildRequires:  gdb  BuildRequires:  gdb
181    
182  # TODO: work on unbundling these!  # TODO: work on unbundling these!
 Provides:       bundled(hoedown) = 3.0.7  
183  Provides:       bundled(jquery) = 2.1.4  Provides:       bundled(jquery) = 2.1.4
184  Provides:       bundled(libbacktrace) = 6.1.0  Provides:       bundled(libbacktrace) = 6.1.0
185  Provides:       bundled(miniz) = 1.16~beta+r1  Provides:       bundled(miniz) = 1.16~beta+r1
186    
187  # Virtual provides for folks who attempt "dnf install rustc"  # Virtual provides for folks who attempt "dnf install rustc"
188  Provides:       rustc = %{version}-%{release}  Provides:       rustc = %{rustc_version}-%{release}
189  Provides:       rustc%{?_isa} = %{version}-%{release}  Provides:       rustc%{?_isa} = %{rustc_version}-%{release}
190    
191  # Always require our exact standard library  # Always require our exact standard library
192  Requires:       %{name}-std-static%{?_isa} = %{version}-%{release}  Requires:       %{name}-std-static%{?_isa} = %{rustc_version}-%{release}
193    
194  # The C compiler is needed at runtime just for linking.  Someday rustc might  # The C compiler is needed at runtime just for linking.  Someday rustc might
195  # invoke the linker directly, and then we'll only need binutils.  # invoke the linker directly, and then we'll only need binutils.
# Line 189  Requires:       /usr/bin/cc Line 201  Requires:       /usr/bin/cc
201  %endif  %endif
202    
203  # ALL Rust libraries are private, because they don't keep an ABI.  # ALL Rust libraries are private, because they don't keep an ABI.
204  %global _privatelibs lib.*-[[:xdigit:]]*[.]so.*  %global _privatelibs lib(.*-[[:xdigit:]]*|rustc.*)[.]so.*
205  %global __provides_exclude ^(%{_privatelibs})$  %global __provides_exclude ^(%{_privatelibs})$
206  %global __requires_exclude ^(%{_privatelibs})$  %global __requires_exclude ^(%{_privatelibs})$
207  %global __provides_exclude_from ^%{_docdir}/.*$  %global __provides_exclude_from ^%{_docdir}/.*$
# Line 237  BuildArch:      noarch Line 249  BuildArch:      noarch
249  %description debugger-common  %description debugger-common
250  This package includes the common functionality for %{name}-gdb and %{name}-lldb.  This package includes the common functionality for %{name}-gdb and %{name}-lldb.
251    
   
252  %package gdb  %package gdb
253  Summary:        GDB pretty printers for Rust  Summary:        GDB pretty printers for Rust
254  BuildArch:      noarch  BuildArch:      noarch
255  Requires:       gdb  Requires:       gdb
256  Requires:       %{name}-debugger-common = %{version}-%{release}  Requires:       %{name}-debugger-common = %{rustc_version}-%{release}
257    
258  %if 0%{?mageia} == 6  %if 0%{?mageia} == 6
259  # (akien) Handle moved files between our old Mageia package and this Fedora-based one  # (akien) Handle moved files between our old Mageia package and this Fedora-based one
# Line 268  Requires:       python-lldb Line 279  Requires:       python-lldb
279  %else  %else
280  Requires:       python2-lldb  Requires:       python2-lldb
281  %endif  %endif
282  Requires:       %{name}-debugger-common = %{version}-%{release}  Requires:       %{name}-debugger-common = %{rustc_version}-%{release}
283    
284  %description lldb  %description lldb
285  This package includes the rust-lldb script, which allows easier debugging of Rust  This package includes the rust-lldb script, which allows easier debugging of Rust
# Line 289  This package includes HTML documentation Line 300  This package includes HTML documentation
300  its standard library.  its standard library.
301    
302    
303    %package -n cargo
304    Summary:        Rust's package manager and build tool
305    Version:        %{cargo_version}
306    %if %with bundled_libgit2
307    Provides:       bundled(libgit2) = 0.26.0
308    %else
309    BuildRequires:  pkgconfig(libgit2) >= 0.24
310    %endif
311    # For tests:
312    BuildRequires:  git
313    # Cargo is not much use without Rust
314    Requires:       rust
315    
316    %description -n cargo
317    Cargo is a tool that allows Rust projects to declare their various dependencies
318    and ensure that you'll always get a repeatable build.
319    
320    
321    %package -n cargo-doc
322    Summary:        Documentation for Cargo
323    Version:        %{cargo_version}
324    BuildArch:      noarch
325    # Cargo no longer builds its own documentation
326    # https://github.com/rust-lang/cargo/pull/4904
327    Requires:       rust-doc
328    
329    %description -n cargo-doc
330    This package includes HTML documentation for Cargo.
331    
332    
333  %package -n rustfmt-preview  %package -n rustfmt-preview
334  Summary:        Tool to find and fix Rust formatting issues  Summary:        Tool to find and fix Rust formatting issues
335  Version:        0.3.8  Version:        %{rustfmt_version}
336  Requires:       cargo  Requires:       cargo
337    
338  # Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9.  # Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9.
339  # It's expected to stay "preview" until it's released as 1.0.  # It's expected to stay "preview" until it's released as 1.0.
340  Obsoletes:      rustfmt <= 0.9.0  Obsoletes:      rustfmt <= 0.9.0
341  Provides:       rustfmt = %{version}  Provides:       rustfmt = %{rustfmt_version}
342    
343  %description -n rustfmt-preview  %description -n rustfmt-preview
344  A tool for formatting Rust code according to style guidelines.  A tool for formatting Rust code according to style guidelines.
345    
346    
347    %package -n rls-preview
348    Summary:        Rust Language Server for IDE integration
349    Version:        %{rls_version}
350    Provides:       rls = %{rls_version}
351    %if %with bundled_libgit2
352    Provides:       bundled(libgit2) = 0.26.0
353    %endif
354    Requires:       rust-analysis
355    # /usr/bin/rls is dynamically linked against internal rustc libs
356    Requires:       %{name}%{?_isa} = %{rustc_version}-%{release}
357    
358    %description -n rls-preview
359    The Rust Language Server provides a server that runs in the background,
360    providing IDEs, editors, and other tools with information about Rust programs.
361    It supports functionality such as 'goto definition', symbol search,
362    reformatting, and code completion, and enables renaming and refactorings.
363    
364    
365  %package src  %package src
366  Summary:        Sources for the Rust standard library  Summary:        Sources for the Rust standard library
367  BuildArch:      noarch  BuildArch:      noarch
# Line 312  This package includes source files for t Line 371  This package includes source files for t
371  useful as a reference for code completion tools in various editors.  useful as a reference for code completion tools in various editors.
372    
373    
374    %package analysis
375    Summary:        Compiler analysis data for the Rust standard library
376    Requires:       rust-std-static%{?_isa} = %{rustc_version}-%{release}
377    
378    %description analysis
379    This package contains analysis data files produced with rustc's -Zsave-analysis
380    feature for the Rust standard library. The RLS (Rust Language Server) uses this
381    data to provide information about the Rust standard library.
382    
383    
384  %prep  %prep
385    
386  %ifarch %{bootstrap_arches}  %ifarch %{bootstrap_arches}
# Line 324  test -f '%{local_rust_root}/bin/rustc' Line 393  test -f '%{local_rust_root}/bin/rustc'
393    
394  %setup -q -n %{rustc_package}  %setup -q -n %{rustc_package}
395    
396  %patch1 -p1 -b .dist-rustfmt  %patch1 -p1
 %patch2 -p1 -b .ignore-ibm  
397    
398  %if "%{python}" == "python3"  %if "%{python}" == "python3"
399  sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure  sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
# Line 342  rm -rf src/llvm/ Line 410  rm -rf src/llvm/
410  rm -rf src/llvm-emscripten/  rm -rf src/llvm-emscripten/
411    
412  # extract bundled licenses for packaging  # extract bundled licenses for packaging
 cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown  
413  sed -e '/*\//q' src/libbacktrace/backtrace.h \  sed -e '/*\//q' src/libbacktrace/backtrace.h \
414    >src/libbacktrace/LICENSE-libbacktrace    >src/libbacktrace/LICENSE-libbacktrace
415    
# Line 373  find src/vendor -name .cargo-checksum.js Line 440  find src/vendor -name .cargo-checksum.js
440    
441  %build  %build
442    
443    %if %without bundled_libgit2
444    # convince libgit2-sys to use the distro libgit2
445    export LIBGIT2_SYS_USE_PKG_CONFIG=1
446    %endif
447    
448  %{?cmake_path:export PATH=%{cmake_path}:$PATH}  %{?cmake_path:export PATH=%{cmake_path}:$PATH}
449  %{?library_path:export LIBRARY_PATH="%{library_path}"}  %{?library_path:export LIBRARY_PATH="%{library_path}"}
450  %{?rustflags:export RUSTFLAGS="%{rustflags}"}  %{?rustflags:export RUSTFLAGS="%{rustflags}"}
# Line 385  find src/vendor -name .cargo-checksum.js Line 457  find src/vendor -name .cargo-checksum.js
457  %ifarch %{arm}  %ifarch %{arm}
458  # full debuginfo is exhausting memory; just do libstd for now  # full debuginfo is exhausting memory; just do libstd for now
459  # https://github.com/rust-lang/rust/issues/45854  # https://github.com/rust-lang/rust/issues/45854
460  %define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-lines  %define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
461  %else  %else
462  %define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-lines  %define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
463  %endif  %endif
464    
465  %configure --disable-option-checking \  %configure --disable-option-checking \
# Line 399  find src/vendor -name .cargo-checksum.js Line 471  find src/vendor -name .cargo-checksum.js
471    --disable-jemalloc \    --disable-jemalloc \
472    --disable-rpath \    --disable-rpath \
473    %{enable_debuginfo} \    %{enable_debuginfo} \
474      --enable-extended \
475    --enable-vendor \    --enable-vendor \
476    --release-channel=%{channel}    --release-channel=%{channel}
477    
478  %{python} ./x.py build  %{python} ./x.py build
 %{python} ./x.py build src/tools/rustfmt  
479  %{python} ./x.py doc  %{python} ./x.py doc
480    
481    
# Line 413  find src/vendor -name .cargo-checksum.js Line 485  find src/vendor -name .cargo-checksum.js
485  %{?rustflags:export RUSTFLAGS="%{rustflags}"}  %{?rustflags:export RUSTFLAGS="%{rustflags}"}
486    
487  DESTDIR=%{buildroot} %{python} ./x.py install  DESTDIR=%{buildroot} %{python} ./x.py install
 DESTDIR=%{buildroot} %{python} ./x.py install rustfmt  
 DESTDIR=%{buildroot} %{python} ./x.py install src  
   
488    
489  # Make sure the shared libraries are in the proper libdir  # Make sure the shared libraries are in the proper libdir
490  %if "%{_libdir}" != "%{common_libdir}"  %if "%{_libdir}" != "%{common_libdir}"
# Line 450  rm -f %{buildroot}%{_docdir}/%{name}/REA Line 519  rm -f %{buildroot}%{_docdir}/%{name}/REA
519  rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT  rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
520  rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE  rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
521  rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT  rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
522    rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY
523  rm -f %{buildroot}%{_docdir}/%{name}/*.old  rm -f %{buildroot}%{_docdir}/%{name}/*.old
524    
525  # Sanitize the HTML documentation  # Sanitize the HTML documentation
526  find %{buildroot}%{_docdir}/%{name}/html -empty -delete  find %{buildroot}%{_docdir}/%{name}/html -empty -delete
527  find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'  find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
528    
529    # Create the path for crate-devel packages
530    mkdir -p %{buildroot}%{_datadir}/cargo/registry
531    
532    # Cargo no longer builds its own documentation
533    # https://github.com/rust-lang/cargo/pull/4904
534    mkdir -p %{buildroot}%{_docdir}/cargo/html
535    cat <<EOF > %{buildroot}%{_docdir}/cargo/html/index.html
536    <!DOCTYPE HTML>
537    <html lang="en-US">
538      <head>
539        <meta charset="UTF-8">
540        <meta http-equiv="refresh" content="0; url=../../rust/html/cargo/index.html">
541        <script type="text/javascript">
542          window.location.href = "../../rust/html/cargo/index.html"
543        </script>
544        <title>cargo-doc redirection</title>
545      </head>
546      <body>
547        Cargo documentation has been moved to the rust-doc package.
548        If you are not redirected automatically, please follow this
549        <a href="../../rust/html/cargo/index.html">link</a>.
550      </body>
551    </html>
552    EOF
553    
554  %if %without lldb  %if %without lldb
555  rm -f %{buildroot}%{_bindir}/rust-lldb  rm -f %{buildroot}%{_bindir}/rust-lldb
556  rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*  rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
# Line 469  rm -f %{buildroot}%{rustlibdir}/etc/lldb Line 564  rm -f %{buildroot}%{rustlibdir}/etc/lldb
564    
565  # The results are not stable on koji, so mask errors and just log it.  # The results are not stable on koji, so mask errors and just log it.
566  %{python} ./x.py test --no-fail-fast || :  %{python} ./x.py test --no-fail-fast || :
567  %{python} ./x.py test --no-fail-fast src/tools/rustfmt || :  %{python} ./x.py test --no-fail-fast cargo || :
568    %{python} ./x.py test --no-fail-fast rls || :
569    %{python} ./x.py test --no-fail-fast rustfmt || :
570    
571    
572  %if ! 0%{?mageia}  %if ! 0%{?mageia}
# Line 480  rm -f %{buildroot}%{rustlibdir}/etc/lldb Line 577  rm -f %{buildroot}%{rustlibdir}/etc/lldb
577  %files  %files
578  %license COPYRIGHT LICENSE-APACHE LICENSE-MIT  %license COPYRIGHT LICENSE-APACHE LICENSE-MIT
579  %license src/libbacktrace/LICENSE-libbacktrace  %license src/libbacktrace/LICENSE-libbacktrace
 %license src/rt/hoedown/LICENSE-hoedown  
580  %doc README.md  %doc README.md
581  %{_bindir}/rustc  %{_bindir}/rustc
582  %{_bindir}/rustdoc  %{_bindir}/rustdoc
# Line 532  rm -f %{buildroot}%{rustlibdir}/etc/lldb Line 628  rm -f %{buildroot}%{rustlibdir}/etc/lldb
628  %license %{_docdir}/%{name}/html/*.txt  %license %{_docdir}/%{name}/html/*.txt
629    
630    
631    %files -n cargo
632    %license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY
633    %doc src/tools/cargo/README.md
634    %{_bindir}/cargo
635    %{_mandir}/man1/cargo*.1*
636    %{_sysconfdir}/bash_completion.d/cargo
637    %{_datadir}/zsh/site-functions/_cargo
638    %dir %{_datadir}/cargo
639    %dir %{_datadir}/cargo/registry
640    
641    
642    %files -n cargo-doc
643    %{_docdir}/cargo/html
644    
645    
646  %files -n rustfmt-preview  %files -n rustfmt-preview
647  %{_bindir}/rustfmt  %{_bindir}/rustfmt
648  %{_bindir}/cargo-fmt  %{_bindir}/cargo-fmt
# Line 539  rm -f %{buildroot}%{rustlibdir}/etc/lldb Line 650  rm -f %{buildroot}%{rustlibdir}/etc/lldb
650  %license src/tools/rustfmt/LICENSE-{APACHE,MIT}  %license src/tools/rustfmt/LICENSE-{APACHE,MIT}
651    
652    
653    %files -n rls-preview
654    %{_bindir}/rls
655    %doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
656    %license src/tools/rls/LICENSE-{APACHE,MIT}
657    
658    
659  %files src  %files src
660  %dir %{rustlibdir}  %dir %{rustlibdir}
661  %{rustlibdir}/src  %{rustlibdir}/src
662    
663    
664    %files analysis
665    %{rustlibdir}/%{rust_triple}/analysis/

Legend:
Removed from v.1215423  
changed lines
  Added in v.1228274

  ViewVC Help
Powered by ViewVC 1.1.30