docker.sh 1.9 KB

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