Blame llvm-libunwind.spec

4f44943
%global toolchain clang
4f44943
%global maj_ver 15
bdddcf4
%global min_ver 0
54daa33
%global patch_ver 7
52b85ba
#global rc_ver 3
bdddcf4
%global libunwind_version %{maj_ver}.%{min_ver}.%{patch_ver}
bdddcf4
bdddcf4
%global libunwind_srcdir libunwind-%{libunwind_version}%{?rc_ver:rc%{rc_ver}}.src
bdddcf4
bdddcf4
Name:       llvm-libunwind
bdddcf4
Version:    %{libunwind_version}%{?rc_ver:~rc%{rc_ver}}
47a190b
Release:    3%{?dist}
bdddcf4
Summary:    LLVM libunwind
bdddcf4
47a190b
License:    Apache-2.0 WITH LLVM-exception OR NCSA OR MIT
bdddcf4
URL:        http://llvm.org
486c3a0
Source0:    https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{libunwind_srcdir}.tar.xz
486c3a0
Source1:    https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{libunwind_srcdir}.tar.xz.sig
4f44943
Source2:    release-keys.asc
bdddcf4
bdddcf4
# Upstream tighly ties its build to libcxx source, we don't want to use that
bdddcf4
# senario, so we need to maintain that patch downstream.
bdddcf4
Patch0:     standalone.patch
bdddcf4
4f44943
BuildRequires:  clang
bdddcf4
BuildRequires:  cmake
bdddcf4
BuildRequires:  ninja-build
bdddcf4
BuildRequires:  llvm-devel
bdddcf4
bdddcf4
# For documentation
bdddcf4
BuildRequires:  python3-sphinx
bdddcf4
bdddcf4
# For gpg source verification
bdddcf4
BuildRequires:  gnupg2
bdddcf4
bdddcf4
# Explicitly not supported upstream
bdddcf4
ExcludeArch:    s390x
bdddcf4
bdddcf4
%description
bdddcf4
bdddcf4
LLVM libunwind is an implementation of the interface defined by the HP libunwind
bdddcf4
project. It was contributed Apple as a way to enable clang++ to port to
bdddcf4
platforms that do not have a system unwinder. It is intended to be a small and
bdddcf4
fast implementation of the ABI, leaving off some features of HP's libunwind
bdddcf4
that never materialized (e.g. remote unwinding).
bdddcf4
bdddcf4
%package devel
bdddcf4
Summary:    LLVM libunwind development files
bdddcf4
Provides:   libunwind(major) = %{maj_ver}
bdddcf4
Requires:   %{name}%{?_isa} = %{version}-%{release}
bdddcf4
bdddcf4
%description devel
29923fa
Unversioned shared library for LLVM libunwind
29923fa
29923fa
%package static
29923fa
Summary: Static library for LLVM libunwind
29923fa
29923fa
%description static
29923fa
%{summary}.
bdddcf4
bdddcf4
%package doc
bdddcf4
Summary:    libunwind documentation
bdddcf4
# jquery.js and langage_data.js are used in the HTML doc and under BSD License
47a190b
License:    BSD AND (Apache-2.0 WITH LLVM-exception OR NCSA OR MIT)
bdddcf4
bdddcf4
%description doc
bdddcf4
Documentation for LLVM libunwind
bdddcf4
bdddcf4
%prep
bdddcf4
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
bdddcf4
%autosetup -n %{libunwind_srcdir} -p2
bdddcf4
bdddcf4
%build
d6128c4
# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files.
d6128c4
export ASMFLAGS=$CFLAGS
d6128c4
bdddcf4
%cmake -GNinja \
4f44943
    -DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
bdddcf4
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
bdddcf4
    -DLLVM_BUILD_DOCS=ON \
bdddcf4
    -DLLVM_ENABLE_SPHINX=ON \
bdddcf4
    -DLIBUNWIND_INCLUDE_DOCS=ON \
4f44943
%if 0%{?__isa_bits} == 64
4f44943
    -DLIBUNWIND_LIBDIR_SUFFIX=64 \
4f44943
%else
4f44943
    -DLIBUNWIND_LIBDIR_SUFFIX= \
4f44943
%endif
4f44943
    -DLIBUNWIND_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \
bdddcf4
    -DSPHINX_WARNINGS_AS_ERRORS=OFF \
bdddcf4
    -DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3
