1313 description : " Install additional dependencies"
1414 type : string
1515 default : " "
16- msys2_packages_branch :
17- description : " MSYS2-packages branch to build"
16+ packages_repository :
17+ description : " MSYS2 packages repository to build from"
18+ type : string
19+ default : " Windows-on-ARM-Experiments/MSYS2-packages"
20+ packages_branch :
21+ description : " MSYS2 packages branch to build from"
1822 type : string
1923 default : " woarm64"
24+ cross_compile :
25+ description : " Use cross-compiler for the package build"
26+ type : boolean
27+ default : false
2028
2129defaults :
2230 run :
@@ -35,24 +43,34 @@ jobs:
3543 msystem : MSYS
3644 update : true
3745
46+ - name : Checkout repository
47+ uses : actions/checkout@v4
48+
49+ - name : Setup packages repository
50+ run : |
51+ `cygpath "${{ github.workspace }}"`/.github/scripts/setup-repository.sh
52+
3853 - name : Install dependencies
3954 run : |
4055 pacman -S --noconfirm \
4156 base-devel \
4257 git \
4358 mingw-w64-x86_64-github-cli \
4459 mingw-w64-x86_64-jq \
60+ ${{ inputs.cross_compile && 'mingw-w64-cross-gcc' || '' }} \
4561 ${{ inputs.dependencies }}
4662
47- - name : Checkout repository
48- uses : actions/checkout@v4
63+ - name : Setup cross-compilation environment
64+ if : ${{ inputs.cross_compile }}
65+ run : |
66+ `cygpath "${{ github.workspace }}"`/.github/scripts/setup-cross-compilation.sh
4967
50- - name : Checkout MSYS2 packages repository
68+ - name : Checkout ${{ inputs.packages_repository }} repository
5169 uses : actions/checkout@v4
5270 with :
53- repository : Windows-on-ARM-Experiments/MSYS2-packages
54- ref : ${{ inputs.msys2_packages_branch }}
55- path : ${{ github.workspace }}/MSYS2- packages
71+ repository : ${{ inputs.packages_repository }}
72+ ref : ${{ inputs.packages_branch }}
73+ path : ${{ github.workspace }}/packages
5674
5775 - name : Download artifacts
5876 if : ${{ inputs.needs }}
@@ -67,21 +85,27 @@ jobs:
6785 run : |
6886 pacman -U --noconfirm *.pkg.tar.zst
6987
70- - name : Copy missing headers
88+ - name : Copy missing headers for mingw-w64-cross-crt
7189 if : ${{ inputs.package_name == 'mingw-w64-cross-crt' }}
7290 run : |
7391 cp /opt/x86_64-w64-mingw32/include/pthread_signal.h /opt/aarch64-w64-mingw32/include/
7492 cp /opt/x86_64-w64-mingw32/include/pthread_unistd.h /opt/aarch64-w64-mingw32/include/
7593 cp /opt/x86_64-w64-mingw32/include/pthread_time.h /opt/aarch64-w64-mingw32/include/
7694
7795 - name : Build ${{ inputs.package_name }}
78- working-directory : ${{ github.workspace }}/MSYS2- packages/${{ inputs.package_name }}
96+ working-directory : ${{ github.workspace }}/packages/${{ inputs.package_name }}
7997 run : |
80- makepkg --syncdeps --rmdeps --cleanbuild --noconfirm --noprogressbar --nocheck --force
98+ if [[ "${{ inputs.packages_repository }}" == *MINGW* ]]; then
99+ command="makepkg-mingw"
100+ else
101+ command="makepkg"
102+ fi
103+ MINGW_ARCH=mingw64 \
104+ $command --syncdeps --rmdeps --cleanbuild --skippgpcheck --noconfirm --noprogressbar --nocheck --force
81105
82106 - name : Upload ${{ inputs.package_name }}
83107 uses : actions/upload-artifact@v4
84108 with :
85109 name : ${{ inputs.package_name }}
86110 retention-days : 1
87- path : ${{ github.workspace }}/MSYS2- packages/${{ inputs.package_name }}/*.pkg.tar.zst
111+ path : ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst
0 commit comments