Bug 118611 - superkaramba does not use the result for its test for KNewStuff
Summary: superkaramba does not use the result for its test for KNewStuff
Status: RESOLVED FIXED
Alias: None
Product: superkaramba
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Ryan Nickell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-19 01:44 UTC by Mirage
Modified: 2005-12-21 21:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
here is my config.log (146.35 KB, text/plain)
2005-12-19 12:50 UTC, Mirage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mirage 2005-12-19 01:44:55 UTC
Version:           SVN (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc/3.4.4 x86_64-pc-linux-gnu
OS:                Linux

./superkaramba/src/karambainterface.o ../superkaramba/src/karambaapp.o ../superkaramba/src/karamba_python.o ../superkaramba/src/lineparser.o ../superkaramba/src/themefile.o ../superkaramba/src/themesdlg.o ../superkaramba/src/themes_layout.o ../superkaramba/src/themewidget_layout.o ../superkaramba/src/themewidget.o ../superkaramba/src/kwidgetlistbox.o ../superkaramba/src/sknewstuff.o ../superkaramba/src/superkarambasettings.o ../superkaramba/src/themelocale.o ../superkaramba/src/input.o ../superkaramba/src/sklineedit.o ../superkaramba/src/input_python.o
../superkaramba/src/themesdlg.o: In function `ThemesDlg::getNewStuff()':
themesdlg.cpp:(.text+0x27b9): undefined reference to `KNewStuff::download()'
themesdlg.cpp:(.text+0x283b): undefined reference to `KNewStuff::download()'
../superkaramba/src/sknewstuff.o: In function `SKNewStuff::SKNewStuff(ThemesDlg*)':
sknewstuff.cpp:(.text+0x30): undefined reference to `KNewStuff::KNewStuff(QString const&, QWidget*)'
../superkaramba/src/sknewstuff.o: In function `SKNewStuff::SKNewStuff(ThemesDlg*)':
sknewstuff.cpp:(.text+0xb0): undefined reference to `KNewStuff::KNewStuff(QString const&, QWidget*)'
../superkaramba/src/sknewstuff.o: In function `SKNewStuff::downloadDestination(KNS::Entry*)':
sknewstuff.cpp:(.text+0x139): undefined reference to `KNS::Entry::payload(QString const&) const'
../superkaramba/src/sknewstuff.o:(.gnu.linkonce.r._ZTI10SKNewStuff+0x10): undefined reference to `typeinfo for KNewStuff'
../superkaramba/src/sknewstuff.o: In function `SKNewStuff::~SKNewStuff()':
sknewstuff.cpp:(.gnu.linkonce.t._ZN10SKNewStuffD1Ev+0x18): undefined reference to `KNewStuff::~KNewStuff()'
../superkaramba/src/sknewstuff.o: In function `SKNewStuff::~SKNewStuff()':
sknewstuff.cpp:(.gnu.linkonce.t._ZN10SKNewStuffD0Ev+0x18): undefined reference to `KNewStuff::~KNewStuff()'
collect2: ld returned 1 exit status
Error creating ../superkaramba/src/superkaramba. Exit status 1.

!!! ERROR: kde-base/superkaramba-7 failed.
Comment 1 Ryan Nickell 2005-12-19 05:23:22 UTC
Can you attach your config.log output when you configured the kdeutils module?
And which version of kde are you compiling against?  I'm assuming recent svn snapshot of the 3.5 branch?
Comment 2 Mirage 2005-12-19 12:50:57 UTC
Created attachment 13982 [details]
here is my config.log

I am on gentoo, and I use genkdesvn ebuild now
but I had exactly the same problem with the regular version of kde-3.5
Comment 3 Ryan Nickell 2005-12-19 16:53:17 UTC
From what I can see, the problem is in the build process where the configure macros aren't setting things properly.  The configure.in.in has a macro to check for the knewstuff libraries, and set a variable that is used when compiling.  In your case it finds the libraries, but the macro isn't setting the variable.  I'll look further into this later tonight.

Here's the problem showing up in your config.log:

LIB_KNEWSTUFF='-lknewstuff'
MY_LIBKNEWSTUFF=''

And here's the build macro we use to set it:

KDE_CHECK_LIB(knewstuff, main, [MY_LIBKNEWSTUFF="-lknewstuff"])
AC_SUBST(MY_LIBKNEWSTUFF)

Comment 4 Thiago Macieira 2005-12-20 01:03:35 UTC
No, libknewstuff wasn't found:

configure:42935: checking for main in -lknewstuff
configure:42959: x86_64-pc-linux-gnu-gcc -o conftest -std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DNDEBUG -O2  -march=athlon64 -O2 -pipe -Wformat-security -Wmissing-format-attribute  -DQT_THREAD_SUPPORT  -D_REENTRANT -Wl,-z,now -L/usr/kde/devel/lib64 -L/usr/qt/devel/lib64 -L/usr/lib64    conftest.c -lknewstuff   >&5
/usr/lib64/libpthread.so.0: undefined reference to `errno@GLIBC_PRIVATE'
/usr/lib64/libpthread.so.0: undefined reference to `__libc_dl_error_tsd@GLIBC_PRIVATE'
/usr/lib64/libpthread.so.0: undefined reference to `__resp@GLIBC_PRIVATE'
/usr/lib64/libpthread.so.0: undefined reference to `h_errno@GLIBC_PRIVATE'

Your system is hosed.

However, this doesn't mean the bug is invalid. The code in superkaramba is not making the proper tests. Instead of verifying if knewstuff was found, it assumes it was and tests for KDE 3.3. Proposed solutions:

1) remove the test for libknewstuff and keep on testing for KDE 3.3
2) use the results of the test for libknewstuff