bdddcf4
bdddcf4
%cmake_build
bdddcf4
bdddcf4
%install
bdddcf4
bdddcf4
%cmake_install
bdddcf4
048172c
# We can't install the unversionned path on default location because that would conflict with
bdddcf4
# https://src.fedoraproject.org/rpms/libunwind
048172c
#
048172c
# The versionned path has a different soname (libunwind.so.1 compared to
048172c
# libunwind.so.8) so they can live together in %{_libdir}
048172c
#
bdddcf4
# ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't
bdddcf4
# have the exact same ABI has gcc's libunwind (it actually provides a subset).
048172c
rm %{buildroot}%{_libdir}/libunwind.so
bdddcf4
mkdir -p %{buildroot}/%{_libdir}/llvm-unwind/
048172c
048172c
pushd %{buildroot}/%{_libdir}/llvm-unwind
048172c
ln -s ../libunwind.so.1.0 libunwind.so
048172c
popd
048172c
048172c
bdddcf4
4f44943
rm %{buildroot}%{_pkgdocdir}/html/.buildinfo
bdddcf4
bdddcf4
%check
bdddcf4
bdddcf4
# upstream has a hard dependency on libcxx source code for test to be configured
bdddcf4
# properly. We can't model that, so rely on gating instead.
bdddcf4
#cmake_build --target check-unwind
bdddcf4
bdddcf4
%files
bdddcf4
%license LICENSE.TXT
048172c
%{_libdir}/libunwind.so.1
048172c
%{_libdir}/libunwind.so.1.0
bdddcf4
bdddcf4
%files devel
048172c
%dir %{_libdir}/llvm-unwind
bdddcf4
%{_libdir}/llvm-unwind/libunwind.so
bdddcf4
29923fa
%files static
29923fa
%{_libdir}/libunwind.a
29923fa
bdddcf4
%files doc
bdddcf4
%license LICENSE.TXT
4f44943
%doc %{_pkgdocdir}/html
bdddcf4
bdddcf4
%changelog
47a190b
* Thu Jan 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 15.0.7-3
47a190b
- Update license to SPDX identifiers.
47a190b
- Include the Apache license adopted in 2019.
47a190b
1f83ff8
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 15.0.7-2
1f83ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
1f83ff8
54daa33
* Fri Jan 13 2023 Nikita Popov <npopov@redhat.com> - 15.0.7-1
54daa33
- Update to LLVM 15.0.7
54daa33
29923fa
* Mon Jan 02 2023 Nikita Popov <npopov@redhat.com> - 15.0.6-2
29923fa
- Provide libunwind.a
29923fa
81bd666
* Tue Dec 06 2022 Nikita Popov <npopov@redhat.com> - 15.0.6-1
81bd666
- Update to LLVM 15.0.6
81bd666
2e1cbda
* Mon Nov 07 2022 Nikita Popov <npopov@redhat.com> - 15.0.4-1
2e1cbda
- Update to LLVM 15.0.4
2e1cbda
d6128c4
* Mon Sep 12 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-2
d6128c4
- Make sure asm files are built with -fcf-protection
d6128c4
4f44943
* Fri Sep 09 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-1
4f44943
- Update to LLVM 15.0.0
4f44943
048172c
* Thu Sep 8 2022 sguelton@redhat.com - 14.0.5-2
cdc6205
- Install versioned library in standard location
048172c
245675b
* Mon Aug 29 2022 sguelton@redhat.com - 14.0.5-1
245675b
- Update to LLVM 14.0.5
245675b
10cf9fb
* Mon Aug 29 2022 sguelton@redhat.com - 14.0.0-1
10cf9fb
- Update to LLVM 14.0.0
10cf9fb
81000dc
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 13.0.1-2
81000dc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
81000dc
52b85ba
* Thu Feb 03 2022 Nikita Popov <npopov@redhat.com> - 13.0.1-1
52b85ba
- Update to LLVM 13.0.1 final
52b85ba
42cad33
* Tue Feb 01 2022 Nikita Popov <npopov@redhat.com> - 13.0.1~rc3-1
42cad33
- Update to LLVM 13.0.1rc3
42cad33
0ca24d1
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 13.0.1~rc2-2
0ca24d1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
0ca24d1
0add467
* Fri Jan 14 2022 Nikita Popov <npopov@redhat.com> - 13.0.1~rc2-1
0add467
- Update to LLVM 13.0.1rc2
0add467
486c3a0
* Wed Jan 12 2022 Nikita Popov <npopov@redhat.com> - 13.0.1~rc1-1
486c3a0
- Update to LLVM 13.0.1rc1
486c3a0
bdddcf4
* Wed Nov 17 2021 sguelton@redhat.com - 13.0.0-1
bdddcf4
- Initial release
bdddcf4