docker.sh 2.0 KB

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