aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <arrowd@FreeBSD.org>2023-10-23 14:53:05 +0000
committerGleb Popov <arrowd@FreeBSD.org>2023-10-23 17:30:56 +0000
commit462adef145ea60bb0201aa23f4c3c14c453a97f9 (patch)
tree10ddc53fe384994f31d9ca7395b71d41eb47d552
parent44997e6d709bf17994c7ac55c54ca31393316b2f (diff)
downloadports-462adef145ea60bb0201aa23f4c3c14c453a97f9.tar.gz
ports-462adef145ea60bb0201aa23f4c3c14c453a97f9.zip
games/moonlight-qt: Open source PC client for NVIDIA GameStream and Sunshine
Differential Revision: https://reviews.freebsd.org/D42323
-rw-r--r--games/moonlight-qt/Makefile45
-rw-r--r--games/moonlight-qt/distinfo3
-rw-r--r--games/moonlight-qt/files/patch-app_streaming_video_ffmpeg-renderers_drm.cpp27
-rw-r--r--games/moonlight-qt/pkg-descr3
4 files changed, 78 insertions, 0 deletions
diff --git a/games/moonlight-qt/Makefile b/games/moonlight-qt/Makefile
new file mode 100644
index 000000000000..3bc21934a1c1
--- /dev/null
+++ b/games/moonlight-qt/Makefile
@@ -0,0 +1,45 @@
+PORTNAME= moonlight
+DISTVERSION= 5.0.0
+CATEGORIES= games
+MASTER_SITES= https://github.com/moonlight-stream/moonlight-qt/releases/download/v${DISTVERSION}/
+PKGNAMESUFFIX= -qt
+DISTNAME= MoonlightSrc-${DISTVERSIONFULL}
+
+MAINTAINER= lisp_25689@163.com
+COMMENT= Gamestream client
+WWW= https://github.com/moonlight-stream/moonlight-qt
+
+LICENSE= GPLv3+
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
+ libopus.so:audio/opus \
+ libva.so:multimedia/libva \
+ libdrm.so:graphics/libdrm \
+ libvdpau.so:multimedia/libvdpau \
+ libwayland-client.so:graphics/wayland
+
+USES= desktop-file-utils gl localbase:ldflags pkgconfig \
+ qmake:outsource qt:5 sdl ssl xorg
+USE_QT= core declarative gui network quickcontrols2 svg widgets buildtools:build
+USE_GL= egl
+USE_SDL= sdl2 ttf2
+USE_XORG= x11
+
+NO_WRKSUBDIR= yes
+
+PLIST_FILES= bin/moonlight-qt \
+ share/applications/com.moonlight_stream.Moonlight.desktop \
+ share/metainfo/com.moonlight_stream.Moonlight.appdata.xml \
+ share/icons/hicolor/scalable/apps/moonlight.svg \
+
+post-patch:
+ @${REINPLACE_CMD} -e 's@^ TARGET = moonlight.*@ TARGET = ${PORTNAME}${PKGNAMESUFFIX}@' \
+ ${WRKSRC}/app/app.pro
+ @${REINPLACE_CMD} -e 's@Exec=moonlight.*@Exec=${PORTNAME}${PKGNAMESUFFIX}@' \
+ ${WRKSRC}/app/deploy/linux/com.moonlight_stream.Moonlight.desktop
+
+post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
+
+.include <bsd.port.mk>
diff --git a/games/moonlight-qt/distinfo b/games/moonlight-qt/distinfo
new file mode 100644
index 000000000000..f7fb7de29906
--- /dev/null
+++ b/games/moonlight-qt/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1697634805
+SHA256 (MoonlightSrc-5.0.0.tar.gz) = bb376640421cd5386a64102cbb9d78f5be87e8f796b78bf517dca2c8c37acfd4
+SIZE (MoonlightSrc-5.0.0.tar.gz) = 79821343
diff --git a/games/moonlight-qt/files/patch-app_streaming_video_ffmpeg-renderers_drm.cpp b/games/moonlight-qt/files/patch-app_streaming_video_ffmpeg-renderers_drm.cpp
new file mode 100644
index 000000000000..4068c7278a21
--- /dev/null
+++ b/games/moonlight-qt/files/patch-app_streaming_video_ffmpeg-renderers_drm.cpp
@@ -0,0 +1,27 @@
+--- app/streaming/video/ffmpeg-renderers/drm.cpp.orig 2023-10-18 05:45:10 UTC
++++ app/streaming/video/ffmpeg-renderers/drm.cpp
+@@ -10,7 +10,24 @@ extern "C" {
+ }
+
+ #include <libdrm/drm_fourcc.h>
++#ifdef __linux__
+ #include <linux/dma-buf.h>
++#else //bundle on BSDs
++typedef uint64_t __u64;
++// From https://github.com/evadot/drm-subtree or https://reviews.freebsd.org/D23085
++struct dma_buf_sync {
++ __u64 flags;
++};
++#define DMA_BUF_SYNC_READ (1 << 0)
++#define DMA_BUF_SYNC_WRITE (2 << 0)
++#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
++#define DMA_BUF_SYNC_START (0 << 2)
++#define DMA_BUF_SYNC_END (1 << 2)
++#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
++ (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
++#define DMA_BUF_BASE 'b'
++#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
++#endif
+ #include <sys/ioctl.h>
+
+ // Special Rockchip type
diff --git a/games/moonlight-qt/pkg-descr b/games/moonlight-qt/pkg-descr
new file mode 100644
index 000000000000..45af489a358a
--- /dev/null
+++ b/games/moonlight-qt/pkg-descr
@@ -0,0 +1,3 @@
+Moonlight PC is an open source PC client for NVIDIA GameStream and Sunshine. It
+allows you to stream your full collection of games from your Windows/Linux
+desktop to your FreeBSD system.