docker.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash -ex
  2. # SPDX-FileCopyrightText: 2019 yuzu Emulator Project
  3. # SPDX-FileCopyrightText: 2024 suyu Emulator Project
  4. # SPDX-License-Identifier: GPL-2.0-or-later
  5. set -e
  6. #cd /suyu
  7. ccache -s
  8. git submodule update --init --recursive
  9. rm -rf build
  10. mkdir -p build && cd build
  11. /usr/bin/x86_64-w64-mingw32-cmake .. \
  12. -DCMAKE_BUILD_TYPE=Release \
  13. -DDISPLAY_VERSION="$1" \
  14. -DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \
  15. -DSUYU_USE_PRECOMPILED_HEADERS=OFF \
  16. -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \
  17. -DUSE_DISCORD_PRESENCE=ON \
  18. -DENABLE_QT_TRANSLATION=ON \
  19. -DUSE_CCACHE=ON \
  20. -DSUYU_USE_BUNDLED_SDL2=OFF \
  21. -DSUYU_USE_EXTERNAL_SDL2=OFF \
  22. -DSUYU_TESTS=OFF \
  23. -GNinja
  24. ninja suyu suyu-cmd
  25. ccache -sv
  26. echo "Tests skipped"
  27. #ctest -VV -C Release
  28. echo 'Prepare binaries...'
  29. cd ..
  30. mkdir package
  31. if [ -d "/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/" ]; then
  32. QT_PLUGINS_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins'
  33. else
  34. #fallback to qt
  35. QT_PLUGINS_PATH='/usr/x86_64-w64-mingw32/lib/qt/plugins'
  36. fi
  37. find build/ -name "suyu*.exe" -exec cp {} 'package' \;
  38. # copy Qt plugins
  39. mkdir package/platforms
  40. cp -v "${QT_PLUGINS_PATH}/platforms/qwindows.dll" package/platforms/
  41. cp -rv "${QT_PLUGINS_PATH}/mediaservice/" package/
  42. cp -rv "${QT_PLUGINS_PATH}/imageformats/" package/
  43. cp -rv "${QT_PLUGINS_PATH}/styles/" package/
  44. rm -f package/mediaservice/*d.dll
  45. for i in package/*.exe; do
  46. # we need to process pdb here, however, cv2pdb
  47. # does not work here, so we just simply strip all the debug symbols
  48. x86_64-w64-mingw32-strip "${i}"
  49. done
  50. python3 .ci/scripts/windows/scan_dll.py package/*.exe package/imageformats/*.dll "package/"
  51. # copy FFmpeg libraries
  52. EXTERNALS_PATH="$(pwd)/build/externals"
  53. FFMPEG_DLL_PATH="$(find "${EXTERNALS_PATH}" -maxdepth 1 -type d | grep 'ffmpeg-')/bin"
  54. find ${FFMPEG_DLL_PATH} -type f -regex ".*\.dll" -exec cp -nv {} package/ ';'
  55. # copy libraries from suyu.exe path
  56. find "$(pwd)/build/bin/" -type f -regex ".*\.dll" -exec cp -v {} package/ ';'