Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.10 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. UNAME=$(uname -s)
  4. if [[ $UNAME == *"MINGW"* ]]; then
  5. suffix=".dll"
  6. if [[ $UNAME == *"MINGW64"* ]]; then
  7. mingw_prefix="mingw64"
  8. else
  9. mingw_prefix="mingw32"
  10. fi
  11. elif [[ $UNAME == "Darwin" ]]; then
  12. suffix=".dylib"
  13. else
  14. suffix=".so"
  15. fi
  16.  
  17. #if [[ $HOST_CPU == "i686" ]]; then
  18. # export NEW_DYNAREC=1
  19. #fi
  20.  
  21. install_dir=$PWD/mupen64plus
  22. mkdir -p $install_dir
  23. base_dir=$PWD
  24.  
  25. cd $base_dir/mupen64plus-core/projects/unix
  26. make -j4 all
  27. cp -P $base_dir/mupen64plus-core/projects/unix/*$suffix* $install_dir
  28. cp $base_dir/mupen64plus-core/data/* $install_dir
  29.  
  30. cd $base_dir/mupen64plus-rsp-hle/projects/unix
  31. make -j4 all
  32. cp $base_dir/mupen64plus-rsp-hle/projects/unix/*$suffix $install_dir
  33.  
  34. cd $base_dir/mupen64plus-input-sdl/projects/unix
  35. make -j4 all
  36. cp $base_dir/mupen64plus-input-sdl/projects/unix/*$suffix $install_dir
  37. cp $base_dir/mupen64plus-input-sdl/data/* $install_dir
  38.  
  39. cd $base_dir/mupen64plus-audio-sdl2/projects/unix
  40. make -j4 all
  41. cp $base_dir/mupen64plus-audio-sdl2/projects/unix/*$suffix $install_dir
  42.  
  43. mkdir -p $base_dir/mupen64plus-gui/build
  44. cd $base_dir/mupen64plus-gui/build
  45. if [[ $UNAME == *"MINGW"* ]]; then
  46. qmake ../mupen64plus-gui.pro
  47. make -j4 release
  48. cp $base_dir/mupen64plus-gui/build/release/mupen64plus-gui.exe $install_dir
  49. elif [[ $UNAME == "Darwin" ]]; then
  50. /usr/local/Cellar/qt5/*/bin/qmake ../mupen64plus-gui.pro
  51. make -j4
  52. cp -Rp $base_dir/mupen64plus-gui/build/mupen64plus-gui.app $install_dir
  53. else
  54. qmake ../mupen64plus-gui.pro
  55. make -j4
  56. cp $base_dir/mupen64plus-gui/build/mupen64plus-gui $install_dir
  57. fi
  58.  
  59. cd $base_dir/GLideN64/src
  60. ./getRevision.sh
  61.  
  62. mkdir -p $base_dir/GLideN64/src/GLideNUI/build
  63. cd $base_dir/GLideN64/src/GLideNUI/build
  64. if [[ $UNAME == *"MINGW"* ]]; then
  65. qmake ../GLideNUI.pro
  66. make -j4 release
  67. elif [[ $UNAME == "Darwin" ]]; then
  68. /usr/local/Cellar/qt5/*/bin/qmake ../GLideNUI.pro
  69. make -j4
  70. else
  71. qmake ../GLideNUI.pro
  72. make -j4
  73. fi
  74.  
  75. cd $base_dir/GLideN64/projects/cmake
  76. sed -i 's/GLideNUI\/build\/debug\/libGLideNUI.a/GLideNUI\/build\/release\/libGLideNUI.a/g' ../../src/CMakeLists.txt
  77. if [[ $UNAME == *"MINGW"* ]]; then
  78. sed -i 's/check_ipo_supported(RESULT result)//g' ../../src/CMakeLists.txt
  79. cmake -G "MSYS Makefiles" -DVEC4_OPT=On -DCRC_OPT=On -DMUPENPLUSAPI=On ../../src/
  80. else
  81. rm -rf ../../src/GLideNHQ/inc
  82. cmake -DUSE_SYSTEM_LIBS=On -DVEC4_OPT=On -DCRC_OPT=On -DMUPENPLUSAPI=On ../../src/
  83. fi
  84. make -j4
  85.  
  86. if [[ $UNAME == *"MINGW"* ]]; then
  87. cp mupen64plus-video-GLideN64$suffix $install_dir
  88. else
  89. cp plugin/Release/mupen64plus-video-GLideN64$suffix $install_dir
  90. fi
  91. cp $base_dir/GLideN64/ini/GLideN64.custom.ini $install_dir
  92.  
  93. cd $base_dir
  94.  
  95. strip $install_dir/*$suffix
  96.  
  97. if [[ $UNAME == *"MINGW"* ]]; then
  98. if [[ $UNAME == *"MINGW64"* ]]; then
  99. my_os=win64
  100. cp /$mingw_prefix/bin/libgcc_s_seh-1.dll $install_dir
  101. else
  102. my_os=win32
  103. cp /$mingw_prefix/bin/libgcc_s_dw2-1.dll $install_dir
  104. fi
  105. cp /$mingw_prefix/bin/libwinpthread-1.dll $install_dir
  106. cp /$mingw_prefix/bin/SDL2.dll $install_dir
  107. cp /$mingw_prefix/bin/libpng16-16.dll $install_dir
  108. cp /$mingw_prefix/bin/libglib-2.0-0.dll $install_dir
  109. cp /$mingw_prefix/bin/libstdc++-6.dll $install_dir
  110. cp /$mingw_prefix/bin/zlib1.dll $install_dir
  111. cp /$mingw_prefix/bin/libintl-8.dll $install_dir
  112. cp /$mingw_prefix/bin/libpcre-1.dll $install_dir
  113. cp /$mingw_prefix/bin/libiconv-2.dll $install_dir
  114. cp /$mingw_prefix/bin/libharfbuzz-0.dll $install_dir
  115. cp /$mingw_prefix/bin/libgraphite2.dll $install_dir
  116. cp /$mingw_prefix/bin/libfreetype-6.dll $install_dir
  117. cp /$mingw_prefix/bin/libbz2-1.dll $install_dir
  118. cp /$mingw_prefix/bin/libminizip-1.dll $install_dir
  119. cp /$mingw_prefix/bin/libsamplerate-0.dll $install_dir
  120. cp /$mingw_prefix/bin/libjasper-4.dll $install_dir
  121. cp /$mingw_prefix/bin/libjpeg-8.dll $install_dir
  122. cp /$mingw_prefix/bin/libicudt62.dll $install_dir
  123. cp /$mingw_prefix/bin/libicuin62.dll $install_dir
  124. cp /$mingw_prefix/bin/libicuuc62.dll $install_dir
  125. cp /$mingw_prefix/bin/libpcre2-16-0.dll $install_dir
  126. cp /$mingw_prefix/bin/Qt5Core.dll $install_dir
  127. cp /$mingw_prefix/bin/Qt5Gui.dll $install_dir
  128. cp /$mingw_prefix/bin/Qt5Widgets.dll $install_dir
  129. cp $base_dir/7za.exe $install_dir
  130. elif [[ $UNAME == "Darwin" ]]; then
  131. my_os=macos
  132.  
  133. find mupen64plus -type f -depth 1 \
  134. -exec mv {} mupen64plus/mupen64plus-gui.app/Contents/MacOS/ \;
  135.  
  136. cd $install_dir
  137. /usr/local/Cellar/qt5/*/bin/macdeployqt mupen64plus-gui.app
  138.  
  139. for P in $(find mupen64plus-gui.app -type f -name 'Qt*'; find mupen64plus-gui.app -type f -name '*.dylib'); do
  140. for P1 in $(otool -L $P | awk '/\/usr\/local\/Cellar/ {print $1}'); do
  141. PATHNAME=$(echo $P1 | awk '{sub(/(\/Qt.+\.framework|[^\/]*\.dylib).*/, ""); print}')
  142. PSLASH1=$(echo $P1 | sed "s,$PATHNAME,@executable_path/../Frameworks,g")
  143. install_name_tool -change $P1 $PSLASH1 $P
  144. done
  145. done
  146.  
  147. cd $base_dir
  148. else
  149. if [[ $HOST_CPU == "i686" ]]; then
  150. my_os=linux32
  151. else
  152. my_os=linux64
  153. fi
  154. fi
  155.  
  156. if [[ $1 == "aws" ]]; then
  157. rm $base_dir/*.zip
  158. DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
  159. zip -r mupen64plus-GLideN64-$my_os.zip mupen64plus
  160. # use artifacts
  161. mkdir build-artifacts
  162. cp mupen64plus-GLideN64-$my_os.zip build-artifacts/
  163. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement