git: cb1700979999 - main - audio/liba52: Switch to fork and update to 0.8.0

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Mon, 01 May 2023 11:09:44 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cb17009799995528557cded011e2e40b7e3be538

commit cb17009799995528557cded011e2e40b7e3be538
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-05-01 10:58:37 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-05-01 11:08:32 +0000

    audio/liba52: Switch to fork and update to 0.8.0
    
    * Switch to Adélie Linux's fork
    * Drop support for unmaintained djbfft library
    * Use stock framework optimization
    
    Changelog:
    https://git.adelielinux.org/community/a52dec/-/blob/c388f3b6d911c246e0b2a7b2c436c3de2e79c74d/ChangeLog
---
 audio/liba52/Makefile                 | 36 ++++++----------------
 audio/liba52/distinfo                 |  5 +--
 audio/liba52/files/patch-configure.ac | 58 +++++++++++++++++++++++++++++++++++
 audio/liba52/pkg-plist                |  1 +
 4 files changed, 72 insertions(+), 28 deletions(-)

diff --git a/audio/liba52/Makefile b/audio/liba52/Makefile
index cbba52b735d3..915f01f8fce0 100644
--- a/audio/liba52/Makefile
+++ b/audio/liba52/Makefile
@@ -1,46 +1,30 @@
 PORTNAME=	liba52
-PORTVERSION=	0.7.4
-PORTREVISION=	3
+DISTVERSION=	0.8.0
 CATEGORIES=	audio
-MASTER_SITES=	http://liba52.sourceforge.net/files/
-DISTNAME=	a52dec-${PORTVERSION:S/.b/b/}
+MASTER_SITES=	https://distfiles.adelielinux.org/source/a52dec/
+DISTNAME=	a52dec-${DISTVERSION}
 
 MAINTAINER=	multimedia@FreeBSD.org
 COMMENT=	Free library for decoding ATSC A/52 streams, aka AC-3
-WWW=		http://liba52.sourceforge.net/
+WWW=		https://git.adelielinux.org/community/a52dec/
 
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-USES=		gmake libtool
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--disable-oss --enable-shared
+USES=		autoreconf libtool pathfix
 USE_LDCONFIG=	yes
 
-OPTIONS_DEFINE=	DJBFFT OPTIMIZED_CFLAGS DOCS
-DJBFFT_DESC=	djb fft support
-
-DJBFFT_BUILD_DEPENDS=	${LOCALBASE}/lib/libdjbfft.a:math/djbfft
-DJBFFT_RUN_DEPENDS=	${LOCALBASE}/lib/libdjbfft.a:math/djbfft
-DJBFFT_CFLAGS=		-I${LOCALBASE}/include
-DJBFFT_LDFLAGS=		-L${LOCALBASE}/lib
-DJBFFT_CONFIGURE_ON=	--enable-djbfft
-
-HEADER_FILES=	liba52/a52_internal.h
+GNU_CONFIGURE=	yes
+INSTALL_TARGET=	install-strip
+TEST_TARGET=	check
 
-post-patch:
-	@${REINPLACE_CMD} '/-prefer-non-pic/d' ${WRKSRC}/configure
+CONFIGURE_ARGS=	--disable-oss --enable-shared
 
-post-patch-OPTIMIZED_CFLAGS-off:
-	@${REINPLACE_CMD} -E -e 's!-O3!${CFLAGS}!' -e 's!-mcpu=[^"]+"!"!' \
-		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
-post-patch-DJBFFT-on:
-	@${REINPLACE_CMD} -E -e 's|(fftc4.h)|djbfft/\1|' ${WRKSRC}/liba52/imdct.c
+OPTIONS_DEFINE=	DOCS
 
 post-install:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/doc/liba52.txt ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/liba52/a52_internal.h ${STAGEDIR}${PREFIX}/include/a52dec
-	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liba52.so.0.*
 
 .include <bsd.port.mk>
