b6ce653
Name:		lldb
740adb6
Version:	4.0.1
Jan Kratochvil 683e84e
Release:	3%{?dist}
b6ce653
Summary:	Next generation high-performance debugger
b6ce653
b6ce653
License:	NCSA
8d3d3b0
URL:		http://lldb.llvm.org/
22c21bf
Source0:	http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.xz
649dc81
8d3d3b0
ExclusiveArch:  %{arm} aarch64 %{ix86} x86_64
Dave Airlie 26e4c25
# Patch to remove use of private llvm headers
866111a
Patch0: 0001-Fix-build-with-gcc-7.patch
Jan Kratochvil 683e84e
# lldb: libedit produces garbled, unusable input on Linux
Jan Kratochvil 683e84e
Patch1: r303907-libedit.patch
b6ce653
b6ce653
BuildRequires:	cmake
b6ce653
BuildRequires:  llvm-devel = %{version}
b6ce653
BuildRequires:  clang-devel = %{version}
4b948d0
BuildRequires:  ncurses-devel
b6ce653
BuildRequires:  swig
b336c16
BuildRequires:  llvm-static = %{version}
b703659
BuildRequires:  libffi-devel
3848e6c
BuildRequires:  zlib-devel
3848e6c
BuildRequires:  libxml2-devel
Jan Kratochvil 683e84e
BuildRequires:  libedit-devel
b6ce653
71df412
Requires: llvm-libs = %{version}
71df412
Requires: clang-libs = %{version}
71df412
b6ce653
%description
b6ce653
LLDB is a next generation, high-performance debugger. It is built as a set
b6ce653
of reusable components which highly leverage existing libraries in the
b6ce653
larger LLVM Project, such as the Clang expression parser and LLVM
b6ce653
disassembler.
b6ce653
b6ce653
%package devel
b6ce653
Summary:	Development header files for LLDB
b6ce653
Requires:	%{name}%{?_isa} = %{version}-%{release}
b6ce653
b6ce653
%description devel
b6ce653
The package contains header files for the LLDB debugger.
b6ce653
b6ce653
%package -n python-lldb
b6ce653
Summary:	Python module for LLDB
b6ce653
BuildRequires:	python2-devel
649dc81
Requires:	python2-six
b6ce653
b6ce653
%description -n python-lldb
b6ce653
The package contains the LLDB Python module.
b6ce653
b6ce653
%prep
22c21bf
%setup -q -n %{name}-%{version}.src
b6ce653
866111a
%patch0 -p1
Jan Kratochvil 683e84e
%patch1 -p1
Dave Airlie 26e4c25
be64a97
# HACK so that lldb can find its custom readline.so, because we move it
be64a97
# after install.
be64a97
sed -i -e "s~import sys~import sys\nsys.path.insert\(1, '%{python_sitearch}/lldb'\)~g" source/Interpreter/embedded_interpreter.py
be64a97
b6ce653
%build
Dave Airlie 26e4c25
b6ce653
mkdir -p _build
b6ce653
cd _build
b6ce653
b6ce653
# Python version detection is broken
b6ce653
b6ce653
LDFLAGS="%{__global_ldflags} -lpthread -ldl"
b6ce653
866111a
CFLAGS="%{optflags} -Wno-error=format-security"
866111a
CXXFLAGS="%{optflags} -Wno-error=format-security"
b6ce653
b6ce653
%cmake .. \
b6ce653
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
6729b69
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
b6ce653
	-DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \
b6ce653
	\
b6ce653
	-DLLDB_PATH_TO_LLVM_BUILD=%{_prefix} \
b6ce653
	-DLLDB_PATH_TO_CLANG_BUILD=%{_prefix} \
b6ce653
	\
b6ce653
	-DLLDB_DISABLE_CURSES:BOOL=OFF \
Jan Kratochvil 683e84e
	-DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
b6ce653
	-DLLDB_DISABLE_PYTHON:BOOL=OFF \
964e9c6
%if 0%{?__isa_bits} == 64
964e9c6
        -DLLVM_LIBDIR_SUFFIX=64 \
964e9c6
%else
964e9c6
        -DLLVM_LIBDIR_SUFFIX= \
964e9c6
%endif
b6ce653
	\
b6ce653
	-DPYTHON_EXECUTABLE:STRING=%{__python} \
