[packagekit] Compilation error

Matej Cepl mcepl at redhat.com
Wed Oct 10 15:22:21 PDT 2007


On 2007-10-10, 16:17 GMT, Richard Hughes wrote:
> On Wed, 2007-10-10 at 15:42 +0200, Adrien BUSTANY wrote:
>> Reading the code I don't even understand how this code could work...
>> Casting a boolean to a GMainLoop is black voodoo to me. Maybe you should
>> replace the gboolean by gpointers in the function's prototype, but I'm
>> not sure.
>
> Correct, I've just committed that fix - sorry about that. I must have
> coded that when I was half-asleep! Can you try rebuilding now please.
> Thanks.

With couple more of these I was able to build the package on 
x86_64 (not real testing though, I am connected to the box via 
ssh; it is also on 
http://www.ceplovi.cz/matej/progs/rpms/gnome-packagekit-MCfix.patch 
in case slrn screws up the inline patch):

diff -up gnome-packagekit/src/pk-install-package.c.MC-build gnome-packagekit/src/pk-install-package.c
--- gnome-packagekit/src/pk-install-package.c.MC-build	2007-10-10 13:59:41.000000000 +0200
+++ gnome-packagekit/src/pk-install-package.c	2007-10-10 23:19:10.000000000 +0200
@@ -43,7 +43,7 @@ static GMainLoop *loop = NULL;
  * pk_monitor_action_unref_cb:
  **/
 static void
