Skip to content

Commit

Permalink
ALL: Add libmpcdec dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
lephilousophe committed Sep 6, 2024
1 parent 99db437 commit 70b905a
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 0 deletions.
2 changes: 2 additions & 0 deletions toolchains/amigaos4/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ local_package(libmpeg2)

local_package(liba52)

local_package(libmpcdec)

local_package(libvpx)

local_package(libopenssl)
Expand Down
16 changes: 16 additions & 0 deletions toolchains/amigaos4/packages/libmpcdec/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/sh

PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
HELPERS_DIR=$PACKAGE_DIR/../..
. $HELPERS_DIR/functions.sh

do_make_bdir

do_lha_fetch audio/libmpcdec "libmpcdec*/"

do_lha_install

# libmpcdec.a is located in common folder where it should not and it has a bad casing, fix this
cp local/common/lib/libMPCdec.a $DESTDIR/$PREFIX/lib/libmpcdec.a

do_clean_bdir
3 changes: 3 additions & 0 deletions toolchains/caanoo/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ helpers_package(mpeg2dec)
# No a52dec in the original toolchain build ours statically
helpers_package(a52dec)

# No libmpcdec in the original toolchain build ours statically
helpers_package(libmpcdec)

# No libvpx in the original toolchain build ours statically
helpers_package(libvpx)

Expand Down
21 changes: 21 additions & 0 deletions toolchains/common/packages/libmpcdec/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! /bin/sh

PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
HELPERS_DIR=$PACKAGE_DIR/../..
. $HELPERS_DIR/functions.sh

do_make_bdir

do_pkg_fetch libmpc

autoreconf -fi

do_configure "$@"

do_make -C include
do_make -C libmpcdec

do_make -C include install
do_make -C libmpcdec install

do_clean_bdir
2 changes: 2 additions & 0 deletions toolchains/devkit3ds/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ helpers_package(mpeg2dec)

helpers_package(a52dec)

helpers_package(libmpcdec)

# Multithreading is not functional (and it's only one core anyway)
helpers_package(libvpx, --disable-multithread)

Expand Down
2 changes: 2 additions & 0 deletions toolchains/devkitppc/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ helpers_package(mpeg2dec, , CFLAGS="$CFLAGS -mno-altivec")

helpers_package(a52dec)

helpers_package(libmpcdec)

# Multithreading is not functional (and it's only one core anyway)
helpers_package(libvpx, --disable-multithread)

Expand Down
2 changes: 2 additions & 0 deletions toolchains/devkitswitch/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ helpers_package(mpeg2dec)

helpers_package(a52dec)

helpers_package(libmpcdec)

# libvpx is already installed in original toolchain

# curl is already installed in original toolchain
Expand Down
2 changes: 2 additions & 0 deletions toolchains/m4/android/packages_list.m4
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ helpers_package(a52dec)

helpers_package(libmikmod)

helpers_package(libmpcdec)

# --as is used for x86* and overrides AS environment variable: exactly what we want
# Fix build with nasm
COPY --from=android-helpers /lib-helpers/packages/libvpx lib-helpers/packages/libvpx
Expand Down
2 changes: 2 additions & 0 deletions toolchains/m4/apple/macosx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ helpers_package(mpeg2dec)

ports_package(a52dec)

ports_package(libmpcdec)

ports_package(libvpx)

# No curl as it's provided in SDK
Expand Down
2 changes: 2 additions & 0 deletions toolchains/m4/apple/xos.m4
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ helpers_package(mpeg2dec)

helpers_package(a52dec)

helpers_package(libmpcdec)

# libvpx thinks that darwin means xcode and adds too many flags
# disable this treatment
COPY --from=apple-common /lib-helpers/packages/libvpx lib-helpers/packages/libvpx
Expand Down
2 changes: 2 additions & 0 deletions toolchains/miyoo/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ helpers_package(mpeg2dec)

helpers_package(a52dec)

helpers_package(libmpcdec)

helpers_package(libvpx)

# curl is already installed in original toolchain
Expand Down
3 changes: 3 additions & 0 deletions toolchains/mxe/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ local_mxe_package(libmpeg2)

mxe_package(a52dec)

# Patch libmpcdec to install the static library without a _static suffix
local_mxe_package(libmpcdec)

mxe_package(libvpx)

local_mxe_package(curl-light)
Expand Down
15 changes: 15 additions & 0 deletions toolchains/mxe/packages/libmpcdec/libmpcdec-9999-build_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Index: libmpcdec/requant.h
===================================================================
--- a/libmpcdec/requant.h
+++ b/libmpcdec/requant.h
@@ -48,7 +48,7 @@

