Bug 183599 - [patch] audio/openal fix build with clang; support staging
Summary: [patch] audio/openal fix build with clang; support staging
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bernhard Froehlich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-02 18:40 UTC by Vladimir Kondratiev
Modified: 2014-01-30 15:40 UTC (History)
0 users

See Also:


Attachments
file.diff (3.79 KB, patch)
2013-11-02 18:40 UTC, Vladimir Kondratiev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kondratiev 2013-11-02 18:40:00 UTC
1. Fix build with clang and modern gcc
2. Support staging
3. Add support for ALSA sound

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-11-02 18:40:07 UTC
Maintainer of audio/openal,

Please note that PR ports/183599 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/183599

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-11-02 18:40:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Bernhard Froehlich freebsd_committer freebsd_triage 2014-01-30 12:58:43 UTC
Responsible Changed
From-To: freebsd-ports-bugs->decke

I'll take it.
Comment 4 dfilter service freebsd_committer freebsd_triage 2014-01-30 15:34:37 UTC
Author: decke
Date: Thu Jan 30 15:34:30 2014
New Revision: 341848
URL: http://svnweb.freebsd.org/changeset/ports/341848
QAT: https://qat.redports.org/buildarchive/r341848/

Log:
  - Fix build with clang and modern gcc
  - Support staging
  - Add support for ALSA sound
  
  PR:		ports/183599
  Submitted by:	Vladimir Kondratiev <wulf@mail.mipt.ru>
  Approved by:	maintainer timeout (11 weeks)

Modified:
  head/audio/openal/Makefile
  head/audio/openal/files/patch-src-arch-i386-x86_floatmul.c

Modified: head/audio/openal/Makefile
==============================================================================
--- head/audio/openal/Makefile	Thu Jan 30 15:31:46 2014	(r341847)
+++ head/audio/openal/Makefile	Thu Jan 30 15:34:30 2014	(r341848)
@@ -5,16 +5,17 @@ PORTNAME=	openal
 PORTVERSION=	20060211
 PORTREVISION=	12
 CATEGORIES=	audio
-MASTER_SITES=	http://openal.org/openal_webstf/downloads/
+MASTER_SITES=	GENTOO/distfiles
 DISTVERSION=	0.0.8
 
 MAINTAINER=	erik@bz.bzflag.bz
 COMMENT=	A 3D positional spatialized sound library
 
+LICENSE=	GPLv2
+
 CONFLICTS=	openal-soft-[0-9]*
 
 USE_AUTOTOOLS=	libtool
-NO_STAGE=	yes
 GNU_CONFIGURE=	yes
 CPPFLAGS+=	-I${LOCALBASE}/include
 CFLAGS+=	-Wno-return-type
@@ -22,57 +23,30 @@ LDFLAGS+=	-L${LOCALBASE}/lib
 CONFIGURE_ARGS=	--enable-capture \
 		--disable-arts
 USES=		pathfix pkgconfig gmake
-WANT_SDL=	yes
 USE_LDCONFIG=	yes
 
