aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia
diff options
context:
space:
mode:
authornox <nox@FreeBSD.org>2014-08-10 07:52:55 +0800
committernox <nox@FreeBSD.org>2014-08-10 07:52:55 +0800
commit5b866b622ba1fc51b7aa6e23ed471e985ab5332b (patch)
tree2229904845d5183a8891be949fd2d8b0c1d6f0a9 /multimedia
parent2bc6ae82ded896deccb34f5d234bafeeb068e9ef (diff)
downloadfreebsd-ports-gnome-5b866b622ba1fc51b7aa6e23ed471e985ab5332b.tar.gz
freebsd-ports-gnome-5b866b622ba1fc51b7aa6e23ed471e985ab5332b.tar.zst
freebsd-ports-gnome-5b866b622ba1fc51b7aa6e23ed471e985ab5332b.zip
Bandaid fix after alsa update until I get to update the vdr ports properly.
Reported by: antoine
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/vdr-plugin-softhddevice/Makefile14
-rw-r--r--multimedia/vdr-plugin-softhddevice/files/iatomic.h97
2 files changed, 108 insertions, 3 deletions
diff --git a/multimedia/vdr-plugin-softhddevice/Makefile b/multimedia/vdr-plugin-softhddevice/Makefile
index f7b25736a5ab..3251bf739088 100644
--- a/multimedia/vdr-plugin-softhddevice/Makefile
+++ b/multimedia/vdr-plugin-softhddevice/Makefile
@@ -16,7 +16,7 @@ LIB_DEPENDS+= libavcodec0.so:${PORTSDIR}/multimedia/ffmpeg0 \
libxcb-keysyms.so:${PORTSDIR}/x11/xcb-util-keysyms \
libasound.so:${PORTSDIR}/audio/alsa-lib
-USES= pkgconfig tar:tgz
+USES= compiler:features pkgconfig tar:tgz
USE_XORG+= xv x11 xcb xinerama
USE_GL+= gl glu
PATCH_STRIP= -p1
@@ -33,17 +33,25 @@ WRKSRC= ${WRKDIR}/${PLUGIN}-${PORTVERSION}
OPTIONS_DEFINE= VAAPI DOCS NLS
VAAPI_DESC= Enable vaapi support (experimental)
-.include <bsd.port.options.mk>
+.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MVAAPI}
LIB_DEPENDS+= libva.so:${PORTSDIR}/multimedia/libva
CONFIG+= -DUSE_VAAPI
.endif
+.if !(${COMPILER_TYPE} == clang)
+USE_GCC= yes
+.endif
+
post-patch: post-patch-plugin
@${REINPLACE_CMD} \
-e 's,libavcodec,libavcodec0,g' \
${WRKSRC}/Makefile
+ @${CP} ${FILESDIR}/iatomic.h ${WRKSRC}
+ @${REINPLACE_CMD} \
+ -e 's,<alsa/iatomic.h>,"iatomic.h",' \
+ ${WRKSRC}/*.c ${WRKSRC}/*.cpp
pre-install:
${MKDIR} ${STAGEDIR}${PREFIX}/lib/vdr
@@ -54,4 +62,4 @@ post-install: post-install-pluginlocales
(cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/multimedia/vdr-plugin-softhddevice/files/iatomic.h b/multimedia/vdr-plugin-softhddevice/files/iatomic.h
new file mode 100644
index 000000000000..a7ab9a4d7707
--- /dev/null
+++ b/multimedia/vdr-plugin-softhddevice/files/iatomic.h
@@ -0,0 +1,97 @@
+///
+/// @file iatomic.h @brief Misc function header file
+///
+/// Copyright (c) 2014 by Johns. All Rights Reserved.
+///
+/// Contributor(s):
+///
+/// License: AGPLv3
+///
+/// This program is free software: you can redistribute it and/or modify
+/// it under the terms of the GNU Affero General Public License as
+/// published by the Free Software Foundation, either version 3 of the
+/// License.
+///
+/// This program is distributed in the hope that it will be useful,
+/// but WITHOUT ANY WARRANTY; without even the implied warranty of
+/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+/// GNU Affero General Public License for more details.
+///
+/// $Id$
+//////////////////////////////////////////////////////////////////////////////
+
+/// @addtogroup iatomic
+/// @{
+
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+
+// gcc before 4.7 didn't support atomic builtins,
+// use alsa atomic functions.
+#if 0 // GCC_VERSION < 40700
+
+#include <alsa/iatomic.h>
+
+#else
+
+//////////////////////////////////////////////////////////////////////////////
+// Defines
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// Declares
+//////////////////////////////////////////////////////////////////////////////
+
+///
+/// atomic type, 24 bit useable,
+///
+typedef volatile int atomic_t;
+
+//////////////////////////////////////////////////////////////////////////////
+// Prototypes
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// Inlines
+//////////////////////////////////////////////////////////////////////////////
+
+///
+/// Set atomic value.
+///
+#define atomic_set(ptr, val) \
+ __atomic_store_n(ptr, val, __ATOMIC_SEQ_CST)
+
+///
+/// Read atomic value.
+///
+#define atomic_read(ptr) \
+ __atomic_load_n(ptr, __ATOMIC_SEQ_CST)
+
+///
+/// Increment atomic value.
+///
+#define atomic_inc(ptr) \
+ __atomic_add_fetch(ptr, 1, __ATOMIC_SEQ_CST)
+
+///
+/// Decrement atomic value.
+///
+#define atomic_dec(ptr) \
+ __atomic_sub_fetch(ptr, 1, __ATOMIC_SEQ_CST)
+
+///
+/// Add to atomic value.
+///
+#define atomic_add(val, ptr) \
+ __atomic_add_fetch(ptr, val, __ATOMIC_SEQ_CST)
+
+///
+/// Subtract from atomic value.
+///
+#define atomic_sub(val, ptr) \
+ __atomic_sub_fetch(ptr, val, __ATOMIC_SEQ_CST)
+
+#endif
+
+/// @}