Overview

Request 222255 accepted

Some gi-find-deps enhancements, as pointed out by Mageia as new requirement.

Since GNOME 3.11.x, javascript files (for one) can be embedded into binaries.
In order for the typelib() deps to be found, we need to extract the embedded
sources and parse them again for dependencies.

A sample package affected by this would be gnome-shell-3.11.5, which has almost
all typelib()- dependenices lost.

old: GNOME:Next/gobject-introspection
new: home:dimstar:gresource/gobject-introspection rev None
Index: gi-find-deps.sh
===================================================================
--- gi-find-deps.sh (revision 25)
+++ gi-find-deps.sh (revision 7)
@@ -44,6 +44,21 @@
done
}

+function gresources_requires {
+# GNOME is embedding .js files into ELF binaries for faster startup.
+# As a result, we need to extract them and re'run the scanner over the
+# embedded files.
+# We extract all the gresources embedded in ELF binaries and start
+# gi-find-deps.sh recusively over the extracted file list.
+tmpdir=$(mktemp -d)
+for resource in $($gresourcecmd list "$1" 2>/dev/null); do
+ mkdir -p $tmpdir/$(dirname $resource)
+ $gresourcecmd extract "$1" $resource > $tmpdir/$resource
+done
+find $tmpdir -type f | sh $0 -R
+rm -rf "$tmpdir"
+}
+
function python_requires {
for module in $(grep -h -P "from gi\.repository import (\w+)" $1 | sed -e 's:#.*::' -e 's:raise ImportError.*::' -e 's:.*"from gi.repository import .*".*::' | sed -e 's,from gi.repository import,,' -r -e 's:\s+$::g' -e 's:\s+as\s+\w+::g' -e 's:,: :g'); do
split_name_version $module
@@ -173,6 +188,9 @@
Python\ script*)
python_requires "$file"
;;
+ *ELF*)
+ gresources_requires "$file"
+ ;;
esac
;;
esac
@@ -203,6 +221,12 @@
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:$path
done

+if which gresource >/dev/null 2>&1; then
+ gresourcecmd=$(which gresource 2>/dev/null)
+else
+ grsourcecmd="false"
+fi
+
if inList "$x64bitarch" "${HOSTTYPE}"; then
shlib_64="()(64bit)"
fi
Index: gobject-introspection.changes
===================================================================
--- gobject-introspection.changes (revision 25)
+++ gobject-introspection.changes (revision 7)
@@ -1,4 +1,21 @@
-------------------------------------------------------------------
+Thu Feb 13 19:31:34 UTC 2014 - dimstar@opensuse.org
+
+- gi-find-deps.sh: Support gresource scanning:
+ + Add *.so to gobjectintrospection.attr: those files can contain
+ gresources, which in fact could be javascript code, requiring
+ typelibs (seen since gnome-shell 3.11.5 for example).
+ + Introduce gresource_requires function in gi-find-deps.sh, which
+ extracts the javascript gresources from ELF binaries and scans
+ them for typelib dependencies.
+
+-------------------------------------------------------------------
+Thu Feb 13 08:23:27 UTC 2014 - dimstar@opensuse.org
+
+- Pass --enable-doctool to configure: enable g-ir-doctool.
+- Add python-Mako BuildRequires: dependency to build g-ir-doctool.
+
+-------------------------------------------------------------------
Tue Feb 4 18:28:48 UTC 2014 - dimstar@opensuse.org

- gi-find-deps.sh: be more resilient in detecting examples: the
Index: gobject-introspection.spec
===================================================================
--- gobject-introspection.spec (revision 25)
+++ gobject-introspection.spec (revision 7)
@@ -40,6 +40,7 @@
BuildRequires: libffi-devel
# needed for patch0
BuildRequires: libtool
+BuildRequires: python-Mako
BuildRequires: python-devel
BuildRequires: python-xml
BuildRequires: pkgconfig(cairo)
@@ -102,7 +103,8 @@
autoreconf -fi
%configure \
--enable-gtk-doc \
- --disable-static
+ --disable-static \
+ --enable-doctool
%__make %{?_smp_mflags} V=1

%install
@@ -128,6 +130,7 @@
%{_bindir}/g-ir-annotation-tool
%{_bindir}/g-ir-compiler
%{_bindir}/g-ir-dep-tool
+%{_bindir}/g-ir-doc-tool
%{_bindir}/g-ir-generate
%{_bindir}/g-ir-scanner
%doc %{_mandir}/man1/g-ir-compiler.1*
Index: gobjectintrospection.attr
===================================================================
--- gobjectintrospection.attr (revision 25)
+++ gobjectintrospection.attr (revision 7)
@@ -1,4 +1,4 @@
%__gobjectintrospection_provides %{_rpmconfigdir}/gi-find-deps.sh -P
%__gobjectintrospection_requires %{_rpmconfigdir}/gi-find-deps.sh -R
-%__gobjectintrospection_path ^(%{_libdir}/.*\.typelib)|(.*\.py)|(.*\.js)|(%{_bindir}/.*)$
+%__gobjectintrospection_path ^(%{_libdir}/.*\.typelib)|(.*\.py)|(.*\.js)|(.*\.so)|(%{_bindir}/.*)$
%__gobjectintrospection_exclude_path ^/usr/share/doc/packages/

Request History
Dominique Leuenberger's avatar

dimstar created request

