# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup muniversal 1.0
name dbus
version 1.14.10
revision 1
checksums rmd160 ea365b427b92b1a50746766b84002b9569533aa5 \
sha256 ba1f21d2bd9d339da2d4aa8780c09df32fea87998b73da24f49ab9df1e36a50f \
size 1372328
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
categories devel
license {AFL-2.1 GPL-2+}
description A message bus system, a simple way for applications to talk to one another.
long_description \
{*}${description}
homepage https://www.freedesktop.org/wiki/Software/dbus/
master_sites https://dbus.freedesktop.org/releases/dbus/
use_xz yes
# See r68276
# For configure
# see https://trac.macports.org/ticket/47741#comment:12 for EXTERNAL authentication
patchfiles patch-bus-system.conf.in.diff \
patch-configure.diff \
patch-dbus-server-launchd.diff \
patch-dbus-sysdeps-unix.diff
# see https://bugs.freedesktop.org/show_bug.cgi?id=9449
if {$macosx_deployment_target eq "10.4"} {
patchfiles-append patch-tiger-org.freedesktop.dbus-session.plist.in.diff
} else {
patchfiles-append patch-org.freedesktop.dbus-session.plist.in.diff
}
depends_build \
port:pkgconfig
if {[getuid] != 0} {
set dbus_user ${install.user}
set dbus_group ${install.group}
} else {
if {${os.platform} eq "darwin" && ${os.major} >= 9} {
set dbus_user _messagebus
} else {
set dbus_user messagebus
}
set dbus_group ${dbus_user}
add_users ${dbus_user} group=${dbus_group} realname=Message\ Bus
}
set daemon_uniquename org.freedesktop.dbus-system
set agent_uniquename org.freedesktop.dbus-session
startupitem.type launchd
startupitem.create no
startupitems name dbus-system \
location LaunchDaemons \
uniquename ${daemon_uniquename} \
plist ${daemon_uniquename}.plist \
name dbus-session \
location LaunchAgents \
uniquename ${agent_uniquename} \
plist ${agent_uniquename}.plist
depends_lib port:expat
configure.args --disable-doxygen-docs \
--disable-xml-docs \
--disable-ducktype-docs \
--without-x \
--enable-launchd \
--with-launchd-agent-dir=${prefix}/etc/LaunchAgents/${agent_uniquename} \
--with-dbus-user=${dbus_user} \
--disable-tests
post-patch {
# Make agent initially disabled.
reinplace "s||\\\n\\\n\\\tDisabled\\\n\\\t|" \
${worksrcpath}/bus/org.freedesktop.dbus-session.plist.in
}
use_parallel_build yes
test.run yes
test.target check
pre-test {
if {![variant_isset test]} {
ui_error "test variant must be activated to enable test support."
error "Please enable test variant."
}
}
destroot.keepdirs \
${destroot}${prefix}/share/dbus-1/services \
${destroot}${prefix}/var/run/dbus \
${destroot}${prefix}/etc/dbus-1/system.d \
${destroot}${prefix}/etc/dbus-1/session.d
# universal_archs_to_use might not be set before pre-fetch.
pre-destroot {
global merger_dont_diff merger_configure_env
# PortGroup muniversal has difficulty merging three files.
if {[info exists universal_archs_to_use] && [llength ${universal_archs_to_use}] == 3} {
set merger_dont_diff "${prefix}/lib/dbus-1.0/include/dbus/dbus-arch-deps.h"
}
}
post-destroot {
# Simplify startup script over startupitem.install.
# See #15081
xinstall -d -m 0755 ${destroot}${prefix}/etc/LaunchDaemons/${daemon_uniquename}
set plist [open "${destroot}${prefix}/etc/LaunchDaemons/${daemon_uniquename}/${daemon_uniquename}.plist" w 0644]
puts ${plist} ""
puts ${plist} ""
puts ${plist} ""
puts ${plist} ""
puts ${plist} "Label${daemon_uniquename}"
puts ${plist} "ProgramArguments"
puts ${plist} ""
puts ${plist} "\t${prefix}/bin/dbus-daemon"
puts ${plist} "\t--system"
puts ${plist} "\t--nofork"
puts ${plist} ""
if {$macosx_deployment_target eq "10.4"} {
puts ${plist} "OnDemand"
} else {
puts ${plist} "KeepAlive"
}
puts ${plist} "Disabled"
puts ${plist} ""
puts ${plist} ""
close ${plist}
if {${startupitem.install} && [geteuid] == 0} {
xinstall -d -m 0755 ${destroot}/Library/LaunchDaemons
xinstall -d -m 0755 ${destroot}/Library/LaunchAgents
ln -s ${prefix}/etc/LaunchDaemons/${daemon_uniquename}/${daemon_uniquename}.plist ${destroot}/Library/LaunchDaemons
ln -s ${prefix}/etc/LaunchAgents/${agent_uniquename}/${agent_uniquename}.plist ${destroot}/Library/LaunchAgents
} else {
ln -sf ${prefix}/etc/LaunchDaemons/${daemon_uniquename}/${daemon_uniquename}.plist ${destroot}${prefix}/etc/LaunchDaemons
ln -sf ${prefix}/etc/LaunchAgents/${agent_uniquename}/${agent_uniquename}.plist ${destroot}${prefix}/etc/LaunchAgents
}
system "env DYLD_LIBRARY_PATH=${destroot}${prefix}/lib ${destroot}${prefix}/bin/dbus-uuidgen --ensure=${destroot}${prefix}/var/lib/dbus/machine-id"
}
post-activate {
file attributes ${prefix}/var/run/dbus -group ${dbus_group} -owner ${dbus_user}
file attributes ${prefix}/libexec/dbus-daemon-launch-helper -group ${dbus_group}
}
# XXX Building with tests enabled causes dbus to link with dbus-glib,
# which it shouldn't do because that port depends on this one: see #30088
variant test description {enable tests (Only Works if dbus is Already Installed)} {
ui_warn "This variant requires circular dependencies and only works if ${name} is already installed"
configure.args-replace --disable-tests \
--enable-tests
configure.args-append --without-dbus-glib
depends_build-append path:lib/pkgconfig/glib-2.0.pc:glib2
depends_build-append port:python27 port:dbus-python27 port:py27-gobject3 port:dbus-python
configure.python ${prefix}/bin/python2.7
}
set cross_opts "ac_cv_have_abstract_sockets=no"
if {${os.arch} eq "i386"} {
if { ${os.major} >= 10 } {
set merger_configure_env(ppc) ${cross_opts}
}
set merger_configure_env(ppc64) ${cross_opts}
} else {
set merger_configure_env(i386) ${cross_opts}
set merger_configure_env(x86_64) ${cross_opts}
}
# see https://trac.macports.org/ticket/50619
# see https://trac.macports.org/ticket/58436
if {${os.major} < 9} {
depends_build-append port:gmake
configure.env-append MAKE=${prefix}/bin/gmake
build.cmd ${prefix}/bin/gmake
}
livecheck.type regex
livecheck.url [lindex ${master_sites} 0]
livecheck.regex {dbus-(\d+\.\d*[02468](\.\d+)*)\.tar}