Name:           cogl
Version:        1.22.4
Release:        1
Summary:        Cogl is a modern 3D graphics API with associated utility APIs

License:        LGPLv2+
URL:            https://developer.gnome.org/cogl/
Source0:        https://github.com/GNOME/cogl/releases/tag/%{name}-%{version}.tar.xz

BuildRequires:  chrpath cairo-devel mesa-libEGL-devel mesa-libgbm-devel gdk-pixbuf2-devel
BuildRequires:  mesa-libGL-devel glib2-devel gobject-introspection-devel gtk-doc pango-devel
BuildRequires:  wayland-devel libXcomposite-devel libXdamage-devel libXext-devel
BuildRequires:  libXfixes-devel libxkbcommon-devel libXrandr-devel

Patch0:         0001-egl-Use-eglGetPlatformDisplay-not-eglGetDisplay.patch
Patch1:         0002-add-GL_ARB_shader_texture_lod-support.patch
Patch2:         0003-texture-support-copy_sub_image.patch

%description
COGL is a low level OpenGL abstraction library developed for (and part of)
Clutter. It is used primarily by Clutter to provide a common rendering API
that works transparently across OpenGL >=1.4, OpenGL ES 1.1 and OpenGL ES 2.0.

%package        devel
Summary:        The development environment for %{name}
Requires:       %{name} = %{version}-%{release}
Provides:       %{name}-tests
Obsoletes:      %{name}-tests

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

%package        help
Summary:        Documents for %{name}
Buildarch:      noarch
Requires:       man info %{name} = %{version}-%{release}
Provides:       %{name}-doc
Obsoletes:      %{name}-doc

%description    help
Man pages and other related documents for %{name}.

%prep
%autosetup -n %{name}-%{version} -p1

%build
%configure --enable-cairo=yes --enable-cogl-pango=yes --enable-gdk-pixbuf=yes \
           --enable-glx=yes --enable-gtk-doc --enable-introspection=yes \
           --enable-kms-egl-platform --enable-wayland-egl-platform \
           --enable-wayland-egl-server --enable-xlib-egl-platform \
           --enable-installed-tests
%make_build V=1

%install
make install DESTDIR=%{buildroot}
%delete_la

# Remove lib64 rpaths
chrpath --delete %{buildroot}%{_libdir}/libcogl-path.so
chrpath --delete %{buildroot}%{_libdir}/libcogl-pango.so

%ldconfig_scriptlets

%files
%license COPYING
%{_datadir}/locale/*
%{_libdir}/*.so.*
%{_libdir}/girepository-1.0/*.typelib

%files devel
%{_datadir}/gir-1.0/*.gir
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/cogl
%{_datadir}/installed-tests/cogl/*.test
%{_libexecdir}/installed-tests/cogl

%files help
%doc NEWS README
%{_datadir}/gtk-doc/html/*/
%exclude %{_datadir}/cogl/examples-data/crate.jpg

%changelog
* Tue Sep 3 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.22.4-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:upgrade to 1.22.4

* Fri Aug 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.22.2-12
- Package Init
