Fix build after recent gphoto2 update.

ok ajacoutot@
This commit is contained in:
zhuk 2013-01-19 11:26:02 +00:00
parent cedceed1de
commit 7ec0e678cb
10 changed files with 281 additions and 9 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.35 2012/12/23 13:25:11 sthen Exp $
# $OpenBSD: Makefile,v 1.36 2013/01/19 11:26:02 zhuk Exp $
COMMENT = digital image kde application
CATEGORIES = graphics x11 x11/kde
V = 0.9.6
DISTNAME = digikam-$V
REVISION = 5
REVISION = 6
SHARED_LIBS += digikam 3.0 # .0.0
HOMEPAGE = http://www.digikam.org/
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=digikam/}
@ -14,7 +14,7 @@ SHARED_ONLY = Yes
RUN_DEPENDS = devel/desktop-file-utils
LIB_DEPENDS += x11/kde/libs3 \
graphics/libgphoto2 \
graphics/libgphoto2>=2.5 \
graphics/libkipi \
graphics/tiff \
graphics/libkexiv2>=0.1.5 \

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-digikam_utilities_cameragui_gpcamera_cpp,v 1.1 2013/01/19 11:26:02 zhuk Exp $
Fix compilation with GPhoto2. Modelled after this patch for later Digikam:
http://bugsfiles.kde.org/attachment.cgi?id=73176
--- digikam/utilities/cameragui/gpcamera.cpp.orig Sat Jan 19 00:26:09 2013
+++ digikam/utilities/cameragui/gpcamera.cpp Sat Jan 19 00:33:14 2013
@@ -847,6 +847,8 @@ bool GPCamera::uploadItem(const QString& folder, const
errorCode = gp_camera_folder_put_file(d->camera,
QFile::encodeName(folder),
+ QFile::encodeName(itemName),
+ GP_FILE_TYPE_NORMAL,
cfile,
m_status->context);
if (errorCode != GP_OK)
@@ -1108,7 +1110,9 @@ void GPCamera::getSupportedPorts(QStringList& plist)
for (int i = 0 ; i < numPorts ; i++)
{
gp_port_info_list_get_info( list, i, &info );
- plist.append( info.path );
+ char *path;
+ gp_port_info_get_name( info, &path );
+ plist.append( path );
}
}

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.29 2011/11/02 09:57:21 jasper Exp $
# $OpenBSD: Makefile,v 1.30 2013/01/19 11:27:01 zhuk Exp $
COMMENT-main = kde image plugins
COMMENT-cal = kde image calendar plugin
@ -6,7 +6,7 @@ CATEGORIES = graphics x11 x11/kde
DISTNAME = kipi-plugins-0.1.6
PKGNAME-main = ${DISTNAME}
PKGNAME-cal = kipi-kcal-plugin-0.1.6
REVISION-main = 2
REVISION-main = 3
REVISION-cal = 2
HOMEPAGE = http://extragear.kde.org/apps/kipi/
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=kipi/}
@ -23,7 +23,7 @@ LIB_DEPENDS = x11/kde/libs3 \
LIB_DEPENDS-main =${LIB_DEPENDS} \
x11/kde/libs3 \
graphics/libgphoto2 \
graphics/libgphoto2>=2.5 \
graphics/libkexiv2>=0.1.5 \
graphics/libkdcraw

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-kipi-plugins_kameraklient_gpcamera_cpp,v 1.1 2013/01/19 11:27:01 zhuk Exp $
Fix compilation with GPhoto 2.5. Based on ideas from this patch:
http://bugsfiles.kde.org/attachment.cgi?id=73176
--- kipi-plugins/kameraklient/gpcamera.cpp.orig Sat Jan 19 00:43:53 2013
+++ kipi-plugins/kameraklient/gpcamera.cpp Sat Jan 19 00:46:03 2013
@@ -436,7 +436,7 @@ int GPCamera::uploadItem(const QString& folder, const
status = 0;
}
status = new GPStatus;
- if (gp_camera_folder_put_file(d->camera, folder.latin1(), cfile, status->context) != GP_OK) {
+ if (gp_camera_folder_put_file(d->camera, folder.latin1(), itemName.latin1(), GP_FILE_TYPE_NORMAL, cfile, status->context) != GP_OK) {
gp_file_unref(cfile);
delete status;
status = 0;
@@ -530,7 +530,9 @@ void GPCamera::getSupportedPorts(QStringList& plist) {
int numPorts = gp_port_info_list_count( list );
for (int i = 0; i < numPorts; i++) {
gp_port_info_list_get_info( list, i, &info );
- plist.append(info.path);
+ char *path;
+ gp_port_info_get_name( info, &path );
+ plist.append(path);
}
gp_port_info_list_free( list );
}

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-kipi-plugins_kameraklient_gpiface_cpp,v 1.1 2013/01/19 11:27:01 zhuk Exp $
Fix compilation with GPhoto 2.5. Based on ideas from this patch:
http://bugsfiles.kde.org/attachment.cgi?id=73176
--- kipi-plugins/kameraklient/gpiface.cpp.orig Sat Jan 19 00:42:43 2013
+++ kipi-plugins/kameraklient/gpiface.cpp Sat Jan 19 00:43:20 2013
@@ -114,7 +114,9 @@ void GPIface::getSupportedPorts(QStringList& plist) {
int numPorts = gp_port_info_list_count( list );
for (int i = 0; i < numPorts; i++) {
gp_port_info_list_get_info( list, i, &info );
- plist.append( info.path );
+ char *path;
+ gp_port_info_get_name ( info, &path );
+ plist.append( path );
}
gp_port_info_list_free( list );
}

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-kipi-plugins_kameraklient_gpstatus_cpp,v 1.1 2013/01/19 11:27:01 zhuk Exp $
Fix compilation with GPhoto 2.5. Based on ideas from this patch:
http://bugsfiles.kde.org/attachment.cgi?id=73176
--- kipi-plugins/kameraklient/gpstatus.cpp.orig Sat Jan 19 00:39:07 2013
+++ kipi-plugins/kameraklient/gpstatus.cpp Sat Jan 19 01:03:24 2013
@@ -52,39 +52,16 @@ GPContextFeedback GPStatus::cancel_func(GPContext *, v
return (cancel ? GP_CONTEXT_FEEDBACK_CANCEL : GP_CONTEXT_FEEDBACK_OK);
}
-void GPStatus::error_func(GPContext *, const char *format, va_list args, void *) {
- char buf[4096] = "";
- int nSize = vsnprintf( buf, 4096, format, args );
- if(nSize > 4094) {
- nSize = 4094;
- }
- buf[nSize] = '\0';
- QString error;
- error = error.fromLocal8Bit(buf);
- GPMessages::gpMessagesWrapper()->emit errorMessage(error);
+void GPStatus::error_func(GPContext *, const char *str, void *) {
+ GPMessages::gpMessagesWrapper()->emit errorMessage(QString(str));
}
-void GPStatus::status_func (GPContext *, const char *format, va_list args, void *) {
- char buf[4096] = "";
- int nSize = vsnprintf( buf, 4096, format, args );
- if(nSize > 4094) {
- nSize = 4094;
- }
- buf[nSize] = '\0';
- QString status;
- status = status.fromLocal8Bit(buf);
- GPMessages::gpMessagesWrapper()->emit statusChanged(status);
+void GPStatus::status_func (GPContext *, const char *str, void *) {
+ GPMessages::gpMessagesWrapper()->emit statusChanged(QString(str));
}
-unsigned int GPStatus::progress_start_func(GPContext *, float _target, const char *format, va_list args, void *) {
- char buf[4096] = "";
- int nSize = vsnprintf( buf, 4096, format, args );
- if(nSize > 4094) {
- nSize = 4094;
- }
- buf[nSize] = '\0';
- QString prog;
- prog = prog.fromLocal8Bit(buf);
+unsigned int GPStatus::progress_start_func(GPContext *, float _target, const char *str, void *) {
+ // XXX str not used?
target = _target;
return GP_OK;
}

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-kipi-plugins_kameraklient_gpstatus_h,v 1.1 2013/01/19 11:27:01 zhuk Exp $
Fix compilation with GPhoto 2.5. Based on ideas from this patch:
http://bugsfiles.kde.org/attachment.cgi?id=73176
--- kipi-plugins/kameraklient/gpstatus.h.orig Sat Jan 19 01:01:33 2013
+++ kipi-plugins/kameraklient/gpstatus.h Sat Jan 19 01:02:54 2013
@@ -48,9 +48,9 @@ class GPStatus : public QObject {
private:
static GPContextFeedback cancel_func(GPContext *context, void *data);
- static void error_func(GPContext *context, const char *format, va_list args, void *data);
- static void status_func(GPContext *context, const char *format, va_list args, void *data);
- static unsigned int progress_start_func (GPContext *context, float target, const char *format, va_list args, void *data);
+ static void error_func(GPContext *context, const char *format, void *data);
+ static void status_func(GPContext *context, const char *format, void *data);
+ static unsigned int progress_start_func (GPContext *context, float target, const char *format, void *data);
static void progress_update_func (GPContext *context, unsigned int id, float current, void *data);
static void progress_stop_func(GPContext *context, unsigned int id, void *data);
static float target;

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.106 2013/01/14 12:09:59 zhuk Exp $
# $OpenBSD: Makefile,v 1.107 2013/01/19 11:28:00 zhuk Exp $
COMMENT-main = K Desktop Environment, graphic applications
COMMENT-kamera = KDE interface to digital cameras
@ -52,7 +52,7 @@ RUN_DEPENDS-kpov = ${RUN_DEPENDS} \
x11/gtk+2,-guic
LIB_DEPENDS-kamera = ${LIB_DEPENDS} \
graphics/libgphoto2
graphics/libgphoto2>=2.5
RUN_DEPENDS-kamera = ${RUN_DEPENDS} \
devel/desktop-file-utils
@ -68,7 +68,7 @@ WANTLIB-kamera = ${WANTLIB}
WANTLIB-sane = ${WANTLIB}
REVISION-main = 17
REVISION-kamera = 8
REVISION-kamera = 9
REVISION-kpov = 8
REVISION-sane = 12

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-kamera_kcontrol_kameradevice_cpp,v 1.1 2013/01/19 11:28:00 zhuk Exp $
Fix compilation with GPhoto 2.5. Based on ideas from those patches:
http://bugsfiles.kde.org/attachment.cgi?id=73176
http://www.mail-archive.com/opensuse-commit@opensuse.org/msg30153.html
--- kamera/kcontrol/kameradevice.cpp.orig Sat Jan 19 01:08:58 2013
+++ kamera/kcontrol/kameradevice.cpp Sat Jan 19 01:11:01 2013
@@ -346,8 +346,10 @@ KameraDeviceSelectDialog::KameraDeviceSelectDialog(QWi
}
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->insertItem(QString::fromLatin1(info.path).mid(7));
+ char *path;
+ gp_port_info_get_name(info, &path);
+ if (strncmp(path, "serial:", 7) == 0)
+ m_serialPortCombo->insertItem(QString::fromLatin1(path).mid(7));
}
}
gp_port_info_list_free(list);

View File

@ -0,0 +1,118 @@
$OpenBSD: patch-kamera_kioslave_kamera_cpp,v 1.1 2013/01/19 11:28:00 zhuk Exp $
Fix compilation with GPhoto 2.5. Based on ideas from those patches:
http://bugsfiles.kde.org/attachment.cgi?id=73176
http://www.mail-archive.com/opensuse-commit@opensuse.org/msg30153.html
--- kamera/kioslave/kamera.cpp.orig Sat Jan 19 01:11:30 2013
+++ kamera/kioslave/kamera.cpp Sat Jan 19 01:25:18 2013
@@ -55,10 +55,10 @@ extern "C"
{
KDE_EXPORT int kdemain(int argc, char **argv);
- static void frontendCameraStatus(GPContext *context, const char *format, va_list args, void *data);
+ static void frontendCameraStatus(GPContext *context, const char *format, void *data);
static unsigned int frontendProgressStart(
- GPContext *context, float totalsize, const char *format,
- va_list args, void *data
+ GPContext *context, float totalsize, const char *str,
+ void *data
);
static void frontendProgressUpdate(
GPContext *context, unsigned int id, float current, void *data
@@ -857,10 +857,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsE
udsEntry.append(atom);
atom.m_uds = UDS_NAME;
- if (info.file.fields & GP_FILE_INFO_NAME)
- atom.m_str = QString::fromLocal8Bit(info.file.name);
- else
- atom.m_str = name;
+ atom.m_str = name;
udsEntry.append(atom);
if (info.file.fields & GP_FILE_INFO_SIZE) {
@@ -986,81 +983,17 @@ void frontendProgressUpdate(
}
unsigned int frontendProgressStart(
- GPContext * /*context*/, float totalsize, const char *format, va_list args,
- void *data
+ GPContext * /*context*/, float totalsize, const char *str, void *data
) {
KameraProtocol *object = (KameraProtocol*)data;
- char *status;
-
- /* We must copy the va_list to walk it twice, or all hell
- * breaks loose on non-i386 platforms.
- */
-#if defined(HAVE_VA_COPY) || defined(HAVE___VA_COPY)
- va_list xvalist;
-# ifdef HAVE_VA_COPY
- va_copy(xvalist, args);
-# elif HAVE___VA_COPY
- __va_copy(xvalist, args);
-# endif
- int size=vsnprintf(NULL, 0, format, xvalist);
- if(size<=0)
- return GP_OK; // vsnprintf is broken, better don't do anything.
-
- status=new char[size+1];
-# ifdef HAVE_VA_COPY
- va_copy(xvalist, args);
-# elif HAVE___VA_COPY
- __va_copy(xvalist, args);
-# endif
- vsnprintf(status, size+1, format, xvalist);
-#else
- /* We cannot copy the va_list, so make sure we
- * walk it just _once_.
- */
- status=new char[300];
- vsnprintf(status, 300, format, args);
-#endif
-
- object->infoMessage(QString::fromLocal8Bit(status));
- delete [] status;
+ object->infoMessage(QString::fromLocal8Bit(str));
object->totalSize((int)totalsize); // hack: call slot directly
return GP_OK;
}
// this callback function is activated on every status message from gphoto2
-static void frontendCameraStatus(GPContext * /*context*/, const char *format, va_list args, void *data)
+static void frontendCameraStatus(GPContext * /*context*/, const char *str, void *data)
{
KameraProtocol *object = (KameraProtocol*)data;
- char *status;
-
- /* We must copy the va_list to walk it twice, or all hell
- * breaks loose on non-i386 platforms.
- */
-#if defined(HAVE_VA_COPY) || defined(HAVE___VA_COPY)
- va_list xvalist;
-# ifdef HAVE_VA_COPY
- va_copy(xvalist, args);
-# elif HAVE___VA_COPY
- __va_copy(xvalist, args);
-# endif
- int size=vsnprintf(NULL, 0, format, xvalist);
- if(size<=0)
- return; // vsnprintf is broken, better don't do anything.
-
- status=new char[size+1];
-# ifdef HAVE_VA_COPY
- va_copy(xvalist, args);
-# elif HAVE___VA_COPY
- __va_copy(xvalist, args);
-# endif
- vsnprintf(status, size+1, format, xvalist);
-#else
- /* We cannot copy the va_list, so make sure we
- * walk it just _once_.
- */
- status=new char[300];
- vsnprintf(status, 300, format, args);
-#endif
- object->infoMessage(QString::fromLocal8Bit(status));
- delete [] status;
+ object->infoMessage(QString::fromLocal8Bit(str));
}