diff options
author | CoprDistGit <infra@openeuler.org> | 2025-09-16 02:14:23 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2025-09-16 02:14:23 +0000 |
commit | a1a9ca04a535ba8c893370f5c5738b3c6f9e9941 (patch) | |
tree | 5c58cf99d37cd0804478a689f39b488fa1decb72 | |
parent | 0d1171fce1e277ef6ed6cdb2918b2bc9637b82ac (diff) |
automatic import of dbus-c++
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | dbus-c++-gcc4.7.patch | 12 | ||||
-rw-r--r-- | dbus-c++-linkfix.patch | 12 | ||||
-rw-r--r-- | dbus-c++-macro_collision.patch | 14 | ||||
-rw-r--r-- | dbus-c++-template-operators.patch | 88 | ||||
-rw-r--r-- | dbus-c++-threading.patch | 45 | ||||
-rw-r--r-- | dbus-c++-writechar.patch | 9 | ||||
-rw-r--r-- | dbus-c++.spec | 71 | ||||
-rw-r--r-- | libdbus-c++-0.9.0-link.patch | 52 | ||||
-rw-r--r-- | sources | 1 |
10 files changed, 305 insertions, 0 deletions
@@ -0,0 +1 @@ +/libdbus-c++-0.9.0.tar.gz diff --git a/dbus-c++-gcc4.7.patch b/dbus-c++-gcc4.7.patch new file mode 100644 index 0000000..5cb8096 --- /dev/null +++ b/dbus-c++-gcc4.7.patch @@ -0,0 +1,12 @@ +diff --git a/include/dbus-c++/eventloop-integration.h b/include/dbus-c++/eventloop-integration.h +index 1b0302e..3e44304 100644 +--- a/include/dbus-c++/eventloop-integration.h ++++ b/include/dbus-c++/eventloop-integration.h +@@ -26,6 +26,7 @@ + #define __DBUSXX_EVENTLOOP_INTEGRATION_H + + #include <errno.h> ++#include <unistd.h> + #include "api.h" + #include "dispatcher.h" + #include "util.h" diff --git a/dbus-c++-linkfix.patch b/dbus-c++-linkfix.patch new file mode 100644 index 0000000..3672fe2 --- /dev/null +++ b/dbus-c++-linkfix.patch @@ -0,0 +1,12 @@ +diff -up libdbus-c++-0.9.0/src/Makefile.am.linkfix libdbus-c++-0.9.0/src/Makefile.am +--- libdbus-c++-0.9.0/src/Makefile.am.linkfix 2013-12-17 16:07:22.326715886 +0100 ++++ libdbus-c++-0.9.0/src/Makefile.am 2013-12-17 16:07:34.474542044 +0100 +@@ -29,7 +29,7 @@ libdbus_c___1_la_CXXFLAGS = \ + -Wno-unused-parameter + + libdbus_c___1_la_LIBADD = \ +- $(dbus_LIBS) ++ $(dbus_LIBS) $(xml_LIBS) + + AM_CPPFLAGS = \ + $(dbus_CFLAGS) \ diff --git a/dbus-c++-macro_collision.patch b/dbus-c++-macro_collision.patch new file mode 100644 index 0000000..5704402 --- /dev/null +++ b/dbus-c++-macro_collision.patch @@ -0,0 +1,14 @@ +diff -rupN libdbus-c++-0.9.0/examples/glib/dbus-browser.h libdbus-c++-0.9.0-new/examples/glib/dbus-browser.h +--- libdbus-c++-0.9.0/examples/glib/dbus-browser.h 2015-03-05 23:43:26.903517530 +0100 ++++ libdbus-c++-0.9.0-new/examples/glib/dbus-browser.h 2011-11-28 16:03:19.000000000 +0100 +@@ -1,9 +1,9 @@ + #ifndef __DEMO_DBUS_BROWSER_H + #define __DEMO_DBUS_BROWSER_H + ++#include <gtkmm.h> + #include <dbus-c++/dbus.h> + #include <dbus-c++/glib-integration.h> +-#include <gtkmm.h> + + #include "dbus-glue.h" + diff --git a/dbus-c++-template-operators.patch b/dbus-c++-template-operators.patch new file mode 100644 index 0000000..e1a6d10 --- /dev/null +++ b/dbus-c++-template-operators.patch @@ -0,0 +1,88 @@ +commit a0b9ef3b469ca23c6a3229d8abb967cbbddcee38 +Author: Peter Williams <peter@newton.cx> +Date: Sat Dec 19 21:12:46 2015 -0500 + + Fix some weird template/operator issues on OS X. + + I frankly don't understand at all what's going on here. These fixes + derive from: + + https://chromium.googlesource.com/chromiumos/third_party/dbus-cplusplus/+/c3f69f6be02e31521474dce7eadf6ba4f4a7ce94 + https://chromium.googlesource.com/chromiumos/third_party/dbus-cplusplus/+/7104857773f790a549d399715482fa23d9b736cd + + Except I've dropped some changes that break the OS X build for me. Frankly, if + it compiles, that's good enough for me. + +diff --git a/include/dbus-c++/types.h b/include/dbus-c++/types.h +index 044e72b..7b3108f 100644 +--- a/include/dbus-c++/types.h ++++ b/include/dbus-c++/types.h +@@ -89,13 +89,7 @@ public: + } + + template <typename T> +- operator T() const +- { +- T cast; +- MessageIter ri = _msg.reader(); +- ri >> cast; +- return cast; +- } ++ operator T() const; + + private: + +@@ -316,7 +310,7 @@ struct type< Struct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, + } + }; + +-} /* namespace DBus */ ++extern DXXAPI DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Variant &val); + + inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Invalid &) + { +@@ -551,6 +545,8 @@ inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Signature + return ++iter; + } + ++extern DXXAPI DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Variant &val); ++ + template<typename E> + inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, std::vector<E>& val) + { +@@ -644,7 +640,16 @@ inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Struct<T1, + return ++iter; + } + +-extern DXXAPI DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Variant &val); ++template <typename T> ++inline DBus::Variant::operator T() const ++{ ++ T cast; ++ DBus::MessageIter ri = _msg.reader(); ++ ri >> cast; ++ return cast; ++} ++ ++} /* namespace DBus */ + + #endif//__DBUSXX_TYPES_H + +diff --git a/src/types.cpp b/src/types.cpp +index d414a3e..70f9ac0 100644 +--- a/src/types.cpp ++++ b/src/types.cpp +@@ -34,7 +34,7 @@ + #include "message_p.h" + #include "internalerror.h" + +-using namespace DBus; ++namespace DBus { + + Variant::Variant() + : _msg(CallMessage()) // dummy message used as temporary storage for variant data +@@ -104,3 +104,4 @@ MessageIter &operator >> (MessageIter &iter, Variant &val) + return ++iter; + } + ++} /* namespace DBus */ diff --git a/dbus-c++-threading.patch b/dbus-c++-threading.patch new file mode 100644 index 0000000..c4fafef --- /dev/null +++ b/dbus-c++-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/dbus-c++-writechar.patch b/dbus-c++-writechar.patch new file mode 100644 index 0000000..d936b7f --- /dev/null +++ b/dbus-c++-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/dbus-c++.spec b/dbus-c++.spec new file mode 100644 index 0000000..1c7517f --- /dev/null +++ b/dbus-c++.spec @@ -0,0 +1,71 @@ +Name: dbus-c++ +Version: 0.9.0 +Release: 22 +Summary: Native C++ bindings for D-Bus +License: LGPL-2.1-or-later +URL: https://sourceforge.net/projects/dbus-cplusplus/ +Source0: https://downloads.sourceforge.net/dbus-cplusplus/libdbus-c++-%{version}.tar.gz + +Patch0001: dbus-c++-gcc4.7.patch +Patch0002: dbus-c++-linkfix.patch +Patch0003: dbus-c++-macro_collision.patch +Patch0004: dbus-c++-threading.patch +Patch0005: dbus-c++-writechar.patch +Patch0006: dbus-c++-template-operators.patch +Patch0007: libdbus-c++-0.9.0-link.patch + +BuildRequires: make gcc-c++ +BuildRequires: autoconf automake libtool +BuildRequires: pkgconfig(dbus-1) >= 0.60 +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: libexpat-devel +Provides: %{name}-ecore = %{version}-%{release} %{name}-glib = %{version}-%{release} +Obsoletes: %{name}-ecore < %{version}-%{release} %{name}-glib < %{version}-%{release} + +%description +dbus-c++ attempts to provide a C++ API for D-BUS. The library has a glib/gtk and an Ecore mainloop +integration.It also offers an optional own main loop. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains libraries and header files for developing applications that use %{name}. + +%prep +%autosetup -n libdbus-c++-%{version} -p1 +sed -i 's/libtoolize --force --copy/libtoolize -if --copy/' bootstrap + +%build +autoreconf -vfi +#export CPPFLAGS='-pthread %{optflags}' CXXFLAGS='--std=gnu++11 -pthread %{optflags}' +%configure --disable-static --enable-ecore --enable-glib +%make_build + +%install +%make_install +%delete_la + +%files +%license COPYING +%doc AUTHORS +%{_bindir}/dbusxx-* +%{_libdir}/*.so.* + +%files devel +%doc TODO +%{_includedir}/* +%{_libdir}/*.so +%{_libdir}/pkgconfig/* + +%changelog +* Tue Sep 16 2025 Funda Wang <fundawang@yeah.net> - 0.9.0-22 +- fix build with glib feature + +* Thu Jul 13 2023 liyanan <thistleslyn@163.com> - 0.9.0-21 +- fix build error + +* Mon Dec 2 2019 lingsheng <lingsheng@huawei.com> - 0.9.0-20 +- Package init diff --git a/libdbus-c++-0.9.0-link.patch b/libdbus-c++-0.9.0-link.patch new file mode 100644 index 0000000..f69b1c4 --- /dev/null +++ b/libdbus-c++-0.9.0-link.patch @@ -0,0 +1,52 @@ +--- ./src/integration/ecore/Makefile.am.link 2012-07-28 07:29:07.000000000 +0000 ++++ ./src/integration/ecore/Makefile.am 2012-07-28 07:29:34.000000000 +0000 +@@ -11,6 +11,7 @@ + -Wno-unused-parameter + + libdbus_c___ecore_1_la_LIBADD = \ ++ $(top_builddir)/src/libdbus-c++-1.la \ + $(dbus_LIBS) \ + $(ecore_LIBS) + +--- ./src/Makefile.am.link 2012-07-28 07:28:42.000000000 +0000 ++++ ./src/Makefile.am 2012-07-28 07:28:54.000000000 +0000 +@@ -36,7 +36,7 @@ + $(glib_CFLAGS) \ + $(ecore_CFLAGS) + +-SUBDIRS = \ ++SUBDIRS = . \ + integration + + HEADER_DIR = $(top_srcdir)/include/dbus-c++ +--- ./src/integration/glib/Makefile.am.link 2012-07-28 07:36:02.000000000 +0000 ++++ ./src/integration/glib/Makefile.am 2012-07-28 07:36:53.000000000 +0000 +@@ -11,6 +11,7 @@ + -Wno-unused-parameter + + libdbus_c___glib_1_la_LIBADD = \ ++ $(top_builddir)/src/libdbus-c++-1.la \ + $(dbus_LIBS) \ + $(glib_LIBS) + +--- ./examples/glib/Makefile.am.link 2012-07-28 07:53:24.000000000 +0000 ++++ ./examples/glib/Makefile.am 2012-07-28 07:53:54.000000000 +0000 +@@ -8,7 +8,7 @@ + + dbus_browser_SOURCES = dbus-glue.h dbus-browser.h dbus-browser.cpp $(top_srcdir)/tools/xml.cpp + dbus_browser_LDADD = $(top_builddir)/src/integration/glib/libdbus-c++-glib-1.la \ +- $(top_builddir)/src/libdbus-c++-1.la $(gtkmm_LIBS) ++ $(top_builddir)/src/libdbus-c++-1.la $(gtkmm_LIBS) $(xml_LIBS) + + dbus-glue.h: $(top_srcdir)/data/org.freedesktop.DBus.xml + $(top_builddir)/tools/dbusxx-xml2cpp $^ --proxy=$@ +--- ./test/functional/Test1/Makefile.am.link 2012-07-28 08:10:06.000000000 +0000 ++++ ./test/functional/Test1/Makefile.am 2012-07-28 08:10:36.000000000 +0000 +@@ -34,6 +34,7 @@ + $(RT_LIBS) + + TestApp_CXXFLAGS = \ ++ $(PTHREAD_CFLAGS) \ + -I$(top_srcdir)/include + + AM_CPPFLAGS = @@ -0,0 +1 @@ +e752116f523fa88ef041e63d3dee4de2 libdbus-c++-0.9.0.tar.gz |