aboutsummaryrefslogtreecommitdiff
path: root/games/moonlight-embedded
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2017-08-03 21:44:51 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2017-08-03 21:44:51 +0000
commit68f16288f72dbf76e9c0d4739948faae8cf9cf7a (patch)
tree6c8607e5e2a128dfcdf6db5f66cbe31748699255 /games/moonlight-embedded
parent55ba325fbb06caab888edc12be4988ab7991e5d6 (diff)
downloadports-68f16288f72dbf76e9c0d4739948faae8cf9cf7a.tar.gz
ports-68f16288f72dbf76e9c0d4739948faae8cf9cf7a.zip
New port: games/moonlight-embedded
Moonlight Embedded is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield. Moonlight Embedded allows you to stream your full collection of games from your powerful Windows desktop to your FreeBSD system. WWW: https://github.com/irtimmer/moonlight-embedded
Notes
Notes: svn path=/head/; revision=447284
Diffstat (limited to 'games/moonlight-embedded')
-rw-r--r--games/moonlight-embedded/Makefile56
-rw-r--r--games/moonlight-embedded/distinfo5
-rw-r--r--games/moonlight-embedded/files/patch-libgamestream_client.c14
-rw-r--r--games/moonlight-embedded/files/patch-src_main.c80
-rw-r--r--games/moonlight-embedded/files/patch-src_platform.c17
-rw-r--r--games/moonlight-embedded/files/patch-third__party_moonlight-common-c_src_InputStream.c11
-rw-r--r--games/moonlight-embedded/pkg-descr7
-rw-r--r--games/moonlight-embedded/pkg-plist4
8 files changed, 194 insertions, 0 deletions
diff --git a/games/moonlight-embedded/Makefile b/games/moonlight-embedded/Makefile
new file mode 100644
index 000000000000..a60f257b74b1
--- /dev/null
+++ b/games/moonlight-embedded/Makefile
@@ -0,0 +1,56 @@
+# $FreeBSD$
+
+PORTNAME= moonlight-embedded
+PORTVERSION= 2.4.2
+DISTVERSIONPREFIX= v
+CATEGORIES= games
+
+MAINTAINER= tobik@FreeBSD.org
+COMMENT= Gamestream client
+
+LICENSE= GPLv3+
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
+ libcurl.so:ftp/curl \
+ libenet.so:net/enet \
+ libexpat.so:textproc/expat2 \
+ libopus.so:audio/opus \
+ libuuid.so:misc/e2fsprogs-libuuid
+
+USES= cmake localbase:ldflags perl5 pkgconfig ssl
+USE_GITHUB= yes
+GH_ACCOUNT= irtimmer
+GH_TUPLE= irtimmer:moonlight-common-c:a1bdb36766f8db5dc9cc0694c9a376f0dca3ab59:common/third_party/moonlight-common-c
+USE_LDCONFIG= yes
+USE_PERL5= build
+USE_SDL= sdl2
+
+CFLAGS+= -DPREFIX="\\\"${PREFIX}\\\""
+
+post-patch:
+ @${REINPLACE_CMD} -e '/(ALSA)/d' \
+ -e '/libpulse-simple/d' \
+ -e '/libcec/d' \
+ -e '/libevdev/d' -e 's@./src/input/evdev.c@@' \
+ -e '/libudev/d' -e 's@./src/input/udev.c@@' \
+ -e '/libva/d' \
+ -e '/vdpau/d' \
+ -e '/egl/d' \
+ -e '/glesv2/d' \
+ -e '/x11/d' \
+ ${WRKSRC}/CMakeLists.txt
+ @${RM} ${WRKSRC}/src/loop.c
+ @${REINPLACE_CMD} -e '/avahi-client/d' -e 's@SHARED@STATIC@' \
+ -e 's@OpenSSL 1.0.2@OpenSSL@' -e '/^install(/d' \
+ ${WRKSRC}/libgamestream/CMakeLists.txt
+ @${RM} ${WRKSRC}/libgamestream/discover.c
+ @${REINPLACE_CMD} -e 's@/etc/moonlight/moonlight.conf@${PREFIX}/etc/moonlight.conf@' \
+ -e 's@moonligt@moonlight@' \
+ ${WRKSRC}/docs/README.pod
+
+post-install:
+ @${MV} ${STAGEDIR}${PREFIX}/etc/moonlight.conf \
+ ${STAGEDIR}${PREFIX}/etc/moonlight.conf.sample
+
+.include <bsd.port.mk>
diff --git a/games/moonlight-embedded/distinfo b/games/moonlight-embedded/distinfo
new file mode 100644
index 000000000000..4579b370a013
--- /dev/null
+++ b/games/moonlight-embedded/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1501714039
+SHA256 (irtimmer-moonlight-embedded-v2.4.2_GH0.tar.gz) = 263ec71dc552c8e7f9a21a2b04ad563c34d2a422ba8fe6a0ba5dbb2804500314
+SIZE (irtimmer-moonlight-embedded-v2.4.2_GH0.tar.gz) = 136010
+SHA256 (irtimmer-moonlight-common-c-a1bdb36766f8db5dc9cc0694c9a376f0dca3ab59_GH0.tar.gz) = b9fce9621b4b0cf780c3e1e75b52afa3e4493993289f28301b957beb7299d8bb
+SIZE (irtimmer-moonlight-common-c-a1bdb36766f8db5dc9cc0694c9a376f0dca3ab59_GH0.tar.gz) = 64283
diff --git a/games/moonlight-embedded/files/patch-libgamestream_client.c b/games/moonlight-embedded/files/patch-libgamestream_client.c
new file mode 100644
index 000000000000..6895b7f72025
--- /dev/null
+++ b/games/moonlight-embedded/files/patch-libgamestream_client.c
@@ -0,0 +1,14 @@
+--- libgamestream/client.c.orig 2017-07-02 11:38:48 UTC
++++ libgamestream/client.c
+@@ -494,7 +494,11 @@ int gs_pair(PSERVER_DATA server, char* pin) {
+ RAND_bytes(client_secret_data, 16);
+
+ const ASN1_BIT_STRING *asnSignature;
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ X509_get0_signature(&asnSignature, NULL, cert);
++#else
++ asnSignature = cert->signature;
++#endif
+
+ char challenge_response[16 + 256 + 16];
+ char challenge_response_hash[32];
diff --git a/games/moonlight-embedded/files/patch-src_main.c b/games/moonlight-embedded/files/patch-src_main.c
new file mode 100644
index 000000000000..ba5ef680502a
--- /dev/null
+++ b/games/moonlight-embedded/files/patch-src_main.c
@@ -0,0 +1,80 @@
+--- src/main.c.orig 2017-07-02 11:38:48 UTC
++++ src/main.c
+@@ -113,13 +113,8 @@ static void stream(PSERVER_DATA server, PCONFIGURATION
+ platform_start(system);
+ LiStartConnection(&server->serverInfo, &config->stream, &connection_callbacks, platform_get_video(system), platform_get_audio(system, config->audio_device), NULL, drFlags, config->audio_device, 0);
+
+- if (IS_EMBEDDED(system)) {
+- evdev_start();
+- loop_main();
+- evdev_stop();
+- }
+ #ifdef HAVE_SDL
+- else if (system == SDL)
++ if (system == SDL)
+ sdl_loop();
+ #endif
+
+@@ -160,7 +155,6 @@ static void help() {
+ printf("\t-surround\t\tStream 5.1 surround sound (requires GFE 2.7)\n");
+ printf("\t-keydir <directory>\tLoad encryption keys from directory\n");
+ printf("\t-mapping <file>\t\tUse <file> as gamepad mappings configuration file\n");
+- printf("\t-platform <system>\tSpecify system used for audio, video and input: pi/imx/aml/x11/x11_vdpau/sdl/fake (default auto)\n");
+ printf("\t-unsupported\t\tTry streaming if GFE version or options are unsupported\n");
+ #if defined(HAVE_SDL) || defined(HAVE_X11)
+ printf("\n WM options (SDL and X11 only)\n\n");
+@@ -199,12 +193,8 @@ int main(int argc, char* argv[]) {
+ exit(-1);
+ }
+ config.address[0] = 0;
+- printf("Searching for server...\n");
+- gs_discover_server(config.address);
+- if (config.address[0] == 0) {
+- fprintf(stderr, "Autodiscovery failed. Specify an IP address next time.\n");
+- exit(-1);
+- }
++ fprintf(stderr, "Autodiscovery unsupported. Specify an IP address next time.\n");
++ exit(-1);
+ }
+
+ char host_config_file[128];
+@@ -251,38 +241,8 @@ int main(int argc, char* argv[]) {
+ }
+ config.stream.supportsHevc = config.codec != CODEC_H264 && (config.codec == CODEC_HEVC || platform_supports_hevc(system));
+
+- if (IS_EMBEDDED(system)) {
+- char* mapping_env = getenv("SDL_GAMECONTROLLERCONFIG");
+- if (config.mapping == NULL && mapping_env == NULL) {
+- fprintf(stderr, "Please specify mapping file as default mapping could not be found.\n");
+- exit(-1);
+- }
+-
+- struct mapping* mappings = NULL;
+- if (config.mapping != NULL)
+- mappings = mapping_load(config.mapping, config.debug_level > 0);
+-
+- if (mapping_env != NULL) {
+- struct mapping* map = mapping_parse(mapping_env);
+- map->next = mappings;
+- mappings = map;
+- }
+-
+- for (int i=0;i<config.inputsCount;i++) {
+- if (config.debug_level > 0)
+- printf("Add input %s...\n", config.inputs[i]);
+-
+- evdev_create(config.inputs[i], mappings, config.debug_level > 0);
+- }
+-
+- udev_init(!inputAdded, mappings, config.debug_level > 0);
+- evdev_init();
+- #ifdef HAVE_LIBCEC
+- cec_init();
+- #endif /* HAVE_LIBCEC */
+- }
+ #ifdef HAVE_SDL
+- else if (system == SDL) {
++ if (system == SDL) {
+ if (config.inputsCount > 0) {
+ fprintf(stderr, "You can't select input devices as SDL will automatically use all available controllers\n");
+ exit(-1);
diff --git a/games/moonlight-embedded/files/patch-src_platform.c b/games/moonlight-embedded/files/patch-src_platform.c
new file mode 100644
index 000000000000..190a0e6600b4
--- /dev/null
+++ b/games/moonlight-embedded/files/patch-src_platform.c
@@ -0,0 +1,17 @@
+--- src/platform.c.orig 2017-07-02 11:38:48 UTC
++++ src/platform.c
+@@ -163,14 +163,6 @@ AUDIO_RENDERER_CALLBACKS* platform_get_audio(enum plat
+ if (audio_device == NULL || strcmp(audio_device, "local") == 0 || strcmp(audio_device, "hdmi") == 0)
+ return (PAUDIO_RENDERER_CALLBACKS) dlsym(RTLD_DEFAULT, "audio_callbacks_omx");
+ #endif
+- default:
+- #ifdef HAVE_PULSE
+- if (audio_pulse_init(audio_device))
+- return &audio_callbacks_pulse;
+- #endif
+- #ifdef HAVE_ALSA
+- return &audio_callbacks_alsa;
+- #endif
+ }
+ return NULL;
+ }
diff --git a/games/moonlight-embedded/files/patch-third__party_moonlight-common-c_src_InputStream.c b/games/moonlight-embedded/files/patch-third__party_moonlight-common-c_src_InputStream.c
new file mode 100644
index 000000000000..b5382ac25255
--- /dev/null
+++ b/games/moonlight-embedded/files/patch-third__party_moonlight-common-c_src_InputStream.c
@@ -0,0 +1,11 @@
+--- third_party/moonlight-common-c/src/InputStream.c.orig 2017-06-11 16:02:49 UTC
++++ third_party/moonlight-common-c/src/InputStream.c
+@@ -34,7 +34,7 @@ typedef struct _PACKET_HOLDER {
+ LINKED_BLOCKING_QUEUE_ENTRY entry;
+ } PACKET_HOLDER, *PPACKET_HOLDER;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define EVP_CIPHER_CTX_reset(x) EVP_CIPHER_CTX_cleanup(x); EVP_CIPHER_CTX_init(x)
+ #endif
+
diff --git a/games/moonlight-embedded/pkg-descr b/games/moonlight-embedded/pkg-descr
new file mode 100644
index 000000000000..2170045857e7
--- /dev/null
+++ b/games/moonlight-embedded/pkg-descr
@@ -0,0 +1,7 @@
+Moonlight Embedded is an open source implementation of NVIDIA's
+GameStream, as used by the NVIDIA Shield.
+
+Moonlight Embedded allows you to stream your full collection of games
+from your powerful Windows desktop to your FreeBSD system.
+
+WWW: https://github.com/irtimmer/moonlight-embedded
diff --git a/games/moonlight-embedded/pkg-plist b/games/moonlight-embedded/pkg-plist
new file mode 100644
index 000000000000..c6b5a2d4aaf2
--- /dev/null
+++ b/games/moonlight-embedded/pkg-plist
@@ -0,0 +1,4 @@
+bin/moonlight
+@sample etc/moonlight.conf.sample
+man/man1/moonlight.1.gz
+share/moonlight/gamecontrollerdb.txt