Option #2 would "fix" this bug report.
Comment 5 Ryan Nickell 2005-12-21 21:53:20 UTC
SVN commit 490432 by nickell:

BUG:118611  Defining a variable in config.h is better than checking for
KDE_3_3.  Now if you don't have that library, the functionality won't be
enabled for New Stuff. Whereas before if you had kde >= 3.3, it was
still enabled b/c of wrong assumptions.


 M  +6 -2      configure.in.in  
 M  +6 -2      src/sknewstuff.cpp  
 M  +7 -2      src/sknewstuff.h  
 M  +11 -7     src/themesdlg.cpp  
 M  +6 -2      src/themesdlg.h  


--- branches/KDE/3.5/kdeutils/superkaramba/configure.in.in #490431:490432
@@ -63,8 +63,12 @@
 AC_SUBST(XMMS_LDFLAGS)
 AC_SUBST(XMMS_INCLUDES)
 
-KDE_CHECK_LIB(knewstuff, main, [MY_LIBKNEWSTUFF="-lknewstuff"])
-AC_SUBST(MY_LIBKNEWSTUFF)
+kde_have_knewstuff=yes
+KDE_CHECK_LIB(knewstuff, main, [MY_LIBKNEWSTUFF="-lknewstuff"], kde_have_knewstuff=no)
+if test "$kde_have_knewstuff" = "yes"; then
+  AC_DEFINE(HAVE_KNEWSTUFF, 1, [Define if you have knewstuff])
+  AC_SUBST(MY_LIBKNEWSTUFF)
+fi
 
 AC_CHECK_LIB(kvm, main, [LIBKVM="-lkvm"])
 AC_SUBST(LIBKVM)
--- branches/KDE/3.5/kdeutils/superkaramba/src/sknewstuff.cpp #490431:490432
@@ -30,9 +30,13 @@
 #include <qdir.h>
 #include <qfileinfo.h>
 
+#ifdef HAVE_CONFIG_H
+  #include <config.h>
+#endif
+
 #include "karambaapp.h"
 #include "themesdlg.h"
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
 #include "sknewstuff.h"
 
 SKNewStuff::SKNewStuff( ThemesDlg *dlg ) :
@@ -152,4 +156,4 @@
   }
   return KGlobal::dirs()->saveLocation( "tmp" ) + source.fileName();
 }
-#endif //KDE_3_3
+#endif //HAVE_KNEWSTUFF
--- branches/KDE/3.5/kdeutils/superkaramba/src/sknewstuff.h #490431:490432
@@ -23,7 +23,12 @@
 
 #include <kurl.h>
 #include "karambaapp.h"
-#ifdef KDE_3_3
+
+#ifdef HAVE_CONFIG_H
+  #include <config.h>
+#endif
+
+#ifdef HAVE_KNEWSTUFF
 #include "knewstuff/knewstuff.h"
 #include "knewstuff/entry.h"
 
@@ -49,4 +54,4 @@
 };
 
 #endif //SKNEWSTUFF_H
-#endif //KDE_3_3
+#endif //HAVE_KNEWSTUFF
--- branches/KDE/3.5/kdeutils/superkaramba/src/themesdlg.cpp #490431:490432
@@ -25,7 +25,11 @@
 #include "kwidgetlistbox.h"
 #include "karamba.h"
 
-#ifdef KDE_3_3
+#ifdef HAVE_CONFIG_H
+  #include <config.h>
+#endif
+
+#ifdef HAVE_KNEWSTUFF
   #include "sknewstuff.h"
 #endif
 
@@ -49,7 +53,7 @@
  : ThemesLayout(parent, name)
 {
   populateListbox();
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
   mNewStuff = 0;
 #endif
 }
@@ -58,7 +62,7 @@
 {
   //kdDebug() << k_funcinfo << endl;
   saveUserAddedThemes();
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
   if(mNewStuff)
   {
     delete mNewStuff;
@@ -126,7 +130,7 @@
   item->setDescriptionText(i18n("Download new themes."));
 
   item->buttonGo->setText(i18n("New Stuff..."));
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
   item->buttonGo->setEnabled(true);
   connect(item->buttonGo, SIGNAL(clicked()),
           this, SLOT(getNewStuff()));
@@ -210,7 +214,7 @@
 
 void ThemesDlg::getNewStuff()
 {
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
   KConfig* config = KGlobal::config();
   config->setGroup("KNewStuff");
   config->writeEntry("ProvidersUrl",
@@ -260,7 +264,7 @@
 {
   addThemeToList(file);
 
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
   KConfig* config = KGlobal::config();
   QStringList keys = config->entryMap("KNewStuffStatus").keys();
 
@@ -359,7 +363,7 @@
     trash = KGlobalSettings::trashPath();
   KIO::move(theme, trash);
   tableThemes->removeItem(w);
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
   // Remove theme from KNewStuffStatus
   KConfig* config = KGlobal::config();
 
--- branches/KDE/3.5/kdeutils/superkaramba/src/themesdlg.h #490431:490432
@@ -24,10 +24,14 @@
 #include <themes_layout.h>
 #include "karambaapp.h"
 
+#ifdef HAVE_CONFIG_H
+  #include <config.h>
+#endif
+
 /**
 @author See README for the list of authors
 */
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
 class SKNewStuff;
 #endif
 
@@ -60,7 +64,7 @@
     int themeIndex(QString file);
     QStringList themes();
 
-#ifdef KDE_3_3
+#ifdef HAVE_KNEWSTUFF
   private:
     SKNewStuff *mNewStuff;
     QStringList m_newStuffStatus;