Tweak net/tigervnc version 1.3.1_2
[dports.git] / net / tigervnc / Makefile
1 # Created by: Koichiro IWAO <meta+ports@vmeta.jp>
2 # $FreeBSD$
3
4 PORTNAME=       tigervnc
5 PORTVERSION=    1.3.1
6 PORTREVISION=   2
7 CATEGORIES=     net x11-servers
8 MASTER_SITES=   SF:tigervnc
9 MASTER_SITE_SUBDIR=     ${PORTNAME}/${PORTNAME}/${PORTVERSION}/:tigervnc
10 DISTFILES=      ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}: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 libtool pkgconfig
30 USE_GL=         gl
31 USE_AUTOTOOLS=  autoconf:env automake:env libtoolize: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 CFLAGS+=        -fPIC
42
43 OPTIONS_DEFINE=         GNUTLS NLS PAM VIEWER HPJPG DOCS
44 OPTIONS_DEFAULT=        GNUTLS NLS PAM VIEWER
45 VIEWER_DESC=            Build vncviewer
46 HPJPG_DESC=             Build with High-Performance JPEG support
47
48 .include <bsd.port.options.mk>
49
50 CMAKE_ARGS=     -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=${STAGE}${PREFIX}
51
52 .if ${PORT_OPTIONS:MGNUTLS}
53 LIB_DEPENDS+=   libtasn1.so:${PORTSDIR}/security/libtasn1 \
54                 libgcrypt.so:${PORTSDIR}/security/libgcrypt \
55                 libgpg-error.so:${PORTSDIR}/security/libgpg-error \
56                 libgnutls.so:${PORTSDIR}/security/gnutls
57 CONFIGURE_ARGS+=        --enable-glx-tls
58 CMAKE_ARGS+=    -DENABLE_GNUTLS=1
59 .else
60 CMAKE_ARGS+=    -DENABLE_GNUTLS=0
61 .endif
62
63 .if ${PORT_OPTIONS:MNLS}
64 USES+=          gettext
65 CMAKE_ARGS+=    -DENABLE_NLS=1
66 PLIST_SUB+=     NLS=""
67 .else
68 CMAKE_ARGS+=    -DENABLE_NLS=0
69 PLIST_SUB+=     NLS="@comment "
70 .endif
71
72 .if ${PORT_OPTIONS:MPAM}
73 CMAKE_ARGS+=    -DENABLE_PAM=1
74 .else
75 CMAKE_ARGS+=    -DENABLE_PAM=0
76 .endif
77
78 .if ${PORT_OPTIONS:MVIEWER}
79 CMAKE_ARGS+=    -DBUILD_VIEWER=1
80 LIB_DEPENDS+=   libpng15.so:${PORTSDIR}/graphics/png \
81                 libfltk.so:${PORTSDIR}/x11-toolkits/fltk
82 # ImageMagick is required to generate icons during build process
83 BUILD_DEPENDS+= ${LOCALBASE}/bin/convert:${PORTSDIR}/graphics/ImageMagick
84 USE_XORG+=      xcursor xfixes xft xinerama
85 PLIST_SUB+=     VIEWER=""
86 INSTALLS_ICONS= yes
87 DESKTOP_ENTRIES=        "TigerVNC viewer" "Connect to VNC server and display remote desktop" \
88                         "${PORTNAME}" "vncviewer" "Network;" false
89 .else
90 CMAKE_ARGS+=    -DBUILD_VIEWER=0
91 PLIST_SUB+=     VIEWER="@comment "
92 .endif
93
94 .if ${PORT_OPTIONS:MHPJPG}
95 LIB_DEPENDS+=   libturbojpeg.so:${PORTSDIR}/graphics/libjpeg-turbo
96 .else
97 LIB_DEPENDS+=   libjpeg.so:${PORTSDIR}/graphics/jpeg
98 .endif
99
100 MAKE_ARGS+=     TIGERVNC_SRCDIR=${WRKSRC}
101 CONFIGURE_ARGS+=        \
102                 --prefix=${PREFIX} --mandir=${PREFIX}/man/ \
103                 --docdir=${PREFIX}/share/doc/${PORTNAME}/ --with-pic --without-dtrace \
104                 --disable-static --disable-dri \
105                 --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
106                 --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
107                 --disable-config-dbus --disable-config-hal \
108                 --disable-dri2 --enable-install-libxf86config --enable-glx \
109                 --with-default-font-path="catalogue:${LOCALBASE}/share/fonts,built-ins" \
110                 --with-xkb-path=${LOCALBASE}/share/X11/xkb \
111                 --with-xkb-bin-directory=${LOCALBASE}/bin \
112                 --with-serverconfig-path=${LOCALBASE}/lib/X11 \
113                 --disable-selective-werror
114 .ifdef WITH_NEW_XORG
115 CONFIGURE_ARGS+=        --with-fontrootdir=${LOCALBASE}/share/fonts
116 .else
117 CONFIGURE_ARGS+=        --with-fontdir=${LOCALBASE}/share/fonts
118 .endif
119
120 .include <bsd.port.pre.mk>
121
122 .ifdef WITH_NEW_XORG
123 TIGERVNC_XORG_PATCH_VER=        112
124 .else
125 TIGERVNC_XORG_PATCH_VER=        17
126 .endif
127
128 # import from x11-server/xorg-server/Makefile
129 .ifdef WITH_OPENSSL_BASE
130 # The reason why I use this is cause openssl from base doesn't install a .pc file
131 # and configure will fail trying to find it. Setting both of those variables to
132 # a *non-empty* value by-passes the pkg-config check.
133 CONFIGURE_ENV=  SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include"
134 .endif
135
136 XORG_WRKDIR=    ${MAKE} -C ${PORTSDIR}/x11-servers/xorg-server -VWRKSRC
137
138 pre-patch:
139         @${CP} -R `${XORG_WRKDIR}`/ ${WRKSRC}/unix/xserver/
140
141 post-patch:
142         @cd ${WRKSRC}/unix/xserver/ && ${PATCH} -p1 < ${WRKSRC}/unix/xserver${TIGERVNC_XORG_PATCH_VER}.patch
143
144 post-configure:
145         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${CONFIGURE_ENV} ${AUTORECONF} -fiv
146         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${CONFIGURE_ENV} ./configure ${CONFIGURE_ARGS}
147
148 post-build:
149         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} SHELL=${LOCALBASE}/bin/bash
150
151 post-install:
152         @cd ${WRKSRC}/unix/xserver/hw/vnc/ && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install
153
154 .include <bsd.port.post.mk>