[librsvg2] build introspectable bindings

Daniel Drake dsd at fedoraproject.org
Sat Nov 26 15:51:42 UTC 2011


commit 4649e167e3cda4b27585ebd0929a941d65953ec5
Author: Daniel Drake <dsd at laptop.org>
Date:   Fri Nov 25 13:00:20 2011 -0600

    build introspectable bindings

 librsvg2-build-gir.patch |   32 ++++++++++++++++++++++++++++++++
 librsvg2.spec            |   17 +++++++++++++++--
 2 files changed, 47 insertions(+), 2 deletions(-)
---
diff --git a/librsvg2-build-gir.patch b/librsvg2-build-gir.patch
new file mode 100644
index 0000000..7aa4e6a
--- /dev/null
+++ b/librsvg2-build-gir.patch
@@ -0,0 +1,32 @@
+From 154dcd5f4366dc5080a6582b51b0769c51c0b068 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino at gentoo.org>
+Date: Wed, 23 Nov 2011 22:41:12 +0000
+Subject: Use RSVG_API_VERSION in the .gir filename
+
+RSVG_API_VERSION == "2.0"
+RSVG_API_VERSION_U == "2_0"
+
+We want to use 2.0 when referring to the .gir filename, and 2_0 when
+referring to the automake targets derived from the filename. Otherwise,
+parallel make fails.
+
+Thanks to Rafał Mużyło <galtgendo at o2.pl> for pointing this out in
+https://bugs.gentoo.org/show_bug.cgi?id=391215#c10
+
+https://bugzilla.gnome.org/show_bug.cgi?id=664684
+---
+diff --git a/Makefile.am b/Makefile.am
+index 511df68..5a8dda3 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -235,7 +235,7 @@ INTROSPECTION_GIRS = Rsvg- at RSVG_API_VERSION@.gir
+ INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+ INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+ 
+-Rsvg- at RSVG_API_VERSION_U@.gir: librsvg- at RSVG_API_MAJOR_VERSION@.la
++Rsvg- at RSVG_API_VERSION@.gir: librsvg- at RSVG_API_MAJOR_VERSION@.la
+ 
+ Rsvg_ at RSVG_API_VERSION_U@_gir_NAMESPACE = Rsvg
+ Rsvg_ at RSVG_API_VERSION_U@_gir_EXPORT_PACKAGES = librsvg-$(RSVG_API_VERSION)
+--
+cgit v0.9.0.2
diff --git a/librsvg2.spec b/librsvg2.spec
index a1e2399..854b67d 100644
--- a/librsvg2.spec
+++ b/librsvg2.spec
@@ -1,13 +1,14 @@
 Name:           librsvg2
 Summary:        An SVG library based on cairo
 Version:        2.35.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 
 License:        LGPLv2+
 Group:          System Environment/Libraries
 #VCS:           git:git://git.gnome.org/librsvg
 Source:         http://download.gnome.org/sources/librsvg/2.35/librsvg-%{version}.tar.xz
 
+Patch0:         librsvg2-build-gir.patch
 
 
 Requires(post):   gdk-pixbuf2
@@ -20,11 +21,15 @@ BuildRequires:  pango-devel
 BuildRequires:  libxml2-devel
 BuildRequires:  freetype-devel
 BuildRequires:  cairo-devel
+BuildRequires:  cairo-gobject-devel
 BuildRequires:  libgsf-devel
 BuildRequires:  libcroco-devel
 BuildRequires:  libgsf-devel
+BuildRequires:  gobject-introspection-devel
 # grr, librsvg does not install api docs if --disable-gtk-doc
 BuildRequires:  gtk-doc
+BuildRequires:  automake
+BuildRequires:  autoconf
 
 Provides:       librsvg3 = %{name}.%{version}-%{release}
 Obsoletes:      librsvg3 <= 2.26.3-3.fc14
@@ -47,6 +52,8 @@ files to allow you to develop with librsvg.
 
 %prep
 %setup -q -n librsvg-%{version}
+%patch0 -p1
+autoreconf -i -f
 
 %build
 GDK_PIXBUF_QUERYLOADERS=/usr/bin/gdk-pixbuf-query-loaders-%{__isa_bits}
@@ -58,7 +65,8 @@ export enable_pixbuf_loader
         --with-svgz \
         --disable-gtk-doc \
         --disable-gtk-theme \
-        --with-croco
+        --with-croco \
+        --enable-introspection
 make %{?_smp_mflags}
 
 %install
@@ -82,6 +90,7 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
 %doc AUTHORS COPYING COPYING.LIB NEWS README
 %{_libdir}/librsvg-2.so.*
 %{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-svg.so
+%{_libdir}/girepository-1.0/*
 %{_bindir}/rsvg
 %{_bindir}/rsvg-view
 %{_bindir}/rsvg-convert
@@ -91,10 +100,14 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
 %{_libdir}/librsvg-2.so
 %{_includedir}/librsvg-2.0
 %{_libdir}/pkgconfig/librsvg-2.0.pc
+%{_datadir}/gir-1.0/*
 %doc %{_datadir}/gtk-doc/html/rsvg-2.0
 
 
 %changelog
+* Fri Nov 25 2011 Daniel Drake <dsd at laptop.org> - 2.35.0-2
+- Build gobject-introspection bindings
+
 * Tue Nov 22 2011 Matthias Clasen <mclasen at redhat.com> - 2.35.0-1
 - Update to 2.35.0
 


More information about the scm-commits mailing list