Ticket #52257: dbus.diff

File dbus.diff, 7.6 KB (added by RJVB (René Bertin), 8 years ago)
  • devel/dbus/Portfile

    old new  
    77name            dbus
    88conflicts       dbus-devel
    99version         1.10.8
     10revision        1
    1011maintainers     mcalhoun openmaintainer
    1112categories      devel
    1213platforms       darwin
     
    2728#    poll is always broken
    2829#    see https://trac.macports.org/ticket/47741#comment:12 for EXTERNAL authentication
    2930patchfiles      patch-bus-system.conf.in.diff \
    30                 patch-configure.diff
    31 
    32 depends_build       \
    33     port:pkgconfig
     31                patch-improve-systembus.diff \
     32                patch-autogen.sh \
     33                patch-enable-standard-launch2.diff
     34
     35depends_build \
     36                port:pkgconfig \
     37                port:autoconf \
     38                port:automake \
     39                port:libtool
    3440
    3541unset -nocomplain startup_root
    3642if { [variant_isset no_root] } {
     
    7177        set startup_root  ""
    7278    }
    7379}
    74 add_users         ${dbus_user} group=${dbus_group} realname=Message\ Bus
     80add_users       ${dbus_user} group=${dbus_group} realname=Message\ Bus
    7581
    7682depends_lib     port:expat
    7783
     84configure.cmd   ./autogen.sh
     85
    7886configure.args  --disable-doxygen-docs \
    7987                --disable-xml-docs \
    8088                --disable-ducktype-docs \
    8189                --without-x \
    8290                --enable-launchd \
    8391                --with-launchd-agent-dir=${prefix}/Library/LaunchAgents \
     92                --with-launchd-daemon-dir=${prefix}/Library/LaunchDaemons \
     93                --with-session-socket-dir=/tmp \
    8494                --with-dbus-user=${dbus_user} \
    85                 --disable-tests
     95                --disable-tests \
     96                --disable-maintainer-mode \
     97                --disable-dependency-tracking \
     98                --disable-verbose-mode \
     99                --disable-asserts
    86100
    87101set sudo ""
    88102if {![variant_isset no_root]} {
    89103    set sudo "sudo "
    90104}
    91105
     106variant x11 description {Build with support for X11 (*experimental* on OS X!), \
     107        for running a session dbus when working on a remote X11 display} {
     108    # we *can* enable X11 autolaunch, but I have some doubts that's a good idea on OS X
     109    configure.args-replace \
     110                --without-x --with-x
     111    depends_lib-append \
     112                port:xorg-libsm port:xorg-libX11
     113#     patchfiles-append \
     114#                 patch-enable-standard-launch.diff
     115}
     116
     117# the variant for building the documentation is not called 'docs' to avoid propagating
     118# the docs variant to doxygen, which causes a dependency explosion
     119variant documentation description {Build the (doxygen) documentation} {
     120    configure.args-replace \
     121                --disable-doxygen-docs --enable-doxygen-docs
     122    # this is a hack to avoid installing port:doxygen+universal
     123    if {![file exists ${prefix}/bin/doxygen]} {
     124        depends_build-append \
     125                port:doxygen
     126    }
     127}
     128
    92129# These variants are obsolete
    93130# dbus should respect the global variable startupitem.install set in ${prefix}/etc/macports/macports.conf
    94131# See https://guide.macports.org/#reference.startupitems
     
    125162}
    126163
    127164post-patch {
     165    # moved from patch-configure.diff:
     166    reinplace "s|broken_poll=\"no (cross compiling)\"|broken_poll=yes|g" ${worksrcpath}/configure.ac
     167    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/dbus/dbus-sysdeps-util-unix.c
     168
    128169    if { [tbool startupitem.create] } {
    129170        # Disable if installed into startup directory.
    130171        reinplace "s|</array>|</array>\\\n\\\n\\\t<key>Disabled</key>\\\n\\\t<true/>|" \
     
    167208}
    168209
    169210post-destroot {
    170     # Simplify startup script over startupitem.install.
    171     # See #15081
    172     xinstall -d -m 0755 ${destroot}${plistDir}
    173     set plist [open "${destroot}${plistFl}" w 0644]
    174 
    175     puts ${plist} "<?xml version='1.0' encoding='UTF-8'?>"
    176     puts ${plist} "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\""
    177     puts ${plist} "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\" >"
    178     puts ${plist} "<plist version='1.0'>"
    179     puts ${plist} "<dict>"
    180 
    181     puts ${plist} "<key>Label</key><string>org.freedesktop.dbus-system</string>"
    182 
    183     puts ${plist} "<key>ProgramArguments</key>"
    184     puts ${plist} "<array>"
    185     puts ${plist} "\t<string>${prefix}/bin/dbus-daemon</string>"
    186     puts ${plist} "\t<string>--system</string>"
    187     puts ${plist} "\t<string>--nofork</string>"
    188     puts ${plist} "</array>"
    189     if {$macosx_deployment_target eq "10.4"} {
    190         puts ${plist} "<key>OnDemand</key><false/>"
    191     } else {
    192         puts ${plist} "<key>KeepAlive</key><true/>"
    193     }
    194 
    195     if { [tbool startupitem.install] } {
    196         puts ${plist} "<key>Disabled</key><true/>"
    197     }
    198 
    199     puts ${plist} "</dict>"
    200     puts ${plist} "</plist>"
    201 
    202     close ${plist}
     211#     # Simplify startup script over startupitem.install.
     212#     # See #15081
     213    # handled through configure/build/install; see patch-improve-systembus.diff
    203214
    204215    if { [info exists startup_root] } {
    205216        xinstall -d -m 0755 ${destroot}${startup_root}/Library/LaunchDaemons
     
    220231
    221232post-activate {
    222233    file attributes ${prefix}/var/run/dbus -group ${dbus_group} -owner ${dbus_user}
     234    file attributes ${prefix}/libexec/dbus-daemon-launch-helper -owner root
    223235    file attributes ${prefix}/libexec/dbus-daemon-launch-helper -group ${dbus_group}
     236    system "chmod u+s ${prefix}/libexec/dbus-daemon-launch-helper"
    224237
    225238    if { [tbool startupitem.install] && ![variant_isset no_root] } {
    226239        file attributes ${prefix}/Library/LaunchAgents/org.freedesktop.dbus-session.plist -owner root -group wheel
     
    241254    ui_warn "This variant requires circular dependencies and only works if ${name} is already installed"
    242255
    243256    configure.args-replace  --disable-tests --enable-tests
    244     configure.args-append   --without-dbus-glib
    245     depends_build-append      port:glib2
    246     depends_build-append      port:python27 port:dbus-python27 port:py27-gobject port:dbus-python
     257#     configure.args-append   --without-dbus-glib
     258    configure.args-append   --enable-modular-tests \
     259                            --with-test-socket-dir=/tmp
     260    depends_build-append    port:glib2
     261    depends_build-append    port:python27 port:dbus-python27 port:py27-gobject port:py27-gobject3 port:dbus-python
    247262    configure.python        ${prefix}/bin/python2.7
    248263}
    249264
     
    268283############################################################################"
    269284}
    270285
     286# obsolete advice, but keep for reference:
     287# - Add a line to /etc/sudoers (using the visudo Terminal command):
     288# Defaults        env_keep += \"DBUS_LAUNCHD_SESSION_BUS_SOCKET\"
     289
    271290variant no_root conflicts underscore description {Run the DBUS daemon as MacPorts install user.} {
    272291    pre-fetch {
    273292        ###########
     
    277296        # add_users root trashes the root user in the extract phase. See
    278297        # #45737.
    279298        if {${install.user} eq "root" || ${install.group} eq "wheel"} {
    280             ui_error "The DBUS daemon should not be run as root."
     299            ui_error "The DBUS daemon should not be run as root (${install.user} ${install.group})."
    281300            error "Please do not use this variant with your MacPorts configuration."
    282301        }
    283302    }
     
    293312    # This variant allows the user to follow that convention.
    294313}
    295314
     315configure.optflags-append   -g
     316configure.ldflags-append    -g
     317configure.env-append        LDFLAGS=-g STRIP=/bin/echo
     318build.env-append            STRIP=/bin/echo
     319
    296320set cross_opts  "ac_cv_have_abstract_sockets=no"
    297321if {${os.arch} eq "i386"} {
    298322    if { ${os.major} >= 10 } {