[Apt-Rpm] Apt-RPM won't build....

Panu Matilainen pmatilai at laiskiainen.org
Thu Oct 4 01:03:30 PDT 2007


On Fri, 28 Sep 2007, Gary L. Greene Jr. wrote:

> Hi Panu,
>
> I'm upgrading to 0.5.15lorg3.93 and getting a build error with rpmdb.h:
>
>        /bin/sh ../libtool --tag=CXX   --mode=compile
> i586-altimatos-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../include -I../include/apt-pkg  -DLIBDIR=\"/usr/lib\" -DPKGDATADIR=\"/usr/share/apt\" -DLOCALEDIR=\"/usr/share/locale\" -DAPT_DOMAIN=\"apt\" -I../lua/include -I../lua/local -I/usr/include/rpm  -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -march=i586 -mtune=pentiumpro -fasynchronous-unwind-tables -MT
> rpm/rpmhandler.lo -MD -MP -MF $depbase.Tpo -c -o rpm/rpmhandler.lo
> rpm/rpmhandler.cc &&\
>        mv -f $depbase.Tpo $depbase.Plo
>
> i586-altimatos-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../include -I../include/apt-pkg -DLIBDIR=\"/usr/lib\" -DPKGDATADIR=\"/usr/share/apt\" -DLOCALEDIR=\"/usr/share/locale\" -DAPT_DOMAIN=\"apt\" -I../lua/include -I../lua/local -I/usr/include/rpm -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -march=i586 -mtune=pentiumpro -fasynchronous-unwind-tables -MT
> rpm/rpmhandler.lo -MD -MP -MF rpm/.deps/rpmhandler.Tpo -c
> rpm/rpmhandler.cc  -fPIC -DPIC -o rpm/.libs/rpmhandler.o
> /usr/include/rpm/rpmdb.h: In function 'int dbiDel(_dbiIndex*, DBC*, DBT*,
> DBT*, unsigned int)':
> /usr/include/rpm/rpmdb.h:582: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:582: error:   initializing argument 1 of 'int
> rpmswEnter(rpmop_s*, ssize_t)'
> /usr/include/rpm/rpmdb.h:584: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:584: error:   initializing argument 1 of 'rpmtime_t
> rpmswExit(rpmop_s*, ssize_t)'
> /usr/include/rpm/rpmdb.h: In function 'int dbiGet(_dbiIndex*, DBC*, DBT*,
> DBT*, unsigned int)':
> /usr/include/rpm/rpmdb.h:606: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:606: error:   initializing argument 1 of 'int
> rpmswEnter(rpmop_s*, ssize_t)'
> /usr/include/rpm/rpmdb.h:608: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:608: error:   initializing argument 1 of 'rpmtime_t
> rpmswExit(rpmop_s*, ssize_t)'
> /usr/include/rpm/rpmdb.h: In function 'int dbiPget(_dbiIndex*, DBC*, DBT*,
> DBT*, DBT*, unsigned int)':
> /usr/include/rpm/rpmdb.h:631: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:631: error:   initializing argument 1 of 'int
> rpmswEnter(rpmop_s*, ssize_t)'
> /usr/include/rpm/rpmdb.h:633: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:633: error:   initializing argument 1 of 'rpmtime_t
> rpmswExit(rpmop_s*, ssize_t)'
> /usr/include/rpm/rpmdb.h: In function 'int dbiPut(_dbiIndex*, DBC*, DBT*,
> DBT*, unsigned int)':
> /usr/include/rpm/rpmdb.h:655: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:655: error:   initializing argument 1 of 'int
> rpmswEnter(rpmop_s*, ssize_t)'
> /usr/include/rpm/rpmdb.h:657: error: invalid conversion from 'void*'
> to 'rpmop_s*'
> /usr/include/rpm/rpmdb.h:657: error:   initializing argument 1 of 'rpmtime_t
> rpmswExit(rpmop_s*, ssize_t)'
> make[1]: *** [rpm/rpmhandler.lo] Error 1
> make[1]: Leaving directory
> `/srv/foremand/RPM/BUILD/apt-0.5.15lorg3.93/apt-pkg'
> make: *** [all-recursive] Error 1
> error: Bad exit status from /srv/foremand/RPM/tmp/rpm-tmp.47096 (%build)
>
>
> RPM build errors:
>    Bad exit status from /srv/foremand/RPM/tmp/rpm-tmp.47096 (%build)
>
> This is against RPM 4.4.6 and with gcc 4.1.2.

You'll need to patch rpmdb.h to be buildable as C++ (maybe older gcc 
versions accepted it as is, gcc 4.1.x doesn't), this is not something that 
can be fixed/worked around in apt.

The attached patch for rpmdb.h would appear to help...

 	- Panu -
-------------- next part --------------
--- rpmdb.h.orig	2007-10-04 10:43:55.000000000 +0300
+++ rpmdb.h	2007-10-04 10:43:59.000000000 +0300
@@ -508,7 +508,7 @@
  * @param opx		per-rpmdb accumulator index (aka rpmtsOpX)
  * @return		per-rpmdb accumulator pointer
  */
-void * dbiStatsAccumulator(dbiIndex dbi, int opx)
+rpmop_s * dbiStatsAccumulator(dbiIndex dbi, int opx)
         /*@*/;
 
 #if !defined(SWIG)
@@ -576,7 +576,7 @@
 	/*@globals fileSystem, internalState @*/
 	/*@modifies dbi, *dbcursor, fileSystem, internalState @*/
 {
-    void * sw = dbiStatsAccumulator(dbi, 16);	/* RPMTS_OP_DBDEL */
+    rpmop_s * sw = dbiStatsAccumulator(dbi, 16);	/* RPMTS_OP_DBDEL */
     int rc;
     assert(key->data != NULL && key->size > 0);
     (void) rpmswEnter(sw, 0);
@@ -600,7 +600,7 @@
 	/*@globals fileSystem, internalState @*/
 	/*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @*/
 {
-    void * sw = dbiStatsAccumulator(dbi, 14);	/* RPMTS_OP_DBGET */
+    rpmop_s * sw = dbiStatsAccumulator(dbi, 14);	/* RPMTS_OP_DBGET */
     int rc;
     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
     (void) rpmswEnter(sw, 0);
@@ -625,7 +625,7 @@
 	/*@globals fileSystem, internalState @*/
 	/*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internalState @*/
 {
-    void * sw = dbiStatsAccumulator(dbi, 14);	/* RPMTS_OP_DBGET */
+    rpmop_s * sw = dbiStatsAccumulator(dbi, 14);	/* RPMTS_OP_DBGET */
     int rc;
     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
     (void) rpmswEnter(sw, 0);
@@ -649,7 +649,7 @@
 	/*@globals fileSystem, internalState @*/
 	/*@modifies dbi, *dbcursor, *key, fileSystem, internalState @*/
 {
-    void * sw = dbiStatsAccumulator(dbi, 15);	/* RPMTS_OP_DBPUT */
+    rpmop_s* sw = dbiStatsAccumulator(dbi, 15);	/* RPMTS_OP_DBPUT */
     int rc;
     assert(key->data != NULL && key->size > 0 && data->data != NULL && data->size > 0);
     (void) rpmswEnter(sw, 0);


More information about the Apt-Rpm mailing list