docker.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_FLAGS="-march=x86-64-v2" \
  12. -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
  13. -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
  14. -DCMAKE_INSTALL_PREFIX="/usr" \
  15. -DDISPLAY_VERSION=$1 \
  16. -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
  17. -DENABLE_QT_TRANSLATION=ON \
  18. -DUSE_DISCORD_PRESENCE=ON \
  19. -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
  20. -DYUZU_USE_BUNDLED_FFMPEG=ON \
  21. -GNinja
  22. ninja
  23. ccache -s
  24. ctest -VV -C Release
  25. DESTDIR="$PWD/AppDir" ninja install
  26. rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester
  27. # Download tools needed to build an AppImage
  28. wget -nc https://raw.githubusercontent.com/yuzu-emu/ext-linux-bin/main/gcc/deploy-linux.sh
  29. wget -nc https://raw.githubusercontent.com/yuzu-emu/AppImageKit-checkrt/old/AppRun.sh
  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. deploy-linux.sh \
  34. AppRun.sh \
  35. exec-x86_64.so \
  36. # Workaround for https://github.com/AppImage/AppImageKit/issues/828
  37. export APPIMAGE_EXTRACT_AND_RUN=1
  38. mkdir -p AppDir/usr/optional
  39. mkdir -p AppDir/usr/optional/libstdc++
  40. mkdir -p AppDir/usr/optional/libgcc_s
  41. # Deploy yuzu's needed dependencies
  42. DEPLOY_QT=1 ./deploy-linux.sh AppDir/usr/bin/yuzu AppDir
  43. # Workaround for libQt5MultimediaGstTools indirectly requiring libwayland-client and breaking Vulkan usage on end-user systems
  44. find AppDir -type f -regex '.*libwayland-client\.so.*' -delete -print
  45. # Workaround for building yuzu with GCC 10 but also trying to distribute it to Ubuntu 18.04 et al.
  46. # See https://github.com/darealshinji/AppImageKit-checkrt
  47. cp exec-x86_64.so AppDir/usr/optional/exec.so
  48. cp AppRun.sh AppDir/AppRun
  49. cp --dereference /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6
  50. cp --dereference /lib/x86_64-linux-gnu/libgcc_s.so.1 AppDir/usr/optional/libgcc_s/libgcc_s.so.1