This updates audio/mac (Monkey's Audio Codec) to the latest release.
Previously, this port was using a custom distfile, because historically,
Monkey's Audio was a Windows-only application. However, the Monkey's
Audio SDK now compiles without patches on non-Windows operating systems,
including OpenBSD. So this switches to using the upstream distfile.
The upstream distfile is annoying as it doesn't use a directory and uses
CRLF line endings, but the port can deal with that.
Build system has switched to CMAKE, and none of the previous patches
apply, so remove them all. Add a couple patches to make the header
files easier to use on OpenBSD.
The library changed from libmac to libMAC. I think it was always MAC
upstream. Also, the license changed from a non-open source license to a
BSD-3-Clause license.
The only port that depends on audio/mac is audio/aqualung. Use GitHub
commit distpatches to backport support for the updated MAC. This
requires adding an autoreconf configure style, since one of the
backported commits touches configure.ac.
bin/mac support tested by encoding and then decoding WAV files and
ensuring that the decoded WAV file is the same (Monkey's Audio is a
lossless codec). MAC support in aqualung tested by playing a .ape file.
Both tested on amd64.
OKs? If not, I plan on committing next week unless there are
objections.
Thanks,
Jeremy
Index: mac/Makefile
===================================================================
RCS file: /cvs/ports/audio/mac/Makefile,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 Makefile
--- mac/Makefile 11 Mar 2022 18:20:17 -0000 1.16
+++ mac/Makefile 5 Sep 2023 16:43:24 -0000
@@ -2,32 +2,30 @@ ONLY_FOR_ARCHS= aarch64 amd64 arm i386
COMMENT= Monkey's audio lossless codec
-DISTNAME= mac-3.99-u4-b5
-PKGNAME= mac-3.99.4.5
-REVISION = 5
-SHARED_LIBS += mac 0.0 # .2.0
+VERSION= 10.20
+DISTNAME= MAC_1020_SDK
+PKGNAME= mac-${VERSION}
+SHARED_LIBS += MAC 0.0 # .0.0
CATEGORIES= audio
+EXTRACT_SUFX= .zip
-HOMEPAGE= http://www.monkeysaudio.com/
+HOMEPAGE= https://monkeysaudio.com
-# Monkey's Audio Source Code License Agreement
-# http://www.monkeysaudio.com/license.html
+# BSD-3-Clause
PERMIT_PACKAGE= Yes
WANTLIB= c m ${COMPILER_LIBCXX}
-COMPILER = base-clang ports-gcc base-gcc
+COMPILER = base-clang ports-gcc base-gcc
-MASTER_SITES= http://bsd.cenkes.org/myports/
+MODULES = devel/cmake
+MASTER_SITES= https://monkeysaudio.com/files/
+WRKDIST= ${WRKDIR}/mac-${VERSION}
+FIX_CRLF_FILES= Shared/*.h
-CONFIGURE_STYLE=gnu
-
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
-BUILD_DEPENDS= devel/yasm
-CONFIGURE_ARGS= --enable-assembly=yes
-.else
-CONFIGURE_ARGS= --enable-assembly=no
-.endif
+post-extract:
+ mkdir ${WRKSRC}
+ mv ${WRKDIR}/!(mac-${VERSION}|bin) ${WRKSRC}
.include <bsd.port.mk>
Index: mac/distinfo
===================================================================
RCS file: /cvs/ports/audio/mac/distinfo,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 distinfo
--- mac/distinfo 18 Jan 2015 03:12:44 -0000 1.2
+++ mac/distinfo 5 Sep 2023 13:28:06 -0000
@@ -1,2 +1,2 @@
-SHA256 (mac-3.99-u4-b5.tar.gz) = 1ZrFsfo3Wnjq29XZu2OK0CKRhbQrVi27BLDatkdbZlE=
-SIZE (mac-3.99-u4-b5.tar.gz) = 421234
+SHA256 (MAC_1020_SDK.zip) = CYchq+lXqaUcL4NUudqPd7cOMDVmAH1uV+wYB7L0hr8=
+SIZE (MAC_1020_SDK.zip) = 1653346
Index: mac/patches/patch-Shared_All_h
===================================================================
RCS file: mac/patches/patch-Shared_All_h
diff -N mac/patches/patch-Shared_All_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ mac/patches/patch-Shared_All_h 5 Sep 2023 14:31:20 -0000
@@ -0,0 +1,13 @@
+Index: Shared/All.h
+--- Shared/All.h.orig
++++ Shared/All.h
+@@ -10,8 +10,7 @@ PLATFORM_LINUX
+ PLATFORM_ANDROID
+
**************************************************************************************************/
+ #if !defined(PLATFORM_WINDOWS) && !defined(PLATFORM_APPLE) &&
!defined(PLATFORM_LINUX)
+- #pragma message("No platform set for MACLib, defaulting to Windows")
+- #define PLATFORM_WINDOWS
++ #define PLATFORM_LINUX
+ #endif
+
+ #ifdef PLATFORM_ANDROID
Index: mac/patches/patch-Shared_NoWindows_h
===================================================================
RCS file: mac/patches/patch-Shared_NoWindows_h
diff -N mac/patches/patch-Shared_NoWindows_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ mac/patches/patch-Shared_NoWindows_h 5 Sep 2023 15:05:03 -0000
@@ -0,0 +1,16 @@
+Index: Shared/NoWindows.h
+--- Shared/NoWindows.h.orig
++++ Shared/NoWindows.h
+@@ -38,8 +38,12 @@ typedef struct _GUID {
+ #undef ZeroMemory
+ #define ZeroMemory(POINTER, BYTES) memset(POINTER, 0, BYTES);
+
++#ifndef TRUE
+ #define TRUE 1
++#endif
++#ifndef FALSE
+ #define FALSE 0
++#endif
+
+ #define CALLBACK
+
Index: mac/patches/patch-configure
===================================================================
RCS file: mac/patches/patch-configure
diff -N mac/patches/patch-configure
--- mac/patches/patch-configure 11 Mar 2022 18:20:17 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- configure.orig Sat Jul 14 11:22:11 2007
-+++ configure Sat Jul 14 11:22:20 2007
-@@ -1978,7 +1978,7 @@ fi
-
-
- # Checks for programs.
--CXXFLAGS="$CXXFLAGS -O3 -Wall -pedantic -Wno-long-long"
-+CXXFLAGS="$CXXFLAGS -Wall -pedantic -Wno-long-long"
- ac_ext=cc
- ac_cpp='$CXXCPP $CPPFLAGS'
- ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Index: mac/patches/patch-src_Console_Console_cpp
===================================================================
RCS file: mac/patches/patch-src_Console_Console_cpp
diff -N mac/patches/patch-src_Console_Console_cpp
--- mac/patches/patch-src_Console_Console_cpp 11 Mar 2022 18:20:17 -0000
1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
---- src/Console/Console.cpp.orig Mon Jul 16 23:50:51 2007
-+++ src/Console/Console.cpp Mon Jul 16 23:53:13 2007
-@@ -27,8 +27,10 @@ Displays the proper usage for MAC.exe
-
***************************************************************************************/
- void DisplayProperUsage(FILE * pFile)
- {
-- fprintf(pFile, "Proper Usage: [EXE] [Input File] [Output File]
[Mode]\n\n");
-+ extern char *__progname;
-
-+ fprintf(pFile, "Proper Usage: %s [Input File] [Output File]
[Mode]\n\n", __progname);
-+
- fprintf(pFile, "Modes: \n");
- fprintf(pFile, " Compress (fast): '-c1000'\n");
- fprintf(pFile, " Compress (normal): '-c2000'\n");
-@@ -40,9 +42,9 @@ void DisplayProperUsage(FILE * pFile)
- fprintf(pFile, " Convert: '-nXXXX'\n\n");
-
- fprintf(pFile, "Examples:\n");
-- fprintf(pFile, " Compress: mac.exe \"Metallica - One.wav\"
\"Metallica - One.ape\" -c2000\n");
-- fprintf(pFile, " Decompress: mac.exe \"Metallica - One.ape\"
\"Metallica - One.wav\" -d\n");
-- fprintf(pFile, " Verify: mac.exe \"Metallica - One.ape\" -v\n");
-+ fprintf(pFile, " Compress: %s \"Metallica - One.wav\" \"Metallica -
One.ape\" -c2000\n", __progname);
-+ fprintf(pFile, " Decompress: %s \"Metallica - One.ape\" \"Metallica
- One.wav\" -d\n", __progname);
-+ fprintf(pFile, " Verify: %s \"Metallica - One.ape\" -v\n",
__progname);
- fprintf(pFile, " (note: int filenames must be put inside of
quotations)\n");
- }
-
Index: mac/patches/patch-src_MACLib_APEDecompress_cpp
===================================================================
RCS file: mac/patches/patch-src_MACLib_APEDecompress_cpp
diff -N mac/patches/patch-src_MACLib_APEDecompress_cpp
--- mac/patches/patch-src_MACLib_APEDecompress_cpp 11 Mar 2022 18:20:17
-0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- src/MACLib/APEDecompress.cpp.orig Thu Jun 1 13:00:58 2006
-+++ src/MACLib/APEDecompress.cpp Sat Jul 14 10:16:11 2007
-@@ -369,7 +369,7 @@ Get information from the decompressor
-
*****************************************************************************************/
- intptr_t CAPEDecompress::GetInfo(APE_DECOMPRESS_FIELDS Field, intptr_t
nParam1, intptr_t nParam2)
- {
-- int nRetVal = 0;
-+ intptr_t nRetVal = 0;
- BOOL bHandled = TRUE;
-
- switch (Field)
Index: mac/patches/patch-src_MACLib_APELink_cpp
===================================================================
RCS file: mac/patches/patch-src_MACLib_APELink_cpp
diff -N mac/patches/patch-src_MACLib_APELink_cpp
--- mac/patches/patch-src_MACLib_APELink_cpp 11 Mar 2022 18:20:17 -0000
1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
---- src/MACLib/APELink.cpp.orig Thu Jun 1 11:00:57 2006
-+++ src/MACLib/APELink.cpp Sun Apr 16 11:51:08 2017
-@@ -63,10 +63,10 @@ void CAPELink::ParseData(const char * pData, const str
- if (pData != NULL)
- {
- // parse out the information
-- char * pHeader = strstr(pData, APE_LINK_HEADER);
-- char * pImageFile = strstr(pData, APE_LINK_IMAGE_FILE_TAG);
-- char * pStartBlock = strstr(pData, APE_LINK_START_BLOCK_TAG);
-- char * pFinishBlock = strstr(pData, APE_LINK_FINISH_BLOCK_TAG);
-+ const char * pHeader = strstr(pData, APE_LINK_HEADER);
-+ const char * pImageFile = strstr(pData, APE_LINK_IMAGE_FILE_TAG);
-+ const char * pStartBlock = strstr(pData, APE_LINK_START_BLOCK_TAG);
-+ const char * pFinishBlock = strstr(pData, APE_LINK_FINISH_BLOCK_TAG);
-
- if (pHeader && pImageFile && pStartBlock && pFinishBlock)
- {
-@@ -81,7 +81,7 @@ void CAPELink::ParseData(const char * pData, const str
-
- // get the path
- char cImageFile[MAX_PATH + 1]; int nIndex = 0;
-- char * pImageCharacter =
&pImageFile[strlen(APE_LINK_IMAGE_FILE_TAG)];
-+ const char * pImageCharacter =
&pImageFile[strlen(APE_LINK_IMAGE_FILE_TAG)];
- while ((*pImageCharacter != 0) && (*pImageCharacter != '\r')
&& (*pImageCharacter != '\n'))
- cImageFile[nIndex++] = *pImageCharacter++;
- cImageFile[nIndex] = 0;
Index: mac/patches/patch-src_MACLib_MACLib_h
===================================================================
RCS file: mac/patches/patch-src_MACLib_MACLib_h
diff -N mac/patches/patch-src_MACLib_MACLib_h
--- mac/patches/patch-src_MACLib_MACLib_h 11 Mar 2022 18:20:17 -0000
1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- src/MACLib/MACLib.h.orig Thu Jun 1 13:00:58 2006
-+++ src/MACLib/MACLib.h Sat Jul 14 10:16:11 2007
-@@ -29,6 +29,8 @@ or, if necessary, matt @ monkeysaudio.com
- #ifndef APE_MACLIB_H
- #define APE_MACLIB_H
-
-+#include <sys/stdint.h>
-+
-
/*************************************************************************************************
- APE File Format Overview: (pieces in order -- only valid for the latest
version APE files)
-
Index: mac/pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/mac/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 PLIST
--- mac/pkg/PLIST 11 Mar 2022 18:20:17 -0000 1.3
+++ mac/pkg/PLIST 5 Sep 2023 13:47:35 -0000
@@ -1,26 +1,14 @@
@bin bin/mac
-include/mac/
-include/mac/APECompress.h
-include/mac/APECompressCore.h
-include/mac/APECompressCreate.h
-include/mac/APEDecompress.h
-include/mac/APEHeader.h
-include/mac/APEInfo.h
-include/mac/APELink.h
-include/mac/APETag.h
-include/mac/All.h
-include/mac/CharacterHelper.h
-include/mac/CircleBuffer.h
-include/mac/GlobalFunctions.h
-include/mac/ID3Genres.h
-include/mac/IO.h
-include/mac/MACLib.h
-include/mac/MACProgressHelper.h
-include/mac/MACUtils.h
-include/mac/NoWindows.h
-include/mac/SmartPtr.h
-include/mac/StdLibFileIO.h
-include/mac/config.h
-lib/libmac.a
-lib/libmac.la
-@lib lib/libmac.so.${LIBmac_VERSION}
+include/MAC/
+include/MAC/APETag.h
+include/MAC/All.h
+include/MAC/CharacterHelper.h
+include/MAC/IO.h
+include/MAC/MACDll.h
+include/MAC/MACLib.h
+include/MAC/NoWindows.h
+include/MAC/SmartPtr.h
+include/MAC/Version.h
+include/MAC/Warnings.h
+include/MAC/WindowsEnvironment.h
+@lib lib/libMAC.so.${LIBMAC_VERSION}
Index: aqualung/Makefile
===================================================================
RCS file: /cvs/ports/audio/aqualung/Makefile,v
retrieving revision 1.60
diff -u -p -u -p -r1.60 Makefile
--- aqualung/Makefile 10 Jun 2023 17:30:54 -0000 1.60
+++ aqualung/Makefile 6 Sep 2023 07:59:28 -0000
@@ -3,12 +3,19 @@ COMMENT= advanced music player
VERSION= 1.2
DISTNAME= aqualung-${VERSION}
EPOCH= 0
+REVISION= 0
CATEGORIES= audio
HOMEPAGE= https://github.com/jeremyevans/aqualung
MAINTAINER= Jeremy Evans <[email protected]>
+MASTER_SITES.github = https://github.com/jeremyevans/aqualung/commit/
+PATCHFILES.github =
aqualung-lavc-fix{0ecc6721d5078c0bc9cae771d485c8d676443c23}.patch \
+
aqualung-mac-fix1{a991c13d0df734a5d0fea7db6b181176858f3e58}.patch \
+
aqualung-mac-fix2{d2c88317b6042a05c236faf3c09f600337c6379e}.patch
+PATCH_DIST_STRIP= -p1
+
# GPLv2
PERMIT_PACKAGE= Yes
@@ -18,7 +25,7 @@ WANTLIB += freetype gio-2.0 glib-2.0 gob
WANTLIB += harfbuzz iconv intl m mp3lame ogg pango-1.0 pangocairo-1.0
WANTLIB += pangoft2-1.0 pthread samplerate sndfile sndio ${COMPILER_LIBCXX}
WANTLIB += vorbis vorbisenc vorbisfile z gtk-x11-2.0 gdk-x11-2.0
-WANTLIB += gdk_pixbuf-2.0 xml2 mac mad mpcdec FLAC avcodec
+WANTLIB += gdk_pixbuf-2.0 xml2 MAC mad mpcdec FLAC avcodec
WANTLIB += avformat avutil wavpack lrdf oggz speex cddb cdio
WANTLIB += cdio_cdda cdio_paranoia modplug ${MODLUA_WANTLIB}
@@ -57,7 +64,10 @@ DEBUG_PACKAGES=${BUILD_PACKAGES}
CFLAGS+= -DPTHREAD_MIN_PRIORITY=0 -DPTHREAD_MAX_PRIORITY=31 \
-I${LOCALBASE}/include -I${MODLUA_INCL_DIR}
-CONFIGURE_STYLE= gnu
+BUILD_DEPENDS= devel/gettext,-tools
+AUTOCONF_VERSION=2.69
+AUTOMAKE_VERSION=1.16
+CONFIGURE_STYLE= gnu autoreconf
CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib " \
lua_CFLAGS="`pkg-config --cflags ${MODLUA_DEP}`" \
lua_LIBS="`pkg-config --libs ${MODLUA_DEP}`"
@@ -70,7 +80,7 @@ CONFIGURE_ARGS= --with-cdda \
--with-lame \
--with-lavc \
--with-lua \
- --with-mac \
+ --with-MAC \
--with-mod \
--with-mpc \
--with-mpeg \
Index: aqualung/distinfo
===================================================================
RCS file: /cvs/ports/audio/aqualung/distinfo,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 distinfo
--- aqualung/distinfo 10 Jun 2023 17:30:54 -0000 1.9
+++ aqualung/distinfo 5 Sep 2023 17:01:14 -0000
@@ -1,2 +1,8 @@
SHA256 (aqualung-1.2.tar.gz) = Myv6Dqni97/ZZrl5h7dTf2i42o1WO6xKuYb6RBjc7TI=
+SHA256 (aqualung-lavc-fix.patch) = JNlPwDlY5uneSjJ96fhbrAkLXZn0g+Wcxs4CiCEEewA=
+SHA256 (aqualung-mac-fix1.patch) = +YT1E/0NGSUjqJLDg06/Jq3wKzeiXq0SJtuVqnl39OY=
+SHA256 (aqualung-mac-fix2.patch) = 354g/PTCa5WuCSSphHsXhZK928+2Q2ZlhAoSrhhr40k=
SIZE (aqualung-1.2.tar.gz) = 1974910
+SIZE (aqualung-lavc-fix.patch) = 1133
+SIZE (aqualung-mac-fix1.patch) = 7590
+SIZE (aqualung-mac-fix2.patch) = 2441