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