Some gi-find-deps enhancements, as pointed out by Mageia as new requirement.

Since GNOME 3.11.x, javascript files (for one) can be embedded into binaries.
In order for the typelib() deps to be found, we need to extract the embedded
sources and parse them again for dependencies.

A sample package affected by this would be gnome-shell-3.11.5, which has almost
all typelib()- dependenices lost.

old: GNOME:Next/gobject-introspection
new: home:dimstar:gresource/gobject-introspection rev None
Index: gi-find-deps.sh
===================================================================
--- gi-find-deps.sh (revision 25)
+++ gi-find-deps.sh (revision 7)
@@ -44,6 +44,21 @@
done
}

+function gresources_requires {
+# GNOME is embedding .js files into ELF binaries for faster startup.
+# As a result, we need to extract them and re'run the scanner over the
+# embedded files.
+# We extract all the gresources embedded in ELF binaries and start
+# gi-find-deps.sh recusively over the extracted file list.
+tmpdir=$(mktemp -d)
+for resource in $($gresourcecmd list "$1" 2>/dev/null); do
+ mkdir -p $tmpdir/$(dirname $resource)
+ $gresourcecmd extract "$1" $resource > $tmpdir/$resource
+done
+find $tmpdir -type f | sh $0 -R
+rm -rf "$tmpdir"
+}
+
function python_requires {
for module in $(grep -h -P "from gi\.repository import (\w+)" $1 | sed -e 's:#.*::' -e 's:raise ImportError.*::' -e 's:.*"from gi.repository import .*".*::' | sed -e 's,from gi.repository import,,' -r -e 's:\s+$::g' -e 's:\s+as\s+\w+::g' -e 's:,: :g'); do
split_name_version $module
@@ -173,6 +188,9 @@
Python\ script*)
python_requires "$file"
;;
+ *ELF*)
+ gresources_requires "$file"
+ ;;
esac
;;
esac
@@ -203,6 +221,12 @@
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:$path
done

+if which gresource >/dev/null 2>&1; then
+ gresourcecmd=$(which gresource 2>/dev/null)
+else
+ grsourcecmd="false"
+fi
+
if inList "$x64bitarch" "${HOSTTYPE}"; then
shlib_64="()(64bit)"
fi
Index: gobject-introspection.changes
===================================================================
--- gobject-introspection.changes (revision 25)
+++ gobject-introspection.changes (revision 7)
@@ -1,4 +1,21 @@
-------------------------------------------------------------------
+Thu Feb 13 19:31:34 UTC 2014 - dimstar@opensuse.org
+
+- gi-find-deps.sh: Support gresource scanning:
+ + Add *.so to gobjectintrospection.attr: those files can contain
+ gresources, which in fact could be javascript code, requiring
+ typelibs (seen since gnome-shell 3.11.5 for example).
+ + Introduce gresource_requires function in gi-find-deps.sh, which
+ extracts the javascript gresources from ELF binaries and scans
+ them for typelib dependencies.
+
+-------------------------------------------------------------------
+Thu Feb 13 08:23:27 UTC 2014 - dimstar@opensuse.org
+
+- Pass --enable-doctool to configure: enable g-ir-doctool.
+- Add python-Mako BuildRequires: dependency to build g-ir-doctool.
+
+-------------------------------------------------------------------
Tue Feb 4 18:28:48 UTC 2014 - dimstar@opensuse.org

- gi-find-deps.sh: be more resilient in detecting examples: the
Index: gobject-introspection.spec
===================================================================
--- gobject-introspection.spec (revision 25)
+++ gobject-introspection.spec (revision 7)
@@ -40,6 +40,7 @@
BuildRequires: libffi-devel
# needed for patch0
BuildRequires: libtool
+BuildRequires: python-Mako
BuildRequires: python-devel
BuildRequires: python-xml
BuildRequires: pkgconfig(cairo)
@@ -102,7 +103,8 @@
autoreconf -fi
%configure \
--enable-gtk-doc \
- --disable-static
+ --disable-static \
+ --enable-doctool
%__make %{?_smp_mflags} V=1

%install
@@ -128,6 +130,7 @@
%{_bindir}/g-ir-annotation-tool
%{_bindir}/g-ir-compiler
%{_bindir}/g-ir-dep-tool
+%{_bindir}/g-ir-doc-tool
%{_bindir}/g-ir-generate
%{_bindir}/g-ir-scanner
%doc %{_mandir}/man1/g-ir-compiler.1*
Index: gobjectintrospection.attr
===================================================================
--- gobjectintrospection.attr (revision 25)
+++ gobjectintrospection.attr (revision 7)
@@ -1,4 +1,4 @@
%__gobjectintrospection_provides %{_rpmconfigdir}/gi-find-deps.sh -P
%__gobjectintrospection_requires %{_rpmconfigdir}/gi-find-deps.sh -R
-%__gobjectintrospection_path ^(%{_libdir}/.*\.typelib)|(.*\.py)|(.*\.js)|(%{_bindir}/.*)$
+%__gobjectintrospection_path ^(%{_libdir}/.*\.typelib)|(.*\.py)|(.*\.js)|(.*\.so)|(%{_bindir}/.*)$
%__gobjectintrospection_exclude_path ^/usr/share/doc/packages/


Dominique Leuenberger's avatar

dimstar accepted request

time to break.. it was too quiet here

openSUSE Build Service is sponsored by