File sourcetrail.spec of Package sourcetrail

#
# spec file for package sourcetrail
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%define _smp_mflags "-j1"
%define _lto_cflags %{nil}
Name:           sourcetrail
Version:        2020.2
Release:        0
Summary:        Free and open-source cross-platform source explorer
License:        GPL-3.0-only
URL:            https://www.sourcetrail.com/
Source:         https://github.com/CoatiSoftware/Sourcetrail/archive/%{version}.tar.gz
Patch0:         sourcetrail-dont-install-libs.patch
#BuildRequires:  gcc-c++
BuildRequires:  clang
BuildRequires:  cmake
BuildRequires:  libQt5Network-devel
BuildRequires:  libQt5PrintSupport-devel
BuildRequires:  libQt5Svg-devel
BuildRequires:  libQt5Widgets-devel
BuildRequires:  libXau-devel
BuildRequires:  libXi-devel
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_system-devel >= 1.67
BuildRequires:  libdrm-devel
BuildRequires:  libffi-devel
BuildRequires:  libxcb-devel
BuildRequires:  pthread-stubs-devel

%description
Sourcetrail is a free and open-source cross-platform source explorer that helps you get productive on unfamiliar source code.

%prep
%autosetup -p1 -n Sourcetrail-%{version}

%build
# get rid of bundled libs
rm -f lib/libXi.so.6 lib/libXxf86vm.so.1 lib/libXrender.so.1 lib/libXfixes.so.3 lib/libXext.so.6 \
      lib/libXdamage.so.1 lib/libxcb* lib/libXau.so.6 lib/libX11-xcb.so.1 lib/libX11.so.6 \
      lib/libudev.so.0 lib/libEGL.so.1 lib/libgbm.so.1 lib/libglapi.so.0 lib/libGL.so.1 \
      lib/libdrm.so.2 lib/libfontconfig.so.1 lib/libfreetype.so.6 lib/libcrypto.so lib/libssl.so \
      lib/libpng12.so.0 lib/libselinux.so.1

%cmake -DBoost_USE_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_STATIC_LIBS:BOOL=ON

%install
%cmake_install
mkdir -p %{buildroot}%{_bindir}
ln -s %{_prefix}/Sourcetrail/Sourcetrail.sh %{buildroot}%{_bindir}/sourcetrail

%files
%license LICENSE.txt
%doc CHANGELOG.md README.md
%{_prefix}/Sourcetrail/
%{_bindir}/sourcetrail

%changelog
openSUSE Build Service is sponsored by