[mingw-gstreamer] Avoid FTBFS when winpthreads is available

Erik van Pienbroek epienbro at fedoraproject.org
Sat Sep 7 18:18:59 UTC 2013


commit c66efb55b80fcd1ff8b0240e66b5bb0f44d7bb84
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sat Sep 7 20:18:48 2013 +0200

    Avoid FTBFS when winpthreads is available

 e2f2ee3582731fd52e5b93a0a82fdf6f4156bce2.patch |   29 +++++++++++++++
 e745a2bcf07eb7ecafcb92428b4d2907ff22b124.patch |   45 ++++++++++++++++++++++++
 mingw-gstreamer.spec                           |   19 ++++++++--
 3 files changed, 89 insertions(+), 4 deletions(-)
---
diff --git a/e2f2ee3582731fd52e5b93a0a82fdf6f4156bce2.patch b/e2f2ee3582731fd52e5b93a0a82fdf6f4156bce2.patch
new file mode 100644
index 0000000..1ec333a
--- /dev/null
+++ b/e2f2ee3582731fd52e5b93a0a82fdf6f4156bce2.patch
@@ -0,0 +1,29 @@
+From e2f2ee3582731fd52e5b93a0a82fdf6f4156bce2 Mon Sep 17 00:00:00 2001
+From: Руслан Ижбулатов <lrn1986 at gmail.com>
+Date: Mon, 08 Apr 2013 09:14:35 +0000
+Subject: configure: Also check for clock_gettime in libpthread
+
+libwinpthreads provides POSIX time API.
+It also provides libpthread alias for itself, for compatibility, so that
+is what we will link with.
+
+Fixes #697550
+---
+diff --git a/configure.ac b/configure.ac
+index 1063828..34b7448 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -458,6 +458,11 @@ AC_CHECK_FUNCS(clock_gettime, [], [
+   AC_CHECK_LIB(rt, clock_gettime, [
+     AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
+     LIBS="$LIBS -lrt"
++  ], [
++    AC_CHECK_LIB(pthread, clock_gettime, [
++      AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
++      LIBS="$LIBS -lpthread"
++    ])
+   ])
+ ])
+ 
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/e745a2bcf07eb7ecafcb92428b4d2907ff22b124.patch b/e745a2bcf07eb7ecafcb92428b4d2907ff22b124.patch
new file mode 100644
index 0000000..5e0592f
--- /dev/null
+++ b/e745a2bcf07eb7ecafcb92428b4d2907ff22b124.patch
@@ -0,0 +1,45 @@
+From e745a2bcf07eb7ecafcb92428b4d2907ff22b124 Mon Sep 17 00:00:00 2001
+From: Руслан Ижбулатов <lrn1986 at gmail.com>
+Date: Mon, 08 Apr 2013 11:30:07 +0000
+Subject: clock: Do use HAVE_CLOCK_GETTIME
+
+Fixes #697549
+---
+diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c
+index 5b531f2..5e7f6b1 100644
+--- a/gst/gstsystemclock.c
++++ b/gst/gstsystemclock.c
+@@ -521,7 +521,7 @@ gst_system_clock_get_internal_time (GstClock * clock)
+         GST_SECOND, sysclock->priv->frequency.QuadPart);
+   } else
+ #endif /* G_OS_WIN32 */
+-#if !defined HAVE_POSIX_TIMERS
++#if !defined HAVE_POSIX_TIMERS || !defined HAVE_CLOCK_GETTIME
+   {
+     GTimeVal timeval;
+ 
+@@ -555,7 +555,7 @@ gst_system_clock_get_resolution (GstClock * clock)
+     return GST_SECOND / sysclock->priv->frequency.QuadPart;
+   } else
+ #endif /* G_OS_WIN32 */
+-#ifdef HAVE_POSIX_TIMERS
++#if defined(HAVE_POSIX_TIMERS) && defined(HAVE_CLOCK_GETTIME)
+   {
+     GstSystemClock *sysclock = GST_SYSTEM_CLOCK_CAST (clock);
+     clockid_t ptype;
+diff --git a/gst/gstutils.c b/gst/gstutils.c
+index 5df5df8..53a99d8 100644
+--- a/gst/gstutils.c
++++ b/gst/gstutils.c
+@@ -3096,7 +3096,8 @@ gst_parse_bin_from_description_full (const gchar * bin_description,
+ GstClockTime
+ gst_util_get_timestamp (void)
+ {
+-#if defined (HAVE_POSIX_TIMERS) && defined(HAVE_MONOTONIC_CLOCK)
++#if defined (HAVE_POSIX_TIMERS) && defined(HAVE_MONOTONIC_CLOCK) &&\
++    defined (HAVE_CLOCK_GETTIME)
+   struct timespec now;
+ 
+   clock_gettime (CLOCK_MONOTONIC, &now);
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/mingw-gstreamer.spec b/mingw-gstreamer.spec
index 51e671f..bec2d70 100644
--- a/mingw-gstreamer.spec
+++ b/mingw-gstreamer.spec
@@ -1,11 +1,8 @@
 %?mingw_package_header
 
-%global mingw_build_win32 1
-%global mingw_build_win64 1
-
 Name:           mingw-gstreamer
 Version:        0.10.36
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        MinGW Windows Streaming-Media Framework Runtime
 
 License:        LGPLv2+
@@ -31,6 +28,13 @@ BuildRequires:  bison flex
 # use native glib-genmarshal and glib-mkenums
 BuildRequires:  glib2-devel
 
+# Needed for the patches
+BuildRequires:  autoconf automake libtool gtk-doc
+
+# Upstream commits which are required to fix the build when winpthreads is available
+Patch0:         e2f2ee3582731fd52e5b93a0a82fdf6f4156bce2.patch
+Patch1:         e745a2bcf07eb7ecafcb92428b4d2907ff22b124.patch
+
 
 %description
 GStreamer is a streaming-media framework, based on graphs of filters
@@ -80,6 +84,10 @@ installing new plug-ins.
 
 %prep
 %setup -q -n gstreamer-%{version}
+%patch0 -p1 -b .winpthreads
+%patch1 -p1 -b .winpthreads
+
+NOCONFIGURE=1 ./autogen.sh
 
 
 %build
@@ -206,6 +214,9 @@ rm -f $RPM_BUILD_ROOT%{mingw64_datadir}/aclocal/gst-element-check-0.10.m4
 
 
 %changelog
+* Sat Sep  7 2013 Erik van Pienbroek <epienbro at fedoraproject.org> - 0.10.36-5
+- Backported upstream commits which are needed to avoid FTBFS when winpthreads is available
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.10.36-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list