File krita.spec of Package krita

#
# spec file for package krita
#
# 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/
#


%bcond_without released
# Build fails on x86 and powerpc with xsimd (kde#462122)
%ifnarch %{ix86} ppc64 ppc64le
%bcond_without xsimd
%endif
# Default python version is too old in Leap 15
%{?sle15_python_module_pythons}
%if 0%{?suse_version} > 1500
%define pyver python3
%else
%define pyver python311
%endif
Name:           krita
Version:        5.2.3
Release:        0
Summary:        Digital Painting Application
License:        BSD-2-Clause AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-3.0-or-later AND CC0-1.0 AND LGPL-2.0-only
URL:            https://www.krita.org/
Source0:        https://download.kde.org/stable/krita/%{version}/krita-%{version}.tar.xz
%if %{with released}
Source1:        https://download.kde.org/stable/krita/%{version}/krita-%{version}.tar.xz.sig
Source2:        krita.keyring
%endif
# PATCH-FIX-UPSTREAM
Patch0:         0004-Fix-build-with-sip6.8.patch
Patch10:        krita-MR2225-Qt6.patch
BuildRequires:  %{pyver}-devel
BuildRequires:  %{pyver}-qt6-devel
BuildRequires:  %{pyver}-sip-devel
BuildRequires:  OpenEXR-devel
BuildRequires:  extra-cmake-modules
BuildRequires:  fftw3-devel
BuildRequires:  giflib-devel
BuildRequires:  gsl-devel
%if 0%{?suse_version} > 1500
BuildRequires:  libboost_system-devel
%else
BuildRequires:  libboost_system1_75_0-devel
#!BuildIgnore:  libboost_headers1_66_0-devel
%endif
BuildRequires:  libeigen3-devel
BuildRequires:  libexiv2-devel
BuildRequires:  libheif-devel
BuildRequires:  libjpeg-devel
BuildRequires:  liblcms2-devel
BuildRequires:  libpng-devel
BuildRequires:  libpoppler-qt6-devel
BuildRequires:  libraw-devel
BuildRequires:  libtiff-devel
BuildRequires:  openjpeg2-devel
BuildRequires:  perl
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  zlib-devel
BuildRequires:  cmake(Immer)
BuildRequires:  cmake(KDcrawQt6)
BuildRequires:  cmake(KF6Completion)
BuildRequires:  cmake(KF6Config)
BuildRequires:  cmake(KF6CoreAddons)
BuildRequires:  cmake(KF6Crash)
BuildRequires:  cmake(KF6GuiAddons)
BuildRequires:  cmake(KF6I18n)
BuildRequires:  cmake(KF6ItemModels)
BuildRequires:  cmake(KF6ItemViews)
BuildRequires:  cmake(KF6WidgetsAddons)
BuildRequires:  cmake(KF6WindowSystem)
BuildRequires:  cmake(Lager)
BuildRequires:  cmake(Mlt7)
BuildRequires:  cmake(Qt6Concurrent)
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6DBus)
BuildRequires:  cmake(Qt6Gui)
BuildRequires:  cmake(Qt6Network)
BuildRequires:  cmake(Qt6PrintSupport)
BuildRequires:  cmake(Qt6Qml)
BuildRequires:  cmake(Qt6Quick)
BuildRequires:  cmake(Qt6QuickWidgets)
BuildRequires:  cmake(Qt6Sql)
BuildRequires:  cmake(Qt6Svg)
BuildRequires:  cmake(Qt6Test)
BuildRequires:  cmake(Qt6Widgets)
BuildRequires:  cmake(Qt6XcbQpaPrivate)
BuildRequires:  cmake(Qt6Xml)
BuildRequires:  cmake(QuaZip-Qt6)
BuildRequires:  cmake(Zug)
BuildRequires:  cmake(kseexpr)
BuildRequires:  cmake(sdl2)
%if %{with xsimd}
BuildRequires:  cmake(xsimd)
%endif
BuildRequires:  pkgconfig(OpenColorIO)
BuildRequires:  pkgconfig(fontconfig) >= 2.13.1
BuildRequires:  pkgconfig(freetype2) >= 2.11.0
BuildRequires:  pkgconfig(fribidi) >= 1.0.6
BuildRequires:  pkgconfig(harfbuzz) >= 4.0
BuildRequires:  pkgconfig(libjxl)
BuildRequires:  pkgconfig(libmypaint)
BuildRequires:  pkgconfig(libunibreak)
BuildRequires:  pkgconfig(libwebp)
BuildRequires:  pkgconfig(xcb-atom)
BuildRequires:  pkgconfig(xcb-xinput)
BuildRequires:  pkgconfig(xi) >= 1.4.99.1
Recommends:     %{pyver}-qt6
Recommends:     krita-plugin-gmic
Obsoletes:      calligra-krita < %{version}
Provides:       calligra-krita = %{version}

%description
Krita is a painting program. It supports concept art, texture and
matte painters, as well as illustrations and comics.

%package devel
Summary:        Krita Build Environment
Requires:       krita = %{version}
Requires:       cmake(Qt6Core)

%description devel
Development headers and libraries for Krita.

%lang_package

%prep
%autosetup -p1

%build
export CFLAGS="%{optflags} -w -fPIC -O3 -fno-strict-aliasing"
%ifarch x86_64 %{?x86_64}
export CFLAGS="${CFLAGS} -march=x86-64-v2 -mtune=generic -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes -mpclmul -ftree-parallelize-loops=4 -ftree-vectorize -fvect-cost-model=cheap -fsimd-cost-model=cheap -fpredictive-commoning"
%endif
export CXXFLAGS="${CFLAGS}"
%cmake_kf6 \
	-DBUILD_WITH_QT6=ON \
	-DKRITA_ENABLE_PCH=OFF

%cmake_build

%install
%kf6_makeinstall -C build

%suse_update_desktop_file -r org.kde.krita Qt KDE Graphics RasterGraphics

%find_lang %{name}

chmod -x %{buildroot}%{_kf6_applicationsdir}/*.desktop

# remove shebang to avoid rpmlint warning, that file is not supposed to be run directly anyway
sed -i "/#!\/usr\/bin\/env/d" %{buildroot}%{_kf6_libdir}/krita-python-libs/krita/sceditor/highlighter.py

%ldconfig_scriptlets

%files
%license COPYING*
%doc AUTHORS HACKING README*
%{_kf6_bindir}/krita
%{_kf6_bindir}/krita_version
%{_kf6_bindir}/kritarunner
%{_kf6_applicationsdir}/*.desktop
%{_kf6_sharedir}/krita/
%{_kf6_appstreamdir}/
%{_kf6_libdir}/libkrita*.so.*
%{_kf6_libdir}/kritaplugins/
%{_kf6_libdir}/krita-python-libs/
%{_kf6_sharedir}/kritaplugins/
%{_kf6_sharedir}/color/
%{_kf6_sharedir}/color-schemes/
%{_kf6_iconsdir}/hicolor/*
%config %{_kf6_configdir}/krita*

%files devel
%{_kf6_libdir}/libkrita*.so
%{_includedir}/kis_qmic_interface.h
%{_includedir}/kis_qmic_plugin_interface.h
%{_includedir}/kritaqmicinterface_export.h

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by