jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

272 lines
9.8KB

  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - '*'
  6. pull_request:
  7. branches:
  8. - '*'
  9. env:
  10. DEBIAN_FRONTEND: noninteractive
  11. HOMEBREW_NO_AUTO_UPDATE: 1
  12. PAWPAW_VERSION: 8c69660ab10b75cd7a488f41386dbcb4c8802c5a
  13. jobs:
  14. # macOS native intel build
  15. macos:
  16. runs-on: macos-10.15
  17. steps:
  18. - uses: actions/checkout@v2
  19. with:
  20. submodules: recursive
  21. - name: Set up cache
  22. uses: actions/cache@v2
  23. with:
  24. path: |
  25. ~/PawPawBuilds/builds
  26. ~/PawPawBuilds/downloads
  27. ~/PawPawBuilds/targets
  28. key: macos
  29. - name: Set up dependencies
  30. run: |
  31. brew install cmake jq meson
  32. - name: Bootstrap macOS intel
  33. shell: bash
  34. run: |
  35. if [ ! -d PawPaw ]; then
  36. git clone https://github.com/DISTRHO/PawPaw.git
  37. git -C PawPaw checkout ${PAWPAW_VERSION}
  38. fi
  39. ./PawPaw/bootstrap-jack2.sh macos && ./PawPaw/.cleanup.sh macos
  40. - name: Build jack2
  41. shell: bash
  42. run: |
  43. pushd PawPaw && source local.env macos && popd
  44. python ./waf configure --platform=darwin --prefix=/usr/local
  45. python ./waf build -j $(sysctl -n hw.logicalcpu)
  46. python ./waf install --destdir=$(pwd)/destdir
  47. - name: Set sha8
  48. id: slug
  49. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  50. - name: Generate macOS package
  51. shell: bash
  52. run: |
  53. ./macosx/generate-pkg.sh $(pwd)/destdir ${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  54. - uses: actions/upload-artifact@v2
  55. with:
  56. name: jack2-macOS-intel-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  57. path: macosx/jack2-osx-*.pkg
  58. # macOS native universal build
  59. macos_universal:
  60. runs-on: macos-10.15
  61. steps:
  62. - uses: actions/checkout@v2
  63. with:
  64. submodules: recursive
  65. - name: Set up cache
  66. uses: actions/cache@v2
  67. with:
  68. path: |
  69. ~/PawPawBuilds/builds
  70. ~/PawPawBuilds/downloads
  71. ~/PawPawBuilds/targets
  72. key: macos-universal
  73. - name: Set up dependencies
  74. run: |
  75. brew install cmake jq meson
  76. - name: Fix up Xcode
  77. run: |
  78. sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
  79. sudo xcode-select -s /Applications/Xcode_12.3.app
  80. - name: Bootstrap macOS universal
  81. shell: bash
  82. run: |
  83. if [ ! -d PawPaw ]; then
  84. git clone https://github.com/DISTRHO/PawPaw.git
  85. git -C PawPaw checkout ${PAWPAW_VERSION}
  86. fi
  87. ./PawPaw/bootstrap-jack2.sh macos-universal && ./PawPaw/.cleanup.sh macos-universal
  88. - name: Build jack2
  89. shell: bash
  90. run: |
  91. pushd PawPaw && source local.env macos-universal && popd
  92. python ./waf configure --platform=darwin --prefix=/usr/local
  93. python ./waf build -j $(sysctl -n hw.logicalcpu)
  94. python ./waf install --destdir=$(pwd)/destdir
  95. #- name: Patch binaries
  96. #shell: bash
  97. #run: |
  98. #pushd $(pwd)/destdir
  99. #for f in $(ls bin/* lib/*.dylib lib/jack/*); do
  100. #install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjack.0.dylib" "/usr/local/lib/libjack.0.dylib" "${f}"
  101. #install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjacknet.0.dylib" "/usr/local/lib/libjacknet.0.dylib" "${f}"
  102. #install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjackserver.0.dylib" "/usr/local/lib/libjackserver.0.dylib" "${f}"
  103. - name: Set sha8
  104. id: slug
  105. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  106. - name: Generate macOS package
  107. shell: bash
  108. run: |
  109. ./macosx/generate-pkg.sh $(pwd)/destdir ${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  110. - uses: actions/upload-artifact@v2
  111. with:
  112. name: jack2-macOS-universal-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  113. path: macosx/jack2-osx-*.pkg
  114. # linux with win32 cross-compilation
  115. win32:
  116. runs-on: ubuntu-20.04
  117. steps:
  118. - uses: actions/checkout@v2
  119. with:
  120. submodules: recursive
  121. - name: Set up cache
  122. uses: actions/cache@v2
  123. with:
  124. path: |
  125. ~/PawPawBuilds/builds
  126. ~/PawPawBuilds/debs
  127. ~/PawPawBuilds/downloads
  128. ~/PawPawBuilds/targets
  129. key: win32
  130. - name: Restore debian packages cache
  131. run: |
  132. if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \
  133. sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/; \
  134. fi
  135. - name: Set up dependencies
  136. run: |
  137. wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
  138. sudo dpkg --add-architecture i386
  139. sudo apt-add-repository -y 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
  140. sudo apt-get install -y autopoint build-essential curl cmake jq llvm mingw-w64 qttools5-dev-tools winehq-stable xvfb \
  141. binutils-mingw-w64-i686 g++-mingw-w64-i686
  142. - name: Cache debian packages
  143. run: |
  144. mkdir -p ~/PawPawBuilds/debs && \
  145. sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
  146. - name: Bootstrap win32 cross-compiled
  147. shell: bash
  148. run: |
  149. if [ ! -d PawPaw ]; then
  150. git clone https://github.com/DISTRHO/PawPaw.git
  151. git -C PawPaw checkout ${PAWPAW_VERSION}
  152. fi
  153. ./PawPaw/bootstrap-jack2.sh win32 && ./PawPaw/.cleanup.sh win32
  154. - name: Build jack2
  155. shell: bash
  156. run: |
  157. pushd PawPaw && source local.env win32 && popd
  158. ./waf configure --platform=win32 --prefix=$(pwd)/destdir --static
  159. ./waf build -j $(nproc)
  160. ./waf install
  161. - name: Generate MSVC lib files
  162. shell: bash
  163. run: |
  164. pushd $(pwd)/destdir/lib
  165. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  166. llvm-dlltool -m i386 -D libjacknet.dll -d libjacknet.def -l libjacknet.lib
  167. llvm-dlltool -m i386 -D libjackserver.dll -d libjackserver.def -l libjackserver.lib
  168. popd
  169. - name: Set sha8
  170. id: slug
  171. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  172. - name: Generate Windows installer
  173. shell: bash
  174. run: |
  175. # Setup wine
  176. export WINEPREFIX=$(pwd)/innosetup
  177. wineboot -u
  178. # Download and install innosetup
  179. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
  180. wine is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  181. # create installer
  182. ln -sf $(pwd)/destdir windows/inno/win32
  183. pushd windows/inno
  184. echo "#define VERSION \"${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}\"" > version.iss
  185. wine ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe win32-mini.iss
  186. popd
  187. # linux with win64 cross-compilation
  188. win64:
  189. runs-on: ubuntu-20.04
  190. steps:
  191. - uses: actions/checkout@v2
  192. with:
  193. submodules: recursive
  194. - name: Set up cache
  195. uses: actions/cache@v2
  196. with:
  197. path: |
  198. ~/PawPawBuilds/builds
  199. ~/PawPawBuilds/debs
  200. ~/PawPawBuilds/downloads
  201. ~/PawPawBuilds/targets
  202. key: win64
  203. - name: Restore debian packages cache
  204. run: |
  205. if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \
  206. sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/; \
  207. fi
  208. - name: Set up dependencies
  209. run: |
  210. wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
  211. sudo dpkg --add-architecture i386
  212. sudo apt-add-repository -y 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
  213. sudo apt-get install -y autopoint build-essential curl cmake jq llvm mingw-w64 qttools5-dev-tools winehq-stable xvfb \
  214. binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64
  215. - name: Cache debian packages
  216. run: |
  217. mkdir -p ~/PawPawBuilds/debs && \
  218. sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
  219. - name: Bootstrap win64 cross-compiled
  220. shell: bash
  221. run: |
  222. if [ ! -d PawPaw ]; then
  223. git clone https://github.com/DISTRHO/PawPaw.git
  224. git -C PawPaw checkout ${PAWPAW_VERSION}
  225. fi
  226. ./PawPaw/bootstrap-jack2.sh win64 && ./PawPaw/.cleanup.sh win64
  227. - name: Build jack2
  228. shell: bash
  229. run: |
  230. pushd PawPaw && source local.env win64 && popd
  231. export PATH+=":/usr/i686-w64-mingw32/bin"
  232. export LDFLAGS+="-L~/PawPawBuilds/targets/win64/lib32"
  233. ./waf configure --platform=win32 --prefix=$(pwd)/destdir --static --mixed
  234. ./waf build -j $(nproc)
  235. ./waf install
  236. - name: Generate MSVC lib files
  237. shell: bash
  238. run: |
  239. # 32bit
  240. pushd $(pwd)/destdir/lib32
  241. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  242. popd
  243. # 64bit
  244. pushd $(pwd)/destdir/lib
  245. llvm-dlltool -m i386:x86-64 -D libjack64.dll -d libjack64.def -l libjack64.lib
  246. llvm-dlltool -m i386:x86-64 -D libjacknet64.dll -d libjacknet64.def -l libjacknet64.lib
  247. llvm-dlltool -m i386:x86-64 -D libjackserver64.dll -d libjackserver64.def -l libjackserver64.lib
  248. popd
  249. - name: Set sha8
  250. id: slug
  251. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  252. - name: Generate Windows installer
  253. shell: bash
  254. run: |
  255. # Setup wine
  256. export WINEPREFIX=$(pwd)/innosetup
  257. wineboot -u
  258. # Download and install innosetup
  259. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
  260. wine64 is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  261. # create installer
  262. ln -sf $(pwd)/destdir windows/inno/win64
  263. pushd windows/inno
  264. echo "#define VERSION \"${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}\"" > version.iss
  265. wine64 ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe win64-mini.iss
  266. popd