aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/dbus
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/dbus
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/dbus')
-rw-r--r--vcpkg/ports/dbus/cmake.dep.patch15
-rw-r--r--vcpkg/ports/dbus/getpeereid.patch26
-rw-r--r--vcpkg/ports/dbus/libsystemd.patch15
-rw-r--r--vcpkg/ports/dbus/pkgconfig.patch21
-rw-r--r--vcpkg/ports/dbus/portfile.cmake93
-rw-r--r--vcpkg/ports/dbus/remove-path.patch12
-rw-r--r--vcpkg/ports/dbus/remove-var-lib-dbus-creation.patch14
-rw-r--r--vcpkg/ports/dbus/vcpkg.json45
8 files changed, 241 insertions, 0 deletions
diff --git a/vcpkg/ports/dbus/cmake.dep.patch b/vcpkg/ports/dbus/cmake.dep.patch
new file mode 100644
index 0000000..ac827f0
--- /dev/null
+++ b/vcpkg/ports/dbus/cmake.dep.patch
@@ -0,0 +1,15 @@
+diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
+index 8cde1ffe0..d4d09f223 100644
+--- a/tools/CMakeLists.txt
++++ b/tools/CMakeLists.txt
+@@ -91,7 +91,9 @@ endif()
+ add_executable(dbus-launch ${dbus_launch_SOURCES})
+ target_link_libraries(dbus-launch ${DBUS_LIBRARIES})
+ if(DBUS_BUILD_X11)
+- target_link_libraries(dbus-launch ${X11_LIBRARIES} )
++ find_package(Threads REQUIRED)
++ target_link_libraries(dbus-launch ${X11_LIBRARIES} ${X11_xcb_LIB} ${X11_Xau_LIB} ${X11_Xdmcp_LIB} Threads::Threads)
++ target_include_directories(dbus-launch PRIVATE ${X11_INCLUDE_DIR})
+ endif()
+ install(TARGETS dbus-launch ${INSTALL_TARGETS_DEFAULT_ARGS})
+
diff --git a/vcpkg/ports/dbus/getpeereid.patch b/vcpkg/ports/dbus/getpeereid.patch
new file mode 100644
index 0000000..5cd2309
--- /dev/null
+++ b/vcpkg/ports/dbus/getpeereid.patch
@@ -0,0 +1,26 @@
+diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake
+index b7f3702..e2336ba 100644
+--- a/cmake/ConfigureChecks.cmake
++++ b/cmake/ConfigureChecks.cmake
+@@ -51,6 +51,7 @@ check_symbol_exists(closefrom "unistd.h" HAVE_CLOSEFROM) #
+ check_symbol_exists(environ "unistd.h" HAVE_DECL_ENVIRON)
+ check_symbol_exists(fstatfs "sys/vfs.h" HAVE_FSTATFS)
+ check_symbol_exists(getgrouplist "grp.h" HAVE_GETGROUPLIST) # dbus-sysdeps.c
++check_symbol_exists(getpeereid "sys/types.h;unistd.h" HAVE_GETPEEREID) # dbus-sysdeps.c,
+ check_symbol_exists(getpeerucred "ucred.h" HAVE_GETPEERUCRED) # dbus-sysdeps.c, dbus-sysdeps-win.c
+ check_symbol_exists(getpwnam_r "errno.h;pwd.h" HAVE_GETPWNAM_R) # dbus-sysdeps-util-unix.c
+ check_symbol_exists(getrandom "sys/random.h" HAVE_GETRANDOM)
+diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake
+index 77fc19c..2f25643 100644
+--- a/cmake/config.h.cmake
++++ b/cmake/config.h.cmake
+@@ -140,6 +140,9 @@
+ /* Define to 1 if you have getgrouplist */
+ #cmakedefine HAVE_GETGROUPLIST 1
+
++/* Define to 1 if you have getpeereid */
++#cmakedefine HAVE_GETPEEREID 1
++
+ /* Define to 1 if you have getpeerucred */
+ #cmakedefine HAVE_GETPEERUCRED 1
+
diff --git a/vcpkg/ports/dbus/libsystemd.patch b/vcpkg/ports/dbus/libsystemd.patch
new file mode 100644
index 0000000..74193dc
--- /dev/null
+++ b/vcpkg/ports/dbus/libsystemd.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d3ec71b..932066a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -141,6 +141,10 @@ if(DBUS_LINUX)
+ if(ENABLE_SYSTEMD AND SYSTEMD_FOUND)
+ set(DBUS_BUS_ENABLE_SYSTEMD ON)
+ set(HAVE_SYSTEMD ${SYSTEMD_FOUND})
++ pkg_check_modules(SYSTEMD libsystemd IMPORTED_TARGET)
++ set(SYSTEMD_LIBRARIES PkgConfig::SYSTEMD CACHE INTERNAL "")
++ else()
++ set(SYSTEMD_LIBRARIES "" CACHE INTERNAL "")
+ endif()
+ option(ENABLE_USER_SESSION "enable user-session semantics for session bus under systemd" OFF)
+ set(DBUS_ENABLE_USER_SESSION ${ENABLE_USER_SESSION})
diff --git a/vcpkg/ports/dbus/pkgconfig.patch b/vcpkg/ports/dbus/pkgconfig.patch
new file mode 100644
index 0000000..6358148
--- /dev/null
+++ b/vcpkg/ports/dbus/pkgconfig.patch
@@ -0,0 +1,21 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index caef738..b878f42 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -724,11 +724,11 @@ add_custom_target(help-options
+ #
+ if(DBUS_ENABLE_PKGCONFIG)
+ set(PLATFORM_LIBS pthread ${LIBRT})
+- if(PKG_CONFIG_FOUND)
+- # convert lists of link libraries into -lstdc++ -lm etc..
+- foreach(LIB ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
+- set(LIBDBUS_LIBS "${LIBDBUS_LIBS} -l${LIB}")
+- endforeach()
++ if(1)
++ set(LIBDBUS_LIBS "${CMAKE_THREAD_LIBS_INIT}")
++ if(LIBRT)
++ string(APPEND LIBDBUS_LIBS " -lrt")
++ endif()
+ set(original_prefix "${CMAKE_INSTALL_PREFIX}")
+ if(DBUS_RELOCATABLE)
+ set(pkgconfig_prefix "\${pcfiledir}/../..")
diff --git a/vcpkg/ports/dbus/portfile.cmake b/vcpkg/ports/dbus/portfile.cmake
new file mode 100644
index 0000000..3ddd2e4
--- /dev/null
+++ b/vcpkg/ports/dbus/portfile.cmake
@@ -0,0 +1,93 @@
+vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO dbus/dbus
+ REF "dbus-${VERSION}"
+ SHA512 8ad3ab55bf6e2bbe6ff871302c2840c0cb82b4ec785b05f146c577ca1e931825084012ac90251e28c30e44d111e5ca5711b29349f4f0e68a09ba49392e63ac89
+ HEAD_REF master
+ PATCHES
+ cmake.dep.patch
+ pkgconfig.patch
+ getpeereid.patch # missing check from configure.ac
+ libsystemd.patch
+ remove-path.patch
+ remove-var-lib-dbus-creation.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS options
+ FEATURES
+ systemd ENABLE_SYSTEMD
+ x11 DBUS_BUILD_X11
+ x11 CMAKE_REQUIRE_FIND_PACKAGE_X11
+)
+
+unset(ENV{DBUSDIR})
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DDBUS_BUILD_TESTS=OFF
+ -DDBUS_ENABLE_DOXYGEN_DOCS=OFF
+ -DDBUS_ENABLE_XML_DOCS=OFF
+ -DDBUS_INSTALL_SYSTEM_LIBS=OFF
+ #-DDBUS_SERVICE=ON
+ -DDBUS_WITH_GLIB=OFF
+ -DTHREADS_PREFER_PTHREAD_FLAG=ON
+ -DXSLTPROC_EXECUTABLE=FALSE
+ "-DCMAKE_INSTALL_SYSCONFDIR=${CURRENT_PACKAGES_DIR}/etc/${PORT}"
+ "-DWITH_SYSTEMD_SYSTEMUNITDIR=lib/systemd/system"
+ "-DWITH_SYSTEMD_USERUNITDIR=lib/systemd/user"
+ ${options}
+ OPTIONS_RELEASE
+ -DDBUS_DISABLE_ASSERT=OFF
+ -DDBUS_ENABLE_STATS=OFF
+ -DDBUS_ENABLE_VERBOSE_MODE=OFF
+ MAYBE_UNUSED_VARIABLES
+ DBUS_BUILD_X11
+ DBUS_WITH_GLIB
+ ENABLE_SYSTEMD
+ THREADS_PREFER_PTHREAD_FLAG
+ WITH_SYSTEMD_SYSTEMUNITDIR
+ WITH_SYSTEMD_USERUNITDIR
+)
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(PACKAGE_NAME "DBus1" CONFIG_PATH "lib/cmake/DBus1")
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/debug/var/"
+ "${CURRENT_PACKAGES_DIR}/etc"
+ "${CURRENT_PACKAGES_DIR}/share/dbus-1/services"
+ "${CURRENT_PACKAGES_DIR}/share/dbus-1/session.d"
+ "${CURRENT_PACKAGES_DIR}/share/dbus-1/system-services"
+ "${CURRENT_PACKAGES_DIR}/share/dbus-1/system.d"
+ "${CURRENT_PACKAGES_DIR}/share/dbus-1/system.conf"
+ "${CURRENT_PACKAGES_DIR}/share/dbus-1/system.conf"
+ "${CURRENT_PACKAGES_DIR}/share/doc"
+ "${CURRENT_PACKAGES_DIR}/var"
+)
+
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/dbus-1/session.conf" "<include ignore_missing=\"yes\">${CURRENT_PACKAGES_DIR}/etc/dbus/dbus-1/session.conf</include>" "")
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/dbus-1/session.conf" "<includedir>${CURRENT_PACKAGES_DIR}/etc/dbus/dbus-1/session.d</includedir>" "")
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/dbus-1/session.conf" "<include ignore_missing=\"yes\">${CURRENT_PACKAGES_DIR}/etc/dbus/dbus-1/session-local.conf</include>" "")
+
+set(TOOLS daemon launch monitor run-session send test-tool update-activation-environment)
+if(VCPKG_TARGET_IS_WINDOWS)
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/bin/dbus-env.bat" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/dbus-env.bat")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/dbus-env.bat" "${CURRENT_PACKAGES_DIR}" "%~dp0/../..")
+else()
+ list(APPEND TOOLS cleanup-sockets uuidgen)
+endif()
+list(TRANSFORM TOOLS PREPEND "dbus-" )
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ vcpkg_copy_tools(TOOL_NAMES ${TOOLS} SEARCH_DIR ${CURRENT_PACKAGES_DIR}/debug/bin DESTINATION "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}")
+endif()
+vcpkg_copy_tools(TOOL_NAMES ${TOOLS} AUTO_CLEAN)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/dbus/remove-path.patch b/vcpkg/ports/dbus/remove-path.patch
new file mode 100644
index 0000000..691cdea
--- /dev/null
+++ b/vcpkg/ports/dbus/remove-path.patch
@@ -0,0 +1,12 @@
+diff --git a/bus/CMakeLists.txt b/bus/CMakeLists.txt
+index e464f60..fc991f4 100644
+--- a/bus/CMakeLists.txt
++++ b/bus/CMakeLists.txt
+@@ -113,7 +113,6 @@ if(NOT WIN32)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/legacy-config/system.conf DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1)
+ install(DIRECTORY DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/system.d)
+ install(DIRECTORY DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/system-services)
+- install(DIRECTORY DESTINATION ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run/dbus)
+ endif()
+
+ if(DBUS_SERVICE)
diff --git a/vcpkg/ports/dbus/remove-var-lib-dbus-creation.patch b/vcpkg/ports/dbus/remove-var-lib-dbus-creation.patch
new file mode 100644
index 0000000..6309546
--- /dev/null
+++ b/vcpkg/ports/dbus/remove-var-lib-dbus-creation.patch
@@ -0,0 +1,14 @@
+diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
+index 5caf5de5..d8124818 100644
+--- a/tools/CMakeLists.txt
++++ b/tools/CMakeLists.txt
+@@ -130,9 +130,6 @@ if(NOT WIN32)
+ install(TARGETS dbus-uuidgen ${INSTALL_TARGETS_DEFAULT_ARGS})
+ endif()
+
+-# create the /var/lib/dbus directory for dbus-uuidgen
+-install(DIRECTORY DESTINATION ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/dbus)
+-
+ set(EXAMPLES_SCRIPTS
+ GetAllMatchRules.py
+ )
diff --git a/vcpkg/ports/dbus/vcpkg.json b/vcpkg/ports/dbus/vcpkg.json
new file mode 100644
index 0000000..afd561f
--- /dev/null
+++ b/vcpkg/ports/dbus/vcpkg.json
@@ -0,0 +1,45 @@
+{
+ "name": "dbus",
+ "version": "1.16.2",
+ "port-version": 2,
+ "description": "D-Bus specification and reference implementation, including libdbus and dbus-daemon",
+ "homepage": "https://gitlab.freedesktop.org/dbus/dbus",
+ "license": "AFL-2.1 OR GPL-2.0-or-later",
+ "supports": "!uwp & !staticcrt & !android & !ios",
+ "dependencies": [
+ "expat",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ {
+ "name": "systemd",
+ "platform": "linux"
+ }
+ ],
+ "features": {
+ "systemd": {
+ "description": "Build with systemd at_console support",
+ "supports": "linux",
+ "dependencies": [
+ {
+ "name": "libsystemd",
+ "platform": "linux"
+ }
+ ]
+ },
+ "x11": {
+ "description": "Build with X11 autolaunch support",
+ "supports": "!windows",
+ "dependencies": [
+ "libx11"
+ ]
+ }
+ }
+}