1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils cmake-utils autotools java-pkg-opt-2 flag-o-matic
10 XSERVER_VERSION="1.15.0"
12 #MY_P="${PN}-1.2.80-20130314svn5065"
13 #S="${WORKDIR}/${MY_P}"
15 DESCRIPTION="Remote desktop viewer display system"
16 HOMEPAGE="http://www.tigervnc.org"
17 SRC_URI="mirror://sourceforge/tigervnc/${P}.tar.gz
18 mirror://gentoo/${PN}.png
19 mirror://gentoo/${PN}-1.3.0-patches-${PATCHVER}.tar.bz2
20 https://dev.gentoo.org/~armin76/dist/${PN}-1.3.0-patches-${PATCHVER}.tar.bz2
21 server? ( ftp://ftp.freedesktop.org/pub/xorg/individual/xserver/xorg-server-${XSERVER_VERSION}.tar.bz2 )"
25 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86"
26 IUSE="gnutls java nptl +opengl pam server +xorgmodule"
28 RDEPEND="virtual/jpeg:0
30 >=x11-libs/libXtst-1.0.99.2
32 gnutls? ( net-libs/gnutls )
33 java? ( >=virtual/jre-1.5 )
37 >=x11-libs/libXi-1.2.99.1
38 >=x11-libs/libXfont-1.4.2
39 >=x11-libs/libxkbfile-1.0.4
41 >=x11-libs/pixman-0.27.2
42 >=x11-apps/xauth-1.0.3
44 >=x11-misc/xkeyboard-config-2.4.1-r3
45 opengl? ( >=app-eselect/eselect-opengl-1.0.8 )
46 xorgmodule? ( =x11-base/xorg-server-${XSERVER_VERSION%.*}* )
52 amd64? ( dev-lang/nasm )
53 x86? ( dev-lang/nasm )
54 >=x11-proto/inputproto-2.2.99.1
55 >=x11-proto/xextproto-7.2.99.901
56 >=x11-proto/xproto-7.0.22
57 java? ( >=virtual/jdk-1.5 )
62 >=x11-proto/bigreqsproto-1.1.0
63 >=x11-proto/compositeproto-0.4
64 >=x11-proto/damageproto-1.1
65 >=x11-proto/fixesproto-5.0
66 >=x11-proto/fontsproto-2.0.2
67 >=x11-proto/glproto-1.4.17
68 >=x11-proto/randrproto-1.4.0
69 >=x11-proto/renderproto-0.11
70 >=x11-proto/resourceproto-1.2.0
71 >=x11-proto/scrnsaverproto-1.1
72 >=x11-proto/videoproto-2.2.2
73 >=x11-proto/xcmiscproto-1.2.0
74 >=x11-proto/xineramaproto-1.1.3
75 >=x11-libs/xtrans-1.3.2
76 >=x11-proto/dri2proto-2.8
77 opengl? ( >=media-libs/mesa-7.8_rc[nptl=] )
80 CMAKE_IN_SOURCE_BUILD=1
83 if ! use server ; then
85 einfo "The 'server' USE flag will build tigervnc's server."
86 einfo "If '-server' is chosen only the client is built to save space."
87 einfo "Stop the build now if you need to add 'server' to USE flags.\n"
89 ewarn "Forcing on xorg-x11 for new enough glxtokens.h..."
90 OLD_IMPLEM="$(eselect opengl show)"
91 eselect opengl set ${OPENGL_DIR}
95 switch_opengl_implem() {
96 # Switch to the xorg implementation.
97 # Use new opengl-update that will not reset user selected
98 # OpenGL interface ...
100 eselect opengl set ${OLD_IMPLEM}
105 cp -r "${WORKDIR}"/xorg-server-${XSERVER_VERSION}/* unix/xserver
107 rm "${WORKDIR}"/patches/*_server_*
110 EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \
111 EPATCH_FORCE="yes" epatch
115 epatch ../xserver114.patch
122 use arm || use hppa && append-flags "-fPIC"
126 $(cmake-utils_use_enable gnutls GNUTLS)
127 $(cmake-utils_use_enable pam PAM)
128 $(cmake-utils_use_build java JAVA)
131 cmake-utils_src_configure
136 $(use_enable nptl glx-tls) \
137 $(use_enable opengl glx) \
138 --disable-config-dbus \
139 --disable-config-hal \
140 --disable-config-udev \
141 --disable-devel-docs \
146 --disable-selective-werror \
147 --disable-silent-rules \
149 --disable-unit-tests \
165 cmake-utils_src_compile
174 cmake-utils_src_install
176 newicon "${DISTDIR}"/tigervnc.png vncviewer.png
177 make_desktop_entry vncviewer vncviewer vncviewer Network
180 cd unix/xserver/hw/vnc
181 emake DESTDIR="${D}" install
182 ! use xorgmodule && rm -rf "${D}"/usr/$(get_libdir)/xorg
184 newconfd "${FILESDIR}"/${PN}.confd ${PN}
185 newinitd "${FILESDIR}"/${PN}.initd ${PN}
187 rm "${D}"/usr/$(get_libdir)/xorg/modules/extensions/libvnc.la
190 for f in vncserver vncpasswd x0vncserver vncconfig; do
192 rm usr/share/man/man1/$f.1
198 use server && switch_opengl_implem