commit: 81782dbff6cb3d7c601a09f3e4cdf84fea4b36c2 Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com> AuthorDate: Sat Jun 18 09:53:32 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Jul 4 00:32:53 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81782dbf
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 <AT> draconx.ca> Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com> Closes: https://github.com/gentoo/gentoo/pull/26034 Signed-off-by: Sam James <sam <AT> gentoo.org> .../tigervnc-1.12.0-disable-server-and-pam.patch | 57 ++++++++++++++++++++++ .../tigervnc-1.12.80-disable-server-and-pam.patch | 57 ++++++++++++++++++++++ net-misc/tigervnc/metadata.xml | 1 - ...ervnc-9999.ebuild => tigervnc-1.12.0-r7.ebuild} | 48 ++++++++---------- net-misc/tigervnc/tigervnc-9999.ebuild | 30 +++++------- 5 files changed, 146 insertions(+), 47 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-9999.ebuild b/net-misc/tigervnc/tigervnc-1.12.0-r7.ebuild similarity index 77% copy from net-misc/tigervnc/tigervnc-9999.ebuild copy to net-misc/tigervnc/tigervnc-1.12.0-r7.ebuild index 903570b2dd06..ada6c94f5d44 100644 --- a/net-misc/tigervnc/tigervnc-9999.ebuild +++ b/net-misc/tigervnc/tigervnc-1.12.0-r7.ebuild @@ -4,19 +4,26 @@ EAPI=7 CMAKE_IN_SOURCE_BUILD=1 -inherit autotools cmake flag-o-matic git-r3 java-pkg-opt-2 optfeature systemd xdg +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="server? ( ftp://ftp.freedesktop.org/pub/xorg/individual/xserver/xorg-server-${XSERVER_VERSION}.tar.xz )" -EGIT_REPO_URI="https://github.com/TigerVNC/tigervnc/" +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="" -IUSE="dri3 +drm gnutls java nls +opengl server xinerama +xorgmodule" +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:= @@ -48,7 +55,6 @@ CDEPEND=" x11-apps/xsetroot x11-misc/xkeyboard-config opengl? ( media-libs/libglvnd[X] ) - xorgmodule? ( =x11-base/xorg-server-${XSERVER_VERSION%.*}* ) ) " @@ -79,16 +85,14 @@ 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_unpack() { - git-r3_src_unpack - unpack xorg-server-${XSERVER_VERSION}.tar.xz -} - 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 @@ -100,7 +104,6 @@ src_prepare() { sed -i 's:\(present.h\):../present/\1:' os/utils.c || die sed -i '/strcmp.*-fakescreenfps/,/^ \}/d' os/utils.c || die fi - cd "${WORKDIR}" && sed -i 's:\(drm_fourcc.h\):libdrm/\1:' $(grep drm_fourcc.h -rl .) || die } src_configure() { @@ -112,6 +115,7 @@ src_configure() { -DENABLE_GNUTLS=$(usex gnutls) -DENABLE_NLS=$(usex nls) -DBUILD_JAVA=$(usex java) + -DBUILD_SERVER=$(usex server) ) cmake_src_configure @@ -168,14 +172,10 @@ 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} + newconfd "${FILESDIR}"/${PN}-${PV}.confd ${PN} + newinitd "${FILESDIR}"/${PN}-${PV}.initd ${PN} systemd_douserunit unix/vncserver/[email protected] @@ -185,15 +185,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 +193,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} } 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} }
