Skip to content

Commit

Permalink
Update SDL2 builds and downgrade a little opusfile.
Browse files Browse the repository at this point in the history
Adding fluidsynth and timidity libraries and some improvements.
  • Loading branch information
Wolf3s committed Oct 1, 2024
1 parent fe607f5 commit 589b921
Show file tree
Hide file tree
Showing 3 changed files with 842 additions and 727 deletions.
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
LIBS := \
external_libs\
libconfuse \
libtimidity \
libunzip \
libjpeg_ps2_addons\
madplay\
romfs\
Expand Down Expand Up @@ -45,6 +48,26 @@ external_libs:
clean-external_libs:
rm -rf ./build

libconfuse:
./fetch.sh v3.3 https://github.com/libconfuse/libconfuse
cd build/$@ && ./autogen.sh
cd build/$@ && CFLAGS_FOR_TARGET="-G0 -O2 -gdwarf-2 -gz" ./configure --host=mips64r5900el-ps2-elf --prefix=${PS2SDK}/ports --disable-shared --disable-examples
$(MAKE) -C build/$@ all
$(MAKE) -C build/$@ install

libtimidity:
./fetch.sh libtimidity-0.2.7 https://github.com/sezero/libtimidity
cd build/$@ && autoreconf -vfi
cd build/$@ && ./configure --host=mips64r5900el-ps2-elf --prefix=${PS2SDK}/ports --disable-shared --enable-static --disable-examples --disable-aotest --disable-ao
$(MAKE) -C build/$@ all
$(MAKE) -C build/$@ install

libunzip:
cd build/zlib/contrib/minizip && autoreconf -vfi
cd build/zlib/contrib/minizip && CFLAGS="-DIOAPI_NO_64 -I${PS2SDK}/ports/include" ./configure --host=mips64r5900el-ps2-elf --prefix=${PS2SDK}/ports --disable-shared --disable-examples
$(MAKE) -C build/zlib/contrib/minizip all
$(MAKE) -C build/zlib/contrib/minizip install

