From 08db80e50c6587953ce9d69e825b2cdff4528923 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 10 Apr 2020 20:34:07 +0200 Subject: [PATCH] MonkeysAudio: fix build on ppc* and big endian --- srcpkgs/MonkeysAudio/patches/big-endian.patch | 30 +++++++++ srcpkgs/MonkeysAudio/patches/endian.patch | 66 +++++++++++++++++++ srcpkgs/MonkeysAudio/patches/ppc64.patch | 39 +++++++++++ srcpkgs/MonkeysAudio/template | 2 +- 4 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/MonkeysAudio/patches/big-endian.patch create mode 100644 srcpkgs/MonkeysAudio/patches/endian.patch create mode 100644 srcpkgs/MonkeysAudio/patches/ppc64.patch diff --git a/srcpkgs/MonkeysAudio/patches/big-endian.patch b/srcpkgs/MonkeysAudio/patches/big-endian.patch new file mode 100644 index 00000000000..6b37531dca3 --- /dev/null +++ b/srcpkgs/MonkeysAudio/patches/big-endian.patch @@ -0,0 +1,30 @@ +From cbace147456d6ccc1921f62582a791b340b8a88d Mon Sep 17 00:00:00 2001 +From: q66 +Date: Fri, 10 Apr 2020 20:31:00 +0200 +Subject: [PATCH] fix build on big endian + +--- + Source/MACLib/MD5.cpp | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git Source/MACLib/MD5.cpp Source/MACLib/MD5.cpp +index c122fb5..89079b2 100644 +--- Source/MACLib/MD5.cpp ++++ Source/MACLib/MD5.cpp +@@ -35,11 +35,11 @@ CopyToLittleEndian ( uint32_t* dst, + const uint8_t* src, + size_t length ) + { +- for ( ; length--; src += 4; dst++ ) { +- *dst = (( (uint32_t) src [3] ) << 24) | +- (( (uint32_t) src [2] ) << 16) | +- (( (uint32_t) src [1] ) << 8) | +- (( (uint32_t) src [0] ) << 0); ++ for ( ; length--; src += 4 ) { ++ *dst++ = (( (uint32_t) src [3] ) << 24) | ++ (( (uint32_t) src [2] ) << 16) | ++ (( (uint32_t) src [1] ) << 8) | ++ (( (uint32_t) src [0] ) << 0); + + + } diff --git a/srcpkgs/MonkeysAudio/patches/endian.patch b/srcpkgs/MonkeysAudio/patches/endian.patch new file mode 100644 index 00000000000..38c21755670 --- /dev/null +++ b/srcpkgs/MonkeysAudio/patches/endian.patch @@ -0,0 +1,66 @@ +From ba9bb2bccdf67a8a202c578fcf09a3aa6dda4c63 Mon Sep 17 00:00:00 2001 +From: q66 +Date: Fri, 10 Apr 2020 20:22:17 +0200 +Subject: [PATCH] MonkeysAudio: patch out bad endian definitions breaking + builds + +--- + Shared/All.h | 8 +------- + Source/Shared/All.h | 8 +------- + 2 files changed, 2 insertions(+), 14 deletions(-) + +diff --git Shared/All.h Shared/All.h +index 6dfb669..cc9a988 100644 +--- Shared/All.h ++++ Shared/All.h +@@ -45,6 +45,7 @@ Global includes + #include + #include + #include ++ #include + #include "NoWindows.h" + #endif + #define ape_max(a,b) (((a) > (b)) ? (a) : (b)) +@@ -246,13 +247,6 @@ Global defines + #define APE_FILENAME_SLASH '/' + #endif + +-/***************************************************************************************** +-Byte order +-*****************************************************************************************/ +-#define __LITTLE_ENDIAN 1234 +-#define __BIG_ENDIAN 4321 +-#define __BYTE_ORDER __LITTLE_ENDIAN +- + /***************************************************************************************** + Macros + *****************************************************************************************/ +diff --git Source/Shared/All.h Source/Shared/All.h +index 6dfb669..cc9a988 100644 +--- Source/Shared/All.h ++++ Source/Shared/All.h +@@ -45,6 +45,7 @@ Global includes + #include + #include + #include ++ #include + #include "NoWindows.h" + #endif + #define ape_max(a,b) (((a) > (b)) ? (a) : (b)) +@@ -246,13 +247,6 @@ Global defines + #define APE_FILENAME_SLASH '/' + #endif + +-/***************************************************************************************** +-Byte order +-*****************************************************************************************/ +-#define __LITTLE_ENDIAN 1234 +-#define __BIG_ENDIAN 4321 +-#define __BYTE_ORDER __LITTLE_ENDIAN +- + /***************************************************************************************** + Macros + *****************************************************************************************/ +-- +2.25.1 + diff --git a/srcpkgs/MonkeysAudio/patches/ppc64.patch b/srcpkgs/MonkeysAudio/patches/ppc64.patch new file mode 100644 index 00000000000..f8d9c55008c --- /dev/null +++ b/srcpkgs/MonkeysAudio/patches/ppc64.patch @@ -0,0 +1,39 @@ +From 9b8a97da0946d01f60798a5636062141a61a92ac Mon Sep 17 00:00:00 2001 +From: q66 +Date: Fri, 10 Apr 2020 20:26:23 +0200 +Subject: [PATCH] add powerpc64 in 64-bit platforms to unbreak build + +--- + Shared/All.h | 2 +- + Source/Shared/All.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git Shared/All.h Shared/All.h +index cc9a988..615e3d1 100644 +--- Shared/All.h ++++ Shared/All.h +@@ -123,7 +123,7 @@ Global compiler settings (useful for porting) + #endif + #endif + +-#if __x86_64__ || __aarch64__ ++#if __x86_64__ || __aarch64__ || __powerpc64__ + #ifndef PLATFORM_x64 + #define PLATFORM_x64 + #endif +diff --git Source/Shared/All.h Source/Shared/All.h +index cc9a988..615e3d1 100644 +--- Source/Shared/All.h ++++ Source/Shared/All.h +@@ -123,7 +123,7 @@ Global compiler settings (useful for porting) + #endif + #endif + +-#if __x86_64__ || __aarch64__ ++#if __x86_64__ || __aarch64__ || __powerpc64__ + #ifndef PLATFORM_x64 + #define PLATFORM_x64 + #endif +-- +2.25.1 + diff --git a/srcpkgs/MonkeysAudio/template b/srcpkgs/MonkeysAudio/template index af58c7f2525..99b89b58034 100644 --- a/srcpkgs/MonkeysAudio/template +++ b/srcpkgs/MonkeysAudio/template @@ -1,7 +1,7 @@ # Template file for 'MonkeysAudio' pkgname=MonkeysAudio version=5.28 -revision=1 +revision=2 create_wrksrc=yes build_style="gnu-makefile" depends="libMAC>=${version}_${revision}"