Import net/tigervnc version 1.7.0_1
[dports.git] / net / tigervnc / Makefile
1 # Created by: Koichiro IWAO <meta+ports@vmeta.jp>
2 # $FreeBSD$
3
4 PORTNAME=       tigervnc
5 PORTVERSION=    1.7.0
6 DISTVERSIONPREFIX=      v
7 PORTREVISION=   1
8 CATEGORIES=     net x11-servers
9
10 MAINTAINER=     meta+ports@vmeta.jp
11 COMMENT=        High-performance, platform-neutral implementation of VNC
12
13 LICENSE=        GPLv2+
14 LICENSE_FILE=   ${WRKSRC}/LICENCE.TXT
15
16 PATCH_DEPENDS=  ${NONEXISTENT}:x11-servers/xorg-server:patch
17 BUILD_DEPENDS=  ${LOCALBASE}/include/GL/internal/dri_interface.h:graphics/dri \
18                 ${LOCALBASE}/libdata/pkgconfig/fontutil.pc:x11-fonts/font-util \
19                 bash:shells/bash
20 # almost equivalent to x11-servers/xorg-server's
21 RUN_DEPENDS=    ${LOCALBASE}/share/X11/xkb/rules/base:x11/xkeyboard-config \
22                 xkbcomp:x11/xkbcomp
23
24 CONFLICTS=      tigervnc-devel-[0-9]* \
25                 tightvnc-[0-9]* \
26                 tridiavnc-[0-9]* \
27                 vnc-[0-9]*
28
29 USES=           autoreconf:build cmake cpe gmake iconv jpeg libtool pkgconfig \
30                 python ssl
31 USE_GL=         gl
32 USE_LDCONFIG=   yes
33 USE_GITHUB=     yes
34 GH_ACCOUNT=     TigerVNC
35
36 USE_XORG+=      bigreqsproto compositeproto damageproto fixesproto fontsproto glproto \
37                 ice inputproto kbproto pixman presentproto randrproto renderproto \
38                 resourceproto scrnsaverproto sm videoproto x11 xau xcmiscproto xdamage \
39                 xdmcp xext xextproto xfont xkbfile xorg-macros xproto xrandr xrender \
40                 xtrans xtst
41
42 LIB_DEPENDS=    libunwind.so:devel/libunwind \
43                 libxshmfence.so:x11/libxshmfence \
44                 libfontconfig.so:x11-fonts/fontconfig
45
46 CFLAGS+=        -fPIC
47
48 OPTIONS_DEFINE=         GNUTLS NLS PAM VIEWER DOCS
49 OPTIONS_DEFAULT=        GNUTLS PAM VIEWER
50 VIEWER_DESC=            Build vncviewer
51
52 .include <bsd.port.options.mk>
53
54 CMAKE_ARGS=     -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=${STAGE}${PREFIX}
55
56 .if ${PORT_OPTIONS:MGNUTLS}
57 LIB_DEPENDS+=   libtasn1.so:security/libtasn1 \
58                 libgcrypt.so:security/libgcrypt \
59                 libgpg-error.so:security/libgpg-error \
60                 libgnutls.so: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+=    -DBUILD_VIEWER=1
84 LIB_DEPENDS+=   libpng.so:graphics/png \
85                 libfltk.so:x11-toolkits/fltk
86 # ImageMagick is required to generate icons during build process
87 BUILD_DEPENDS+= ${LOCALBASE}/bin/convert:graphics/ImageMagick
88 USE_XORG+=      xcursor xfixes xft xinerama
89 PLIST_SUB+=     VIEWER=""
90 INSTALLS_ICONS= yes
91 DESKTOP_ENTRIES=        "TigerVNC viewer" "Connect to VNC server and display remote desktop" \
92                         "${PORTNAME}" "vncviewer" "Network;" false
93 .else
94 CMAKE_ARGS+=    -DBUILD_VIEWER=0
95 PLIST_SUB+=     VIEWER="@comment "
96 .endif
97
98 MAKE_ARGS+=     TIGERVNC_SRCDIR=${WRKSRC}
99 CONFIGURE_ARGS+=        \
100                 --prefix=${PREFIX} --mandir=${PREFIX}/man/ \
101                 --docdir=${PREFIX}/share/doc/${PORTNAME}/ --with-pic --without-dtrace \
102                 --disable-static --disable-dri --disable-unit-tests \
103                 --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
104                 --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
105                 --disable-config-dbus --disable-config-hal \
106                 --disable-dri2 --enable-install-libxf86config --enable-glx \
107                 --with-default-font-path="catalogue:${LOCALBASE}/share/fonts,built-ins" \
108                 --with-xkb-path=${LOCALBASE}/share/X11/xkb \
109                 --with-xkb-bin-directory=${LOCALBASE}/bin \
110                 --with-serverconfig-path=${LOCALBASE}/lib/X11 \
111                 --disable-selective-werror \
112                 --disable-xwayland \
113                 --with-fontrootdir=${LOCALBASE}/share/fonts
114
115 .include <bsd.port.pre.mk>
116
117 TIGERVNC_XORG_PATCH_VER=        117
118
119 # import from x11-server/xorg-server/Makefile
120 .if ${SSL_DEFAULT} == base
121 # The reason why I use this is cause openssl from base doesn't
122 # install a .pc file and configure will fail trying to find it.
123 # Setting both of those variables to a *non-empty* value by-passes
124 # the pkg-config check.
125 CONFIGURE_ENV=  SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include"
126 .endif
127
128 XORG_WRKDIR=    ${MAKE} -C ${PORTSDIR}/x11-servers/xorg-server -VWRKSRC
129
130 pre-patch:
131         @${CP} -R `${XORG_WRKDIR}`/ ${WRKSRC}/unix/xserver/
132
133 post-patch:
134         @cd ${WRKSRC}/unix/xserver/ && ${PATCH} -p1 < ${WRKSRC}/unix/xserver${TIGERVNC_XORG_PATCH_VER}.patch
135
136 post-configure:
137         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${CONFIGURE_ENV} ${MAKE_ENV} ${AUTORECONF} -fiv
138         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${CONFIGURE_ENV} ${MAKE_ENV} ./configure ${CONFIGURE_ARGS}
139
140 post-build:
141         @cd ${WRKSRC}/unix/xserver/ && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} SHELL=${LOCALBASE}/bin/bash
142
143 post-install:
144         @cd ${WRKSRC}/unix/xserver/hw/vnc/ && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install
145         @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/Xvnc ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/libvnc.so
146
147 .include <bsd.port.post.mk>