Bug#48784: compiling gnome-apt with recent potato (patch)
Package: gnome-apt
Version: 0.3.4
Hi Debianers,
There may be a way more recent version of gnome-apt that's not a broken,
uninstallable package whose sources don't compile, but I've gotten tired
of waiting for it :-). I'm not too patient when it comes to looking for
ways of destroying a perfectly working Debian system.
So I'm including the procedure I used to compile gnome-apt on a
(reasonably) up-to-date potato system. It passes the "runs for 30
seconds" test but I can't vouch for anything else.
Please close this bug when gnome-apt is installable again.
Steps:
(0) Install libzvt-dev in addition to a stock Gnome devel environment.
(1) Apply the patch at the end of this mail to the sources to fix 'const'
bugs and a library API version problem. These are not necessarily
correct fixes (in particular, I'm not sure about the GetLock()
change and the GNOMEUIINFO_HELP() change). Someone familiar with
libapt-pkg and Gnome should be able to vet them pretty quickly.
(2) After running 'configure', change these lines in config.h:
#define const
#define inline
to these:
#define const const
#define inline inline
Failing to change the former will yield tons of errors in the
STL include files when you try to compile. Failing to change the
latter will yield tons of multiply defined symbols in the link step.
I didn't look into the reason autoconf is messing these up, I just
did this quick and dirty fix. I'm sure it would be just a minute
for someone who knows autoconf.
thanks,
miket
Here's the patch. I'm not using a text MIME attachment because I'm
worried that the BTS will choke on it.
diff -ur gnome-apt-0.3.4.orig/src/cache.cc gnome-apt-0.3.4/src/cache.cc
--- gnome-apt-0.3.4.orig/src/cache.cc Mon Jun 21 07:46:30 1999
+++ gnome-apt-0.3.4/src/cache.cc Sat Oct 30 19:28:29 1999
@@ -780,7 +780,7 @@
bool retval = cd.run();
// get lock back
- if (Lock.GetLock() == false)
+ if (Lock.GetLock(true) == false)
gnome_apt_fatal_dialog(_("Failed to get the lock back from dpkg"));
diff -ur gnome-apt-0.3.4.orig/src/menus.cc gnome-apt-0.3.4/src/menus.cc
--- gnome-apt-0.3.4.orig/src/menus.cc Sat Feb 20 10:58:55 1999
+++ gnome-apt-0.3.4/src/menus.cc Sat Oct 30 19:40:07 1999
@@ -347,7 +347,7 @@
};
static GnomeUIInfo help_menu[] = {
- GNOMEUIINFO_HELP(APPNAME),
+ GNOMEUIINFO_HELP((void*) APPNAME),
{GNOME_APP_UI_ITEM, N_("_About..."),
N_("Tell about this application"),
about_cb, NULL, NULL,
@@ -1390,7 +1390,7 @@
hbox = gtk_hbox_new(FALSE, GNOME_PAD*12);
- pix = gnome_pixmap_new_from_xpm_d(GAptPkgTree::pixmap_data(p));
+ pix = gnome_pixmap_new_from_xpm_d((char**) GAptPkgTree::pixmap_data(p));
gtk_box_pack_start(GTK_BOX(hbox), pix, TRUE, TRUE, 0);
diff -ur gnome-apt-0.3.4.orig/src/pkgtree.cc gnome-apt-0.3.4/src/pkgtree.cc
--- gnome-apt-0.3.4.orig/src/pkgtree.cc Mon Jun 21 07:46:30 1999
+++ gnome-apt-0.3.4/src/pkgtree.cc Sat Oct 30 19:47:04 1999
@@ -49,7 +49,7 @@
#include "pixmaps/upgrade.xpm"
#include "pixmaps/replaces.xpm"
-const char**
+const char* const*
GAptPkgTree::pixmap_data(PixmapType p)
{
switch (p) {
@@ -1120,7 +1120,7 @@
if (tree_ == 0) return;
if (!GTK_WIDGET_REALIZED(GTK_WIDGET(tree_->widget()))) return;
- char** data = pixmap_data(static_cast<PixmapType>(p));
+ const char* const* data = pixmap_data(static_cast<PixmapType>(p));
if (data) {
GdkPixmap * pix = 0;
@@ -1129,7 +1129,7 @@
GdkImlibImage* im = 0;
static GdkImlibColor shape_color = { 0xff, 0, 0xff, 0 };
- im = gdk_imlib_create_image_from_xpm_data (data);
+ im = gdk_imlib_create_image_from_xpm_data ((gchar**) data);
if (im != 0)
{
@@ -1148,7 +1148,7 @@
pix = gdk_pixmap_create_from_xpm_d(tree_->widget()->window,
&m,
&tree_->widget()->style->bg[GTK_STATE_NORMAL],
- data);
+ (gchar**) data);
#endif
pixmaps_[p] = pix;
diff -ur gnome-apt-0.3.4.orig/src/pkgtree.h gnome-apt-0.3.4/src/pkgtree.h
--- gnome-apt-0.3.4.orig/src/pkgtree.h Sun Jan 31 05:16:07 1999
+++ gnome-apt-0.3.4/src/pkgtree.h Sat Oct 30 19:44:39 1999
@@ -147,7 +147,7 @@
PixmapTypeEnd
} PixmapType;
- static const char** pixmap_data(PixmapType p);
+ static const char* const* pixmap_data(PixmapType p);
void pixmap(PixmapType p, GdkPixmap** pixmap, GdkPixmap ** mask);
Reply to: