File harfbuzz.spec of Package harfbuzz

#
# spec file for package harfbuzz
#
# Copyright (c) 2025 SUSE LLC and contributors
# Copyright (c) 2024 Andreas Stieger <Andreas.Stieger@gmx.de>
#
# 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/
#


%if 0%{?suse_version} < 1500 || 0%{?gcc_version} < 13
%define with_gcc 13
%endif
Name:           harfbuzz
Version:        11.4.5
Release:        0
Summary:        An OpenType text shaping engine
License:        MIT
URL:            https://www.freedesktop.org/wiki/Software/HarfBuzz
Source0:        %{name}-%{version}.tar.xz
Source99:       baselibs.conf
Patch0:         0001-cmake-Fix-missing-sources-5519.patch
Patch1:         %{name}-soversion.patch
Patch2:         fix-gir.patch
BuildRequires:  cmake
BuildRequires:  gcc%{?with_gcc}
BuildRequires:  gcc%{?with_gcc}-c++
BuildRequires:  pkgconfig >= 0.28
BuildRequires:  pkgconfig(cairo) >= 1.10
BuildRequires:  pkgconfig(cairo-ft)
BuildRequires:  pkgconfig(freetype2) >= 12.0.6
BuildRequires:  pkgconfig(glib-2.0) >= 2.30
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(graphite2) >= 1.2.0
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(icu-uc) >= 49.0
Conflicts:      cantarell-fonts < 0.0.23

%description
HarfBuzz is an OpenType text shaping engine.

%package -n libharfbuzz0
Summary:        An OpenType text shaping engine

%description -n libharfbuzz0
HarfBuzz is an OpenType text shaping engine.

%package -n libharfbuzz-cairo0
Summary:        Cairo integration into the HarfBuzz OpenType text shaping engine

%description -n libharfbuzz-cairo0
HarfBuzz is an OpenType text shaping engine.
This package contains the Cairo library.

%package -n libharfbuzz-icu0
Summary:        ICU integration into the HarfBuzz OpenType text shaping engine

%description -n libharfbuzz-icu0
HarfBuzz is an OpenType text shaping engine.
This package contains the ICU library.

%package -n libharfbuzz-gobject0
Summary:        GObject wrapper around the HarfBuzz OpenType text shaping engine

%description -n libharfbuzz-gobject0
HarfBuzz is an OpenType text shaping engine.
This package contains the GObject library.

%package -n libharfbuzz-subset0
Summary:        An OpenType text shaping engine

%description -n libharfbuzz-subset0
HarfBuzz is an OpenType text shaping engine.
This package contains the subset library

%package -n typelib-1_0-HarfBuzz-0_0
Summary:        Introspection bindings for the HarfBuzz/GObject library

%description -n typelib-1_0-HarfBuzz-0_0
HarfBuzz is an OpenType text shaping engine.
This package provides the GObject Introspection bindings for HarfBuzz.

%package tools
Summary:        Tools from the HarfBuzz text shaping software

%description tools
HarfBuzz is an OpenType text shaping engine.
This package provides a set of tools for HarfBuzz.

%package devel
Summary:        Development files for the HarfBuzz OpenType text shaping engine
Requires:       libharfbuzz-cairo0 = %{version}
Requires:       libharfbuzz-icu0 = %{version}
Requires:       libharfbuzz-subset0 = %{version}
Requires:       libharfbuzz0 = %{version}
Requires:       pkgconfig(freetype2) >= 12.0.6
%if 0%{?suse_version} >= 1500
Requires:       libharfbuzz-gobject0 = %{version}
Requires:       typelib-1_0-HarfBuzz-0_0 = %{version}
%endif

%description devel
HarfBuzz is an OpenType text shaping engine.
This package contains the development files.

%prep
%autosetup -p1

