Accepting request 72629 from GNOME:Factory

Only provide the typelib() symbol... do not yet require any

OBS-URL: https://build.opensuse.org/request/show/72629
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gobject-introspection?expand=0&rev=23
This commit is contained in:
Sascha Peilicke 2011-06-06 13:58:27 +00:00 committed by Git OBS Bridge
commit b70ecc09ab
5 changed files with 75 additions and 8 deletions

View File

@ -8,10 +8,13 @@
function split_name_version {
base=$1
symbol=${base%-*}
tsymbol=${base%-*}
# Sometimes we get a Requires on Gdk.Settings.foo, bebause you can directly use imports.gi.Gdk.Settings.Foo in Javascript.
# We know that the symbol in this case is call Gdk, so we cut everything after the . away.
symbol=$(echo $tsymbol | awk -F. '{print $1}')
version=${base#*-}
# In case there is no '-' in the filename, then the split above 'fails' and version == symbol (thus: no version specified)
if [ "$symbol" = "$version" ]; then
if [ "$tsymbol" = "$version" ]; then
unset version
fi
}
@ -28,7 +31,7 @@ fi
function find_provides {
while read file; do
case $file in
/usr/lib[^/]*/girepository-1.0/*.typelib)
*.typelib)
split_name_version $(basename $file | sed 's,.typelib$,,')
print_req_prov
;;
@ -56,13 +59,13 @@ function find_requires {
while read file; do
case $file in
*.js)
for module in $(grep -h -P -o "imports.gi.([^\s;]+)" $file | grep -v "imports.gi.version" | sed 's,imports.gi.,,'); do
for module in $(grep -h -P -o "imports.gi.([^\s'\";]+)" $file | grep -v "imports.gi.version" | sed 's,imports.gi.,,'); do
split_name_version $module
print_req_prov
done
;;
*.py)
for module in $(grep -h -P "from gi.repository import (\w+)" $file | sed -e 's,from gi.repository import,,' -r -e 's:\s+as\s+\w+::g' -e 's:,::g'); do
for module in $(grep -h -P "from gi.repository import (\w+)" $file | sed 's:#.*::' | sed -e 's,from gi.repository import,,' -r -e 's:\s+as\s+\w+::g' -e 's:,::g'); do
split_name_version $module
print_req_prov
done

View File

@ -0,0 +1,16 @@
typelib(DBus) = 1.0
typelib(DBusGLib) = 1.0
typelib(GIRepository) = 2.0
typelib(GL) = 1.0
typelib(GLib) = 2.0
typelib(GModule) = 2.0
typelib(GObject) = 2.0
typelib(Gio) = 2.0
typelib(cairo) = 1.0
typelib(fontconfig) = 2.0
typelib(freetype2) = 2.0
typelib(libxml2) = 2.0
typelib(xfixes) = 4.0
typelib(xft) = 2.0
typelib(xlib) = 2.0
typelib(xrandr) = 1.3

View File

@ -1,3 +1,39 @@
-------------------------------------------------------------------
Fri Jun 3 13:02:55 UTC 2011 - dimstar@opensuse.org
- Currently only add typelib() Provides symbol to make sure we do
not break entire Factory.
-------------------------------------------------------------------
Sat May 28 15:41:02 UTC 2011 - dimstar@opensuse.org
- Minor fixes on gi-find-deps.sh:
+ Quotes are not allowed symbols in an import name. Fixes for
example gnome-shell Requiring typelib(').
+ The typelib symbol is not supposed to contain a dot [.]. Should
we find a Requires / Provides that does, then we know we were
caught in some code using it direcly as an object. The typelib
symbol in this case is the first token before the first dot.
+ Ignore anything after # in python parsing (it's a comment).
- Provide the template-based typelib() versioned.
-------------------------------------------------------------------
Fri May 27 10:07:14 UTC 2011 - dimstar@opensuse.org
- Manually provide the typelib() symbols for libgirepository-1_0-1.
The rpm magic is not yet in place and can thus not automatically
detect the symbols.
-------------------------------------------------------------------
Tue May 17 09:06:56 UTC 2011 - dimstar@opensuse.org
- Add gobjectintrospection.attr: install rpm reqprov plugin
handler, benefitting from the new rpm 4.9 infrastructure.
- Move the rpm helpers to the main package: this is really what is
used to build with gobject-introspection, while the devel
subpackage is mostly needed if building against
libgirepository-1.0.
-------------------------------------------------------------------
Wed Apr 27 09:16:02 UTC 2011 - dimstar@opensuse.org

View File

@ -28,6 +28,8 @@ Group: Development/Libraries/GNOME
Source0: %{name}-%{version}.tar.bz2
# gi-find-deps.sh is a rpm helper for Provides and Requires. Script creates typelib()-style Provides/Requires.
Source1: gi-find-deps.sh
Source2: gobjectintrospection.attr
Source3: gobject-introspection-typelib.template
Source99: %{name}-rpmlintrc
BuildRequires: bison
BuildRequires: fdupes
@ -53,6 +55,9 @@ a uniform, machine readable format.
License: LGPLv2.1+
Summary: GObject Introspection Library
Group: Development/Libraries/GNOME
# Provide typelib() symbols based on gobject-introspection-typelib.template
# The template is checked during install if it matches the installed *.typelib files.
%(cat %{S:3} | awk '{ print "Provides: " $0}')
%description -n libgirepository-1_0-1
The goal of the project is to describe the APIs and collect them in
@ -83,12 +88,16 @@ a uniform, machine readable format.
--enable-gtk-doc \
%endif
--disable-static
%__make %{?jobs:-j%jobs} V=1
%__make %{?_smp_mflags} V=1
%install
%makeinstall
find %{buildroot} -type f -name "*.la" -delete -print
install -D %{S:1} %{buildroot}%{_prefix}/lib/rpm/gi-find-deps.sh
install -D %{S:1} %{buildroot}%{_rpmconfigdir}/gi-find-deps.sh
install -D %{S:2} -m 0644 %{buildroot}%{_rpmconfigdir}/fileattrs/gobjectintrospection.attr
# comparing, if we provide all the symbols expected.
ls %{buildroot}%{_libdir}/girepository-1.0/*.typelib | sh %{S:1} -P > gobject-introspection-typelib.installed
diff -s %{S:3} gobject-introspection-typelib.installed
%fdupes %{buildroot}
%clean
@ -121,6 +130,8 @@ rm -rf %{buildroot}
%{_datadir}/gobject-introspection-1.0/Makefile.introspection
%{_datadir}/gobject-introspection-1.0/tests/
%{_datadir}/gobject-introspection-1.0/gdump.c
%{_rpmconfigdir}/gi-find-deps.sh
%{_rpmconfigdir}/fileattrs/gobjectintrospection.attr
%files -n libgirepository-1_0-1
%defattr(-,root,root)
@ -139,6 +150,5 @@ rm -rf %{buildroot}
# FIXME: those two files should be moved to the main package when bgo#629930 gets fixed
%{_libdir}/pkgconfig/gobject-introspection-1.0.pc
%{_libdir}/pkgconfig/gobject-introspection-no-export-1.0.pc
%{_prefix}/lib/rpm/gi-find-deps.sh
%changelog

View File

@ -0,0 +1,2 @@
%__gobjectintrospection_provides %{_rpmconfigdir}/gi-find-deps.sh -P
%__gobjectintrospection_path ^(%{_libdir}/.*\.typelib)|(.*\.py)|(.*\.js)$