summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViorel Munteanu <ceamac.paragon@gmail.com>2022-04-10 22:04:10 +0300
committerJoonas Niilola <juippis@gentoo.org>2022-04-18 10:27:31 +0300
commit60d0914cd8746831795a75d052a3e1126229460c (patch)
tree1a2170ecf901092352bd46ddc1f335538b5c09ad /net-misc/turbovnc
parentdev-python/setuptools: Keyword 62.1.0 riscv, #836568 (diff)
downloadgentoo-60d0914cd8746831795a75d052a3e1126229460c.tar.gz
gentoo-60d0914cd8746831795a75d052a3e1126229460c.tar.bz2
gentoo-60d0914cd8746831795a75d052a3e1126229460c.zip
net-misc/turbovnc: Fix compilation on musl
Closes: https://bugs.gentoo.org/836723 Signed-off-by: Viorel Munteanu <ceamac.paragon@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/24981 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'net-misc/turbovnc')
-rw-r--r--net-misc/turbovnc/files/turbovnc-2.2.7-fix-musl-compilation.patch51
-rw-r--r--net-misc/turbovnc/turbovnc-2.2.7-r2.ebuild3
2 files changed, 54 insertions, 0 deletions
diff --git a/net-misc/turbovnc/files/turbovnc-2.2.7-fix-musl-compilation.patch b/net-misc/turbovnc/files/turbovnc-2.2.7-fix-musl-compilation.patch
new file mode 100644
index 000000000000..c9f5f0397b4c
--- /dev/null
+++ b/net-misc/turbovnc/files/turbovnc-2.2.7-fix-musl-compilation.patch
@@ -0,0 +1,51 @@
+See bug https://bugs.gentoo.org/836723
+
+There are 2 compilation errors:
+
+/var/tmp/portage/net-misc/turbovnc-2.2.7-r2/work/turbovnc-2.2.7/unix/Xvnc/programs/Xserver/os/access.c: In function 'GetLocalClientCreds':
+/var/tmp/portage/net-misc/turbovnc-2.2.7-r2/work/turbovnc-2.2.7/unix/Xvnc/programs/Xserver/os/access.c:1178:18: error: storage size of 'peercred' isn't known
+ 1178 | struct ucred peercred;
+ | ^~~~~~~~
+
+/var/tmp/portage/net-misc/turbovnc-2.2.7-r2/work/turbovnc-2.2.7/unix/Xvnc/programs/Xserver/Xext/xf86bigfont.c:48:10: fatal error: asm/page.h: No such file or directory
+ 48 | #include <asm/page.h>
+ | ^~~~~~~~~~~~
+
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -69,6 +69,8 @@
+ boolean_number(TVNC_BUILDSERVER)
+ report_option(TVNC_BUILDSERVER "TurboVNC Server")
+
++option(BUILDING_ON_MUSL "Define GNU macros on musl" 0)
++
+ if(TVNC_BUILDNATIVE OR TVNC_BUILDSERVER)
+ set(USEC 1)
+ endif()
+--- a/unix/Xvnc/programs/Xserver/os/CMakeLists.txt
++++ b/unix/Xvnc/programs/Xserver/os/CMakeLists.txt
+@@ -13,6 +13,10 @@
+ add_definitions(-DBSD44SOCKETS)
+ endif()
+
++if(BUILDING_ON_MUSL)
++ add_definitions(-D_GNU_SOURCE)
++endif()
++
+ set(EXTRASRCS "")
+ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
+ add_definitions(-DSECURE_RPC)
+--- a/unix/Xvnc/programs/Xserver/Xext/CMakeLists.txt
++++ b/unix/Xvnc/programs/Xserver/Xext/CMakeLists.txt
+@@ -8,6 +8,10 @@
+ endif()
+ endforeach()
+
++if(BUILDING_ON_MUSL)
++ add_definitions(-D__GNU_LIBRARY__=2)
++endif()
++
+ disable_compiler_warnings()
+ handle_type_puns()
+
diff --git a/net-misc/turbovnc/turbovnc-2.2.7-r2.ebuild b/net-misc/turbovnc/turbovnc-2.2.7-r2.ebuild
index 5b1a5561d896..89f5f2da2cce 100644
--- a/net-misc/turbovnc/turbovnc-2.2.7-r2.ebuild
+++ b/net-misc/turbovnc/turbovnc-2.2.7-r2.ebuild
@@ -44,6 +44,8 @@ RDEPEND="
x11-apps/xkbcomp
"
+PATCHES=( "${FILESDIR}"/"${P}"-fix-musl-compilation.patch )
+
src_prepare() {
use java && java-pkg-opt-2_src_prepare
cmake_src_prepare
@@ -57,6 +59,7 @@ src_configure() {
-DTVNC_BUILDNATIVE=$(usex java)
-DXKB_BIN_DIRECTORY=/usr/bin
-DXKB_DFLT_RULES=base
+ -DBUILDING_ON_MUSL=$(usex elibc_musl) # bug #836723
)
if use ssl ; then