Skip to content

Commit 6025069

Browse files
committed
Add script for local build (#5)
1 parent 54a2266 commit 6025069

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.code-workspace

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ pacman -S mingw-w64-cross-gcc
4242

4343
to install x64 host MinGW compiler with `aarch64-w64-mingw32` target support.
4444

45+
## Building Packages Locally
46+
47+
In case one would like to build all the packages locally, there is a `build.sh` script. It expects
48+
that all the dependency repositories are cloned in the parent folder of this repository's folder.
49+
4550
## Dependencies Chart
4651

4752
The color of the blocks indicates whether the package recipes exist and/or succeed to build

build.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
3+
set -e # exit on error
4+
set -x # echo on
5+
6+
CLEAN_BUILD=${CLEAN_BUILD:-0}
7+
8+
MAKEPKG_OPTIONS="--syncdeps --rmdeps --noconfirm --noprogressbar --nocheck --force --install"
9+
if [ "$CLEAN_BUILD" = 1 ] ; then
10+
MAKEPKG_OPTIONS="$MAKEPKG_OPTIONS --cleanbuild"
11+
fi
12+
13+
pacman -R mingw-w64-cross-gcc --noconfirm || true
14+
pacman -R mingw-w64-cross-winpthreads --noconfirm || true
15+
pacman -R mingw-w64-cross-crt --noconfirm || true
16+
pacman -R mingw-w64-cross-windows-default-manifest --noconfirm || true
17+
pacman -R mingw-w64-cross-gcc-stage1 --noconfirm || true
18+
pacman -R mingw-w64-cross-binutils --noconfirm || true
19+
pacman -R mingw-w64-cross-headers --noconfirm || true
20+
21+
pacman -S --noconfirm base-devel
22+
23+
echo "::group::Build mingw-w64-cross-headers"
24+
pushd ../MSYS2-packages/mingw-w64-cross-headers
25+
makepkg $MAKEPKG_OPTIONS
26+
popd
27+
echo "::endgroup::"
28+
29+
echo "::group::Build mingw-w64-cross-binutils"
30+
pushd ../MSYS2-packages/mingw-w64-cross-binutils
31+
makepkg $MAKEPKG_OPTIONS
32+
popd
33+
echo "::endgroup::"
34+
35+
echo "::group::Build mingw-w64-cross-gcc-stage1"
36+
pushd ../MSYS2-packages/mingw-w64-cross-gcc-stage1
37+
makepkg $MAKEPKG_OPTIONS
38+
popd
39+
echo "::endgroup::"
40+
41+
echo "::group::Build mingw-w64-cross-windows-default-manifest"
42+
pushd ../MSYS2-packages/mingw-w64-cross-windows-default-manifest
43+
makepkg $MAKEPKG_OPTIONS
44+
popd
45+
echo "::endgroup::"
46+
47+
echo "::group::Build mingw-w64-cross-crt"
48+
pushd ../MSYS2-packages/mingw-w64-cross-crt
49+
pacman -S --noconfirm mingw-w64-cross-winpthreads
50+
cp /opt/x86_64-w64-mingw32/include/pthread_signal.h /opt/aarch64-w64-mingw32/include/
51+
cp /opt/x86_64-w64-mingw32/include/pthread_unistd.h /opt/aarch64-w64-mingw32/include/
52+
cp /opt/x86_64-w64-mingw32/include/pthread_time.h /opt/aarch64-w64-mingw32/include/
53+
54+
makepkg $MAKEPKG_OPTIONS
55+
56+
rm -rf /opt/aarch64-w64-mingw32/include/pthread_signal.h
57+
rm -rf /opt/aarch64-w64-mingw32/include/pthread_unistd.h
58+
rm -rf /opt/aarch64-w64-mingw32/include/pthread_time.h
59+
popd
60+
echo "::endgroup::"
61+
62+
echo "::group::Build mingw-w64-cross-winpthreads"
63+
pushd ../MSYS2-packages/mingw-w64-cross-winpthreads
64+
makepkg $MAKEPKG_OPTIONS
65+
popd
66+
echo "::endgroup::"
67+
68+
echo "::group::Build mingw-w64-cross-gcc"
69+
pushd ../MSYS2-packages/mingw-w64-cross-gcc
70+
makepkg ${MAKEPKG_OPTIONS//--install/}
71+
pacman -R mingw-w64-cross-gcc-stage1 --noconfirm || true
72+
pacman -U *.pkg.tar.zst --noconfirm
73+
popd
74+
echo "::endgroup::"

0 commit comments

Comments
 (0)