summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Sun2018-06-18 13:06:00 -0400
committerAndrew Sun2018-06-18 13:06:00 -0400
commit002221b29cc533cd363ec13577a76a5db28341d0 (patch)
tree815676a387dda3c4946f67552879f560869b7f54
downloadaur-002221b29cc533cd363ec13577a76a5db28341d0.tar.gz
version 0.9.0
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD64
-rw-r--r--dbus-c++-0.9.0-mingw.patch192
-rw-r--r--disable-threading.patch45
-rw-r--r--fix-writechar.patch9
-rw-r--r--gcc47.patch10
6 files changed, 347 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..4e71e2a82047
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = mingw-w64-dbus-c++
+ pkgdesc = A C++ API for D-BUS (mingw-w64)
+ pkgver = 0.9.0
+ pkgrel = 1
+ url = http://dbus-cplusplus.sourceforge.net/
+ arch = any
+ license = LGPL
+ makedepends = mingw-w64-configure
+ depends = mingw-w64-crt
+ depends = mingw-w64-dbus
+ depends = mingw-w64-glib2
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = https://sourceforge.net/projects/dbus-cplusplus/files/dbus-c++/0.9.0/libdbus-c++-0.9.0.tar.gz
+ source = gcc47.patch
+ source = disable-threading.patch
+ source = fix-writechar.patch
+ source = dbus-c++-0.9.0-mingw.patch
+ sha512sums = 7acebbb4254b2886cc0f05c5ddeeeac0b5863c5552d32249463b89380b0b95b8225c80bd98b8c7fcaada42ab770b5eff41b15390cd0d78bf1ee322ac6c2de319
+ sha512sums = d8618e1eafd25be074ffecf958fbc04f1b2a844c865ec2d795565809a5d11e7f60c1a8c3a6d952b1485af6b199753b36c06f1759a5559274eed55cf5e6585e20
+ sha512sums = 94d95089ea84af1438191285955bf0866a7d7cbe535ac7fb8282ef6fb96c4ee052f439fb8c9d0b18b9ebec65d39cc45754bb48192ffb46c3d0c4ed6b1b6693a6
+ sha512sums = df0a3a80d139877eaea5f352da5dfa2bc0407360ddfb59301707c77bd4329ecd986f366f27bbdd7e4ce385125c6ec46fcf115854aa01d97cf11dff905cd9a385
+ sha512sums = 49198f9930dacfc7569e4626adca649039f7d21c69a75067a20f43280e18370c67f5b56efa9866962043e47923f1d225115ab4bf488510eb343b58b75f777e1d
+
+pkgname = mingw-w64-dbus-c++
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2478b03cac72
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer: Andrew Sun <adsun701@gmail.com>
+
+pkgname=mingw-w64-dbus-c++
+_pkgname=libdbus-c++
+_upstream="dbus-cplusplus"
+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')
+makedepends=('mingw-w64-configure')
+depends=('mingw-w64-crt' 'mingw-w64-dbus' 'mingw-w64-glib2')
+options=('!strip' '!buildflags' 'staticlibs')
+source=("https://sourceforge.net/projects/${_upstream}/files/dbus-c++/${pkgver}/${_pkgname}-${pkgver}.tar.gz"
+ 'gcc47.patch'
+ 'disable-threading.patch'
+ 'fix-writechar.patch'
+ 'dbus-c++-0.9.0-mingw.patch')
+sha512sums=('7acebbb4254b2886cc0f05c5ddeeeac0b5863c5552d32249463b89380b0b95b8225c80bd98b8c7fcaada42ab770b5eff41b15390cd0d78bf1ee322ac6c2de319'
+ 'd8618e1eafd25be074ffecf958fbc04f1b2a844c865ec2d795565809a5d11e7f60c1a8c3a6d952b1485af6b199753b36c06f1759a5559274eed55cf5e6585e20'
+ '94d95089ea84af1438191285955bf0866a7d7cbe535ac7fb8282ef6fb96c4ee052f439fb8c9d0b18b9ebec65d39cc45754bb48192ffb46c3d0c4ed6b1b6693a6'
+ 'df0a3a80d139877eaea5f352da5dfa2bc0407360ddfb59301707c77bd4329ecd986f366f27bbdd7e4ce385125c6ec46fcf115854aa01d97cf11dff905cd9a385'
+ '49198f9930dacfc7569e4626adca649039f7d21c69a75067a20f43280e18370c67f5b56efa9866962043e47923f1d225115ab4bf488510eb343b58b75f777e1d')
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd "${srcdir}/${_pkgname}-${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() {
+ cd "${srcdir}/${_pkgname}-$pkgver/"
+
+ export LIBS+=" -lexpat -lpthread -lws2_32" # -lpthread needed for i686
+ export CPPFLAGS+=" -D_WIN32_WINNT=0x600" # needed to build with winsock2.h
+
+ for _arch in ${_architectures}; do
+ mkdir -p build-${_arch} && pushd build-${_arch}
+ ${_arch}-configure \
+ --disable-ecore \
+ --disable-glib \
+ --disable-tests \
+ --disable-examples \
+ ..
+ make
+ popd
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd "${srcdir}/${_pkgname}-$pkgver/build-${_arch}"
+ make DESTDIR="${pkgdir}" install
+ ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
+ ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.exe
+ ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
+ done
+}
diff --git a/dbus-c++-0.9.0-mingw.patch b/dbus-c++-0.9.0-mingw.patch
new file mode 100644
index 000000000000..78619de493e6
--- /dev/null
+++ b/dbus-c++-0.9.0-mingw.patch
@@ -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();
+ }
diff --git a/disable-threading.patch b/disable-threading.patch
new file mode 100644
index 000000000000..c4fafef6270a
--- /dev/null
+++ b/disable-threading.patch
@@ -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
diff --git a/fix-writechar.patch b/fix-writechar.patch
new file mode 100644
index 000000000000..d936b7fc172d
--- /dev/null
+++ b/fix-writechar.patch
@@ -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);
+ }
diff --git a/gcc47.patch b/gcc47.patch
new file mode 100644
index 000000000000..6a8277300698
--- /dev/null
+++ b/gcc47.patch
@@ -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;