Dbus version 1.2.16 - How to Download and Install on Mac OS X
Sunday the 22nd of November, 2009

    version 1.2.16

      View the most recent changes for the dbus port at: dbus.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for dbus.
      The raw portfile for dbus 1.2.16 is located here:
      http://dbus.darwinports.com/dports/devel/dbus/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/dbus


      # -*- 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
      The dbus Portfile 59742 2009-10-21 15:01:41Z jmr macports.org $

      PortSystem 1.0
      PortGroup muniversal 1.0

      Name: dbus
      Version: 1.2.16
      Revision: 1
      Maintainers: mcalhoun openmaintainer
      Category: devel
      Platform: darwin
      Description: A message bus system, a simple way for applications to talk to one another.

      Long Description: ${description}

      Homepage: http://www.freedesktop.org/Software/dbus
      Master Sites: http://dbus.freedesktop.org/releases/dbus

      Checksums: md5 c7a47b851ebe02f6726b65b78d1b730b sha1 28aa5c8839e60d82eb9ce934e3e244abdda913f7 rmd160 7141c483dd4f40c9f7bbfe4cc646d555193a3b08

      # There is a proposal to use launchd with dbus (see https://bugs.freedesktop.org/show_bug.cgi?id=14259).
      Patch Files: 0001-make-session-bus-listen-tag-configurable.patch 0002-add-launchd-implementation.patch 0003-look-up-DISPLAY-from-launchd-if-not-initialized.patch 0004-enable-launchd.patch 0005-dont-dup-closed-stdin.patch
      patch.pre_args -p1

      depends_build port:pkgconfig

      set dbus_user messagebus
      set dbus_group messagebus
      set startup_root ""

      depends_lib port:expat

      use_autoreconf yes

      configure.args --disable-doxygen-docs --disable-xml-docs --without-x --enable-launchd --with-launchd-agent-dir=${prefix}/Library/LaunchAgents

      pre-configure {
      # Value must be set in pre-configure because dbus_user may change in variant.
      configure.args-append --with-dbus-user=${dbus_user}
      }

      post-patch {
      reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/dbus/dbus-sysdeps-unix.c
      reinplace {s|broken_poll="no (cross compiling)"|broken_poll=yes|} ${worksrcpath}/configure

      if { ! [variant_isset no_startupitem] } {
      # Disable if installed into startup directory.
      reinplace "s||\\\n\\\n\\\tDisabled\\\n\\\t|" ${worksrcpath}/bus/org.freedesktop.dbus-session.plist.in
      }

      if { ${os.major} == 9 } {
      # Allow OnDemand for Leopard.
      reinplace {s|||} ${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

      set plistDir ${prefix}/Library/LaunchDaemons
      set plistFl ${plistDir}/org.freedesktop.dbus-system.plist

      # 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.create.
      # See http://trac.macports.org/ticket/15081
      xinstall -d -m 0755 ${destroot}${plistDir}
      set plist [open "${destroot}${plistFl}" w 0644]

      puts ${plist} ""
      puts ${plist} " puts ${plist} "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\" >"
      puts ${plist} ""
      puts ${plist} ""

      puts ${plist} "Labelorg.freedesktop.dbus-system"

      puts ${plist} "ProgramArguments"
      puts ${plist} ""
      puts ${plist} "\t${prefix}/bin/dbus-daemon"
      puts ${plist} "\t--system"
      puts ${plist} "\t--nofork"
      puts ${plist} "
      "

      puts ${plist} "OnDemand"

      if { ! [variant_isset no_startupitem] } {
      puts ${plist} "Disabled"
      }

      puts ${plist} "
      "
      puts ${plist} "
      "

      close ${plist}

      if { ! [variant_isset no_startupitem] } {
      xinstall -d -m 0755 ${destroot}${startup_root}/Library/LaunchDaemons
      xinstall -d -m 0755 ${destroot}${startup_root}/Library/LaunchAgents
      ln -s ${plistFl} ${destroot}${startup_root}/Library/LaunchDaemons
      ln -s ${prefix}/Library/LaunchAgents/org.freedesktop.dbus-session.plist ${destroot}${startup_root}/Library/LaunchAgents
      }

      system "env DYLD_LIBRARY_PATH=${destroot}${prefix}/lib ${destroot}${prefix}/bin/dbus-uuidgen --ensure=${destroot}${prefix}/var/lib/dbus/machine-id"
      }

      pre-activate {
      addgroup ${dbus_group}
      adduser ${dbus_user} gid=[existsgroup ${dbus_group}] realname=Message\ Bus

      if { [file exists ${prefix}/var/lib/dbus/machine-id] } {
      # See http://trac.macports.org/ticket/19234
      delete ${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}

      if { ![variant_isset no_startupitem] } {
      if { ! [variant_isset no_root] } {
      set sudo "sudo "
      file attributes /Library/LaunchAgents/org.freedesktop.dbus-session.plist -owner root -group wheel
      file attributes /Library/LaunchDaemons/[file tail ${plistFl}] -owner root -group wheel
      } else {
      set sudo ""
      }

      ui_msg "#################################################################################################"
      ui_msg "# Startup items have been generated that will aid in"
      ui_msg "# starting ${name} with launchd. They are disabled"
      ui_msg "# by default. Execute the following command to start them,"
      ui_msg "# and to cause it to launch at startup:"
      ui_msg "#"
      ui_msg "# ${sudo}launchctl load -w ${startup_root}/Library/LaunchDaemons/[file tail ${plistFl}]"
      ui_msg "# launchctl load -w ${startup_root}/Library/LaunchAgents/org.freedesktop.dbus-session.plist"
      ui_msg "##################################################################################################"
      }
      }

      Variant: test description {enable tests} {
      configure.args-append --enable-tests
      }

      Variant: no_startupitem description {Do not install startup files.} {}

      Variant: no_root description {Run the DBUS daemon as MacPorts install user.} {
      pre-fetch {
      if { ${install.user}=="root" || ${install.group}=="wheel" } {
      ui_error "The DBUS daemon should not be run as root."
      error "Please do not use this variant with your MacPorts configuration."
      }
      }

      set dbus_user ${install.user}
      set dbus_group ${install.group}
      set startup_root [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]

      # Files are installed into user's startup directory.
      if { ![variant_isset no_staruptitem] } {
      destroot.violate_mtree yes
      }
      }

      set cross_opts "ac_cv_have_abstract_sockets=no NM='/usr/bin/nm -p'"
      if { ${os.arch}=="i386" } {
      if { ${os.major} >= 10 } {
      set merger_configure_env(ppc) ${cross_opts}
      } else {
      set merger_configure_env(ppc) "NM='/usr/bin/nm -p'"
      }
      set merger_configure_env(ppc64) ${cross_opts}
      } else {
      set merger_configure_env(i386) ${cross_opts}
      set merger_configure_env(x86_64) ${cross_opts}
      }

      livecheck.type regex
      livecheck.url [lindex ${master_sites} 0]
      livecheck.regex {dbus-(\d+\.\d*[02468](\.\d+)*)\.tar}

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/dbus
      % sudo port install dbus
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching dbus
      ---> Verifying checksum for dbus
      ---> Extracting dbus
      ---> Configuring dbus
      ---> Building dbus with target all
      ---> Staging dbus into destroot
      ---> Installing dbus
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using dbus with these commands:
      %  man dbus
      % apropos dbus
      % which dbus
      % locate dbus

     Where to find more information:

    Darwin Ports



    Lightbox this page.