File mingw64-librsvg.spec of Package mingw64-librsvg

#
# spec file for package mingw64-librsvg
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%define build_gtk3 0
Name:           mingw64-librsvg
Version:        2.36.3
Release:        0
Summary:        Library for Rendering SVG Data
License:        LGPL-2.1-or-later
Group:          Development/Libraries/C and C++
Url:            ftp://ftp.gnome.org/pub/gnome/sources/librsvg
Source:         ftp://ftp.gnome.org/pub/gnome/sources/librsvg/2.36/librsvg-%{version}.tar.xz
Patch2:         librsvg-2.32.0-gtk3.patch
BuildRequires:  glib2-devel
BuildRequires:  gtk-doc
BuildRequires:  mingw64-cairo-devel
#!BuildIgnore: post-build-checks
BuildRequires:  mingw64-cross-binutils
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-cross-pkg-config
BuildRequires:  mingw64-filesystem
BuildRequires:  mingw64-gdk-pixbuf-devel
BuildRequires:  mingw64-glib2-devel
BuildRequires:  mingw64-gtk2-devel
BuildRequires:  mingw64-libcroco-devel
BuildRequires:  mingw64-libxml2-devel
BuildRequires:  mingw64-pango-devel
BuildRequires:  python
BuildRequires:  xz
%_mingw64_package_header_debug
BuildArch:      noarch
%if %{build_gtk3}
BuildRequires:  mingw64-gtk3-devel
%endif
%if %{?suse_version} > 1200
BuildRequires:  gdk-pixbuf-query-loaders
%else
BuildRequires:  gtk2
%endif

%description
MinGW Windows port of a Library for Rendering SVG Data.
This package contains a library to render SVG (scalable vector
graphics) data. This format has been specified by the W3C (see
http://www.w3c.org).

%package -n mingw64-librsvg-2-2
Summary:        Library for Rendering SVG Data
Group:          System/Libraries
Obsoletes:      %{name}
Provides:       %{name}

%description -n mingw64-librsvg-2-2
MinGW Windows port of a Library for Rendering SVG Data.
This package contains a library to render SVG (scalable vector
graphics) data. This format has been specified by the W3C (see
http://www.w3c.org).

%package devel
Summary:        Library for Rendering SVG Data (development files)
Group:          Development/Libraries/C and C++

%description devel
MinGW Windows port of a Library for Rendering SVG Data (development files).
This package contains a library to render SVG (scalable vector
graphics) data. This format has been specified by the W3C (see
http://www.w3c.org).

%package -n mingw64-gdk-pixbuf-loader-rsvg
Summary:        Library for Rendering SVG Data -- gdk-pixbuf loader
Group:          System/Libraries

%description -n mingw64-gdk-pixbuf-loader-rsvg
This package provides a librsvg-based gdk-pixbuf loader.

%package -n mingw64-gtk2-engine-svg
Summary:        SVG-based GTK+ 2 Theme Engine
Group:          System/Libraries

%description -n mingw64-gtk2-engine-svg
This package provides a librsvg-based GTK+ 2 theme engine.

%if %{build_gtk3}
%package -n mingw64-gtk3-engine-svg
Summary:        SVG-based GTK+ 3 Theme Engine
Group:          System/Libraries

%description -n mingw64-gtk3-engine-svg
This package provides a librsvg-based GTK+ 3 theme engine.

%endif

%package tools
Summary:        SVG tools using the GNOME Render SVG library
Group:          System/Libraries

%description tools
SVG tools using the GNOME Render SVG library.
This package contains a librsvg based SVG viewer and a converter tool.

%_mingw64_debug_package

%prep
%setup -q -n librsvg-%{version}
%patch -P 2 -p1 -b .gtk3

%build
export PATH="%{_mingw64_bindir}:$PATH"
echo "lt_cv_deplibs_check_method='pass_all'" >>%{_mingw64_cache}
%{_mingw64_configure} \
	--disable-mozilla-plugin \
	--disable-introspection \
	--enable-gtk-theme --enable-pixbuf-loader \
	--with-croco --with-svgz --without-x \
	--enable-shared --disable-static
make %{?_smp_mflags} || make

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}

rm -rf %{buildroot}%{_mingw64_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-svg.dll.a
rm -rf %{buildroot}%{_mingw64_libdir}/gtk-2.0/*/engines/libsvg.dll.a
%if %{build_gtk3}
rm -rf %{buildroot}%{_mingw64_libdir}/gtk-3.0/*/engines/libsvg-3.dll.a
%endif
rm -rf %{buildroot}%{_mingw64_sysconfdir}/gtk-2.0/gdk-pixbuf.loaders

%files -n mingw64-librsvg-2-2
%defattr(-,root,root)
%{_mingw64_bindir}/librsvg-2-2.dll

%files devel
%defattr(-,root,root)
%{_mingw64_includedir}/librsvg-2.0/librsvg
%{_mingw64_libdir}/librsvg-2.dll.a
%{_mingw64_libdir}/pkgconfig/librsvg-2.0.pc
%{_mingw64_datadir}/gtk-doc/html/rsvg-2.0

%files -n mingw64-gdk-pixbuf-loader-rsvg
%defattr(-,root,root)
%{_mingw64_libdir}/gdk-pixbuf-2.0/2.*/loaders/libpixbufloader-svg.dll

%files -n mingw64-gtk2-engine-svg
%defattr(-,root,root)
%{_mingw64_libdir}/gtk-2.0/*/engines/libsvg.dll
%{_mingw64_datadir}/themes/bubble/gtk-2.0/

%if %{build_gtk3}
%files -n mingw64-gtk3-engine-svg
%defattr(-,root,root)
%{_mingw64_libdir}/gtk-3.0/*/engines/libsvg-3.dll
%dir %{_mingw64_datadir}/themes/bubble
%{_mingw64_datadir}/themes/bubble/gtk-3.0/

%endif

%files tools
%defattr(-,root,root)
%{_mingw64_bindir}/rsvg-convert.exe
%if %{build_gtk3}
%{_mingw64_bindir}/rsvg-view-3.exe
%endif
%{_mingw64_mandir}/man1/rsvg*

%changelog
openSUSE Build Service is sponsored by