Update to Monkey's Audio Codec 10.20

This switches to using the upstream distfile, instead of what appears
to be a Linux port of a quite old version (Monkey's Audio was
previously Windows-only). The upstream distfile compiles without
hanges.

The shared library has changed from libmac to libMAC.  The license
has changed from a custom, non-open source license to a standard
BSD-3-Clause license.

All previous patches no longer necessary or apply. Add a couple
new patches to the include files to make it easier to use the
library.
master
jeremy 2023-09-10 03:11:51 +00:00
parent 7a2796d99e
commit d23e76a5d0
10 changed files with 58 additions and 129 deletions

View File

@ -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
SITES= http://bsd.cenkes.org/myports/
MODULES = devel/cmake
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>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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");
}

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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}