With epoll-shim (attached) newer freerdp works well enough.
The TestSynchWaitableTimer test does still hang but runtime works well
enough and it lets us get updated past the vulnerable version we've stuck
with for ages due to it required either timerfd/posix timers/or a custom
implementation.
OK to import epoll-shim?
(I'm testing ports that depend on freerdp now).
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/freerdp/Makefile,v
retrieving revision 1.41
diff -u -p -r1.41 Makefile
--- Makefile 31 Jan 2021 20:14:42 -0000 1.41
+++ Makefile 26 Feb 2021 16:15:51 -0000
@@ -4,25 +4,13 @@
BROKEN-hppa = undefined reference to __sync_val_compare_and_swap_4
COMMENT = client for Microsoft RDP (remote desktop protocol)
-DISTNAME = freerdp-2.0.0-rc1
-PKGNAME = freerdp-2.0.0rc1
-REVISION = 5
+DISTNAME = freerdp-2.3.0
CATEGORIES = x11 net
-# XXX This version has known security issues.
-
-# XXX Can't be updated without either timer_create() and friends or
-# an alternative timer implementation (as was done for OSX).
-# Make sure it gets through the waitable timer checks in "make
-# test" without hanging or failing. Since it came up a few times,
-# just setting "timer->fd = kqueue()" in InitializeWaitableTimer
-# is not enough. See https://junkpile.org/freerdp.diff for the
-# non-timer-related parts of an update.
-
-SHARED_LIBS += freerdp-client2 0.0 # 2.0
-SHARED_LIBS += freerdp2 0.0 # 2.0
-SHARED_LIBS += winpr-tools2 0.0 # 2.0
-SHARED_LIBS += winpr2 0.0 # 2.0
+SHARED_LIBS += freerdp-client2 1.0
+SHARED_LIBS += freerdp2 1.0
+SHARED_LIBS += winpr-tools2 1.0
+SHARED_LIBS += winpr2 1.0
HOMEPAGE = https://www.freerdp.com/
MASTER_SITES = https://pub.freerdp.com/releases/
@@ -30,25 +18,31 @@ MASTER_SITES = https://pub.freerdp.com/
# Apache 2.0
PERMIT_PACKAGE = Yes
-WANTLIB += X11 Xcursor Xext Xfixes Xi Xinerama Xrender Xv avcodec
-WANTLIB += avutil c crypto cups execinfo m pthread ssl xkbfile
+WANTLIB += X11 Xcursor Xext Xfixes Xi Xinerama Xrandr Xrender Xv
+WANTLIB += avcodec avutil c crypto cups epoll-shim m pthread ssl
+WANTLIB += swresample usb-1.0 xkbfile
# thread-local storage
COMPILER = base-clang ports-gcc
MODULES = devel/cmake
-CFLAGS += -I${X11BASE}/include -I${LOCALBASE}/include
+CFLAGS += -I${X11BASE}/include \
+ -I${LOCALBASE}/include
CFLAGS += -fcommon
BUILD_DEPENDS = security/pcsc-lite \
textproc/xmlto
-LIB_DEPENDS = devel/libexecinfo \
+LIB_DEPENDS = devel/libusb1 \
print/cups,-libs \
graphics/ffmpeg
+# used to work-around lack of posix timers.
+# not quite everything is correct, but works well enough for most use.
+LIB_DEPENDS += devel/epoll-shim
+
CONFIGURE_ARGS += -DBUILD_TESTING=ON \
-DWITH_CUPS=ON \
-DWITH_DIRECTFB=OFF \
@@ -59,12 +53,11 @@ CONFIGURE_ARGS += -DBUILD_TESTING=ON \
-DWITH_LIBSYSTEMD=OFF \
-DWITH_OSS=OFF
-pre-configure:
- ${SUBST_CMD} ${WRKSRC}/winpr/libwinpr/CMakeLists.txt
- ${SUBST_CMD} ${WRKSRC}/CMakeLists.txt
-
.if ${MACHINE_ARCH} == "sparc64"
CONFIGURE_ARGS += -DWITH_NEON=OFF
.endif
+
+pre-configure:
+ sed -i 's,/usr/local,${LOCALBASE},g' ${WRKSRC}/{,winpr/libwinpr/}CMakeLists.txt
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/x11/freerdp/distinfo,v
retrieving revision 1.8
diff -u -p -r1.8 distinfo
--- distinfo 28 Apr 2018 19:20:17 -0000 1.8
+++ distinfo 26 Feb 2021 16:15:51 -0000
@@ -1,2 +1,2 @@
-SHA256 (freerdp-2.0.0-rc1.tar.gz) = 8JogqXEWPCeD77egtIyGBuIPl7RB9xjyUoNDgnex+Hs=
-SIZE (freerdp-2.0.0-rc1.tar.gz) = 6575999
+SHA256 (freerdp-2.3.0.tar.gz) = lO6I9Ws0TH+WDWgF6i24sd66PI9gnbCX4IzN9r35vXg=
+SIZE (freerdp-2.3.0.tar.gz) = 7280113
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /cvs/ports/x11/freerdp/patches/patch-CMakeLists_txt,v
retrieving revision 1.6
diff -u -p -r1.6 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 28 Apr 2018 19:20:17 -0000 1.6
+++ patches/patch-CMakeLists_txt 26 Feb 2021 16:15:51 -0000
@@ -3,16 +3,59 @@ $OpenBSD: patch-CMakeLists_txt,v 1.6 201
Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
-@@ -953,9 +953,9 @@ if(WAYLAND_FOUND)
+@@ -194,12 +194,14 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "BSD")
+ set(BSD TRUE)
+ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ set(FREEBSD TRUE)
++ set(EPOLLSHIM TRUE)
+ endif()
+ if(${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD")
+ set(KFREEBSD TRUE)
+ endif()
+ if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
+ set(OPENBSD TRUE)
++ set(EPOLLSHIM TRUE)
+ endif()
+ endif()
+
+@@ -208,7 +210,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
+ set(FREEBSD TRUE)
endif()
- if(BSD)
-- if(IS_DIRECTORY /usr/local/include)
-- include_directories(/usr/local/include)
-- link_directories(/usr/local/lib)
-+ if(IS_DIRECTORY ${LOCALBASE}/include)
-+ include_directories(${LOCALBASE}/include)
-+ link_directories(${LOCALBASE}/lib)
+-if(FREEBSD)
++if(EPOLLSHIM)
+ find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim)
+ find_library(EPOLLSHIM_LIBS NAMES epoll-shim libepoll-shim HINTS /usr/local/lib)
+ endif()
+@@ -524,7 +526,7 @@ add_definitions(-DWINPR_EXPORTS -DFREERDP_EXPORTS)
+ if(NOT IOS)
+ check_include_files(fcntl.h HAVE_FCNTL_H)
+ check_include_files(unistd.h HAVE_UNISTD_H)
+- check_include_files(execinfo.h HAVE_EXECINFO_H)
++ #check_include_files(execinfo.h HAVE_EXECINFO_H)
+ check_include_files(inttypes.h HAVE_INTTYPES_H)
+ check_include_files(sys/modem.h HAVE_SYS_MODEM_H)
+ check_include_files(sys/filio.h HAVE_SYS_FILIO_H)
+@@ -576,7 +578,7 @@ if(OPENBSD)
+ set(WITH_MANPAGES "ON")
+ set(WITH_ALSA "OFF")
+ set(WITH_PULSE "OFF")
+- set(WITH_OSS "ON")
++ set(WITH_OSS "OFF")
+ set(WITH_WAYLAND "OFF")
+ endif()
+
+@@ -631,11 +633,11 @@ if(UNIX OR CYGWIN)
+ if (HAVE_SYS_EVENTFD_H)
+ check_symbol_exists(eventfd_read sys/eventfd.h WITH_EVENTFD_READ_WRITE)
+ endif()
+- if (FREEBSD)
++ if (EPOLLSHIM)
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${EPOLLSHIM_INCLUDE_DIR})
+ endif()
+ check_include_files(sys/timerfd.h HAVE_SYS_TIMERFD_H)
+- if (FREEBSD)
++ if (EPOLLSHIM)
+ list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${EPOLLSHIM_INCLUDE_DIR})
endif()
- if(OPENBSD)
- if(IS_DIRECTORY /usr/X11R6/include)
+ check_include_files(poll.h HAVE_POLL_H)
Index: patches/patch-channels_rdpdr_client_rdpdr_main_c
===================================================================
RCS file: patches/patch-channels_rdpdr_client_rdpdr_main_c
diff -N patches/patch-channels_rdpdr_client_rdpdr_main_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-channels_rdpdr_client_rdpdr_main_c 26 Feb 2021 16:15:51 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: channels/rdpdr/client/rdpdr_main.c
+--- channels/rdpdr/client/rdpdr_main.c.orig
++++ channels/rdpdr/client/rdpdr_main.c
+@@ -111,7 +111,7 @@ static UINT rdpdr_send_device_list_remove_request(rdpd
+ return rdpdr_send(rdpdr, s);
+ }
+
+-#if defined(_UWP) || defined(__IOS__)
++#if defined(_UWP) || defined(__IOS__) || defined(__OpenBSD__)
+
+ void first_hotplug(rdpdrPlugin* rdpdr)
+ {
+@@ -957,7 +957,7 @@ out:
+
+
No comments:
Post a Comment