/* C O N S T A N T S */
-const mpc_uint8_t Res_bit [18]; ///< Bits per sample for chosen quantizer
-const MPC_SAMPLE_FORMAT __Cc [1 + 18]; ///< Requantization coefficients
-const mpc_int16_t __Dc [1 + 18]; ///< Requantization offset
+extern const mpc_uint8_t Res_bit [18]; ///< Bits per sample for chosen quantizer
+extern const MPC_SAMPLE_FORMAT __Cc [1 + 18]; ///< Requantization coefficients
+extern const mpc_int16_t __Dc [1 + 18]; ///< Requantization offset

#define Cc (__Cc + 1)
7 changes: 7 additions & 0 deletions toolchains/mxe/packages/libmpcdec/patch.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Patch libmpcdec_BUILD to install libmpcdec.a without a _static suffix
# Also remove useless LDFLAGS once the attached patch is applied
# newline and comma variables are defined by MXE
$(eval define libmpcdec_BUILD$(newline)\
$(subst libmpcdec_static.a' '$$(PREFIX)/$$(TARGET)/lib/',libmpcdec_static.a' '$$(PREFIX)/$$(TARGET)/lib/libmpcdec.a',$(value libmpcdec_BUILD))$(newline)\
$(subst LDFLAGS='$$(LDFLAGS) -Wl$(comma)--allow-multiple-definition',,$(value libmpcdec_BUILD))$(newline)\
endef)
2 changes: 2 additions & 0 deletions toolchains/opendingux-beta/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ helpers_package(mpeg2dec)

helpers_package(a52dec)

helpers_package(libmpcdec)

helpers_package(libvpx)

# No curl support in configure
Expand Down
3 changes: 3 additions & 0 deletions toolchains/opendingux/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ helpers_package(mpeg2dec)
# No a52dec in the original toolchain build ours statically
helpers_package(a52dec)

# No libmpcdec in the original toolchain build ours statically
helpers_package(libmpcdec)

# No libvpx in the original toolchain build ours statically
helpers_package(libvpx)

Expand Down
3 changes: 3 additions & 0 deletions toolchains/openpandora/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ helpers_package(mpeg2dec)
# No a52dec in the original toolchain build ours statically
helpers_package(a52dec)

# No libmpcdec in the original toolchain build ours statically
helpers_package(libmpcdec)

# No libvpx in the original toolchain build ours statically
helpers_package(libvpx)

Expand Down
1 change: 1 addition & 0 deletions toolchains/raspberrypi/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ multistrap_package(libgtk-3-dev)
multistrap_package(libjpeg62-turbo-dev)
multistrap_package(libmad0-dev)
multistrap_package(libmikmod-dev)
multistrap_package(libmpcdec-dev)
multistrap_package(libmpeg2-4-dev)
multistrap_package(libogg-dev)
multistrap_package(libpng-dev)
Expand Down
2 changes: 2 additions & 0 deletions toolchains/riscos/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ helpers_package(mpeg2dec)

helpers_package(a52dec)

helpers_package(libmpcdec)

helpers_package(libvpx)

# helpers_package(openssl)
Expand Down
2 changes: 2 additions & 0 deletions toolchains/vita/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ vdpm_package(libmpeg2)

helpers_package(a52dec)

helpers_package(libmpcdec)

vdpm_package(libvpx)

vdpm_package(openssl)
Expand Down
2 changes: 2 additions & 0 deletions toolchains/windows-9x/Dockerfile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ helpers_package(mpeg2dec)
COPY packages/a52dec lib-helpers/packages/a52dec/
helpers_package(a52dec)

helpers_package(libmpcdec)

# Windows 95 doesn't handle well SSE.
# Multithreading uses InterlockedCompareExchange, not present in Windows 95.
helpers_package(libvpx, --as=nasm --disable-sse --disable-multithread)
Expand Down
1 change: 1 addition & 0 deletions workers/m4/debian-libraries.m4
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN apt-get update && \
libjpeg62-turbo-dev`'APT_ARCH \
libmad0-dev`'APT_ARCH \
libmikmod-dev`'APT_ARCH \
libmpcdec-dev`'APT_ARCH \
libmpeg2-4-dev`'APT_ARCH \
libogg-dev`'APT_ARCH \
libpng-dev`'APT_ARCH \
Expand Down

0 comments on commit 70b905a

Please sign in to comment.