docker.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash -ex
  2. set -e
  3. #cd /yuzu
  4. ccache -sv
  5. mkdir -p build && cd build
  6. export LDFLAGS="-fuse-ld=lld"
  7. # -femulated-tls required due to an incompatibility between GCC and Clang
  8. # TODO(lat9nq): If this is widespread, we probably need to add this to CMakeLists where appropriate
  9. export CXXFLAGS="-femulated-tls"
  10. cmake .. \
  11. -DCMAKE_BUILD_TYPE=Release \
  12. -DCMAKE_TOOLCHAIN_FILE="${PWD}/../CMakeModules/MinGWClangCross.cmake" \
  13. -DDISPLAY_VERSION="$1" \
  14. -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
  15. -DENABLE_QT_TRANSLATION=ON \
  16. -DUSE_CCACHE=ON \
  17. -DYUZU_USE_BUNDLED_SDL2=OFF \
  18. -DYUZU_USE_EXTERNAL_SDL2=OFF \
  19. -DYUZU_TESTS=OFF \
  20. -GNinja
  21. ninja yuzu yuzu-cmd
  22. ccache -sv
  23. echo "Tests skipped"
  24. #ctest -VV -C Release
  25. echo 'Prepare binaries...'
  26. cd ..
  27. mkdir package
  28. if [ -d "/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/" ]; then
  29. QT_PLUGINS_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins'
  30. else
  31. #fallback to qt
  32. QT_PLUGINS_PATH='/usr/x86_64-w64-mingw32/lib/qt/plugins'
  33. fi
  34. find build/ -name "yuzu*.exe" -exec cp {} 'package' \;
  35. # copy Qt plugins
  36. mkdir package/platforms
  37. cp -v "${QT_PLUGINS_PATH}/platforms/qwindows.dll" package/platforms/
  38. cp -rv "${QT_PLUGINS_PATH}/mediaservice/" package/
  39. cp -rv "${QT_PLUGINS_PATH}/imageformats/" package/
  40. cp -rv "${QT_PLUGINS_PATH}/styles/" package/
  41. rm -f package/mediaservice/*d.dll
  42. for i in package/*.exe; do
  43. # we need to process pdb here, however, cv2pdb
  44. # does not work here, so we just simply strip all the debug symbols
  45. x86_64-w64-mingw32-strip "${i}"
  46. done
  47. pip3 install pefile
  48. python3 .ci/scripts/windows/scan_dll.py package/*.exe package/imageformats/*.dll "package/"
  49. # copy FFmpeg libraries
  50. EXTERNALS_PATH="$(pwd)/build/externals"
  51. FFMPEG_DLL_PATH="$(find "${EXTERNALS_PATH}" -maxdepth 1 -type d | grep 'ffmpeg-')/bin"
  52. find ${FFMPEG_DLL_PATH} -type f -regex ".*\.dll" -exec cp -nv {} package/ ';'
  53. # copy libraries from yuzu.exe path
  54. find "$(pwd)/build/bin/" -type f -regex ".*\.dll" -exec cp -v {} package/ ';'