File ImageViewer.spec of Package ImageViewer

#
# spec file for package ImageViewer
#
# Copyright (c) 2024 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/
#


# Fails on Leap 15 with '/usr/include/OpenEXR/ImathVec.h:228:41: error: ISO C++17 does not allow dynamic exception specifications'
%if 0%{?suse_version} > 1500
%define with_exr 1
%endif
%define  _name  com.github.aliencoweatcake.imageviewer
Name:           ImageViewer
Version:        1.8.2
Release:        0
Summary:        Simple, cross-platform image viewer
License:        GPL-3.0-or-later
Group:          Productivity/Graphics/Viewers
URL:            https://github.com/AlienCowEatCake/ImageViewer
Source0:        %{url}/releases/download/v%{version}/%{name}-%{version}_system_thirdparty.tar.xz
Patch0:         install_%{name}.patch
Patch1:         001-desktop.patch
BuildRequires:  FLIF-devel
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  giflib-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  jxrlib-devel
BuildRequires:  libbpg-devel
BuildRequires:  libjbig-devel
BuildRequires:  pkgconfig
BuildRequires:  resvg-c-api-devel
BuildRequires:  update-desktop-files
#uildRequires:  cmake(NanoSVG)
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6Core5Compat)
BuildRequires:  cmake(Qt6Gui)
BuildRequires:  qt6-imageformats-devel
BuildRequires:  cmake(Qt6Network)
BuildRequires:  cmake(Qt6PrintSupport)
BuildRequires:  cmake(Qt6SvgWidgets)
#uildRequires:  cmake(Qt6WebEngineCore)
#uildRequires:  cmake(Qt6WebEngineQuick)
#uildRequires:  cmake(Qt6WebEngineWidgets)
BuildRequires:  cmake(Qt6Widgets)
#uildRequires:  pkgconfig(GraphicsMagick)
#uildRequires:  pkgconfig(GraphicsMagickWand)
BuildRequires:  pkgconfig(Lerc)
#uildRequires:  pkgconfig(MagickCore)
#uildRequires:  pkgconfig(MagickWand)
%if 0%{?with_exr}
BuildRequires:  pkgconfig(OpenEXR)
%endif
BuildRequires:  pkgconfig(exiv2)
BuildRequires:  pkgconfig(jasper)
BuildRequires:  pkgconfig(lcms2)
BuildRequires:  pkgconfig(libavif)
BuildRequires:  pkgconfig(libexif)
BuildRequires:  pkgconfig(libheif)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libjxl)
BuildRequires:  pkgconfig(libmng)
BuildRequires:  pkgconfig(libopenjp2)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libraw)
BuildRequires:  pkgconfig(librsvg-2.0)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  pkgconfig(libwebp)
BuildRequires:  pkgconfig(libwmf)
BuildRequires:  pkgconfig(libyuv)
BuildRequires:  pkgconfig(zlib)
Provides:       bundled(libQtUtils)
#equires:       ImageMagick
Requires:       libwmf-tools

%description
Simple, cross-platform image viewer inspired by GPicView.
Features:
 - Just a viewer, not an editor or organizer;
 - Support a large number of image formats;
 - Support an embedded ICC Profiles;
 - Support EXIF, XMP and other metadata;
 - Lightweight and fast;
 - Very suitable for default image viewer of desktop system;
 - Simple and intuitive interface;
 - Cross platform: GNU/Linux, macOS, Windows, Haiku and other systems;
 - Minimal external lib dependency: only pure Qt and system libraries are used;
 - Flexible and configurable;
 - Desktop independent: doesn't require any specific desktop environment;
 - Open source, licensed under GNU GPL v3 or later;

%prep
%autosetup -p1 -n %{name}-%{version}
find src/ThirdParty/* -maxdepth 1 -mindepth 1 -type d -or -name '*.pro' -exec rm -rfv {} +

%build
%qmake6 CONFIG+="release enable_pkgconfig" \
    CONFIG+="system_thirdparty" \
    CONFIG+="system_resvg" \
%if 0%{?with_exr}
    CONFIG+="system_openexr" \
%else
    CONFIG+="disable_openexr" \
%endif
    INCLUDEPATH+="%{_includedir}/jxrlib" \
    INCLUDEPATH+="%{_includedir}/openjpeg-2.5" \
    INCLUDEPATH+="%{_includedir}/freetype2" \
    INCLUDEPATH+="%{_includedir}/Imath" \
    %{nil}
%qmake6_build

%install
pushd src/%{name}
%qmake6_install
popd

%files
%doc README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{_name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{_name}.??g
%license LICENSE.GPLv3

%changelog
openSUSE Build Service is sponsored by