docker.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash -ex
  2. cd /yuzu
  3. MINGW_PACKAGES="sdl2-mingw-w64 qt5base-mingw-w64 qt5tools-mingw-w64 libsamplerate-mingw-w64 qt5multimedia-mingw-w64"
  4. apt-get update
  5. apt-get install -y gpg wget git python3-pip python ccache g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 mingw-w64-tools cmake
  6. echo 'deb http://ppa.launchpad.net/tobydox/mingw-w64/ubuntu bionic main ' > /etc/apt/sources.list.d/extras.list
  7. apt-key adv --keyserver keyserver.ubuntu.com --recv '72931B477E22FEFD47F8DECE02FE5F12ADDE29B2'
  8. apt-get update
  9. apt-get install -y ${MINGW_PACKAGES}
  10. # fix a problem in current MinGW headers
  11. wget -q https://raw.githubusercontent.com/Alexpux/mingw-w64/d0d7f784833bbb0b2d279310ddc6afb52fe47a46/mingw-w64-headers/crt/errno.h -O /usr/x86_64-w64-mingw32/include/errno.h
  12. # override Travis CI unreasonable ccache size
  13. echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf"
  14. # Dirty hack to trick unicorn makefile into believing we are in a MINGW system
  15. mv /bin/uname /bin/uname1 && echo -e '#!/bin/sh\necho MINGW64' >> /bin/uname
  16. chmod +x /bin/uname
  17. # Dirty hack to trick unicorn makefile into believing we have cmd
  18. echo '' >> /bin/cmd
  19. chmod +x /bin/cmd
  20. mkdir build && cd build
  21. cmake .. -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_UNICORN=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release
  22. make -j4
  23. # Clean up the dirty hacks
  24. rm /bin/uname && mv /bin/uname1 /bin/uname
  25. rm /bin/cmd
  26. ccache -s
  27. echo "Tests skipped"
  28. #ctest -VV -C Release
  29. echo 'Prepare binaries...'
  30. cd ..
  31. mkdir package
  32. QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/'
  33. find build/ -name "yuzu*.exe" -exec cp {} 'package' \;
  34. # copy Qt plugins
  35. mkdir package/platforms
  36. cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/
  37. cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/
  38. cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
  39. rm -f package/mediaservice/*d.dll
  40. for i in package/*.exe; do
  41. # we need to process pdb here, however, cv2pdb
  42. # does not work here, so we just simply strip all the debug symbols
  43. x86_64-w64-mingw32-strip "${i}"
  44. done
  45. pip3 install pefile
  46. python3 .travis/linux-mingw/scan_dll.py package/*.exe "package/"