From dbb34551e9549521451c1ebb4a06200461cb7de0 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 11 Jun 2018 10:47:25 -0500 Subject: [PATCH] Also build and ship openal on Linux The Steam runtime ships a too-old version of OpenAL and it's difficult for them to upgrade. Note that this needs a new version of cmake installed in your chroots. --- README.md | 8 +++++-- build_proton.sh | 61 +++++++++++++++++++++++++++++------------------- dist.LICENSE.lin | 8 +++++++ dist.LICENSE.osx | 8 +++++++ 4 files changed, 59 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 818aa875..2295eb54 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ obtain the various submodules that go into building Proton: cd proton #for linux: - git submodule update --init wine dxvk ffmpeg + git submodule update --init wine dxvk ffmpeg openal-soft #for macos: git submodule update --init @@ -84,7 +84,11 @@ And then repeat all of the commands to install gcc and Wine dependencies again. In addition, your host system will need to be able to run Wine in both 64- and 32-bit modes in order to create the default prefix. It is recommended to install Wine from your package manager, including its optional dependencies. -You will also need the Steam runtime located at $HOME/steam-runtime. + +The openal-soft build system requires cmake 3.0.2 or later, which is newer than +the Steam runtime SDK provides. You will need to build and install a newer +cmake into each of the runtimes. For convenience, the build_proton.sh script +will attempt to use cmake from ~/opt32/bin/ and ~/opt64/bin/, if available. Finally, change your directory back to proton, and run: diff --git a/build_proton.sh b/build_proton.sh index 4e2f1ee4..68743a15 100755 --- a/build_proton.sh +++ b/build_proton.sh @@ -128,29 +128,28 @@ build_libjpeg() build_openal() { - #openal 32-bit - cd "$TOP" - mkdir -p build/openal.win32 - cd build/openal.win32 - cmake "$TOP"/openal-soft -DCMAKE_C_FLAGS="-m32" -DCMAKE_INSTALL_PREFIX="$TOOLS_DIR32" - make $JOBS VERBOSE=1 - make install VERBOSE=1 - cp ./libopenal.dylib "$DST_DIR"/lib/libopenal.1.dylib - if [ x"$RELEASE_BUILD" != x ]; then - $STRIP "$DST_DIR"/lib/libopenal.1.dylib + if [ ! -e "$TOOLS_DIR64"/lib/libopenal.$LIB_SUFFIX ]; then + #openal 32-bit + cd "$TOP" + mkdir -p build/openal.win32 + cd build/openal.win32 + $I386_WRAPPER $CMAKE32 "$TOP"/openal-soft -DCMAKE_C_FLAGS="-m32" -DCMAKE_INSTALL_PREFIX="$TOOLS_DIR32" + $I386_WRAPPER make $JOBS VERBOSE=1 + $I386_WRAPPER make install VERBOSE=1 + + #openal 64-bit + cd "$TOP" + mkdir -p build/openal.win64 + cd build/openal.win64 + $AMD64_WRAPPER $CMAKE64 "$TOP"/openal-soft -DCMAKE_INSTALL_PREFIX="$TOOLS_DIR64" + $AMD64_WRAPPER make $JOBS VERBOSE=1 + $AMD64_WRAPPER make install VERBOSE=1 fi - #openal 64-bit - cd "$TOP" - mkdir -p build/openal.win64 - cd build/openal.win64 - cmake "$TOP"/openal-soft -DCMAKE_INSTALL_PREFIX="$TOOLS_DIR64" - make $JOBS VERBOSE=1 - make install VERBOSE=1 - cp ./libopenal.dylib "$DST_DIR"/lib64/libopenal.1.dylib - if [ x"$RELEASE_BUILD" != x ]; then - $STRIP "$DST_DIR"/lib64/libopenal.1.dylib - fi + cp -L "$TOOLS_DIR32"/lib/libopenal* "$DST_DIR"/lib/ + cp -L "$TOOLS_DIR64"/lib/libopenal* "$DST_DIR"/lib64/ + $STRIP "$DST_DIR"/lib/libopenal.$LIB_SUFFIX + $STRIP "$DST_DIR"/lib64/libopenal.$LIB_SUFFIX } build_libSDL() @@ -198,8 +197,10 @@ build_moltenvk() } if [ "$PLATFORM" == "Darwin" ]; then + LIB_SUFFIX="dylib" STRIP='strip -x' else + LIB_SUFFIX="so" STRIP='strip' fi @@ -240,10 +241,22 @@ if [ "$PLATFORM" == "Darwin" ]; then CC="$CCACHE clang" AMD64_WRAPPER="" I386_WRAPPER="" + CMAKE32="cmake" + CMAKE64="cmake" else CC="$CCACHE gcc" AMD64_WRAPPER="schroot --chroot steamrt_scout_beta_amd64 --" I386_WRAPPER="schroot --chroot steamrt_scout_beta_i386 --" + if [ -e "$HOME/opt32/bin/cmake" ]; then + CMAKE32="$HOME/opt32/bin/cmake" + else + CMAKE32="cmake" + fi + if [ -e "$HOME/opt64/bin/cmake" ]; then + CMAKE64="$HOME/opt64/bin/cmake" + else + CMAKE64="cmake" + fi gcc_ver=$($AMD64_WRAPPER gcc -v 2>&1 | grep 'gcc version' | cut -d' ' -f3) gcc_maj=$(echo $gcc_ver | cut -d'.' -f1) @@ -294,8 +307,6 @@ if [ "$PLATFORM" == "Darwin" ]; then JPEG64_LIBS="-L$TOOLS_DIR64/lib -lprotonjpeg" ac_cv_lib_soname_jpeg64=libprotonjpeg.dylib - build_openal - build_libSDL build_moltenvk @@ -475,7 +486,7 @@ git submodule status -- dxvk > "$DST_DIR"/lib/wine/dxvk/version #build ffmpeg function build_ffmpeg { - if [ ! '(' -e "$TOOLS_DIR64/lib/libavcodec.so" -o -e "$TOOLS_DIR64/lib/libavcodec.dylib" ')' ]; then + if [ ! -e "$TOOLS_DIR64/lib/libavcodec.$LIB_SUFFIX" ]; then #ffmpeg 32-bit cd "$TOP" mkdir -p build/ffmpeg.win32 @@ -552,6 +563,8 @@ function build_ffmpeg build_ffmpeg +build_openal + case "$BUILD_COMPONENTS" in "all") build_wine64 diff --git a/dist.LICENSE.lin b/dist.LICENSE.lin index aa51cfb6..f24c6c5e 100644 --- a/dist.LICENSE.lin +++ b/dist.LICENSE.lin @@ -67,3 +67,11 @@ This software contains FFmpeg licensed under the LGPL 2.1. Visit FFmpeg at https://ffmpeg.org/ + +---- ---- ---- ---- + +This software contains openal-soft licensed under the LGPL 2. + +Visit openal-soft at + + https://github.com/kcat/openal-soft/ diff --git a/dist.LICENSE.osx b/dist.LICENSE.osx index 8283d194..3e30826d 100644 --- a/dist.LICENSE.osx +++ b/dist.LICENSE.osx @@ -96,3 +96,11 @@ This software contains FFmpeg licensed under the LGPL 2.1. Visit FFmpeg at https://ffmpeg.org/ + +---- ---- ---- ---- + +This software contains openal-soft licensed under the LGPL 2. + +Visit openal-soft at + + https://github.com/kcat/openal-soft/