docker.sh 2.1 KB

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