-pk_monitor_action_unref_cb (PkProgress *progress, gboolean data)
+pk_monitor_action_unref_cb (PkProgress *progress, gpointer data)
 {
 	GMainLoop *loop = (GMainLoop *) data;
 	g_object_unref (progress);
diff -up gnome-packagekit/src/pk-update-viewer.c.MC-build gnome-packagekit/src/pk-update-viewer.c
--- gnome-packagekit/src/pk-update-viewer.c.MC-build	2007-10-10 13:59:41.000000000 +0200
+++ gnome-packagekit/src/pk-update-viewer.c	2007-10-10 23:19:10.000000000 +0200
@@ -66,7 +66,7 @@ pk_button_help_cb (GtkWidget *widget,
  **/
 static void
 pk_updates_apply_cb (GtkWidget *widget,
-		     gboolean data)
+		     gpointer data)
 {
 	GMainLoop *loop = (GMainLoop *) data;
 	pk_debug ("Doing the system update");
@@ -80,7 +80,7 @@ pk_updates_apply_cb (GtkWidget *widget,
  **/
 static void
 pk_button_close_cb (GtkWidget	*widget,
-		     gboolean	data)
+		     gpointer data)
 {
 	GMainLoop *loop = (GMainLoop *) data;
 
@@ -133,7 +133,7 @@ pk_updates_package_cb (PkClient *client,
 static gboolean
 pk_window_delete_event_cb (GtkWidget	*widget,
 			    GdkEvent	*event,
-			    gboolean	 data)
+			    gpointer    data)
 {
 	GMainLoop *loop = (GMainLoop *) data;
 
diff -up gnome-packagekit/src/pk-transaction-viewer.c.MC-build gnome-packagekit/src/pk-transaction-viewer.c
--- gnome-packagekit/src/pk-transaction-viewer.c.MC-build	2007-10-10 23:20:34.000000000 +0200
+++ gnome-packagekit/src/pk-transaction-viewer.c	2007-10-10 23:21:06.000000000 +0200
@@ -84,7 +84,7 @@ pk_button_rollback_cb (GtkWidget *widget
  **/
 static void
 pk_button_close_cb (GtkWidget	*widget,
-		     gboolean	data)
+		     gpointer data)
 {
 	GMainLoop *loop = (GMainLoop *) data;
 	g_main_loop_quit (loop);
@@ -167,7 +167,7 @@ pk_transaction_cb (PkClient *client, con
 static gboolean
 pk_window_delete_event_cb (GtkWidget	*widget,
 			    GdkEvent	*event,
-			    gboolean	 data)
+			    gpointer data)
 {
 	GMainLoop *loop = (GMainLoop *) data;
    g_main_loop_quit (loop);

----------------------------------------

However, now the same package 
(http://www.ceplovi.cz/matej/progs/rpms\
/gnome-packagekit-0.0.1-0.128.20071010git.fc8.src.rpm) doesn't 
build on i386 with these errors:

gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -pthread -I/usr/include/dbus-1.0 
-I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -DORBIT2=1 -pthread 
-I/usr/include/gconf/2 -I/usr/include/orbit-2.0 
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   
-I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 
-I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include 
-I/usr/include/atk-1.0 -I/usr/include/cairo 
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -I/usr/include/gtk-2.0 
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include 
-I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0   
-I/usr/include/packagekit -I/usr/include/dbus-1.0 
-I/usr/lib/dbus-1.0/include   -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   
-DBINDIR=\/usr/bin\„ -DDATADIR=\„/usr/share\„ -DPREFIX=\„„/usr„\„ 
-DSYSCONFDIR=\„„/etc„\„ -DLIBDIR=\„„/usr/lib„\„ 
-DVERSION=„\„0.0.1\„„ -DPK_DATA=\„/usr/share/gnome-packagekit\„ 
-I../libpackagekit   -Werror -Wcast-align -Wno-uninitialized 
-Wall -g -fexceptions  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 
-march=i386 -mtune=generic -fasynchronous-unwind-tables -MT 
pk-application.o -MD -MP -MF .deps/pk-application.Tpo -c -o 
pk-application.o pk-application.c
cc1: warnings being treated as errors
pk-application.c: In function 
'pk_application_init':
pk-application.c:1097: warning: implicit declaration of function 
'pk_enum_list_size'
pk-application.c:1099: warning: implicit declaration of function 
'pk_enum_list_get_item'
make[2]: *** [pk-application.o] Error 1
make[2]: Leaving directory 
`/home/matej/redhat/BUILD/gnome-packagekit/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 
`/home/matej/redhat/BUILD/gnome-packagekit'
make: *** [all] Error 2
error: Špatný návratový kód z /var/tmp/rpm-tmp.74444 
(%build)

Will try to fix these as well.

When doing package for Fedora I have run it through rpmlint as 
well and fixed all outstanding problems so that both src.rpm and 
x86_64.rpm are rpmlint-silent. Here is the patch of SPEC file 
(again, also on http://www.ceplovi.cz/matej/progs/rpms\
/gnome-packagekit-spec.diff):

--- /home/matej/rpm/SPECS/gnome-packagekit.spec.orig	2007-10-10 23:24:03.000000000 +0200
+++ /home/matej/rpm/SPECS/gnome-packagekit.spec	2007-10-10 23:42:39.000000000 +0200
@@ -5,18 +5,18 @@
 Name: gnome-packagekit
 Version: 0.0.1
 Release: 0.128%{?alphatag}%{?dist}
-License: GPL
+License: GPLv2+
 Group: Applications/System
 Source: gnome-packagekit-%{version}.tar.gz
 Patch0: gnome-packagekit-MCfix.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 URL: http://www.packagekit.org
-BuildPrereq: libgnomeui-devel
-BuildPrereq: libglade2-devel
-BuildPrereq: libwnck-devel
-BuildPrereq: dbus-devel >= %{dbus_version}
-BuildPrereq: libnotify-devel
-BuildPrereq: gnome-panel-devel
+BuildRequires: libgnomeui-devel
+BuildRequires: libglade2-devel
+BuildRequires: libwnck-devel
+BuildRequires: dbus-devel >= %{dbus_version}
+BuildRequires: libnotify-devel
+BuildRequires: gnome-panel-devel
 BuildRequires: scrollkeeper
 BuildRequires: gnome-doc-utils >= 0.3.2
 BuildRequires: desktop-file-utils
@@ -42,15 +42,13 @@
 removing packages on your system.
 
 %prep
-rm -rf $RPM_BUILD_ROOT
-
 %setup -q -n %{name}
 %patch0 -p1 -b .MC-build
 ./autogen.sh
 
 %build
 %configure \
-	--disable-scrollkeeper
+  --disable-scrollkeeper --disable-schemas-install
 make
 
 %install
@@ -59,8 +57,8 @@
 make install DESTDIR=$RPM_BUILD_ROOT
 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
 
-desktop-file-install --vendor gnome --delete-original                   \
-  --dir $RPM_BUILD_ROOT%{_datadir}/gnome/autostart         		\
+desktop-file-install --vendor gnome --delete-original \
+  --dir $RPM_BUILD_ROOT%{_datadir}/gnome/autostart \
   $RPM_BUILD_ROOT%{_datadir}/gnome/autostart/pk-update-icon.desktop
 
 %find_lang %name
@@ -71,7 +69,7 @@
 %post
 export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 gconftool-2 --makefile-install-rule \
-	%{_sysconfdir}/gconf/schemas/gnome-packagekit.schemas >/dev/null || :
+   %{_sysconfdir}/gconf/schemas/gnome-packagekit.schemas >/dev/null || :
 scrollkeeper-update -q
 touch --no-create %{_datadir}/icons/hicolor
 if [ -x /usr/bin/gtk-update-icon-cache ]; then
@@ -107,7 +105,7 @@
 %{_bindir}/pk-*
 %{_datadir}/gnome-packagekit/pk-*.glade
 %{_datadir}/gnome-packagekit
-%{_sysconfdir}/gconf/schemas/*.schemas
+%config(noreplace)%{_sysconfdir}/gconf/schemas/*.schemas
 %{_datadir}/gnome/help/gnome-packagekit
 %{_datadir}/omf/gnome-packagekit
 %{_datadir}/gnome/autostart/gnome-pk-update-icon.desktop
@@ -116,6 +114,9 @@
 %changelog
 * Tue Oct 10 2007 Matej Cepl <mcepl at redhat.com> 0.0.1-0.128.20071010git
 - Update from GIT.
+- Wash, rinse, dry, repeat. (Richard's patch needed to be applied
+  to many other places).
+- Make rpmlint happy.
 
 * Tue Oct 09 2007 Richard Hughes <richard at hughsie.com> 0.0.1-0.128.20071009git
 - Update from GIT




More information about the PackageKit mailing list