source: trunk/dports/net/avahi/Portfile

Last change on this file was 142128, checked in by nicos@…, 21 months ago

avahi: use qt4 PortGroup in the variant (prevents failing with new qt4-mac path)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 142128 2015-11-04 12:18:49Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6PortGroup           gobject_introspection 1.0
7
8name                avahi
9version             0.6.31
10revision            13
11categories          net devel
12maintainers         nomaintainer
13license             LGPL-2.1+
14platforms           darwin
15description         Avahi is an Implementation of the DNS Service Discovery and Multicast DNS \
16                    specifications for Zeroconf Networking.
17
18long_description    ${description} It uses D-Bus for communication between user applications and a \
19                    system daemon. The daemon is used to coordinate application efforts in caching \
20                    replies, necessary to minimize the traffic imposed on networks.
21
22homepage            http://avahi.org/
23master_sites        ${homepage}download/
24
25checksums           rmd160  122f553ee2d43cdd0185540a63a8e1f587bdb08e \
26                    sha256  8372719b24e2dd75de6f59bb1315e600db4fd092805bd1201ed0cb651a2dab48
27
28patch.pre_args      -p1
29patchfiles          patch-avahi-daemon-Makefile.in.diff \
30                    patch-avahi-dnsconfd-Makefile.in.diff \
31                    patch-avahi-utils-Makefile.in.diff \
32                    patch-configure.diff \
33                    patch-initscript-darwin-org.freedesktop.avahi-daemon.plist.in.diff \
34                    patch-initscript-darwin-org.freedesktop.avahi-dnsconfd.plist.in.diff
35
36post-patch {
37# This preprocessor macro causes a lot of things to be undefined inside netinet/in.h system header.
38    reinplace "s/-D_XOPEN_SOURCE=500//" ${worksrcpath}/configure
39    reinplace "s|/System|${destroot}|g" ${worksrcpath}/initscript/darwin/Makefile.in
40
41    # Let avahi build with newer gtk
42    reinplace "s|-DG_DISABLE_DEPRECATED=1||" \
43        ${worksrcpath}/avahi-ui/Makefile.am \
44        ${worksrcpath}/avahi-ui/Makefile.in
45    reinplace "s|-DGDK_DISABLE_DEPRECATED=1||" \
46        ${worksrcpath}/avahi-ui/Makefile.am \
47        ${worksrcpath}/avahi-ui/Makefile.in
48    reinplace "s|-DGTK_DISABLE_DEPRECATED=1||" \
49        ${worksrcpath}/avahi-ui/Makefile.am \
50        ${worksrcpath}/avahi-ui/Makefile.in
51}
52
53depends_build       port:pkgconfig \
54                    port:intltool
55
56depends_lib         port:expat \
57                    port:gdbm \
58                    port:gettext \
59                    port:libdaemon
60
61gobject_introspection yes
62
63set avahiuser       avahi
64
65configure.args      --disable-autoipd \
66                    --disable-qt3 \
67                    --disable-qt4 \
68                    --disable-mono \
69                    --disable-monodoc \
70                    --with-distro=darwin \
71                    --enable-compat-libdns_sd \
72                    --disable-gtk3 \
73                    --disable-xmltoman \
74                    --disable-gtk \
75                    --disable-pygtk \
76                    --disable-tests \
77                    --with-avahi-priv-access-group=${avahiuser}
78
79# __APPLE_USE_RFC_2292 should be removed once avhi is updated to support RFC 3542
80configure.cppflags-append   -L${prefix}/lib -D__APPLE_USE_RFC_2292
81
82post-destroot {
83    xinstall -d -m 0755 ${destroot}${prefix}/etc/LaunchDaemons
84    eval move [glob ${destroot}/Library/LaunchDaemons/*] \
85        ${destroot}${prefix}/etc/LaunchDaemons/
86    # The startupitem.install keyword does not exist in MacPorts < 2.1.
87    if {![info exists startupitem.install]} {
88        set startupitem.install yes
89    }
90    if { ${startupitem.install} != "no" } {
91        xinstall -d -m 0755 ${destroot}/LaunchDaemons
92        ln -s ${prefix}/etc/LaunchDaemons/org.freedesktop.avahi-daemon.plist \
93            ${destroot}/Library/LaunchDaemons/
94        ln -s ${prefix}/etc/LaunchDaemons/org.freedesktop.avahi-dnsconfd.plist \
95            ${destroot}/Library/LaunchDaemons/
96           
97    }
98}
99
100add_users ${avahiuser} group=${avahiuser} realname=Avahi\ Service
101
102post-activate {
103    if {[file exists /System/Library/LaunchDaemons/org.freedesktop.avahi-dnsconfd.plist]} {
104        ui_debug "Removing cruft from versions prior to 0.6.17_2..."
105        delete \
106            /System/Library/LaunchDaemons/org.freedesktop.avahi-dnsconfd.plist \
107            /System/Library/LaunchDaemons/org.freedesktop.avahi-daemon.plist
108    }
109}
110
111variant mono description {Enable Mono support} {
112    depends_lib-append      port:mono \
113                            port:gtk-sharp2
114
115    configure.args-delete   --disable-mono
116
117    post-patch {
118        reinplace {s/\.so\.0/.0.dylib/} ${worksrcpath}/avahi-ui-sharp/avahi-ui-sharp.dll.config.in
119    }
120
121    post-build {
122        # TODO This shouldn't be needed, we need to fix Mono dllmap library path.
123        reinplace -E "s|(target=\")|\\1${prefix}/lib/|" \
124            ${worksrcpath}/avahi-sharp/avahi-sharp.dll.config \
125            ${worksrcpath}/avahi-ui-sharp/avahi-ui-sharp.dll.config
126    }
127}
128
129variant test description {Build tests} {
130    configure.args-delete   --disable-tests
131    configure.args-append   --enable-tests
132    test.run            yes
133    test.target         check
134}
135
136variant gtk description {Build with GTK2} {
137    depends_lib-append      port:libglade2
138
139    configure.args-delete   --disable-gtk
140}
141
142variant gtk3 description {Build with GTK3} {
143    depends_lib-append      port:gtk3
144
145    configure.args-delete   --disable-gtk3
146}
147
148default_variants +gtk +gtk3
149
150variant qt4 description {Build with Qt4} {
151    PortGroup   qt4 1.0
152    configure.args-delete   --disable-qt4
153}
154
155# just use python27 with no python variants
156
157configure.python        ${prefix}/bin/python2.7
158
159depends_lib-append      port:dbus-python27 \
160                        port:py27-gdbm
161
162if [variant_isset gtk] {
163    depends_lib-append      port:py27-pygtk
164    configure.args-delete   --disable-pygtk
165}
166
167variant x11 {
168    require_active_variants gtk2 x11 quartz
169}
170
171variant quartz {
172    require_active_variants gtk2 quartz x11
173}
174
175catch {
176    if {[active_variants gtk2 quartz x11]} {
177        default_variants-append +quartz
178    }
179}
180if {![variant_isset quartz]} {
181    default_variants-append +x11
182}
183
184livecheck.type      regex
185livecheck.url       [lindex ${master_sites} 0]
186livecheck.regex     ${name}-(\[0-9.\]+)\\.tar
Note: See TracBrowser for help on using the repository browser.