Update net/tigervnc to version 1.3.0
[dports.git] / net / tigervnc / Makefile
1 # Created by: Koichiro IWAO <meta+ports@vmeta.jp>
2 # $FreeBSD: net/tigervnc/Makefile 326978 2013-09-11 13:20:02Z wg $
3
4 PORTNAME=       tigervnc
5 PORTVERSION=    1.3.0
6 CATEGORIES=     net x11-servers
7 MASTER_SITES=   SF:tigervnc
8 MASTER_SITE_SUBDIR=     ${PORTNAME}/${PORTNAME}/${PORTVERSION}/:tigervnc
9 DISTFILES=      ${PORTNAME}-${PORTVERSION}.tar.bz2:tigervnc
10
11 MAINTAINER=     meta+ports@vmeta.jp
12 COMMENT=        High-performance, platform-neutral implementation of VNC
13
14 LICENSE=        GPLv2
15
16 PATCH_DEPENDS=  ${NONEXISTENT}:${PORTSDIR}/x11-servers/xorg-server:patch
17 BUILD_DEPENDS=  ${LOCALBASE}/include/GL/internal/dri_interface.h:${PORTSDIR}/graphics/dri \
18                 ${LOCALBASE}/libdata/pkgconfig/fontutil.pc:${PORTSDIR}/x11-fonts/font-util \
19                 bash:${PORTSDIR}/shells/bash
20 # almost equivalent to x11-servers/xorg-server's
21 RUN_DEPENDS=    ${LOCALBASE}/share/X11/xkb/rules/base:${PORTSDIR}/x11/xkeyboard-config \
22                 xkbcomp:${PORTSDIR}/x11/xkbcomp
23
24 CONFLICTS=      tridiavnc-[0-9]* \
25                 tightvnc-[0-9]* \
26                 vnc-[0-9]*
27
28 USES=           cmake gmake pkgconfig
29 USE_GL=         gl
30 USE_AUTOTOOLS+= autoconf:env automake:env libtool:env
31 USE_PYTHON=     yes
32 USE_LDCONFIG=   yes
33 USE_OPENSSL=    yes
34
35 USE_XORG+=      bigreqsproto compositeproto damageproto fixesproto fontsproto glproto \
36                 inputproto kbproto pixman randrproto renderproto resourceproto \
37                 scrnsaverproto videoproto xau xdmcp xext xkbfile xcmiscproto xextproto \
38                 xfont xproto xrandr xtrans xtst xorg-macros
39
40 MAN1+=          vncpasswd.1 \
41                 x0vncserver.1 \
42                 vncserver.1 \
43                 vncconfig.1 \
44                 Xvnc.1
45 CFLAGS+=        -fPIC
46
47 OPTIONS_DEFINE=         GNUTLS NLS PAM VIEWER HPJPG
48 OPTIONS_DEFAULT=        GNUTLS NLS PAM VIEWER
49 VIEWER_DESC=            Build vncviewer
50 HPJPG_DESC=             Build with High-Performance JPEG support
51
52 .include <bsd.port.options.mk>
53
54 CMAKE_ARGS=     -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=${PREFIX}
55
56 .if ${PORT_OPTIONS:MGNUTLS}
57 LIB_DEPENDS+=   libtasn1.so:${PORTSDIR}/security/libtasn1 \
58                 libgcrypt.so:${PORTSDIR}/security/libgcrypt \
59                 libgpg-error.so:${PORTSDIR}/security/libgpg-error \
60                 libgnutls.so:${PORTSDIR}/security/gnutls
61 CONFIGURE_ARGS+=        --enable-glx-tls
62 CMAKE_ARGS+=    -DENABLE_GNUTLS=1
63 .else
64 CMAKE_ARGS+=    -DENABLE_GNUTLS=0
65 .endif
66
67 .if ${PORT_OPTIONS:MNLS}
68 USES+=          gettext
69 CMAKE_ARGS+=    -DENABLE_NLS=1
70 PLIST_SUB+=     NLS=""
71 .else
72 CMAKE_ARGS+=    -DENABLE_NLS=0
73 PLIST_SUB+=     NLS="@comment "
74 .endif
75
76 .if ${PORT_OPTIONS:MPAM}
77 CMAKE_ARGS+=    -DENABLE_PAM=1
78 .else
79 CMAKE_ARGS+=    -DENABLE_PAM=0
80 .endif
81
82 .if ${PORT_OPTIONS:MVIEWER}
83 CMAKE_ARGS+=    -DENABLE_VIEWER=1
84 LIB_DEPENDS+=   libpng15.so:${PORTSDIR}/graphics/png \
85                 libfltk.so:${PORTSDIR}/x11-toolkits/fltk
86 USE_XORG+=      xcursor xfixes xft xinerama
87 MAN1+=          vncviewer.1
88 PLIST_SUB+=     VIEWER=""
89 INSTALLS_ICONS= yes
90 DESKTOP_ENTRIES=        "TigerVNC viewer" "Connect to VNC server and display remote desktop" \
91                         "${PREFIX}/share/icons/hicolor/scalable/apps/${PORTNAME}.svg" \
92                         "vncviewer" "Network;" false
93 .else
94 PLIST_SUB+=     VIEWER="@comment "
95 .endif
96
97 .if ${PORT_OPTIONS:MHPJPG}
98 LIB_DEPENDS+=   libturbojpeg.so:${PORTSDIR}/graphics/libjpeg-turbo
99 .else
100 LIB_DEPENDS+=   libjpeg.so:${PORTSDIR}/graphics/jpeg
101 .endif
102
103 MAKE_ARGS+=     TIGERVNC_SRCDIR=${WRKSRC}
104 CONFIGURE_ARGS+=        \
105                 --prefix=${PREFIX} --mandir=${PREFIX}/man/ \
106                 --docdir=${PREFIX}/share/doc/${PORTNAME}/ --with-pic --without-dtrace \
107                 --disable-static --disable-dri \
108                 --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
109                 --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
110                 --disable-config-dbus --disable-config-hal \
111                 --disable-dri2 --enable-install-libxf86config --enable-glx \
112                 --with-default-font-path="catalogue:${PREFIX}/share/fonts,built-ins" \
113                 --with-xkb-path=${PREFIX}/share/X11/xkb \
114                 --with-xkb-output=/var/lib/xkb \
115                 --with-xkb-bin-directory=${PREFIX}/bin \
116                 --with-serverconfig-path=${PREFIX}/lib/X11 \
117                 --disable-selective-werror
118 .ifdef WITH_NEW_XORG
119 CONFIGURE_ARGS+=        --with-fontrootdir=${PREFIX}/share/fonts
120 .else
121 CONFIGURE_ARGS+=        --with-fontdir=${PREFIX}/share/fonts
122 .endif
123
124 .include <bsd.port.pre.mk>
125
126 .ifdef WITH_NEW_XORG
127 TIGERVNC_XORG_PATCH_VER=        112
128 .else
129 TIGERVNC_XORG_PATCH_VER=        17
130 .endif
131
132 # import from x11-server/xorg-server/Makefile
133 .ifdef WITH_OPENSSL_BASE
134 # The reason why I use this is cause openssl from base doesn't install a .pc file
135 # and configure will fail trying to find it. Setting both of those variables to
136 # a *non-empty* value by-passes the pkg-config check.
137 CONFIGURE_ENV=  SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include"
138 .endif
139
140 XORG_WRKDIR=    ${MAKE} -C ${PORTSDIR}/x11-servers/xorg-server -VWRKSRC
141
142 pre-patch:
143         @${CP} -R `${XORG_WRKDIR}`/ ${WRKSRC}/unix/xserver/
144
145 post-patch:
146         @cd ${WRKSRC}/unix/xserver/ && ${PATCH} -p1 < ${WRKSRC}/unix/xserver${TIGERVNC_XORG_PATCH_VER}.patch
147
148 post-configure:
149         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${CONFIGURE_ENV} ${AUTORECONF} -fiv
150         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${CONFIGURE_ENV} ./configure ${CONFIGURE_ARGS}
151
152 post-build:
153         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_ARGS} SHELL=${LOCALBASE}/bin/bash
154
155 post-install:
156         @cd ${WRKSRC}/unix/xserver/hw/vnc/ && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_ARGS} install
157 .if ${PORT_OPTIONS:MVIEWER}
158         @${MKDIR} ${PREFIX}/share/icons/hicolor/scalable/apps/
159         @cd ${WRKSRC}/media/ && ${INSTALL_DATA} icons/tigervnc.svg ${PREFIX}/share/icons/hicolor/scalable/apps/
160 .endif
161
162 .include <bsd.port.post.mk>