b6ce653
	-DPYTHON_VERSION_MAJOR:STRING=$(%{__python} -c "import sys; print sys.version_info.major") \
b6ce653
	-DPYTHON_VERSION_MINOR:STRING=$(%{__python} -c "import sys; print sys.version_info.minor")
b6ce653
b6ce653
make %{?_smp_mflags}
b6ce653
b6ce653
%install
b6ce653
cd _build
b6ce653
make install DESTDIR=%{buildroot}
b6ce653
b6ce653
# remove static libraries
b6ce653
rm -fv %{buildroot}%{_libdir}/*.a
b6ce653
b6ce653
# python: fix binary libraries location
b6ce653
liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so))
b6ce653
ln -vsf "../../../${liblldb}" %{buildroot}%{python_sitearch}/lldb/_lldb.so
b6ce653
mv -v %{buildroot}%{python_sitearch}/readline.so %{buildroot}%{python_sitearch}/lldb/readline.so
649dc81
649dc81
# remove bundled six.py
649dc81
rm -f %{buildroot}%{python_sitearch}/six.*
b6ce653
b6ce653
%post -p /sbin/ldconfig
b6ce653
%postun -p /sbin/ldconfig
b6ce653
b6ce653
%files
b6ce653
%{_bindir}/lldb*
b6ce653
%{_libdir}/liblldb.so.*
b6ce653
b6ce653
%files devel
b6ce653
%{_includedir}/lldb
b6ce653
%{_libdir}/*.so
b6ce653
b6ce653
%files -n python-lldb
b6ce653
%{python_sitearch}/lldb
b6ce653
b6ce653
%changelog
Jan Kratochvil 683e84e
* Mon Jul 31 2017 Jan Kratochvil <jan.kratochvil@redhat.com> - 4.0.1-3
Jan Kratochvil 683e84e
- Backport lldb r303907
Jan Kratochvil 683e84e
  Resolves rhbz #1356140
Jan Kratochvil 683e84e
851a3f5
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-2
851a3f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
851a3f5
740adb6
* Mon Jun 26 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
740adb6
- 4.0.1 Release
740adb6
6c004cd
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-2
6c004cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
6c004cd
866111a
* Fri Mar 24 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
866111a
- lldb 4.0.0
866111a
71df412
* Tue Mar 21 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-4
71df412
- Add explicit Requires for llvm-libs and clang-libs
71df412
be64a97
* Fri Mar 17 2017 Tom Stellard <tstellar@redhat.org> - 3.9.1-3
be64a97
- Adjust python sys.path so lldb can find readline.so
be64a97
7391dd6
* Tue Mar 14 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-2
7391dd6
- Fix build with gcc 7
7391dd6
1da0c1e
* Thu Mar 02 2017 Dave Airlie 
1da0c1e
- lldb 3.9.1
1da0c1e
e3b8942
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-4
e3b8942
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e3b8942
d6f326a
* Mon Nov 14 2016 Nathaniel McCallum <npmccallum@redhat.com> - 3.9.0-3
d6f326a
- Disable libedit support until upstream fixes it (#1356140)
d6f326a
8d3d3b0
* Wed Nov  2 2016 Peter Robinson <pbrobinson@fedoraproject.org> 3.9.0-2
8d3d3b0
- Set upstream supported architectures in an ExclusiveArch
8d3d3b0
964e9c6
* Wed Oct 26 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-1
964e9c6
- lldb 3.9.0
Dave Airlie 26e4c25
- fixup some issues with MIUtilParse by removing it
Dave Airlie 26e4c25
- build with -fno-rtti
964e9c6
a0d9136
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8.0-2
a0d9136
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
a0d9136
22c21bf
* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
22c21bf
- lldb 3.8.0
22c21bf
1c60079
* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.3
1c60079
- lldb 3.8.0 rc3
1c60079
6729b69
* Wed Feb 24 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.2
6729b69
- dynamically link to llvm
6729b69
649dc81
* Thu Feb 18 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.1
649dc81
- lldb 3.8.0 rc2
649dc81
b66265d
* Sun Feb 14 2016 Dave Airlie <airlied@redhat.com> 3.7.1-3
b66265d
- rebuild lldb against latest llvm
b66265d
f8aa6a2
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
f8aa6a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f8aa6a2
b6ce653
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
b6ce653
- initial version using cmake build system