SHA256
1
0
forked from pool/llvm
llvm/lldb.spec

118 lines
3.3 KiB
RPMSpec

#
# spec file for package lldb
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define _revision 216961
Name: lldb
Version: 3.5.0
Release: 0
Summary: The LLDB Debugger
License: NCSA
Group: Development/Languages
Url: http://lldb.llvm.org/
Source: http://llvm.org/releases/%{version}/lldb-%{version}.src.tar.xz
Patch1: lldb-cmake.patch
Patch2: lldb-underlink.patch
BuildRequires: cmake
BuildRequires: libedit-devel
BuildRequires: llvm-clang-devel = %{version}
BuildRequires: llvm-devel = %{version}
BuildRequires: ncurses-devel
BuildRequires: ninja
BuildRequires: python-devel
BuildRequires: swig
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: libLLVM = %{version}
Requires: libclang = %{version}
Requires: python-base
ExclusiveArch: arm x86_64
%define py_major $(python -c "import sys; print sys.version_info[0];")
%define py_minor $(python -c "import sys; print sys.version_info[1];")
%description
LLDB is a next generation, high-performance debugger. It is built as a set
of reusable components which highly leverage existing libraries in the
larger LLVM Project, such as the Clang expression parser and LLVM
disassembler.
%package devel
Summary: Next generation high-performance debugger (devel package)
Group: Development/Languages
Requires: libedit-devel
Requires: lldb = %{version}
Requires: zlib-devel
%description devel
LLDB is a next generation, high-performance debugger. It is built as a set
of reusable components which highly leverage existing libraries in the
larger LLVM Project, such as the Clang expression parser and LLVM
disassembler.
%prep
%setup -q -n %{name}-%{version}.src
%patch1 -p1
%patch2 -p1
sed -i s,LLDB_REVISION,\"%{_revision}\",g source/lldb.cpp
%build
mkdir build
pushd build
cmake -DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
%if "%{_lib}" == "lib64"
-DLLVM_LIBDIR_SUFFIX=64 \
%endif
-DLLDB_PATH_TO_LLVM_BUILD=%{_prefix} \
-DLLDB_PATH_TO_CLANG_BUILD=%{_prefix} \
-DLLVM_RUNTIME_OUTPUT_INTDIR=$PWD/bin \
-DLLVM_LIBRARY_OUTPUT_INTDIR=$PWD/%{_lib} \
-DPYTHON_VERSION_MAJOR=%{py_major} \
-DPYTHON_VERSION_MINOR=%{py_minor} \
-G "Ninja" \
..
ninja
%install
pushd build
DESTDIR=%{buildroot} ninja install
rm %{buildroot}%{_libdir}/liblldb*.a
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_libdir}/liblldb.so.*
%{_bindir}/lldb*
%{py_sitedir}/readline.so
%{py_sitedir}/lldb
%files devel
%defattr(-,root,root,-)
%{_includedir}/lldb
%{_libdir}/liblldb.so
%changelog