summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViorel Munteanu <ceamac.paragon@gmail.com>2022-06-18 12:53:32 +0300
committerSam James <sam@gentoo.org>2022-07-04 01:32:53 +0100
commit81782dbff6cb3d7c601a09f3e4cdf84fea4b36c2 (patch)
tree0f8da7df34169170068c571de5d31090b4bb22d4 /net-misc/tigervnc
parentapp-emacs/fennel-mode: fixes to older version ebuild (diff)
downloadgentoo-81782dbff6cb3d7c601a09f3e4cdf84fea4b36c2.tar.gz
gentoo-81782dbff6cb3d7c601a09f3e4cdf84fea4b36c2.tar.bz2
gentoo-81782dbff6cb3d7c601a09f3e4cdf84fea4b36c2.zip
net-misc/tigervnc: Fix for USE=-server and no pam
Don't build server files instead of erasing them afterwards Drop xorgmodule local use flag from metadata (no longer used) Closes: https://bugs.gentoo.org/852830 Signed-off-by: Nick Bowler <nbowler@draconx.ca> Signed-off-by: Viorel Munteanu <ceamac.paragon@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/26034 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-misc/tigervnc')
-rw-r--r--net-misc/tigervnc/files/tigervnc-1.12.0-disable-server-and-pam.patch57
-rw-r--r--net-misc/tigervnc/files/tigervnc-1.12.80-disable-server-and-pam.patch57
-rw-r--r--net-misc/tigervnc/metadata.xml1
-rw-r--r--net-misc/tigervnc/tigervnc-1.12.0-r7.ebuild199
-rw-r--r--net-misc/tigervnc/tigervnc-9999.ebuild30
5 files changed, 325 insertions, 19 deletions
diff --git a/net-misc/tigervnc/files/tigervnc-1.12.0-disable-server-and-pam.patch b/net-misc/tigervnc/files/tigervnc-1.12.0-disable-server-and-pam.patch
new file mode 100644
index 000000000000..5ae07007d467
--- /dev/null
+++ b/net-misc/tigervnc/files/tigervnc-1.12.0-disable-server-and-pam.patch
@@ -0,0 +1,57 @@
+See https://bugs.gentoo.org/852830
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -234,6 +234,7 @@
+ add_subdirectory(java)
+ endif()
+
++option(BUILD_SERVER "Build TigerVNC server" ON)
+ option(BUILD_VIEWER "Build TigerVNC viewer" ON)
+ if(BUILD_VIEWER)
+ # Check for FLTK
+@@ -276,7 +277,7 @@
+ endif()
+
+ # Check for PAM library
+-if(UNIX AND NOT APPLE)
++if(BUILD_SERVER AND UNIX AND NOT APPLE)
+ check_include_files(security/pam_appl.h HAVE_PAM_H)
+ set(CMAKE_REQUIRED_LIBRARIES -lpam)
+ check_function_exists(pam_start HAVE_PAM_START)
+@@ -315,9 +316,6 @@
+ add_subdirectory(media)
+ endif()
+
+-add_subdirectory(tests)
+-
+-
+ if(BUILD_VIEWER)
+ add_subdirectory(release)
+ endif()
+--- a/common/rfb/CMakeLists.txt
++++ b/common/rfb/CMakeLists.txt
+@@ -75,7 +75,7 @@
+
+ set(RFB_LIBRARIES ${JPEG_LIBRARIES} ${PIXMAN_LIBRARY} os rdr)
+
+-if(UNIX AND NOT APPLE)
++if(BUILD_SERVER AND UNIX AND NOT APPLE)
+ set(RFB_SOURCES ${RFB_SOURCES} UnixPasswordValidator.cxx
+ UnixPasswordValidator.h pam.c pam.h)
+ set(RFB_LIBRARIES ${RFB_LIBRARIES} ${PAM_LIBS})
+--- a/unix/CMakeLists.txt
++++ b/unix/CMakeLists.txt
+@@ -1,6 +1,8 @@
+ add_subdirectory(tx)
+ add_subdirectory(common)
+-add_subdirectory(vncconfig)
+-add_subdirectory(vncpasswd)
+-add_subdirectory(vncserver)
+-add_subdirectory(x0vncserver)
++if(BUILD_SERVER)
++ add_subdirectory(vncconfig)
++ add_subdirectory(vncpasswd)
++ add_subdirectory(vncserver)
++ add_subdirectory(x0vncserver)
++endif()
diff --git a/net-misc/tigervnc/files/tigervnc-1.12.80-disable-server-and-pam.patch b/net-misc/tigervnc/files/tigervnc-1.12.80-disable-server-and-pam.patch
new file mode 100644
index 000000000000..e61f099d397a
--- /dev/null
+++ b/net-misc/tigervnc/files/tigervnc-1.12.80-disable-server-and-pam.patch
@@ -0,0 +1,57 @@
+See https://bugs.gentoo.org/852830
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -234,6 +234,7 @@
+ add_subdirectory(java)
+ endif()
+
++option(BUILD_SERVER "Build TigerVNC server" ON)
+ option(BUILD_VIEWER "Build TigerVNC viewer" ON)
+ if(BUILD_VIEWER)
+ # Check for FLTK
+@@ -276,7 +277,7 @@
+ endif()
+
+ # Check for PAM library
+-if(UNIX AND NOT APPLE)
++if(BUILD_SERVER AND UNIX AND NOT APPLE)
+ check_include_files(security/pam_appl.h HAVE_PAM_H)
+ set(CMAKE_REQUIRED_LIBRARIES -lpam)
+ check_function_exists(pam_start HAVE_PAM_START)
+@@ -315,9 +316,6 @@
+ add_subdirectory(media)
+ endif()
+
+-add_subdirectory(tests)
+-
+-
+ if(BUILD_VIEWER)
+ add_subdirectory(release)
+ endif()
+--- a/common/rfb/CMakeLists.txt
++++ b/common/rfb/CMakeLists.txt
+@@ -88,7 +88,7 @@
+ target_sources(rfb PRIVATE WinPasswdValidator.cxx)
+ endif(WIN32)
+
+-if(UNIX AND NOT APPLE)
++if(BUILD_SERVER AND UNIX AND NOT APPLE)
+ target_sources(rfb PRIVATE UnixPasswordValidator.cxx pam.c)
+ target_link_libraries(rfb ${PAM_LIBS})
+ endif()
+--- a/unix/CMakeLists.txt
++++ b/unix/CMakeLists.txt
+@@ -1,6 +1,8 @@
+ add_subdirectory(tx)
+ add_subdirectory(common)
+-add_subdirectory(vncconfig)
+-add_subdirectory(vncpasswd)
+-add_subdirectory(vncserver)
+-add_subdirectory(x0vncserver)
++if(BUILD_SERVER)
++ add_subdirectory(vncconfig)
++ add_subdirectory(vncpasswd)
++ add_subdirectory(vncserver)
++ add_subdirectory(x0vncserver)
++endif()
diff --git a/net-misc/tigervnc/metadata.xml b/net-misc/tigervnc/metadata.xml
index 9717615f517c..68efa8f862da 100644
--- a/net-misc/tigervnc/metadata.xml
+++ b/net-misc/tigervnc/metadata.xml
@@ -12,7 +12,6 @@
<use>
<flag name="drm">Build with DRM support</flag>
<flag name="server">Build TigerVNC server</flag>
- <flag name="xorgmodule">Build the Xorg module</flag>
<flag name="dri3">Build with DRI3 support</flag>
</use>
<upstream>
diff --git a/net-misc/tigervnc/tigervnc-1.12.0-r7.ebuild b/net-misc/tigervnc/tigervnc-1.12.0-r7.ebuild
new file mode 100644
index 000000000000..ada6c94f5d44
--- /dev/null
+++ b/net-misc/tigervnc/tigervnc-1.12.0-r7.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_IN_SOURCE_BUILD=1
+inherit autotools cmake flag-o-matic java-pkg-opt-2 optfeature systemd xdg
+
+XSERVER_VERSION="21.1.1"
+
+DESCRIPTION="Remote desktop viewer display system"
+HOMEPAGE="https://tigervnc.org"
+SRC_URI="https://github.com/TigerVNC/tigervnc/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ server? (
+ ftp://ftp.freedesktop.org/pub/xorg/individual/xserver/xorg-server-${XSERVER_VERSION}.tar.xz
+ https://github.com/TigerVNC/tigervnc/commit/0c5a2b2e7759c2829c07186cfce4d24aa9b5274e.patch -> ${P}-xserver-21.patch
+ )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="dri3 +drm gnutls java nls +opengl +server xinerama"
+REQUIRED_USE="
+ dri3? ( drm )
+ opengl? ( server )
+"
+
+CDEPEND="
+ media-libs/libjpeg-turbo:=
+ sys-libs/zlib:=
+ x11-libs/fltk:1
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/pixman
+ gnutls? ( net-libs/gnutls:= )
+ nls? ( virtual/libiconv )
+ server? (
+ dev-libs/libbsd
+ dev-libs/openssl:0=
+ sys-libs/pam
+ x11-libs/libXau
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXfixes
+ x11-libs/libXfont2
+ x11-libs/libXtst
+ x11-libs/pixman
+ x11-libs/xtrans
+ x11-apps/xauth
+ x11-apps/xinit
+ x11-apps/xkbcomp
+ x11-apps/xsetroot
+ x11-misc/xkeyboard-config
+ opengl? ( media-libs/libglvnd[X] )
+ )
+ "
+
+RDEPEND="${CDEPEND}
+ java? ( virtual/jre:1.8 )
+ server? (
+ dev-lang/perl
+ sys-process/psmisc
+ )"
+
+DEPEND="${CDEPEND}
+ drm? ( x11-libs/libdrm )
+ server? (
+ media-fonts/font-util
+ x11-base/xorg-proto
+ x11-libs/libxcvt
+ x11-libs/libxkbfile
+ x11-misc/util-macros
+ opengl? ( media-libs/mesa )
+ )"
+
+BDEPEND="
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ "
+
+PATCHES=(
+ # Restore Java viewer
+ "${FILESDIR}"/${PN}-1.11.0-install-java-viewer.patch
+ "${FILESDIR}"/${PN}-1.12.0-xsession-path.patch
+ "${FILESDIR}"/${PN}-1.12.0-disable-server-and-pam.patch
+)
+
+src_prepare() {
+ if use server; then
+ cp -r "${WORKDIR}"/xorg-server-${XSERVER_VERSION}/. unix/xserver || die
+ eapply "${FILESDIR}"/${P}-xorg-1.21.patch
+ eapply "${DISTDIR}"/${P}-xserver-21.patch
+ fi
+
+ cmake_src_prepare
+
+ if use server; then
+ cd unix/xserver || die
+ eapply ../xserver${XSERVER_VERSION}.patch
+ eautoreconf
+ sed -i 's:\(present.h\):../present/\1:' os/utils.c || die
+ sed -i '/strcmp.*-fakescreenfps/,/^ \}/d' os/utils.c || die
+ fi
+}
+
+src_configure() {
+ if use arm || use hppa; then
+ append-flags "-fPIC"
+ fi
+
+ local mycmakeargs=(
+ -DENABLE_GNUTLS=$(usex gnutls)
+ -DENABLE_NLS=$(usex nls)
+ -DBUILD_JAVA=$(usex java)
+ -DBUILD_SERVER=$(usex server)
+ )
+
+ cmake_src_configure
+
+ if use server; then
+ cd unix/xserver || die
+ econf \
+ $(use_enable opengl glx) \
+ $(use_enable drm libdrm) \
+ --disable-config-hal \
+ --disable-config-udev \
+ --disable-devel-docs \
+ --disable-dri \
+ $(use_enable dri3) \
+ --disable-glamor \
+ --disable-kdrive \
+ --disable-libunwind \
+ --disable-linux-acpi \
+ --disable-record \
+ --disable-selective-werror \
+ --disable-static \
+ --disable-unit-tests \
+ --disable-xephyr \
+ $(use_enable xinerama) \
+ --disable-xnest \
+ --disable-xorg \
+ --disable-xvfb \
+ --disable-xwin \
+ --enable-dri2 \
+ --with-pic \
+ --without-dtrace \
+ --disable-present \
+ --with-sha1=libcrypto
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use server; then
+ # deps of the vnc module and the module itself
+ local d subdirs=(
+ fb xfixes Xext dbe $(usex opengl glx "") $(usev dri3) randr render
+ damageext miext Xi xkb composite dix mi os hw/vnc
+ )
+ for d in "${subdirs[@]}"; do
+ emake -C unix/xserver/"${d}"
+ done
+ fi
+}
+
+src_install() {
+ cmake_src_install
+
+ if use server; then
+ emake -C unix/xserver/hw/vnc DESTDIR="${D}" install
+ rm -v "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/libvnc.la || die
+
+ newconfd "${FILESDIR}"/${PN}-${PV}.confd ${PN}
+ newinitd "${FILESDIR}"/${PN}-${PV}.initd ${PN}
+
+ systemd_douserunit unix/vncserver/vncserver@.service
+
+ # comment out pam_selinux.so, the server does not start if missing
+ # part of bug #746227
+ sed -i -e '/pam_selinux/s/^/#/' "${ED}"/etc/pam.d/tigervnc || die
+
+ # install vncserver to /usr/bin too, see bug #836620
+ dosym -r /usr/libexec/vncserver /usr/bin/vncserver
+ fi
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+
+ local OPTIONAL_DM="gnome-base/gdm x11-misc/lightdm x11-misc/sddm x11-misc/slim"
+ use server && \
+ optfeature "keeping track of the xorg-server module" net-misc/tigervnc-xorg-module && \
+ optfeature_header "Install any additional display manager package:" && \
+ optfeature "proper session support" ${OPTIONAL_DM}
+}
diff --git a/net-misc/tigervnc/tigervnc-9999.ebuild b/net-misc/tigervnc/tigervnc-9999.ebuild
index 903570b2dd06..437a5aef9438 100644
--- a/net-misc/tigervnc/tigervnc-9999.ebuild
+++ b/net-misc/tigervnc/tigervnc-9999.ebuild
@@ -16,7 +16,11 @@ EGIT_REPO_URI="https://github.com/TigerVNC/tigervnc/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
-IUSE="dri3 +drm gnutls java nls +opengl server xinerama +xorgmodule"
+IUSE="dri3 +drm gnutls java nls +opengl +server xinerama"
+REQUIRED_USE="
+ dri3? ( drm )
+ opengl? ( server )
+"
CDEPEND="
media-libs/libjpeg-turbo:=
@@ -48,7 +52,6 @@ CDEPEND="
x11-apps/xsetroot
x11-misc/xkeyboard-config
opengl? ( media-libs/libglvnd[X] )
- xorgmodule? ( =x11-base/xorg-server-${XSERVER_VERSION%.*}* )
)
"
@@ -79,11 +82,12 @@ PATCHES=(
# Restore Java viewer
"${FILESDIR}"/${PN}-1.11.0-install-java-viewer.patch
"${FILESDIR}"/${PN}-1.12.0-xsession-path.patch
+ "${FILESDIR}"/${PN}-1.12.80-disable-server-and-pam.patch
)
src_unpack() {
git-r3_src_unpack
- unpack xorg-server-${XSERVER_VERSION}.tar.xz
+ use server && unpack xorg-server-${XSERVER_VERSION}.tar.xz
}
src_prepare() {
@@ -99,8 +103,9 @@ src_prepare() {
eautoreconf
sed -i 's:\(present.h\):../present/\1:' os/utils.c || die
sed -i '/strcmp.*-fakescreenfps/,/^ \}/d' os/utils.c || die
+
+ cd "${WORKDIR}" && sed -i 's:\(drm_fourcc.h\):libdrm/\1:' $(grep drm_fourcc.h -rl .) || die
fi
- cd "${WORKDIR}" && sed -i 's:\(drm_fourcc.h\):libdrm/\1:' $(grep drm_fourcc.h -rl .) || die
}
src_configure() {
@@ -112,6 +117,7 @@ src_configure() {
-DENABLE_GNUTLS=$(usex gnutls)
-DENABLE_NLS=$(usex nls)
-DBUILD_JAVA=$(usex java)
+ -DBUILD_SERVER=$(usex server)
)
cmake_src_configure
@@ -168,11 +174,7 @@ src_install() {
if use server; then
emake -C unix/xserver/hw/vnc DESTDIR="${D}" install
- if ! use xorgmodule; then
- rm -rv "${ED}"/usr/$(get_libdir)/xorg || die
- else
- rm -v "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/libvnc.la || die
- fi
+ rm -v "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/libvnc.la || die
newconfd "${FILESDIR}"/${PN}-1.12.0.confd ${PN}
newinitd "${FILESDIR}"/${PN}-1.12.0.initd ${PN}
@@ -185,15 +187,6 @@ src_install() {
# install vncserver to /usr/bin too, see bug #836620
dosym -r /usr/libexec/vncserver /usr/bin/vncserver
- else
- local f
- for f in x0vncserver vncconfig; do
- rm "${ED}"/usr/bin/${f} || die
- rm "${ED}"/usr/share/man/man1/${f}.1 || die
- done
- rm -r "${ED}"/usr/{sbin,libexec} || die
- rm -r "${ED}"/usr/share/man/man8 || die
- rm -r "${ED}"/etc || die
fi
}
@@ -202,6 +195,7 @@ pkg_postinst() {
local OPTIONAL_DM="gnome-base/gdm x11-misc/lightdm x11-misc/sddm x11-misc/slim"
use server && \
+ optfeature "keeping track of the xorg-server module" net-misc/tigervnc-xorg-module && \
optfeature_header "Install any additional display manager package:" && \
optfeature "proper session support" ${OPTIONAL_DM}
}