Makefile 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. # no RCS Id here, please
  2. ONLY_FOR_ARCHS-mono= ${MONO_ARCHS}
  3. COMMENT-main= framework for Multicast DNS Service Discovery
  4. COMMENT-gtk= gtk+2 avahi-ui libraries
  5. COMMENT-gtk3= gtk+3 avahi-ui libraries
  6. COMMENT-gui= GUI client utilities for avahi
  7. COMMENT-mono= mono (.NET) bindings for avahi
  8. COMMENT-qt3= qt3 bindings for avahi
  9. COMMENT-qt4= qt4 bindings for avahi
  10. COMMENT-ui= common avahi-ui header for gtk+2 and gtk+3
  11. V= 0.6.31
  12. DISTNAME= avahi-${V}
  13. CATEGORIES= net devel portcheck
  14. PKGNAME-main= avahi-${V}
  15. PKGNAME-gtk= avahi-gtk-${V}
  16. PKGNAME-gtk3= avahi-gtk3-${V}
  17. PKGNAME-gui= avahi-gui-${V}
  18. PKGNAME-mono= mono-avahi-${V}
  19. PKGNAME-qt3= avahi-qt3-${V}
  20. PKGNAME-qt4= avahi-qt4-${V}
  21. PKGNAME-ui= avahi-ui-${V}
  22. REVISION-main= 10
  23. REVISION-gtk= 5
  24. REVISION-mono= 2
  25. REVISION-qt3= 2
  26. REVISION-qt4= 3
  27. REVISION-ui= 3
  28. MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
  29. SHARED_LIBS += avahi-common 0.0 # .8.0
  30. SHARED_LIBS += avahi-core 0.0 # .5.5
  31. SHARED_LIBS += avahi-client 5.0 # .5.4
  32. SHARED_LIBS += avahi-glib 0.3 # .1.1
  33. SHARED_LIBS += avahi-gobject 0.0 # .0.1
  34. SHARED_LIBS += howl 9.9 \
  35. dns_sd 0.0 # .1.0
  36. HOMEPAGE= http://www.avahi.org/
  37. # LGPLv2.1
  38. PERMIT_PACKAGE_CDROM= Yes
  39. MASTER_SITES= ${HOMEPAGE}/download/
  40. PSEUDO_FLAVORS= no_gui no_mono no_qt3 no_qt4 bootstrap
  41. FLAVOR?= no_gui no_mono no_qt3 no_qt4 bootstrap
  42. MULTI_PACKAGES= -main -mono -qt3 -qt4 -gui -gtk -gtk3 -ui
  43. MODULES= devel/gettext \
  44. textproc/intltool
  45. BUILD_DEPENDS= converters/xmltoman \
  46. devel/gobject-introspection \
  47. WANTLIB-main= c expat glib-2.0 gobject-2.0 pcre pthread \
  48. gdbm daemon dbus-1 ffi \
  49. ${MODGETTEXT_WANTLIB}
  50. LIB_DEPENDS-main= ${MODGETTEXT_LIB_DEPENDS} \
  51. devel/glib2 \
  52. databases/gdbm \
  53. devel/libdaemon>=0.14 \
  54. x11/dbus
  55. .include <bsd.port.arch.mk>
  56. .if !${BUILD_PACKAGES:M-gui}
  57. # all these vanish together
  58. BUILD_PACKAGES := ${BUILD_PACKAGES:N-mono:N-gtk:N-gtk3:N-ui}
  59. .endif
  60. WANTLIB-mono= # empty
  61. .if ${BUILD_PACKAGES:M-mono}
  62. MODULES+= lang/mono
  63. BUILD_DEPENDS+= ${MODMONO_BUILD_DEPENDS} \
  64. x11/mono-gtk2
  65. RUN_DEPENDS-mono= ${MODMONO_RUN_DEPENDS} \
  66. ${BUILD_PKGPATH},-gtk \
  67. x11/mono-gtk2
  68. LIB_DEPENDS-mono= # empty
  69. .else
  70. CONFIGURE_ARGS+= --disable-mono \
  71. --disable-monodoc
  72. .endif
  73. WANTLIB-gtk= X11 Xcomposite Xcursor Xdamage Xext Xfixes \
  74. Xi Xinerama Xrandr Xrender atk-1.0 cairo dbus-1 \
  75. expat fontconfig freetype gdbm gdk-x11-2.0 gthread-2.0 \
  76. gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0 \
  77. gobject-2.0 gtk-x11-2.0 m pango-1.0 pangocairo-1.0 \
  78. pangoft2-1.0 pcre pixman-1 png pthread pthread-stubs xcb z \
  79. xcb-render avahi-client avahi-common xcb-shm \
  80. avahi-glib ffi harfbuzz graphite2 \
  81. ${MODGETTEXT_WANTLIB}
  82. WANTLIB-gtk3 += X11 Xcomposite Xcursor Xdamage Xext Xfixes
  83. WANTLIB-gtk3 += Xi Xinerama Xrandr Xrender atk-1.0 avahi-client
  84. WANTLIB-gtk3 += avahi-common avahi-glib cairo cairo-gobject
  85. WANTLIB-gtk3 += dbus-1 expat fontconfig freetype gdbm gdk-3 gdk_pixbuf-2.0
  86. WANTLIB-gtk3 += gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0
  87. WANTLIB-gtk3 += gtk-3 m pango-1.0 pangocairo-1.0 pangoft2-1.0
  88. WANTLIB-gtk3 += pcre pixman-1 png pthread pthread-stubs xcb xcb-render
  89. WANTLIB-gtk3 += xcb-shm z ffi ${MODGETTEXT_WANTLIB}
  90. WANTLIB-gtk3 += ICE SM atk-bridge-2.0 atspi harfbuzz
  91. WANTLIB-gtk3 += graphite2
  92. WANTLIB-gui += X11 Xcomposite Xcursor Xdamage Xext Xfixes
  93. WANTLIB-gui += Xi Xinerama Xrandr Xrender atk-1.0 avahi-client
  94. WANTLIB-gui += avahi-common avahi-core avahi-glib avahi-ui-gtk3 c
  95. WANTLIB-gui += cairo cairo-gobject dbus-1 expat fontconfig freetype
  96. WANTLIB-gui += gdbm gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0
  97. WANTLIB-gui += gobject-2.0 gthread-2.0 gtk-3 m pango-1.0
  98. WANTLIB-gui += pangocairo-1.0 pangoft2-1.0 pcre pixman-1 png pthread
  99. WANTLIB-gui += pthread-stubs xcb xcb-render xcb-shm z ffi
  100. WANTLIB-gui += ICE SM atk-bridge-2.0 atspi harfbuzz
  101. WANTLIB-gui += graphite2
  102. WANTLIB-gui += ${MODGETTEXT_WANTLIB}
  103. WANTLIB-ui= # empty
  104. .if ${BUILD_PACKAGES:M-gui}
  105. ### common
  106. MODULES+= lang/python
  107. BUILD_DEPENDS+= lang/python/${MODPY_VERSION},-gdbm \
  108. x11/py-gtk2 \
  109. x11/dbus-python
  110. ### -gtk
  111. SHARED_LIBS += avahi-ui 0.0 # .1.0
  112. LIB_DEPENDS-gtk= ${MODGETTEXT_LIB_DEPENDS} \
  113. x11/gtk+2 \
  114. ${BUILD_PKGPATH}
  115. RUN_DEPENDS-gtk= ${MODGETTEXT_RUN_DEPENDS} \
  116. ${BUILD_PKGPATH},-ui
  117. ### -gtk3
  118. SHARED_LIBS += avahi-ui-gtk3 0.0 # 1.4
  119. LIB_DEPENDS-gtk3= ${MODGETTEXT_LIB_DEPENDS} \
  120. x11/gtk+3 \
  121. ${BUILD_PKGPATH}
  122. RUN_DEPENDS-gtk3= ${MODGETTEXT_RUN_DEPENDS} \
  123. ${BUILD_PKGPATH},-ui
  124. ### -gui
  125. LIB_DEPENDS-gui= ${MODGETTEXT_LIB_DEPENDS} \
  126. ${BUILD_PKGPATH},-gtk3
  127. RUN_DEPENDS-gui= ${MODGETTEXT_RUN_DEPENDS} \
  128. ${MODPY_RUN_DEPENDS} \
  129. lang/python/${MODPY_VERSION},-gdbm \
  130. x11/py-gtk2 \
  131. x11/dbus-python \
  132. devel/py-twisted/web \
  133. devel/desktop-file-utils
  134. ### -ui
  135. LIB_DEPENDS-ui= # empty
  136. RUN_DEPENDS-ui= ${BUILD_PKGPATH}
  137. .else
  138. CONFIGURE_ARGS+= --disable-gtk \
  139. --disable-gtk3 \
  140. --disable-python \
  141. --disable-pygtk \
  142. --disable-python-dbus
  143. .endif
  144. WANTLIB-qt3= GL ICE SM X11 Xcursor Xext Xfixes Xft Xi \
  145. Xinerama Xmu Xrandr Xrender Xt expat fontconfig \
  146. freetype jpeg lcms m mng png pthread xcb z \
  147. avahi-common ${LIBCXX} ${MODQT3_WANTLIB} ${MODGETTEXT_WANTLIB} \
  148. Xdamage Xxf86vm drm pthread-stubs
  149. .if ${BUILD_PACKAGES:M-qt3}
  150. SHARED_LIBS += avahi-qt3 0.0 # .1.2
  151. MODULES+= x11/qt3
  152. LIB_DEPENDS-qt3= ${MODGETTEXT_LIB_DEPENDS} \
  153. ${MODQT3_LIB_DEPENDS} \
  154. ${BUILD_PKGPATH}
  155. .else
  156. CONFIGURE_ARGS+= --disable-qt3
  157. .endif
  158. WANTLIB-qt4= QtCore avahi-common m ${LIBCXX} ${MODGETTEXT_WANTLIB} \
  159. pthread
  160. .if ${BUILD_PACKAGES:M-qt4}
  161. SHARED_LIBS += avahi-qt4 0.0 # .1.2
  162. MODULES+= x11/qt4
  163. LIB_DEPENDS-qt4= ${MODGETTEXT_LIB_DEPENDS} \
  164. x11/qt4 \
  165. ${BUILD_PKGPATH}
  166. .else
  167. CONFIGURE_ARGS+= --disable-qt4
  168. .endif
  169. USE_GMAKE= Yes
  170. MODPY_RUNDEP= No
  171. MODMONO_DEPS= No
  172. CFLAGS+= -D_BSD_SOURCE
  173. CONFIGURE_STYLE=gnu
  174. CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
  175. LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" \
  176. PTHREAD_CFLAGS="-pthread" \
  177. PTHREAD_LIBS="-pthread" \
  178. PYTHON="${MODPY_BIN}"
  179. CONFIGURE_ARGS+=--with-dbus-sys="${SYSCONFDIR}/dbus-1/" \
  180. --with-avahi-user=_avahi \
  181. --with-avahi-group=_avahi \
  182. --with-avahi-priv-access-group=wheel \
  183. --with-xml=expat \
  184. --with-distro=none \
  185. --enable-compat-howl \
  186. --enable-compat-libdns_sd \
  187. --enable-core-docs \
  188. --enable-tests \
  189. --enable-introspection \
  190. --disable-autoipd \
  191. --disable-doxygen-doc \
  192. --disable-doxygen-dot \
  193. --disable-doxygen-xml \
  194. --disable-doxygen-html
  195. # don't link with libssp from the gcc4 port
  196. # __guard and __stack_smash_handler are part of libc
  197. CONFIGURE_ARGS+=--disable-stack-protector
  198. FAKE_FLAGS= SYSCONFDIR=${SYSCONFDIR}
  199. PC_FILES= avahi-ui.pc avahi-client.pc avahi-compat-howl.pc \
  200. avahi-compat-libdns_sd.pc avahi-core.pc avahi-glib.pc \
  201. avahi-gobject.pc avahi-qt3.pc avahi-qt4.pc
  202. pre-configure:
  203. find ${WRKSRC} -name Makefile.in -exec \
  204. perl -pi -e 's,LIBINTL,INTLLIBS,g;' \
  205. -e 's,LIBICONV,LTLIBICONV,g' {} \;
  206. find ${WRKSRC}/man -name '*.[1-9]*' | xargs \
  207. perl -pi -e 's,/etc/avahi,${SYSCONFDIR}/avahi,g'
  208. perl -pi -e 's,dbus_connection_disconnect,dbus_connection_close,g' \
  209. ${WRKSRC}/avahi-client/client.c \
  210. ${WRKSRC}/avahi-daemon/dbus-protocol.c
  211. perl -pi -e 's,-ldl,,g' ${WRKSRC}/configure \
  212. ${WRKSRC}/avahi-client/Makefile.in \
  213. ${WRKSRC}/avahi-daemon/Makefile.in
  214. for i in ${PC_FILES}; do \
  215. perl -pi -e 's,Libs:,Libs: -pthread,;' \
  216. -e 's,Cflags:,Cflags: -pthread,' ${WRKSRC}/$${i}.in; done
  217. post-install:
  218. ${INSTALL_DATA_DIR} ${PREFIX}/share/examples
  219. mv ${WRKINST}${SYSCONFDIR}/dbus-1 ${PREFIX}/share/examples/
  220. mv ${WRKINST}${SYSCONFDIR}/avahi ${PREFIX}/share/examples/
  221. # Install the dbus system-service, some applications needs it to
  222. # know that avahi-daemon is running.
  223. ${INSTALL_DATA_DIR} ${PREFIX}/share/dbus-1/system-services
  224. ${INSTALL_DATA} ${WRKBUILD}/avahi-daemon/org.freedesktop.Avahi.service \
  225. ${PREFIX}/share/dbus-1/system-services
  226. # XXX DLLMAP_FILES won't work here since the files are generated during the build process
  227. find ${PREFIX} -name avahi-sharp.dll.config -or -name avahi-ui-sharp.dll.config | \
  228. xargs perl -pi -e 's,\.so(\.[0-9])+,\.so,g'
  229. .include <bsd.port.mk>