Bug 182395 - can't compile kamera with libgphoto-svn
Summary: can't compile kamera with libgphoto-svn
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: kamera (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Marcus Meissner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-30 10:51 UTC by uStick
Modified: 2018-08-05 22:37 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uStick 2009-01-30 10:51:38 UTC
Version:            (using Devel)
Compiler:          gcc-4.3.2 
OS:                Linux
Installed from:    Compiled sources

kamera svn rev 918558 fails to build with libgphoto rev 11786:

[ 80%] Building CXX object kamera/kcontrol/CMakeFiles/kcm_kamera.dir/kameradevice.o
/archive2/kde/KDE/kdegraphics/kamera/kcontrol/kameradevice.cpp: In constructor 'KameraDeviceSelectDialog::KameraDeviceSelectDialog(QWidget*, KCamera*)':
/archive2/kde/KDE/kdegraphics/kamera/kcontrol/kameradevice.cpp:362: error: request for member 'path' in 'info', which is of non-class type '_GPPortInfo*'
/archive2/kde/KDE/kdegraphics/kamera/kcontrol/kameradevice.cpp:363: error: request for member 'path' in 'info', which is of non-class type '_GPPortInfo*'
make[2]: *** [kamera/kcontrol/CMakeFiles/kcm_kamera.dir/kameradevice.o] Error 1

a small patch fixes this error:
--- ../KDE/kdegraphics/kamera/kcontrol/kameradevice.cpp~        2009-01-30 12:05:07.000000000 +0300
+++ ../KDE/kdegraphics/kamera/kcontrol/kameradevice.cpp 2009-01-30 12:05:07.000000000 +0300       
@@ -359,8 +359,10 @@
        }
        for (int i = 0; i < gphoto_ports; i++) {
                if (gp_port_info_list_get_info(list, i, &info) >= 0) {
-                       if (strncmp(info.path, "serial:", 7) == 0)
-                               m_serialPortCombo->addItem(QString::fromLatin1(info.path).mid(7));
+                       char *path;
+                       gp_port_info_get_path(info, &path);
+                       if (strncmp(path, "serial:", 7) == 0)
+                               m_serialPortCombo->addItem(QString::fromLatin1(path).mid(7));
                }
        }
        gp_port_info_list_free(list);


but there is another one...

[ 81%] Building CXX object kamera/kioslave/CMakeFiles/kio_kamera.dir/kamera.o
/archive2/kde/KDE/kdegraphics/kamera/kioslave/kamera.cpp: In member function 'void KameraProtocol::translateFileToUDS(KIO::UDSEntry&, const CameraFileInfo&, QString)':
/archive2/kde/KDE/kdegraphics/kamera/kioslave/kamera.cpp:885: error: 'GP_FILE_INFO_NAME' was not declared in this scope
/archive2/kde/KDE/kdegraphics/kamera/kioslave/kamera.cpp:886: error: 'const struct CameraFileInfoFile' has no member named 'name'
make[2]: *** [kamera/kioslave/CMakeFiles/kio_kamera.dir/kamera.o] Error 1

if you look into libgphoto2/NEWS you can find:
grep -A2 GP_FILE_INFO_NAME NEWS
   * CameraFileInfoFile: removed "name" structmember and GP_FILE_INFO_NAME
     flags.
     Use direct passing in of the filename to the API functions.

i'm using this quick fix just to be able to compile (but i can't see any photos on canon eos 450d):
--- ../KDE/kdegraphics/kamera/kioslave/kamera.cpp~      2009-01-30 12:14:35.000000000 +0300 
+++ ../KDE/kdegraphics/kamera/kioslave/kamera.cpp       2009-01-30 12:14:35.000000000 +0300 
@@ -882,10 +882,10 @@                                                                       
                                                                                            
        udsEntry.insert(KIO::UDSEntry::UDS_FILE_TYPE,S_IFREG);

-       if (info.file.fields & GP_FILE_INFO_NAME)
-               udsEntry.insert(KIO::UDSEntry::UDS_NAME,QString::fromLocal8Bit(info.file.name));
-       else
-               udsEntry.insert(KIO::UDSEntry::UDS_NAME,name);
+//      if (info.file.fields & GP_FILE_INFO_NAME)
+//              udsEntry.insert(KIO::UDSEntry::UDS_NAME,QString::fromLocal8Bit(info.file.name));
+//      else
+//              udsEntry.insert(KIO::UDSEntry::UDS_NAME,name);

        if (info.file.fields & GP_FILE_INFO_SIZE) {
                udsEntry.insert(KIO::UDSEntry::UDS_SIZE,info.file.size);
Comment 1 Marcus Meissner 2009-01-30 15:30:26 UTC
do not build against external packages against libgphoto2 svn, use libgphoto 2.4.4 release. The API changes in libgphoto2 SVN are not stable yet.

(Why do you need SVN, 2.4.4 has all interesting changes?)
Comment 2 null 2018-08-05 22:37:45 UTC
Since this is about a 9 year old compilation failure involving two unreleased versions, and current distros are shipping recent versions of kamera and libgphoto just fine, I'm going to assume that this has been solved in the meantime.

Feel free to open a new bug against Frameworks if this is still an issue.