From 9445ecf824c97cf5ab01defabcbc21af0e69fe25 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Sat, 5 Jan 2019 15:40:35 -0700
Subject: [PATCH] Add gstreamer

---
 recipes/gstreamer/recipe.sh   | 48 +++++++++++++++++++++++++++++++++++
 recipes/gstreamer/redox.patch | 24 ++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 recipes/gstreamer/recipe.sh
 create mode 100644 recipes/gstreamer/redox.patch

diff --git a/recipes/gstreamer/recipe.sh b/recipes/gstreamer/recipe.sh
new file mode 100644
index 000000000..2b6c1dad8
--- /dev/null
+++ b/recipes/gstreamer/recipe.sh
@@ -0,0 +1,48 @@
+VERSION=1.14.4
+TAR=https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$VERSION.tar.xz
+BUILD_DEPENDS=(gettext glib libffi libiconv pcre zlib)
+
+function recipe_version {
+    echo "$VERSION"
+    skip=1
+}
+
+function recipe_update {
+    echo "skipping update"
+    skip=1
+}
+
+function recipe_build {
+    sysroot="$(realpath ../sysroot)"
+    export CFLAGS="-I$sysroot/include"
+    export LDFLAGS="-L$sysroot/lib"
+    export GLIB_GENMARSHAL="$(which glib-genmarshal)"
+    export GLIB_MKENUMS="$(which glib-mkenums)"
+    ./configure \
+        --host=${HOST} \
+        --prefix=/ \
+        --disable-shared \
+        --enable-static \
+        --disable-benchmarks \
+        --disable-examples \
+        --disable-tests
+    make -j"$(nproc)" V=1
+    skip=1
+}
+
+function recipe_test {
+    echo "skipping test"
+    skip=1
+}
+
+function recipe_clean {
+    make clean
+    skip=1
+}
+
+function recipe_stage {
+    dest="$(realpath $1)"
+    make DESTDIR="$dest" install
+    rm -f "$dest/lib/"*.la
+    skip=1
+}
diff --git a/recipes/gstreamer/redox.patch b/recipes/gstreamer/redox.patch
new file mode 100644
index 000000000..e2509f799
--- /dev/null
+++ b/recipes/gstreamer/redox.patch
@@ -0,0 +1,24 @@
+diff -ruwN source/gst/gstpoll.c source-new/gst/gstpoll.c
+--- source/gst/gstpoll.c	2018-03-23 14:44:36.000000000 -0600
++++ source-new/gst/gstpoll.c	2019-01-05 15:17:35.861961634 -0700
+@@ -85,6 +85,10 @@
+ #include <sys/socket.h>
+ #endif
+ 
++#if defined(__redox__)
++#include <sys/select.h>
++#endif
++
+ #ifdef G_OS_WIN32
+ #  ifndef EWOULDBLOCK
+ #  define EWOULDBLOCK EAGAIN    /* This is just to placate gcc */
+@@ -689,7 +693,9 @@
+   {
+     gint control_sock[2];
+ 
++#if !defined(__redox__)
+     if (socketpair (PF_UNIX, SOCK_STREAM, 0, control_sock) < 0)
++#endif
+       goto no_socket_pair;
+ 
+     nset->control_read_fd.fd = control_sock[0];
-- 
GitLab