-
Notifications
You must be signed in to change notification settings - Fork 974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some Debian patches to TigerVNC that might also be useful upstream #1888
Conversation
4fc1cb6
to
b3c755c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on getting this in sync. There are some questions I'd like to discuss before merging, though.
@@ -1,5 +1,5 @@ | |||
TIGERVNC_SRCDIR=${top_srcdir}/../.. | |||
TIGERVNC_BUILDDIR=${TIGERVNC_SRCDIR} | |||
TIGERVNC_BUILDDIR=${top_builddir}/../.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure of the use case here. I would assume that when Xorg is built out of tree, then so is TigerVNC. And it would be unclear what that build directory is.
What is the scenario where you find this change helpful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted the commit message to explain:
"Added reasonable defaults for TIGERVNC_BUILDDIR in the build of Xvnc, assuming that when Xvnc is building out of source, then so are the TigerVNC libraries and that the same relative directory relations will be preserved in the out-of-source build tree as are present in the source tree."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'm afraid I'm still not quite understanding the scenario. Are you saying the setup is:
TigerVNC source: ~/devel/tigervnc
TigerVNC build dir: ~/devel/tigervnc/build
Xvnc source: ~/devel/tigervnc/unix/xserver
Xvnc build dir: ~/devel/tigervnc/build/unix/xserver/
?
A reasonable setup, but not an obvious one. I don't see anyone else using this structure.
Still, I don't think it's a worse default than what we currently have, so I'm okay with merging it.
The commit message doesn't follow normal git conventions, though. Could you make sure it has a maximum 50 character title, follow with a body? Same thing for the other commits in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly like this. I changed the commit messages again to use standard format and used your example to make the meaning cleaner.
CMakeLists.txt
Outdated
option(ENABLE_NLS "Enable translation of program messages" ON) | ||
if(ENABLE_NLS) | ||
set(ENABLE_NLS CACHE BOOL "Enable translation of program messages") | ||
if(ENABLE_NLS OR ENABLE_NLS STREQUAL "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sympathize with the goal here, but I'm concerned that the method gets a bit convoluted. Leaving booleans without a clear value, and doing string comparisons with them, can be a bit confusing and easy to get wrong.
Are you aware of any alternative models to solve this issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote the code to use NOT DEFINED instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this gives a stable behaviour. I guess the option is now only presented if you've also specified it on the command line?
Perhaps we can do something with the default value instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b91d84ed..a5dc8566f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,6 +117,13 @@ if(APPLE)
add_definitions(-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0)
endif()
+#### Check for required and optional libraries ####
+
+macro(trioption VAR DESC)
+ set(${VAR} AUTO CACHE STRING "${DESC}")
+ set_property(CACHE ${VAR} PROPERTY STRINGS AUTO ON OFF)
+endmacro()
+
# X11 stuff. It's in a if() so that we can say REQUIRED
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
@@ -141,13 +148,17 @@ find_package(ZLIB REQUIRED)
find_package(Pixman REQUIRED)
# Check for gettext
-option(ENABLE_NLS "Enable translation of program messages" ON)
+trioption(ENABLE_NLS "Enable translation of program messages")
if(ENABLE_NLS)
# Tools
find_package(Gettext)
# Gettext needs iconv
- find_package(Iconv)
+ if(ENABLE_NLS STREQUAL "AUTO")
+ find_package(Iconv)
+ else()
+ find_package(Iconv REQUIRED)
+ endif()
if(ICONV_FOUND)
# Headers and libraries (copied from licq)
@@ -173,6 +184,10 @@ if(ENABLE_NLS)
set(CMAKE_REQUIRED_LIBRARIES)
set(CMAKE_REQUIRED_FLAGS)
endif()
+
+ if(NOT GETTEXT_FOUND AND NOT ENABLE_NLS STREQUAL "AUTO")
+ message(FATAL_ERROR "Could not find GETTEXT")
+ endif()
endif()
if(NOT GETTEXT_FOUND OR NOT ICONV_FOUND)
@@ -181,7 +196,7 @@ if(ENABLE_NLS)
endif()
endif()
-option(ENABLE_H264 "Enable H.264 RFB encoding" ON)
+trioption(ENABLE_H264 "Enable H.264 RFB encoding")
if(ENABLE_H264)
if(WIN32)
add_definitions("-DHAVE_H264")
@@ -195,7 +210,11 @@ if(ENABLE_H264)
add_definitions("-DHAVE_VIDEO_PROCESSOR_MFT")
endif()
else()
- find_package(Ffmpeg)
+ if(ENABLE_H264 STREQUAL "AUTO")
+ find_package(Ffmpeg)
+ else()
+ find_package(Ffmpeg REQUIRED)
+ endif()
if (AVCODEC_FOUND AND AVUTIL_FOUND AND SWSCALE_FOUND)
set(H264_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS} ${SWSCALE_INCLUDE_DIRS})
set(H264_LIBRARIES ${AVCODEC_LIBRARIES} ${AVUTIL_LIBRARIES} ${SWSCALE_LIBRARIES})
@@ -283,17 +302,25 @@ if(BUILD_VIEWER)
endif()
# Check for GNUTLS library
-option(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication" ON)
+trioption(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication")
if(ENABLE_GNUTLS)
- find_package(GnuTLS)
+ if(ENABLE_GNUTLS STREQUAL "AUTO")
+ find_package(GnuTLS)
+ else()
+ find_package(GnuTLS REQUIRED)
+ endif()
if (GNUTLS_FOUND)
add_definitions("-DHAVE_GNUTLS")
endif()
endif()
-option(ENABLE_NETTLE "Enable RSA-AES security types" ON)
+trioption(ENABLE_NETTLE "Enable RSA-AES security types")
if (ENABLE_NETTLE)
- find_package(Nettle)
+ if(ENABLE_NETTLE STREQUAL "AUTO")
+ find_package(Nettle)
+ else()
+ find_package(Nettle REQUIRED)
+ endif()
if (NETTLE_FOUND)
add_definitions("-DHAVE_NETTLE")
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is much cleaner. I adopted this.
b3c755c
to
f319a6b
Compare
Some '-' in man pages, which start options, are rendered as Unicode dashes, not ASCII '-'; fix this.
Add missing fields developer with value "The TigerVNC Team" and the TigerVNC homepage for the TigerVNC Viewer AppStream meta info file.
The syslog.target is obsolete in Debian due to systemd syslog socket activation. I am relatively sure that this is also the case for other distributions. Therefore, remove syslog.target from [email protected].
Changed default for TIGERVNC_BUILDDIR in the build of Xvnc. Assume that when Xvnc is built out of source, the TigerVNC libraries are as well. Moreover, as a reasonable default, assume that the same relative directory relations will be preserved in the out-of-source build tree as are present in the source tree, e.g., TigerVNC source: ~/devel/tigervnc TigerVNC build dir: ~/devel/tigervnc/build Xvnc source: ~/devel/tigervnc/unix/xserver Xvnc build dir: ~/devel/tigervnc/build/unix/xserver
If a feature is explicitly requested via the cmake command line, error out if necessary libraries are missing and do not silently disable the requested feature.
f319a6b
to
68763a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks again!
On 13.12.24 22:45, Joachim Falk wrote:
On 16.12.24 08:07, Pierre Ossman wrote:
Done as requested.
Best,
Joachim