forked from msys2/MINGW-packages
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dbus-c++ (version 0.9.0) (msys2#3972)
- Loading branch information
Showing
5 changed files
with
314 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Maintainer: Andrew Sun <adsun701@gmail.com> | ||
|
||
_realname=dbus-c++ | ||
_srcname="lib${_realname}" | ||
_upstream="dbus-cplusplus" | ||
pkgbase=mingw-w64-${_realname} | ||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") | ||
pkgver=0.9.0 | ||
pkgrel=1 | ||
pkgdesc="A C++ API for D-BUS (mingw-w64)" | ||
arch=('any') | ||
url="http://dbus-cplusplus.sourceforge.net/" | ||
license=('LGPL') | ||
depends=("${MINGW_PACKAGE_PREFIX}-dbus") | ||
source=("${_realname}-${pkgver}.tar.gz"::"https://sourceforge.net/projects/${_upstream}/files/${_realname}/${pkgver}/${_srcname}-${pkgver}.tar.gz" | ||
'gcc47.patch' | ||
'disable-threading.patch' | ||
'fix-writechar.patch' | ||
'dbus-c++-0.9.0-mingw.patch') | ||
sha256sums=('bc11ac297b3cb010be904c72789695543ee3fdf3d75cdc8225fd371385af4e61' | ||
'9d504faf769026dcaabca94c7645373fcadf43ef93c8263c6a85e905798f07c9' | ||
'38730ee73fe4de320fceab6619579b55861b6b8e0f6d8069a9ddf3d1ad1266c0' | ||
'34ada5bf31918c63558d0fb3fff63e0f1596f25082ff22e84117927ad7236fce' | ||
'e015d31d7ab0107046daedcf34195d41ac99fa97453f05953cfceee70dd09f67') | ||
|
||
prepare() { | ||
cd ${srcdir}/${_srcname}-${pkgver} | ||
patch -Np0 -i "${srcdir}/gcc47.patch" | ||
patch -Np1 -i "${srcdir}/disable-threading.patch" | ||
patch -Np1 -i "${srcdir}/fix-writechar.patch" | ||
patch -Np1 -i "${srcdir}/dbus-c++-0.9.0-mingw.patch" | ||
autoreconf -vi | ||
} | ||
|
||
build() { | ||
export LDFLAGS+=" -lexpat -lpthread -lws2_32" # -lpthread needed for i686 | ||
export CPPFLAGS+=" -D_WIN32_WINNT=0x600" # needed to build with winsock2.h | ||
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH} | ||
mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} | ||
../${_srcname}-${pkgver}/configure \ | ||
--prefix=${MINGW_PREFIX} \ | ||
--build=${MINGW_CHOST} \ | ||
--host=${MINGW_CHOST} \ | ||
--target=${MINGW_CHOST} \ | ||
--enable-static \ | ||
--enable-shared \ | ||
--disable-ecore \ | ||
--disable-glib \ | ||
--disable-tests \ | ||
--disable-examples | ||
|
||
make | ||
} | ||
|
||
package() { | ||
cd "${srcdir}"/build-${CARCH} | ||
make install DESTDIR="${pkgdir}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
diff -Naur libdbus-c++-0.9.0.orig/include/dbus-c++/eventloop-integration.h libdbus-c++-0.9.0/include/dbus-c++/eventloop-integration.h | ||
--- libdbus-c++-0.9.0.orig/include/dbus-c++/eventloop-integration.h 2018-06-18 09:00:31.731863100 -0400 | ||
+++ libdbus-c++-0.9.0/include/dbus-c++/eventloop-integration.h 2018-06-18 10:41:14.726173200 -0400 | ||
@@ -90,7 +90,7 @@ | ||
|
||
private: | ||
bool _running; | ||
- int _pipe[2]; | ||
+ int _Pipe[2]; | ||
std::list <Pipe *> pipe_list; | ||
}; | ||
|
||
diff -Naur libdbus-c++-0.9.0.orig/src/eventloop.cpp libdbus-c++-0.9.0/src/eventloop.cpp | ||
--- libdbus-c++-0.9.0.orig/src/eventloop.cpp 2018-06-18 09:00:31.607861900 -0400 | ||
+++ libdbus-c++-0.9.0/src/eventloop.cpp 2018-06-18 09:22:34.113010700 -0400 | ||
@@ -28,7 +28,13 @@ | ||
#include <dbus-c++/eventloop.h> | ||
#include <dbus-c++/debug.h> | ||
|
||
+#ifdef _WIN32 | ||
+#include <winsock2.h> | ||
+#define poll WSAPoll | ||
+#define pollfd WSAPOLLFD | ||
+#else | ||
#include <sys/poll.h> | ||
+#endif | ||
#include <sys/time.h> | ||
|
||
#include <dbus/dbus.h> | ||
@@ -85,7 +91,7 @@ | ||
{ | ||
if (recursive) | ||
{ | ||
- pthread_mutex_t recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; | ||
+ pthread_mutex_t recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER; | ||
_mutex = recmutex; | ||
} | ||
else | ||
diff -Naur libdbus-c++-0.9.0.orig/src/eventloop-integration.cpp libdbus-c++-0.9.0/src/eventloop-integration.cpp | ||
--- libdbus-c++-0.9.0.orig/src/eventloop-integration.cpp 2018-06-18 09:00:31.605863100 -0400 | ||
+++ libdbus-c++-0.9.0/src/eventloop-integration.cpp 2018-06-18 10:49:21.392037900 -0400 | ||
@@ -36,7 +36,13 @@ | ||
/* STD */ | ||
#include <string.h> | ||
#include <cassert> | ||
+#ifdef _WIN32 | ||
+#include <winsock2.h> | ||
+#define poll WSAPoll | ||
+#define pollfd WSAPOLLFD | ||
+#else | ||
#include <sys/poll.h> | ||
+#endif | ||
#include <fcntl.h> | ||
|
||
using namespace DBus; | ||
@@ -79,13 +85,16 @@ | ||
BusDispatcher::BusDispatcher() : | ||
_running(false) | ||
{ | ||
+ #ifdef _WIN32 | ||
+ #define pipe _pipe | ||
+ #endif | ||
// pipe to create a new fd used to unlock a dispatcher at any | ||
// moment (used by leave function) | ||
- int ret = pipe(_pipe); | ||
+ int ret = pipe(_Pipe, 0, _O_BINARY | _O_NOINHERIT); | ||
if (ret == -1) throw Error("PipeError:errno", toString(errno).c_str()); | ||
|
||
- _fdunlock[0] = _pipe[0]; | ||
- _fdunlock[1] = _pipe[1]; | ||
+ _fdunlock[0] = _Pipe[0]; | ||
+ _fdunlock[1] = _Pipe[1]; | ||
} | ||
|
||
void BusDispatcher::enter() | ||
diff -Naur libdbus-c++-0.9.0.orig/src/Makefile.am libdbus-c++-0.9.0/src/Makefile.am | ||
--- libdbus-c++-0.9.0.orig/src/Makefile.am 2018-06-18 09:00:31.630862000 -0400 | ||
+++ libdbus-c++-0.9.0/src/Makefile.am 2018-06-18 09:02:41.541225800 -0400 | ||
@@ -31,6 +31,9 @@ | ||
libdbus_c___1_la_LIBADD = \ | ||
$(dbus_LIBS) | ||
|
||
+libdbus_c___1_la_LDFLAGS = \ | ||
+ -no-undefined | ||
+ | ||
AM_CPPFLAGS = \ | ||
$(dbus_CFLAGS) \ | ||
$(glib_CFLAGS) \ | ||
diff -Naur libdbus-c++-0.9.0.orig/src/pipe.cpp libdbus-c++-0.9.0/src/pipe.cpp | ||
--- libdbus-c++-0.9.0.orig/src/pipe.cpp 2018-06-18 09:00:31.618869800 -0400 | ||
+++ libdbus-c++-0.9.0/src/pipe.cpp 2018-06-18 10:34:24.220185100 -0400 | ||
@@ -32,7 +32,13 @@ | ||
|
||
/* STD */ | ||
#include <unistd.h> | ||
+#ifdef _WIN32 | ||
+#include <winsock2.h> | ||
+#define poll WSAPoll | ||
+#define pollfd WSAPOLLFD | ||
+#else | ||
#include <sys/poll.h> | ||
+#endif | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
#include <cassert> | ||
@@ -47,12 +53,21 @@ | ||
_data(data) | ||
{ | ||
int fd[2]; | ||
- | ||
+ #ifdef _WIN32 | ||
+ #define pipe _pipe | ||
+ if (_pipe((fd), 0, _O_BINARY | _O_NOINHERIT) == 0) | ||
+ #else | ||
if (pipe(fd) == 0) | ||
+ #endif | ||
{ | ||
_fd_read = fd[0]; | ||
_fd_write = fd[1]; | ||
+ #ifdef _WIN32 | ||
+ u_long nonblock = 1; | ||
+ ioctlsocket(_fd_read, FIONBIO, &nonblock); | ||
+ #else | ||
fcntl(_fd_read, F_SETFL, O_NONBLOCK); | ||
+ #endif | ||
} | ||
else | ||
{ | ||
diff -Naur libdbus-c++-0.9.0.orig/tools/generate_proxy.cpp libdbus-c++-0.9.0/tools/generate_proxy.cpp | ||
--- libdbus-c++-0.9.0.orig/tools/generate_proxy.cpp 2018-06-18 09:00:31.311874400 -0400 | ||
+++ libdbus-c++-0.9.0/tools/generate_proxy.cpp 2018-06-18 11:15:32.307777800 -0400 | ||
@@ -352,7 +352,7 @@ | ||
if (!arg_name.length()) | ||
{ | ||
arg_name = "argin"; | ||
- arg_name += toString <uint> (i); | ||
+ arg_name += toString <int> (i); | ||
} | ||
|
||
// generate extra code to wrap object | ||
@@ -445,7 +445,7 @@ | ||
|
||
if (!arg_name.length()) | ||
{ | ||
- arg_name = "argout" + toString <uint> (i); | ||
+ arg_name = "argout" + toString <int> (i); | ||
} | ||
|
||
if (arg_object.length()) | ||
@@ -569,7 +569,7 @@ | ||
// use a default if no arg name given | ||
if (!arg_name.length()) | ||
{ | ||
- arg_name = "arg" + toString <uint> (i); | ||
+ arg_name = "arg" + toString <int> (i); | ||
} | ||
|
||
body << arg_name << ";" << endl; | ||
@@ -605,7 +605,7 @@ | ||
|
||
if (!arg_name.length()) | ||
{ | ||
- arg_name = "arg" + toString <uint> (j); | ||
+ arg_name = "arg" + toString <int> (j); | ||
} | ||
|
||
if (arg_object.length()) | ||
diff -Naur libdbus-c++-0.9.0.orig/tools/introspect.cpp libdbus-c++-0.9.0/tools/introspect.cpp | ||
--- libdbus-c++-0.9.0.orig/tools/introspect.cpp 2018-06-18 09:00:31.305870900 -0400 | ||
+++ libdbus-c++-0.9.0/tools/introspect.cpp 2018-06-18 10:57:13.796040700 -0400 | ||
@@ -45,9 +45,11 @@ | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
+#ifndef _WIN32 | ||
signal(SIGTERM, niam); | ||
signal(SIGINT, niam); | ||
signal(SIGALRM, niam); | ||
+#endif | ||
|
||
if (argc == 1) | ||
{ | ||
@@ -70,7 +72,9 @@ | ||
|
||
DBus::default_dispatcher = &dispatcher; | ||
|
||
+#ifndef _WIN32 | ||
alarm(1); | ||
+#endif | ||
|
||
dispatcher.enter(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- libdbus-c++-0.9.0/include/dbus-c++/dispatcher.h.threading 2017-02-15 13:40:53.796004263 +0000 | ||
+++ libdbus-c++-0.9.0/include/dbus-c++/dispatcher.h 2017-02-15 13:40:46.907000493 +0000 | ||
@@ -188,6 +188,7 @@ | ||
/* classes for multithreading support | ||
*/ | ||
|
||
+#if 0 | ||
class DXXAPI Mutex | ||
{ | ||
public: | ||
@@ -243,9 +244,11 @@ | ||
typedef bool (*CondVarWaitTimeoutFn)(CondVar *cv, Mutex *mx, int timeout); | ||
typedef void (*CondVarWakeOneFn)(CondVar *cv); | ||
typedef void (*CondVarWakeAllFn)(CondVar *cv); | ||
+#endif | ||
|
||
void DXXAPI _init_threading(); | ||
|
||
+#if 0 | ||
void DXXAPI _init_threading( | ||
MutexNewFn, MutexFreeFn, MutexLockFn, MutexUnlockFn, | ||
CondVarNewFn, CondVarFreeFn, CondVarWaitFn, CondVarWaitTimeoutFn, CondVarWakeOneFn, CondVarWakeAllFn | ||
@@ -312,6 +315,7 @@ | ||
cv->wake_all(); | ||
} | ||
}; | ||
+#endif | ||
|
||
} /* namespace DBus */ | ||
|
||
--- libdbus-c++-0.9.0/src/dispatcher.cpp.threading 2017-02-15 13:48:22.627249868 +0000 | ||
+++ libdbus-c++-0.9.0/src/dispatcher.cpp 2017-02-15 13:48:29.164253445 +0000 | ||
@@ -253,6 +253,7 @@ | ||
#endif//DBUS_HAS_THREADS_INIT_DEFAULT | ||
} | ||
|
||
+#if 0 | ||
void DBus::_init_threading( | ||
MutexNewFn m1, | ||
MutexFreeFn m2, | ||
@@ -318,3 +319,4 @@ | ||
#endif//DBUS_HAS_RECURSIVE_MUTEX | ||
dbus_threads_init(&functions); | ||
} | ||
+#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- libdbus-c++-0.9.0/src/pipe.cpp.writechar 2017-02-16 11:07:13.591950169 +0000 | ||
+++ libdbus-c++-0.9.0/src/pipe.cpp 2017-02-16 11:04:17.158796092 +0000 | ||
@@ -83,5 +83,5 @@ | ||
void Pipe::signal() | ||
{ | ||
// TODO: ignoring return of read/write generates warning; maybe relevant for eventloop work... | ||
- ::write(_fd_write, '\0', 1); | ||
+ ::write(_fd_write, "", 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- src/eventloop-integration.cpp.orig 2012-05-09 11:22:09.683290763 +0200 | ||
+++ src/eventloop-integration.cpp 2012-05-09 11:22:44.313288912 +0200 | ||
@@ -38,6 +38,7 @@ | ||
#include <cassert> | ||
#include <sys/poll.h> | ||
#include <fcntl.h> | ||
+#include <unistd.h> | ||
|
||
using namespace DBus; | ||
using namespace std; |