libjpeg_ps2_addons: external_libs
$(MAKE) -C $@ all
$(MAKE) -C $@ install
Expand Down
57 changes: 18 additions & 39 deletions build-external-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ PROC_NR=$(getconf _NPROCESSORS_ONLN)
CFLAGS=""
XTRA_OPTS=""
MAKECMD=make
CONFIGCMD=./configure
OSVER=$(uname)
if [ ${OSVER:0:5} == MINGW ]; then
XTRA_OPTS=(. -G"MinGW Makefiles")
Expand All @@ -26,7 +25,7 @@ function build_ee {
START_DIR="${PWD}"
DIR="$1"
shift
cd "$DIR"
cd "build/$DIR"
mkdir -p build_ee
cd build_ee
echo "Building '$DIR' for EE..."
Expand Down Expand Up @@ -67,7 +66,7 @@ function make_ee {
START_DIR="${PWD}"
DIR="$1"
shift
cd "$DIR"
cd "build/$DIR"
echo "Building '$DIR' for EE..."
"${MAKECMD}" -j "$PROC_NR" "${MAKE_OPTIONS}" "$@" "${XTRA_OPTS}" all install
cd "${START_DIR}"
Expand All @@ -77,7 +76,7 @@ function make_iop {
START_DIR="${PWD}"
DIR="$1"
shift
cd "$DIR"
cd "build/$DIR"
echo "Building '$DIR' for IOP..."
"${MAKECMD}" -j "$PROC_NR" "${MAKE_OPTIONS}" "$@" "${XTRA_OPTS}" all install
cd "${START_DIR}"
Expand All @@ -87,25 +86,12 @@ function make_irx {
START_DIR="${PWD}"
DIR="$1"
shift
cd "$DIR"
cd "build/$DIR"
echo "Building '$DIR' for IRX..."
"${MAKECMD}" -j "$PROC_NR" "${MAKE_OPTIONS}" "$@" "${XTRA_OPTS}" all install
cd "${START_DIR}"
}

CONFIGURE_OPTIONS=(--host=mips64r5900el-ps2-elf --prefix=${PS2SDK}/ports --disable-shared --disable-examples)

function configure_ps2 {
START_DIR="${PWD}"
DIR="$1"
shift
cd "$DIR"
echo "Configuring '$DIR' for EE..."
"${CONFIGCMD}" "${CONFIGURE_OPTIONS}"
"${MAKECMD}" -j "$PROC_NR" all install
cd "${START_DIR}"
}

## Create a symbolic link for retro-compatibility ps2dev.cmake and ps2dev_iop.cmake
(cd "${PS2SDK}" && ln -sf "../share/ps2dev.cmake" "ps2dev.cmake" && cd -)
(cd "${PS2SDK}" && ln -sf "../share/ps2dev_iop.cmake" "ps2dev_iop.cmake" && cd -)
Expand All @@ -132,7 +118,7 @@ $FETCH v1.5.2 https://github.com/xiph/opus.git &
# We need to clone the whole repo and point to the specific hash for now,
# till they release a new version with cmake compatibility
# we need to clone whole repo because it uses `git describe --tags` for version info
$FETCH 9d718345ce03b2fad5d7d28e0bcd1cc69ab2b166 https://github.com/xiph/opusfile.git true &
$FETCH 81abcb7d7a4f48169556f9dc74c71a78ecad0c70 https://github.com/xiph/opusfile.git true &
# We need to clone the whole repo and point to the specific hash for now,
# till they release a new version with cmake compatibility
$FETCH d1b97ed0020bc620a059d3675d1854b40bd2608d https://github.com/Konstanty/libmodplug.git &
Expand All @@ -151,10 +137,12 @@ $FETCH v1.3.8 https://github.com/ps2dev/gsKit &

# We need to clone the whole repo and point to the specific hash for now,
# till a new version is released after this commit
$FETCH 10c14e78b650e626293aa18155efec54cdee7098 https://github.com/libsdl-org/SDL.git &
$FETCH release-2.6.3 https://github.com/libsdl-org/SDL_mixer.git &
$FETCH release-2.6.3 https://github.com/libsdl-org/SDL_image.git &
$FETCH release-2.20.2 https://github.com/libsdl-org/SDL_ttf.git &
$FETCH 1edaad17218d67b567c149badce9ef0fc67f65fa https://github.com/libsdl-org/SDL.git &
# SDL_mixer Requires to have fluidsynth and libtimidity
$FETCH ps2-ee-sans-glib https://github.com/Wolf3s/fluidsynth.git &
$FETCH release-2.8.0 https://github.com/libsdl-org/SDL_mixer.git &
$FETCH release-2.8.2 https://github.com/libsdl-org/SDL_image.git &
$FETCH release-2.22.0 https://github.com/libsdl-org/SDL_ttf.git &

# We need to clone the whole repo and point to the specific hash for now,
# till a new version is released after this commit
Expand All @@ -179,7 +167,6 @@ $FETCH 0.16.3 https://codeberg.org/tenacityteam/libid3tag.git &
# We need to clone the whole repo and point to the specific hash for now,
# till a new version is released after this commit
$FETCH d6f771cb0e2515dea6a84ece6f9078750bbcc938 https://github.com/billagee/aalib-patched.git &
$FETCH v3.3 https://github.com/libconfuse/libconfuse &
$FETCH 1.6.4 https://github.com/fjtrujy/ps2_drivers &
$FETCH master https://github.com/Wolf3s/libtap.git &
$FETCH ee-v5.4.6 https://github.com/ps2dev/lua &
Expand Down Expand Up @@ -248,9 +235,11 @@ CFLAGS="-Dlfind=bsearch" build_ee libtiff -Dtiff-tools=OFF -Dtiff-tests=OFF
# gsKit is mandatory for SDL
build_ee gsKit
# ps2_drivers is mandatory aswell for SDL
make_ee ps2_drivers
make_ee build/ps2_drivers
build_ee SDL -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DSDL_TESTS=OFF
build_ee SDL_mixer -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DSDL2MIXER_DEPS_SHARED=OFF -DSDL2MIXER_MOD_MODPLUG=ON -DSDL2MIXER_MIDI=OFF -DSDL2MIXER_FLAC=OFF -DSDL2MIXER_SAMPLES=OFF
build_ee fluidsynth -Denable=aufile=OFF -Denable-dbus=OFF -Denable-ladspa=OFF -Denable-ipv6=OFF -Denable-jack=OFF -Denable-libinstpatch=OFF -Denable-libsndfile=OFF -Denable-midishare=OFF -Denable-network=ON -Denable-oss=OFF -Denable-dsound=OFF -Denable-wasapi=OFF -Denable-waveout=OFF -Denable-winmidi=OFF -Denable-sdl2=ON -Denable-pulseaudio=OFF -Denable-pipewire=OFF -Denable-readline=OFF -Denable-threads=ON -Denable-openmp=OFF
build_ee opusfile -DOP_DISABLE_HTTP=ON -DOP_DISABLE_DOCS=ON -DOP_DISABLE_EXAMPLES=ON
build_ee SDL_mixer -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DSDL2MIXER_MIDI=ON -DSDL2MIXER_DEPS_SHARED=OFF -DSDL2MIXER_OPUS=ON -DSDL2MIXER_WAVPACK=OFF -DSDL2MIXER_MIDI_TIMIDITY=ON -DSDL2MIXER_MOD_MODPLUG=ON -DSDL2MIXER_FLAC=OFF -DSDL2MIXER_SAMPLES=OFF -DSDL2MIXER_VORBIS=VORBISFILE
build_ee SDL_image -DCMAKE_POSITION_INDEPENDENT_CODE=OFF
build_ee SDL_ttf -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DSDL2TTF_SAMPLES=OFF

Expand All @@ -259,7 +248,7 @@ build_ee enet
# Build argtable2
CFLAGS="-Wno-implicit-function-declaration" build_ee argtable2-13 -DHAVE_STRINGS_H=ON -DHAVE_STDC_HEADERS=ON
# Copy manually the argtable2.h header
install -m644 argtable2-13/src/argtable2.h $PS2SDK/ports/include/
install -m644 build/argtable2-13/src/argtable2.h $PS2SDK/ports/include/

build_ee argtable3 -DARGTABLE3_INSTALL_CMAKEDIR="${PS2SDK}/ports/lib/cmake/" -DARGTABLE3_REPLACE_GETOPT=OFF -DARGTABLE3_ENABLE_EXAMPLES=OFF -DARGTABLE3_ENABLE_TESTS=OFF

Expand All @@ -272,23 +261,13 @@ CFLAGS="-DHAVE_NEWLOCALE -DHAVE_USELOCALE -DHAVE_FREELOCALE" build_ee libconfig

CFLAGS="-Darc4random_buf=random -DHAVE_GETRANDOM" build_ee libexpat/expat -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_SHARED_LIBS=OFF -DEXPAT_BUILD_TOOLS=OFF

build_ee libmad -DBUILD_SHARED_LIBS=OFF
build_ee libid3tag -DBUILD_SHARED_LIBS=OFF

##
## Build configure projects
##

autoreconf -vfi zlib/contrib/minizip
CFLAGS="-DIOAPI_NO_64 -I${PS2SDK}/ports/include" configure_ps2 zlib/contrib/minizip
cd libconufse && ./autogen.sh && CFLAGS_FOR_TARGET="-G0 -O2 -gdwarf-2 -gz" configure_ps2
cd ..
build_ee libmad
build_ee libid3tag

##
## Build makefile projects
##
make_ee aalib
cd build
make_ee libtap platform=PS2
make_ee lua platform=PS2
make_ee ps2stuff
Expand Down
Loading

0 comments on commit 589b921

Please sign in to comment.