-OPTIONS_DEFINE=	ESOUND SDL VORBIS SMPEG
+OPTIONS_DEFINE=	ESOUND SDL VORBIS SMPEG ALSA
 OPTIONS_DEFINE_i386=	ASM
 OPTIONS_DEFAULT_i386=	ASM
 SMPEG_DESC=	smpeg support
 
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MSMPEG}
-WITH_SDL=	yes	# smpeg requires SDL
-.endif
-
-.if ${PORT_OPTIONS:MESD}
-USE_GNOME+=	esound
-CONFIGURE_ARGS+=--enable-esd
-.else
-CONFIGURE_ARGS+=--disable-esd
-.endif
-
-.if ${PORT_OPTIONS:MSDL}
-USE_SDL+=	sdl
-CONFIGURE_ENV+=	HAVESDL="${SDL_CONFIG}"
-CONFIGURE_ARGS+=--enable-sdl
-.else
-CONFIGURE_ARGS+=--disable-sdl
-.endif
-
-.if ${PORT_OPTIONS:MVORBIS}
-LIB_DEPENDS+=	libvorbisfile.so:${PORTSDIR}/audio/libvorbis
-CONFIGURE_ARGS+=--enable-vorbis
-.else
-CONFIGURE_ARGS+=--disable-vorbis
-.endif
-
-.if ${PORT_OPTIONS:MSMPEG}
-LIB_DEPENDS+=	libsmpeg.so:${PORTSDIR}/multimedia/smpeg
-CONFIGURE_ARGS+=--enable-smpeg
-.else
-CONFIGURE_ARGS+=--disable-smpeg
-.endif
-
-.if ${PORT_OPTIONS:MASM}
-BUILD_DEPENDS+=	nasm:${PORTSDIR}/devel/nasm
-.endif
-
+ESOUND_USE=		GNOME=esound
+ESOUND_CONFIGURE_ENABLE=esd
+SDL_USE=		SDL=sdl
+SDL_CONFIGURE_ENABLE=	sdl
+VORBIS_LIB_DEPENDS=	libvorbisfile.so:${PORTSDIR}/audio/libvorbis
+VORBIS_CONFIGURE_ENABLE=vorbis
+SMPEG_LIB_DEPENDS=	libsmpeg.so:${PORTSDIR}/multimedia/smpeg
+SMPEG_CONFIGURE_ENABLE=	mp3
+ALSA_LIB_DEPENDS=	libasound.so:${PORTSDIR}/audio/alsa-lib
+ALSA_CONFIGURE_ENABLE=	alsa
+ASM_BUILD_DEPENDS=	nasm:${PORTSDIR}/devel/nasm
 
 NOT_FOR_ARCHS=	ia64
 NOT_FOR_ARCHS_REASON_ia64=	does not compile
 
+.include <bsd.port.options.mk>
+
 post-patch:
 	@${REINPLACE_CMD} -e 's/-pthread/${PTHREAD_LIBS}/; \
 		s/x86_64\*/amd64\* | \*ia64\*/g; \
@@ -89,7 +63,4 @@ post-patch:
 	@${REINPLACE_CMD} -e '/^NASM=/ s|=.*|=no|' ${WRKSRC}/configure
 .endif
 
-post-install:
-	@${CAT} ${PKGMESSAGE}
-
 .include <bsd.port.mk>

Modified: head/audio/openal/files/patch-src-arch-i386-x86_floatmul.c
==============================================================================
--- head/audio/openal/files/patch-src-arch-i386-x86_floatmul.c	Thu Jan 30 15:31:46 2014	(r341847)
+++ head/audio/openal/files/patch-src-arch-i386-x86_floatmul.c	Thu Jan 30 15:34:30 2014	(r341848)
@@ -9,3 +9,31 @@
  		samples_pre /= sizeof(ALshort);
  		samples_main = len - samples_pre;
  		samples_post = samples_main % 8;
+@@ -82,11 +82,27 @@ void _alFloatMul(ALshort *bpt, ALfloat s
+ 			v_sa.s[3] = v_sa.s[0];
+ 			
+ 			while (samples_main--) {
++				union {
++					short s[4];
++					v4hi v;
++				} ALIGN16(v_one);
++				v_one.s[0] = 1;
++				v_one.s[1] = 0;
++				v_one.s[2] = 0;
++				v_one.s[3] = 0;
+ 				temp = __builtin_ia32_pmulhw(*(v4hi*)bpt, v_sa.v);
++#if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ <= 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 2)) && !defined(__clang__)
+ 				*(v4hi*)bpt = __builtin_ia32_psllw(temp, 1LL);
++#else
++				*(v4hi*)bpt = __builtin_ia32_psllw(temp, v_one.v);
++#endif
+ 				bpt += 4;
+ 				temp = __builtin_ia32_pmulhw(*(v4hi*)bpt, v_sa.v);
++#if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ <= 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 2)) && !defined(__clang__)
+ 				*(v4hi*)bpt = __builtin_ia32_psllw(temp, 1LL);
++#else
++				*(v4hi*)bpt = __builtin_ia32_psllw(temp, v_one.v);
++#endif
+ 				bpt += 4;
+ 			}
+ 		}
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Bernhard Froehlich freebsd_committer freebsd_triage 2014-01-30 15:34:43 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!