From 19510c958ea2ea1a122969288944205262036c5b Mon Sep 17 00:00:00 2001 From: Brian Callahan Date: Sun, 30 Mar 2025 10:53:32 -0400 Subject: [PATCH] Add OpenBSD support --- README.html | 10 +++++++++- README.md | 11 ++++++++++- README.txt | 11 ++++++++++- lib/raop_rtp_mirror.c | 8 ++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/README.html b/README.html index 33a3793..77cbffe 100644 --- a/README.html +++ b/README.html @@ -56,7 +56,8 @@ alt="Current Packaging status" />.

Building an installable RPM package

@@ -461,6 +466,9 @@ graphics).

gstreamer1-plugins, gstreamer1-plugins-* (* = core, good, bad, x, gtk, gl, vulkan, pulse, v4l2, …), (+ gstreamer1-vaapi for Intel/AMD graphics).

+
  • OpenBSD: Install gstreamer1-libav, +gstreamer1-plugins-* (* = core, bad, base, good). avahi-main must also +be installed for the avahi_daemon rc startup script.

  • Starting and running UxPlay

    Since UxPlay-1.64, UxPlay can be started with options read from a diff --git a/README.md b/README.md index c871564..621cf19 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,8 @@ status](https://repology.org/badge/vertical-allrepos/uxplay.svg)](https://repolo - Install uxplay on Debian-based Linux systems with "`sudo apt install uxplay`"; on FreeBSD with - "`sudo pkg install uxplay`". Also available on Arch-based systems + "`sudo pkg install uxplay`"; on OpenBSD with + "`doas pkg_add uxplay`". Also available on Arch-based systems through AUR. Since v. 1.66, uxplay is now also packaged in RPM format by Fedora 38 ("`sudo dnf install uxplay`"). @@ -373,6 +374,10 @@ package](#building-an-installable-rpm-package). avahi-libdns or mDNSResponder must also be installed to provide the dns_sd library. OpenSSL is already installed as a System Library. +- **OpenBSD:** (doas pkg_add) libplist gstreamer1-plugins-base. + avahi-libs must also be installed to provide the dns_sd library. + OpenSSL is already installed as a System Library. + #### Building an installable RPM package First-time RPM builders should first install the rpm-build and @@ -454,6 +459,10 @@ repositories for those distributions. gstreamer1-plugins-\* (\* = core, good, bad, x, gtk, gl, vulkan, pulse, v4l2, ...), (+ gstreamer1-vaapi for Intel/AMD graphics). +- **OpenBSD:** Install gstreamer1-libav, gstreamer-plugins-\* + (\* = core, bad, base, good). avahi-main must also be installed for + the avahi_daemon rc startup script. + ### Starting and running UxPlay Since UxPlay-1.64, UxPlay can be started with options read from a diff --git a/README.txt b/README.txt index a0d5064..8eed072 100644 --- a/README.txt +++ b/README.txt @@ -48,7 +48,8 @@ status](https://repology.org/badge/vertical-allrepos/uxplay.svg)](https://repolo - Install uxplay on Debian-based Linux systems with "`sudo apt install uxplay`"; on FreeBSD with - "`sudo pkg install uxplay`". Also available on Arch-based systems + "`sudo pkg install uxplay`"; on OpenBSD with + "`doas pkg_add uxplay`". Also available on Arch-based systems through AUR. Since v. 1.66, uxplay is now also packaged in RPM format by Fedora 38 ("`sudo dnf install uxplay`"). @@ -373,6 +374,10 @@ package](#building-an-installable-rpm-package). avahi-libdns or mDNSResponder must also be installed to provide the dns_sd library. OpenSSL is already installed as a System Library. +- **OpenBSD:** (doas pkg_add) libplist gstreamer1-plugins-base. + avahi-libs must also be installed to provide the dns_sd library. + OpenSSL is already installed as a System Library. + #### Building an installable RPM package First-time RPM builders should first install the rpm-build and @@ -454,6 +459,10 @@ repositories for those distributions. gstreamer1-plugins-\* (\* = core, good, bad, x, gtk, gl, vulkan, pulse, v4l2, ...), (+ gstreamer1-vaapi for Intel/AMD graphics). +- **OpenBSD:** Install gstreamer1-libav, gstreamer-plugins-\* + (\* = core, bad, base, good). avahi-main must also be installed for + the avahi_daemon rc startup script. + ### Starting and running UxPlay Since UxPlay-1.64, UxPlay can be started with options read from a diff --git a/lib/raop_rtp_mirror.c b/lib/raop_rtp_mirror.c index de79ed4..82faef9 100644 --- a/lib/raop_rtp_mirror.c +++ b/lib/raop_rtp_mirror.c @@ -62,6 +62,11 @@ #define TCP_KEEPIDLE TCP_KEEPALIVE #endif +/* for OpenBSD, where TCP_KEEPIDLE and TCP_KEEPALIVE are not defined */ +#if !defined(TCP_KEEPIDLE) && !defined(TCP_KEEPALIVE) +#define TCP_KEEPIDLE SO_KEEPALIVE +#endif + //struct h264codec_s { // unsigned char compatibility; // short pps_size; @@ -279,6 +284,8 @@ raop_rtp_mirror_thread(void *arg) logger_log(raop_rtp_mirror->logger, LOGGER_WARNING, "raop_rtp_mirror could not set stream socket keepalive time %d %s", sock_err, SOCKET_ERROR_STRING(sock_err)); } +/* OpenBSD does not have these options. */ +#ifndef __OpenBSD__ option = 10; if (setsockopt(stream_fd, SOL_TCP, TCP_KEEPINTVL, CAST &option, sizeof(option)) < 0) { int sock_err = SOCKET_GET_ERROR(); @@ -291,6 +298,7 @@ raop_rtp_mirror_thread(void *arg) logger_log(raop_rtp_mirror->logger, LOGGER_WARNING, "raop_rtp_mirror could not set stream socket keepalive probes %d %s", sock_err, SOCKET_ERROR_STRING(sock_err)); } +#endif /* !__OpenBSD__ */ readstart = 0; }