File blend2d.spec of Package blend2d

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


%define  sover  0
%define  lname  lib%{name}%{sover}
%bcond_without check
Name:           blend2d
Version:        0.20.0
Release:        0
Summary:        2D Vector Graphics Engine Powered by a JIT Compiler
License:        Zlib
Group:          Productivity/Graphics/Other
URL:            https://blend2d.com
Source0:        %{url}/download/%{name}-%{version}.tar.gz
BuildRequires:  cmake >= 3.19
BuildRequires:  gcc-c++
BuildRequires:  ninja

%description
Blend2D is a high performance 2D vector graphics engine written in C++ and
released under the Zlib license. The engine utilizes a built-in JIT
compiler to generate optimized pipelines at runtime and is capable of using
multiple threads to boost the performance beyond the possibilities of
single-threaded rendering. Additionally, the engine features a new
rasterizer that has been written from scratch. It delivers superior
performance while quality is comparable to rasterizers used by AGG,
FreeType, and Qt. The performance has been optimized by using an innovative
approach to index data that is built during rasterization and scanned
during composition. The rasterizer is robust and excels in rendering basic
shapes, complex vector art, and text.

%package -n     %{lname}
Summary:        2D Vector Graphics Engine Powered by a JIT Compiler
Group:          System/Libraries

%description -n %{lname}
Blend2D is a high performance 2D vector graphics engine written in C++ and
released under the Zlib license. The engine utilizes a built-in JIT
compiler to generate optimized pipelines at runtime and is capable of using
multiple threads to boost the performance beyond the possibilities of
single-threaded rendering. Additionally, the engine features a new
rasterizer that has been written from scratch. It delivers superior
performance while quality is comparable to rasterizers used by AGG,
FreeType, and Qt. The performance has been optimized by using an innovative
approach to index data that is built during rasterization and scanned
during composition. The rasterizer is robust and excels in rendering basic
shapes, complex vector art, and text.
The package contains libraries %{name}.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Languages/C and C++
Requires:       %{lname} = %{version}-%{release}

%description    devel
The package contains libraries and header files for developing applications
that use %{name}.

%prep
%autosetup -p1 -n %{name}
sed -i "s/\(DEFINE_SYMBOL\)/SOVERSION %{sover} \1/" CMakeLists.txt

%build
%define __builder ninja
%cmake \
%if %{with check}
    -DBLEND2D_TEST=ON \
%endif
    -DBLEND2D_NO_JIT=OFF
%ninja_build

%install
%ninja_install -C build

%if %{with check}
%check
%ctest
%endif

%ldconfig_scriptlets -n %{lname}

%files -n %{lname}
%license LICENSE.md
%doc README.md
%{_libdir}/lib%{name}.so.*

%files devel
%{_includedir}/%{name}-debug.h
%{_includedir}/%{name}-impl.h
%{_includedir}/%{name}.h
%{_includedir}/%{name}/
%{_libdir}/cmake/%{name}/
%{_libdir}/lib%{name}.so

%changelog
openSUSE Build Service is sponsored by