diff --git a/audio/liba52/distinfo b/audio/liba52/distinfo
index 289e354f1445..f8f514125447 100644
--- a/audio/liba52/distinfo
+++ b/audio/liba52/distinfo
@@ -1,2 +1,3 @@
-SHA256 (a52dec-0.7.4.tar.gz) = a21d724ab3b3933330194353687df82c475b5dfb997513eef4c25de6c865ec33
-SIZE (a52dec-0.7.4.tar.gz) = 241507
+TIMESTAMP = 1682932929
+SHA256 (a52dec-0.8.0.tar.gz) = 03c181ce9c3fe0d2f5130de18dab9bd8bc63c354071515aa56983c74a9cffcc9
+SIZE (a52dec-0.8.0.tar.gz) = 456192
diff --git a/audio/liba52/files/patch-configure.ac b/audio/liba52/files/patch-configure.ac
new file mode 100644
index 000000000000..245630ecf5ec
--- /dev/null
+++ b/audio/liba52/files/patch-configure.ac
@@ -0,0 +1,58 @@
+--- configure.ac.orig	2022-11-05 09:23:41 UTC
++++ configure.ac
+@@ -29,12 +29,12 @@ if test x"$GCC" = x"yes"; then
+     TRY_CFLAGS="$OPT_CFLAGS -Wall"
+     AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"])
+ 
+-    dnl -O3
+-    changequote(<<,>>)
+-    TRY_CFLAGS=`echo "$OPT_CFLAGS $CFLAGS"|sed "s/-O[0-9]*//g"`
+-    changequote([,])
+-    TRY_CFLAGS="$TRY_CFLAGS -O3"
+-    AC_TRY_CFLAGS([$TRY_CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"; CFLAGS=""])
++#    dnl -O3
++#    changequote(<<,>>)
++#    TRY_CFLAGS=`echo "$OPT_CFLAGS $CFLAGS"|sed "s/-O[0-9]*//g"`
++#    changequote([,])
++#    TRY_CFLAGS="$TRY_CFLAGS -O3"
++#    AC_TRY_CFLAGS([$TRY_CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"; CFLAGS=""])
+ 
+     AC_ARG_ENABLE([debug],
+ 	[  --enable-debug          debug mode configuration])
+@@ -50,21 +50,21 @@ if test x"$GCC" = x"yes"; then
+     TRY_CFLAGS="$OPT_CFLAGS -fno-common"
+     AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"])
+ 
+-    dnl arch-specific flags
+-    case "$host" in
+-    i?86-* | k?-*)
+-	case "$host" in
+-	i386-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=i386";;
+-	i486-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=i486";;
+-	i586-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=pentium";;
+-	i686-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=pentiumpro";;
+-	k6-*)   TRY_CFLAGS="$OPT_CFLAGS -mcpu=k6";;
+-	esac
+-	AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"]);;
+-    sparc-* | sparc64-*)
+-	TRY_CFLAGS="$OPT_CFLAGS -mtune=ultrasparc"
+-	AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"]);;
+-    esac
++#    dnl arch-specific flags
++#    case "$host" in
++#    i?86-* | k?-*)
++#	case "$host" in
++#	i386-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=i386";;
++#	i486-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=i486";;
++#	i586-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=pentium";;
++#	i686-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=pentiumpro";;
++#	k6-*)   TRY_CFLAGS="$OPT_CFLAGS -mcpu=k6";;
++#	esac
++#	AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"]);;
++#    sparc-* | sparc64-*)
++#	TRY_CFLAGS="$OPT_CFLAGS -mtune=ultrasparc"
++#	AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"]);;
++#    esac
+ elif test x"$CC" = x"tendracc"; then
+     dnl TenDRA portability checking compiler
+     TENDRA=yes
diff --git a/audio/liba52/pkg-plist b/audio/liba52/pkg-plist
index 77ebd8fb252c..5f5bfa178d58 100644
--- a/audio/liba52/pkg-plist
+++ b/audio/liba52/pkg-plist
@@ -9,6 +9,7 @@ lib/liba52.so.0.0.0
 lib/liba52.so.0
 lib/liba52.so
 lib/liba52.a
+libdata/pkgconfig/liba52.pc
 man/man1/a52dec.1.gz
 man/man1/extract_a52.1.gz
 %%PORTDOCS%%%%DOCSDIR%%/liba52.txt