Skip to content

Commit

Permalink
Build OpenSSL, OpenBLAS packages using MSYS2 MinGW toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed May 27, 2024
1 parent ca7d780 commit 9e3213b
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e # exit on error
set -x # echo on
set -o pipefail # fail of any command in pipeline is an error

pacman -Syu --noconfirm
pacman -Syuu --noconfirm

# Add WoArm64 custom repository.
REPO='[woarm64]
Expand All @@ -15,4 +15,3 @@ SigLevel = Optional
echo -e "$REPO$(cat /etc/pacman.conf)" > /etc/pacman.conf

pacman -Sy --noconfirm
pacman -S mingw-w64-cross-gcc --noconfirm
40 changes: 27 additions & 13 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ on:
description: "Install additional dependencies"
type: string
default: ""
msys2_packages_branch:
description: "MSYS2-packages branch to build"
packages_repository:
description: "MSYS2 packages repository to build from"
type: string
default: "Windows-on-ARM-Experiments/MSYS2-packages"
packages_branch:
description: "MSYS2 packages branch to build from"
type: string
default: "woarm64"

Expand All @@ -35,6 +39,13 @@ jobs:
msystem: MSYS
update: true

- name: Checkout repository
uses: actions/checkout@v4

- name: Setup packages repository
run: |
`cygpath "${{ github.workspace }}"`/.github/scripts/setup-repository.sh
- name: Install dependencies
run: |
pacman -S --noconfirm \
Expand All @@ -44,15 +55,12 @@ jobs:
mingw-w64-x86_64-jq \
${{ inputs.dependencies }}
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout MSYS2 packages repository
- name: Checkout ${{ inputs.packages_repository }} repository
uses: actions/checkout@v4
with:
repository: Windows-on-ARM-Experiments/MSYS2-packages
ref: ${{ inputs.msys2_packages_branch }}
path: ${{ github.workspace }}/MSYS2-packages
repository: ${{ inputs.packages_repository }}
ref: ${{ inputs.packages_branch }}
path: ${{ github.workspace }}/packages

- name: Download artifacts
if: ${{ inputs.needs }}
Expand All @@ -67,21 +75,27 @@ jobs:
run: |
pacman -U --noconfirm *.pkg.tar.zst
- name: Copy missing headers
- name: Copy missing headers for mingw-w64-cross-crt
if: ${{ inputs.package_name == 'mingw-w64-cross-crt' }}
run: |
cp /opt/x86_64-w64-mingw32/include/pthread_signal.h /opt/aarch64-w64-mingw32/include/
cp /opt/x86_64-w64-mingw32/include/pthread_unistd.h /opt/aarch64-w64-mingw32/include/
cp /opt/x86_64-w64-mingw32/include/pthread_time.h /opt/aarch64-w64-mingw32/include/
- name: Build ${{ inputs.package_name }}
working-directory: ${{ github.workspace }}/MSYS2-packages/${{ inputs.package_name }}
working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }}
run: |
makepkg --syncdeps --rmdeps --cleanbuild --noconfirm --noprogressbar --nocheck --force
if [[ "${{ inputs.packages_repository }}" == *MINGW* ]]; then
command="makepkg-mingw"
else
command="makepkg"
fi
MINGW_ARCH=mingw64 \
$command --syncdeps --rmdeps --cleanbuild --skippgpcheck --noconfirm --noprogressbar --nocheck --force
- name: Upload ${{ inputs.package_name }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.package_name }}
retention-days: 1
path: ${{ github.workspace }}/MSYS2-packages/${{ inputs.package_name }}/*.pkg.tar.zst
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst
6 changes: 5 additions & 1 deletion .github/workflows/check-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup packages repository
run: |
`cygpath "${{ github.workspace }}"`/.github/scripts/setup-repository.sh
- name: Install toolchain
run: |
`cygpath "${{ github.workspace }}"`/.github/scripts/install-toolchain.sh
pacman -S mingw-w64-cross-gcc --noconfirm
- name: Build hello-world.exe
run: |
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
msys2_packages_branch:
Expand All @@ -18,31 +17,35 @@ jobs:
uses: ./.github/workflows/build-package.yml
with:
package_name: mingw-w64-cross-headers
msys2_packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}

mingw-w64-cross-binutils:
needs: mingw-w64-cross-headers
uses: ./.github/workflows/build-package.yml
with:
package_name: mingw-w64-cross-binutils
needs: ${{ toJson(needs) }}
msys2_packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}

mingw-w64-cross-gcc-stage1:
needs: [mingw-w64-cross-headers, mingw-w64-cross-binutils]
uses: ./.github/workflows/build-package.yml
with:
package_name: mingw-w64-cross-gcc-stage1
needs: ${{ toJson(needs) }}
msys2_packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}

mingw-w64-cross-windows-default-manifest:
needs: [mingw-w64-cross-binutils, mingw-w64-cross-gcc-stage1]
uses: ./.github/workflows/build-package.yml
with:
package_name: mingw-w64-cross-windows-default-manifest
needs: ${{ toJson(needs) }}
msys2_packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}

mingw-w64-cross-crt:
needs:
Expand All @@ -56,7 +59,8 @@ jobs:
package_name: mingw-w64-cross-crt
needs: ${{ toJson(needs) }}
dependencies: mingw-w64-cross-winpthreads
msys2_packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}

mingw-w64-cross-winpthreads:
needs:
Expand All @@ -70,7 +74,8 @@ jobs:
with:
package_name: mingw-w64-cross-winpthreads
needs: ${{ toJson(needs) }}
msys2_packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}

mingw-w64-cross-gcc:
needs:
Expand All @@ -86,7 +91,8 @@ jobs:
with:
package_name: mingw-w64-cross-gcc
needs: ${{ toJson(needs) }}
msys2_packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}

repository:
needs:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/openblas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build MinGW OpenBLAS using MSYS2 toolchain

on:
pull_request:
workflow_dispatch:
inputs:
mingw_packages_branch:
description: "MINGW-packages branch to build"
type: string
required: false
default: "woarm64"

jobs:
mingw-w64-openssl:
uses: ./.github/workflows/build-package.yml
with:
package_name: mingw-w64-openblas
dependencies: mingw-w64-cross-gcc
packages_repository: Windows-on-ARM-Experiments/MINGW-packages
packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }}
20 changes: 20 additions & 0 deletions .github/workflows/openssl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build MinGW OpenSSL using MSYS2 toolchain

on:
pull_request:
workflow_dispatch:
inputs:
mingw_packages_branch:
description: "MINGW-packages branch to build"
type: string
required: false
default: "woarm64"

jobs:
mingw-w64-openssl:
uses: ./.github/workflows/build-package.yml
with:
package_name: mingw-w64-openssl
dependencies: mingw-w64-cross-gcc
packages_repository: Windows-on-ARM-Experiments/MINGW-packages
packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }}

0 comments on commit 9e3213b

Please sign in to comment.