Skip to content

Commit d47fab4

Browse files
committed
MACOSXPPC: Import 20221104 dependency build scripts (DIRTY)
Used for the 2.6.1 release.
1 parent e96b301 commit d47fab4

File tree

27 files changed

+1693
-0
lines changed

27 files changed

+1693
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /bin/sh
2+
3+
# use a newer snapshot with fixes; from OpenBSD
4+
A52DEC_VERSION=0.7.5-cvs
5+
A52DEC_SHA256=XXX
6+
7+
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
8+
HELPERS_DIR=$PACKAGE_DIR/../../../common
9+
. $HELPERS_DIR/functions.sh
10+
11+
do_make_bdir
12+
13+
do_http_fetch a52dec "https://comstyle.com/source/a52dec-snapshot.tar.gz" \
14+
'tar xzf' #"sha256:${LIBMAD_SHA256}"
15+
16+
export MACOSX_DEPLOYMENT_TARGET=10.4
17+
export SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk
18+
19+
sed -i'.orig' \
20+
-e 's|-O3|-O2 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wa,-force_cpusubtype_ALL -m32|g' \
21+
-e 's|-g -O2|-O2|g' \
22+
configure
23+
24+
CC=/opt/macports-tff/bin/gcc-mp-4.8 \
25+
LDFLAGS='-Wl,-macosx_version_min,10.4 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' \
26+
do_configure --disable-debug
27+
28+
do_make -C liba52
29+
do_make -C liba52 install
30+
# No need to build includes
31+
do_make -C include install
32+
33+
do_clean_bdir
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Correct type for pointers arithmetic manipulation.
2+
Fix random crashes caused by invalid 32-bit shifts on 32-bit values (upstream).
3+
4+
from OpenBSD ports
5+
6+
--- a/liba52/bitstream.c Mon Sep 3 19:03:40 2012
7+
+++ b/liba52/bitstream.c Mon Sep 3 19:06:39 2012
8+
@@ -23,6 +23,7 @@
9+
10+
#include "config.h"
11+
12+
+#include <stddef.h>
13+
#include <inttypes.h>
14+
15+
#include "a52.h"
16+
@@ -33,9 +34,9 @@
17+
18+
void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf)
19+
{
20+
- int align;
21+
+ ptrdiff_t align;
22+
23+
- align = (long)buf & 3;
24+
+ align = (ptrdiff_t)buf & 3;
25+
state->buffer_start = (uint32_t *) (buf - align);
26+
state->bits_left = 0;
27+
state->current_word = 0;
28+
@@ -62,11 +63,14 @@ static inline void bitstream_fill_current (a52_state_t
29+
30+
uint32_t a52_bitstream_get_bh (a52_state_t * state, uint32_t num_bits)
31+
{
32+
- uint32_t result;
33+
+ uint32_t result = 0;
34+
35+
- num_bits -= state->bits_left;
36+
- result = ((state->current_word << (32 - state->bits_left)) >>
37+
- (32 - state->bits_left));
38+
+ if (state->bits_left)
39+
+ {
40+
+ num_bits -= state->bits_left;
41+
+ result = ((state->current_word << (32 - state->bits_left)) >>
42+
+ (32 - state->bits_left));
43+
+ }
44+
45+
bitstream_fill_current (state);
46+
47+
@@ -80,11 +84,14 @@ uint32_t a52_bitstream_get_bh (a52_state_t * state, ui
48+
49+
int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits)
50+
{
51+
- int32_t result;
52+
+ int32_t result = 0;
53+
54+
- num_bits -= state->bits_left;
55+
- result = ((((int32_t)state->current_word) << (32 - state->bits_left)) >>
56+
- (32 - state->bits_left));
57+
+ if (state->bits_left)
58+
+ {
59+
+ num_bits -= state->bits_left;
60+
+ result = ((((int32_t)state->current_word) << (32 - state->bits_left))
61+
+ >> (32 - state->bits_left));
62+
+ }
63+
64+
bitstream_fill_current(state);
65+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#! /bin/sh
2+
# This library only needs to be compiled if you are planning on using a
3+
# precompiled FreeType that expects it to exist. Otherwise, it is used only for
4+
# an obsolete X11 bitmap font format that ScummVM will never use.
5+
6+
# This is also used when ScummVM expects the library to be here (iphone platform)
7+
8+
BZIP2_VERSION=1.0.8
9+
BZIP2_SHA256=ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
10+
11+
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
12+
HELPERS_DIR=$PACKAGE_DIR/../../../common
13+
. $HELPERS_DIR/functions.sh
14+
15+
do_make_bdir
16+
17+
do_http_fetch bzip2 "https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz" 'tar xzf' #"sha256:${BZIP2_SHA256}"
18+
19+
# Manually build and install only the static library and header
20+
21+
export MACOSX_DEPLOYMENT_TARGET=10.4
22+
export SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk
23+
24+
# bzip2 Makefile redefines these variables so override them here
25+
sed -i'.orig' -e 's|-O2 -g|-O2 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wa,-force_cpusubtype_ALL -m32|g' Makefile
26+
do_make libbz2.a CC=/opt/macports-tff/bin/gcc-mp-4.8 #AR=$AR RANLIB=$RANLIB
27+
28+
mkdir -p "$PREFIX/lib"
29+
cp -f libbz2.a "$PREFIX/lib"
30+
chmod a+r "$PREFIX/lib/libbz2.a"
31+
mkdir -p "$PREFIX/include"
32+
cp -f bzlib.h "$PREFIX/include"
33+
chmod a+r "$PREFIX/include/bzlib.h"
34+
35+
do_clean_bdir
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#! /bin/sh
2+
3+
FAAD2_VERSION=2_10_0
4+
#FAAD2_SHA256=985c3fadb9789d2815e50f4ff714511c79c2710ac27a4aaaf5c0c2662141426d
5+
6+
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
7+
HELPERS_DIR=$PACKAGE_DIR/../../../common
8+
. $HELPERS_DIR/functions.sh
9+
10+
do_make_bdir
11+
12+
do_http_fetch faad2 "https://github.com/knik0/faad2/archive/refs/tags/${FAAD2_VERSION}.tar.gz" \
13+
'tar xzf' #"sha256:${FAAD2_SHA256}"
14+
15+
export MACOSX_DEPLOYMENT_TARGET=10.4
16+
export SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk
17+
18+
/opt/macports-tff/bin/autoreconf -vif
19+
20+
CC=/opt/macports-tff/bin/gcc-mp-4.8 \
21+
CFLAGS='-O2 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wa,-force_cpusubtype_ALL -m32' \
22+
LDFLAGS='-Wl,-macosx_version_min,10.4 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' \
23+
ac_cv_prog_cc_c11=no \
24+
do_configure --with-drm=no
25+
26+
# Avoid compiling and installing libfaad2_drm
27+
sed -i'.orig' -e 's/^\(lib_LTLIBRARIES.*\) libfaad_drm.la/\1/' libfaad/Makefile
28+
29+
do_make -C libfaad
30+
do_make -C libfaad install
31+
32+
do_clean_bdir
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
post-release patch from upstream to reject buffers of zero size (via Debian)
2+
3+
--- a/libfaad/decoder.c
4+
+++ b/libfaad/decoder.c
5+
@@ -271,7 +271,7 @@ long NeAACDecInit(NeAACDecHandle hpDecoder,
6+
NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
7+
8+
9+
- if ((hDecoder == NULL) || (samplerate == NULL) || (channels == NULL))
10+
+ if ((hDecoder == NULL) || (samplerate == NULL) || (channels == NULL) || (buffer_size == 0))
11+
return -1;
12+
13+
hDecoder->sf_index = get_sr_index(hDecoder->config.defSampleRate);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#! /bin/sh
2+
3+
FLAC_VERSION=1.3.4
4+
#FLAC_SHA256=213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748
5+
6+
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
7+
HELPERS_DIR=$PACKAGE_DIR/../../../common
8+
. $HELPERS_DIR/functions.sh
9+
10+
do_make_bdir
11+
12+
do_http_fetch flac "http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz" \
13+
'tar --use-compress-program=/opt/local/bin/xz -xf' #"sha256:${FLAC_SHA256}"
14+
15+
export MACOSX_DEPLOYMENT_TARGET=10.4
16+
export SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk
17+
18+
# If building with one of the base compilers
19+
#HAVE_BSWAP16=0 HAVE_BSWAP32=0 \
20+
#ac_cv_c_bswap16=no ac_cv_c_bswap32=no \
21+
22+
# stack protection will cause undefined symbols when linking against FLAC for 10.4
23+
CC=/opt/macports-tff/bin/gcc-mp-4.8 \
24+
CFLAGS='-O2 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wa,-force_cpusubtype_ALL -m32' \
25+
LDFLAGS='-Wl,-macosx_version_min,10.4 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' \
26+
do_configure \
27+
--disable-altivec --disable-vsx --disable-sse --disable-avx \
28+
--disable-stack-smash-protection --disable-rpath \
29+
--disable-thorough-tests --disable-doxygen-docs --disable-xmms-plugin --disable-cpplibs --disable-ogg
30+
31+
# We don't want any Altivec code, because it's meant for POWER8/9, not PowerPC
32+
sed -i'.orig' -e 's/-faltivec//g' src/libFLAC/Makefile
33+
34+
do_make -C src/libFLAC V=1
35+
36+
do_make -C src/libFLAC install
37+
# No need to build includes
38+
do_make -C include install
39+
40+
do_clean_bdir
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
fix "comma at end of enumerator list" error with older compilers defaulting to C89
2+
3+
--- a/include/FLAC/format.h
4+
+++ b/include/FLAC/format.h
5+
@@ -512,7 +512,7 @@
6+
FLAC__METADATA_TYPE_UNDEFINED = 7,
7+
/**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */
8+
9+
- FLAC__MAX_METADATA_TYPE = FLAC__MAX_METADATA_TYPE_CODE,
10+
+ FLAC__MAX_METADATA_TYPE = FLAC__MAX_METADATA_TYPE_CODE
11+
/**< No type will ever be greater than this. There is not enough room in the protocol block. */
12+
} FLAC__MetadataType;
13+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /bin/sh
2+
3+
FREETYPE_VERSION=2.11.1
4+
FREETYPE_SHA256=XXX
5+
6+
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
7+
HELPERS_DIR=$PACKAGE_DIR/../../../common
8+
. $HELPERS_DIR/functions.sh
9+
10+
do_make_bdir
11+
12+
do_http_fetch freetype "http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz" \
13+
'tar xzf' #"sha256:${FREETYPE_SHA256}"
14+
15+
export MACOSX_DEPLOYMENT_TARGET=10.4
16+
export SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk
17+
18+
# TODO: it tries to inject -std=gnu11 but there's a -std=c99 override
19+
# Nuke the -std=gnu11.
20+
21+
CC=/opt/macports-tff/bin/gcc-mp-4.8 \
22+
CFLAGS='-O2 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wa,-force_cpusubtype_ALL -m32' \
23+
LDFLAGS='-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' \
24+
ZLIB_CFLAGS="-I$PREFIX/include" \
25+
ZLIB_LIBS="-Wl,-macosx_version_min,10.4 -Wl,-search_paths_first -L$PREFIX/lib -lz" \
26+
do_configure \
27+
--enable-freetype-config --with-zlib=yes --with-bzip2=yes \
28+
--with-png=no --with-harfbuzz=no --with-brotli=no \
29+
--with-old-mac-fonts
30+
31+
do_make
32+
do_make install
33+
34+
do_clean_bdir
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Description: Enable subpixel rendering to provide LCD colour filtering.
2+
Author: Steve Langasek <vorlon@debian.org>
3+
Forwarded: not-needed
4+
Last-Update: 2021-10-07
5+
6+
--- a/include/freetype/config/ftoption.h
7+
+++ b/include/freetype/config/ftoption.h
8+
@@ -123,7 +123,7 @@
9+
* When this macro is not defined, FreeType offers alternative LCD
10+
* rendering technology that produces excellent output.
11+
*/
12+
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
13+
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
14+
15+
16+
/**************************************************************************
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/sh
2+
3+
FRIBIDI_VERSION=1.0.12
4+
#FRIBIDI_SHA256=30f93e9c63ee627d1a2cedcf59ac34d45bf30240982f99e44c6e015466b4e73d
5+
6+
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
7+
HELPERS_DIR=$PACKAGE_DIR/../../../common
8+
. $HELPERS_DIR/functions.sh
9+
10+
do_make_bdir
11+
12+
do_http_fetch fribidi "https://github.com/fribidi/fribidi/releases/download/v${FRIBIDI_VERSION}/fribidi-${FRIBIDI_VERSION}.tar.xz" \
13+
'tar --use-compress-program=/opt/local/bin/xz -xf' #"sha256:${FRIBIDI_SHA256}"
14+
15+
export MACOSX_DEPLOYMENT_TARGET=10.4
16+
export SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk
17+
18+
CC=/opt/macports-tff/bin/gcc-mp-4.8 \
19+
CFLAGS='-O2 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wa,-force_cpusubtype_ALL -m32' \
20+
LDFLAGS='-Wl,-macosx_version_min,10.4 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' \
21+
do_configure --disable-silent-rules
22+
23+
# Avoid compiling and installing doc, binaries and tests
24+
sed -i'.orig' -e 's/^\(SUBDIRS.*\) bin doc test/\1/' Makefile
25+
26+
do_make
27+
do_make install
28+
29+
do_clean_bdir

0 commit comments

Comments
 (0)