File gbench.spec of Package gbench
#
# spec file for package gbench
#
# Copyright (c) 2012 Matthias Mailänder
# Copyright (c) 2022 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/
#
Name: gbench
Version: 3.8.1
Release: 0
Summary: View and analyze genome sequences
Group: Productivity/Scientific/Other
License: SUSE-Public-Domain
URL: https://www.ncbi.nlm.nih.gov/tools/gbench/
Source0: https://ftp.ncbi.nlm.nih.gov/toolbox/gbench/ver-%{version}/gbench-src-%{version}.tar.gz
# PATCH-FIX-OPENSUSE -- fix broken MFLAGS mangling, causing quadratic -jN behavior
Patch0: fix_MFLAGS.patch
# PATCH-FIX-OPENSUSE -- fix broken GDK_DISPLAY call
Patch1: fix_GDK_DISPLAY_call.patch
# PATCH-FIX-OPENSUSE -- remove call to removed wxSearchCtrl::IsModified
Patch2: 0001-Trigger-changed-event-on-leave-events.patch
# PATCH-FIX-OPENSUSE -- Add missing conversion for wxUSE_STL builds
Patch3: 0001-Fix-missing-conversion-from-wxString-to-std-string.patch
BuildRequires: fdupes
BuildRequires: fltk-devel
BuildRequires: freeglut-devel
BuildRequires: freetds-devel
BuildRequires: freetype2-devel
BuildRequires: ftgl-devel
BuildRequires: gcc-c++
BuildRequires: giflib-devel
BuildRequires: gl2ps-devel
BuildRequires: glew-devel
BuildRequires: hdf5-devel
BuildRequires: libboost_chrono-devel > 1.35
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_iostreams-devel
BuildRequires: libboost_regex-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_serialization-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_test-devel
BuildRequires: libboost_thread-devel
BuildRequires: libcurl-devel
BuildRequires: libcppunit-devel
BuildRequires: libexpat-devel
BuildRequires: libgnutls-devel
BuildRequires: libicu-devel
BuildRequires: libjpeg-devel
BuildRequires: libmysqlclient-devel
BuildRequires: libnghttp2-devel
BuildRequires: libpng12-devel
BuildRequires: libtiff-devel
BuildRequires: libuv-devel
BuildRequires: libxalan-c-devel
BuildRequires: libxerces-c-devel
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: libdb-4_8-devel
BuildRequires: lzo-devel
BuildRequires: muparser-devel
BuildRequires: ncbi-vdb-devel
BuildRequires: pcre-devel
BuildRequires: python3-devel
BuildRequires: sablot-devel
BuildRequires: sed
BuildRequires: sqlite3-devel
BuildRequires: update-desktop-files
# Several incompatibilities between gbench and GTK3
BuildRequires: wxWidgets-devel >= 3.1
#BuildRequires: wxGTK3-devel >= 3.1
BuildRequires: zlib-devel
%description
NCBI Genome Workbench is an integrated application for viewing and analyzing sequence data.
Genome Workbench was developed entirely in-house at NCBI and makes use of the NCBI C++ ToolKit.
The C++ ToolKit provides a convenient and flexible cross-platform API for managing system internals,
database connections, network sockets, and the NCBI data model. In addition, the C++ ToolKit
provides the Object Manager, which abstracts handling of sequences and sequence-related objects.
%prep
%setup
%autopatch -p1
%build
%global optflags %{optflags} -Wno-error=return-type
# Add mising GTK+-2.0 include dir
export CXXFLAGS="%{optflags} `pkg-config gtk+-2.0 --cflags-only-I` "
# Make reproducible
export NCBI_BUILD_SESSION_ID=${SOURCE_DATE_EPOCH}
# Missing lib dependencies
sed -i -e '/DLL_LIB/ s/.*/\0 w_data/' src/gui/widgets/text_widget/Makefile.w_text_widget.lib
sed -i -e '/DLL_LIB/ s/.*/\0 fastme/' src/algo/phy_tree/Makefile.xalgophytree.lib
# with-3psw enables preference of system packages
./configure \
--target=%{_target_platform} \
--prefix=%{_prefix} \
--exec-prefix=%{_exec_prefix} \
--with-mt \
--with-gbench \
--with-3psw \
--with-libxml \
--with-libxslt \
--without-sse42 \
--with-wxwidgets-ucs \
--without-debug \
--with-vdb=%{_includedir}/ncbi-vdb \
--with-projects=scripts/projects/ncbi_gbench.lst \
--with-runpath="%{_libdir}/gbench/lib" \
--without-sybase \
--with-flat-makefile \
--without-caution \
--with-build-root="build"
%make_build
%install
cd build/build/app/gbench/gbench_install
make install_dir=%{buildroot}%{_libdir}/gbench
%suse_update_desktop_file -c gbench GBench "NCBI Genome Workbench" "%{_libdir}/gbench/bin/gbench-bin" "%{_libdir}/gbench/share/gbench/gbench_about.png" Education Science
# Remove unneeded wrapper script
rm %{buildroot}%{_libdir}/gbench/bin/gbench
mkdir %{buildroot}%{_bindir}
ln -s %{_libdir}/gbench/bin/gbench-bin %{buildroot}%{_bindir}/gbench
# brp RPATH check is broken, and has been removed post 15.4
export NO_BRP_CHECK_RPATH=true
%fdupes %{buildroot}/%{_libdir}/gbench
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%{_bindir}/gbench
%{_datadir}/applications/*
%dir %{_libdir}/gbench
%dir %{_libdir}/gbench/lib/
%dir %{_libdir}/gbench/share/
%dir %{_libdir}/gbench/packages/
%{_libdir}/gbench/bin
%{_libdir}/gbench/etc
%{_libdir}/gbench/lib/lib*.so
%{_libdir}/gbench/share/gbench
%{_libdir}/gbench/packages/alignment
%{_libdir}/gbench/packages/sequence
%{_libdir}/gbench/packages/sequence_edit
%{_libdir}/gbench/packages/snp
%changelog