%build
%if 0%{?with_gcc}
export CXX=g++-%{with_gcc}
export CC=gcc-%{with_gcc}
%endif
%cmake \
    -DHB_HAVE_CAIRO:BOOL=ON \
    -DHB_HAVE_FREETYPE:BOOL=ON \
    -DHB_HAVE_GRAPHITE2:BOOL=ON \
%if 0%{?suse_version} >= 1500
    -DHB_HAVE_GOBJECT:BOOL=ON \
    -DHB_HAVE_INTROSPECTION:BOOL=ON \
%endif
    -DHB_HAVE_GLIB:BOOL=ON \
    -DHB_HAVE_ICU:BOOL=ON \
    -DHB_BUILD_UTILS:BOOL=ON \
    %{nil}
%cmake_build

%install
%cmake_install

%if %{undefined ldconfig_scriptlets}
%post -n libharfbuzz0 -p /sbin/ldconfig
%postun -n libharfbuzz0 -p /sbin/ldconfig
%post -n libharfbuzz-cairo0 -p /sbin/ldconfig
%postun -n libharfbuzz-cairo0 -p /sbin/ldconfig
%post -n libharfbuzz-icu0 -p /sbin/ldconfig
%postun -n libharfbuzz-icu0 -p /sbin/ldconfig
%if 0%{?suse_version} >= 1500
%post -n libharfbuzz-gobject0 -p /sbin/ldconfig
%postun -n libharfbuzz-gobject0 -p /sbin/ldconfig
%endif

%post -n libharfbuzz-subset0 -p /sbin/ldconfig
%postun -n libharfbuzz-subset0 -p /sbin/ldconfig
%else
%ldconfig_scriptlets -n libharfbuzz0
%ldconfig_scriptlets -n libharfbuzz-cairo0
%ldconfig_scriptlets -n libharfbuzz-icu0

%if 0%{?suse_version} >= 1500
%ldconfig_scriptlets -n libharfbuzz-gobject0
%endif
%ldconfig_scriptlets -n libharfbuzz-subset0
%endif

%files -n libharfbuzz0
%license COPYING
%doc NEWS
%{_libdir}/libharfbuzz.so.0*

%files -n libharfbuzz-cairo0
%license COPYING
%{_libdir}/libharfbuzz-cairo.so.0*

%files -n libharfbuzz-icu0
%license COPYING
%{_libdir}/libharfbuzz-icu.so.0*

%if 0%{?suse_version} >= 1500
%files -n libharfbuzz-gobject0
%license COPYING
%{_libdir}/libharfbuzz-gobject.so.0*
%endif

%files -n libharfbuzz-subset0
%license COPYING
%{_libdir}/libharfbuzz-subset.so.0*

%if 0%{?suse_version} >= 1500
%files -n typelib-1_0-HarfBuzz-0_0
%license COPYING
%{_libdir}/girepository-1.0/HarfBuzz-0.0.typelib
%endif

%files tools
%license COPYING
%if 0%{?suse_version} >= 1500
%{_bindir}/hb-info
%endif
%{_bindir}/hb-shape
%{_bindir}/hb-subset
%{_bindir}/hb-view

%files devel
%license COPYING
%doc AUTHORS README.md THANKS
%{_includedir}/harfbuzz/
%{_libdir}/*.so
%{_libdir}/pkgconfig/harfbuzz.pc
%{_libdir}/pkgconfig/harfbuzz-cairo.pc
%{_libdir}/pkgconfig/harfbuzz-icu.pc
%if 0%{?suse_version} >= 1500
%{_libdir}/pkgconfig/harfbuzz-gobject.pc
%{_datadir}/gir-1.0/HarfBuzz-0.0.gir
%endif
%{_libdir}/pkgconfig/harfbuzz-subset.pc
%dir %{_libdir}/cmake
%dir %{_libdir}/cmake/harfbuzz
%{_libdir}/cmake/harfbuzz/*.cmake

%changelog
openSUSE Build Service is sponsored by