docker.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash -ex
  2. # SPDX-FileCopyrightText: 2019 yuzu Emulator Project
  3. # SPDX-License-Identifier: GPL-2.0-or-later
  4. # Exit on error, rather than continuing with the rest of the script.
  5. set -e
  6. ccache -s
  7. mkdir build || true && cd build
  8. cmake .. \
  9. -DBoost_USE_STATIC_LIBS=ON \
  10. -DCMAKE_BUILD_TYPE=Release \
  11. -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
  12. -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
  13. -DCMAKE_INSTALL_PREFIX="/usr" \
  14. -DDISPLAY_VERSION=$1 \
  15. -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
  16. -DENABLE_QT_TRANSLATION=ON \
  17. -DUSE_DISCORD_PRESENCE=ON \
  18. -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
  19. -DYUZU_USE_BUNDLED_FFMPEG=ON \
  20. -GNinja
  21. ninja
  22. ccache -s
  23. ctest -VV -C Release
  24. DESTDIR="$PWD/AppDir" ninja install
  25. rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester
  26. # Download tools needed to build an AppImage
  27. wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/linuxdeploy-x86_64.AppImage
  28. wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/linuxdeploy-plugin-qt-x86_64.AppImage
  29. wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/AppRun-patched-x86_64
  30. wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/exec-x86_64.so
  31. # Set executable bit
  32. chmod 755 \
  33. AppRun-patched-x86_64 \
  34. exec-x86_64.so \
  35. linuxdeploy-x86_64.AppImage \
  36. linuxdeploy-plugin-qt-x86_64.AppImage
  37. # Workaround for https://github.com/AppImage/AppImageKit/issues/828
  38. export APPIMAGE_EXTRACT_AND_RUN=1
  39. mkdir -p AppDir/usr/optional
  40. mkdir -p AppDir/usr/optional/libstdc++
  41. mkdir -p AppDir/usr/optional/libgcc_s
  42. # Deploy yuzu's needed dependencies
  43. ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt
  44. # Workaround for building yuzu with GCC 10 but also trying to distribute it to Ubuntu 18.04 et al.
  45. # See https://github.com/darealshinji/AppImageKit-checkrt
  46. cp exec-x86_64.so AppDir/usr/optional/exec.so
  47. cp AppRun-patched-x86_64 AppDir/AppRun
  48. cp --dereference /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6
  49. cp --dereference /lib/x86_64-linux-gnu/libgcc_s.so.1 AppDir/usr/optional/libgcc_s/libgcc_s.so.1