temp.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ccache -sv
  2. mkdir build || true && cd build
  3. cmake .. \
  4. -DBoost_USE_STATIC_LIBS=ON \
  5. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  6. -DSUYU_USE_PRECOMPILED_HEADERS=OFF \
  7. -DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \
  8. -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
  9. -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ \
  10. -DCMAKE_C_COMPILER=/usr/local/bin/gcc \
  11. -DCMAKE_INSTALL_PREFIX="/usr" \
  12. -DDISPLAY_VERSION=$1 \
  13. -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \
  14. -DENABLE_QT_TRANSLATION=OFF \
  15. -DUSE_DISCORD_PRESENCE=ON \
  16. -DSUYU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
  17. -DSUYU_USE_BUNDLED_FFMPEG=ON \
  18. -DSUYU_ENABLE_LTO=OFF \
  19. -DSUYU_CRASH_DUMPS=ON \
  20. -DSUYU_USE_FASTER_LD=ON \
  21. -GNinja
  22. ninja
  23. ccache -sv
  24. ctest -VV -C Release
  25. # Separate debug symbols from specified executables
  26. for EXE in suyu; do
  27. EXE_PATH="bin/$EXE"
  28. # Copy debug symbols out
  29. objcopy --only-keep-debug $EXE_PATH $EXE_PATH.debug
  30. # Add debug link and strip debug symbols
  31. objcopy -g --add-gnu-debuglink=$EXE_PATH.debug $EXE_PATH $EXE_PATH.out
  32. # Overwrite original with stripped copy
  33. mv $EXE_PATH.out $EXE_PATH
  34. done
  35. # Strip debug symbols from all executables
  36. find bin/ -type f -not -regex '.*.debug' -exec strip -g {} ';'
  37. DESTDIR="$PWD/AppDir" ninja install
  38. rm -vf AppDir/usr/bin/suyu-cmd AppDir/usr/bin/suyu-tester
  39. # Download tools needed to build an AppImage
  40. wget -nc https://git.suyu.dev/suyu/ext-linux-bin/raw/branch/main/appimage/deploy-linux.sh
  41. wget -nc https://git.suyu.dev/suyu/ext-linux-bin/raw/branch/main/appimage/exec-x86_64.so
  42. wget -nc https://git.suyu.dev/suyu/AppImageKit-checkrt/raw/branch/gh-workflow/AppRun
  43. # Set executable bit
  44. chmod 755 \
  45. deploy-linux.sh \
  46. AppRun.sh \
  47. exec-x86_64.so \
  48. # Workaround for https://github.com/AppImage/AppImageKit/issues/828
  49. export APPIMAGE_EXTRACT_AND_RUN=1
  50. mkdir -p AppDir/usr/optional
  51. mkdir -p AppDir/usr/optional/libstdc++
  52. mkdir -p AppDir/usr/optional/libgcc_s
  53. # Deploy suyu's needed dependencies
  54. DEPLOY_QT=1 ./deploy-linux.sh AppDir/usr/bin/suyu AppDir
  55. # Workaround for libQt5MultimediaGstTools indirectly requiring libwayland-client and breaking Vulkan usage on end-user systems
  56. find AppDir -type f -regex '.*libwayland-client\.so.*' -delete -print
  57. # Workaround for building suyu with GCC 10 but also trying to distribute it to Ubuntu 18.04 et al.
  58. # See https://github.com/darealshinji/AppImageKit-checkrt
  59. cp exec-x86_64.so AppDir/usr/optional/exec.so
  60. cp AppRun.sh AppDir/AppRun
  61. cp --dereference /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6
  62. cp --dereference /lib/x86_64-linux-gnu/libgcc_s.so.1 AppDir/usr/optional/libgcc_s/libgcc_s.so.1