Skip to content

Commit

Permalink
Add script for local build (#5)
Browse files Browse the repository at this point in the history
Add script for local build
  • Loading branch information
Blackhex authored May 22, 2024
1 parent 54a2266 commit 1eefe17
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.code-workspace
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ pacman -S mingw-w64-cross-gcc

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

## Building Packages Locally

In case one would like to build all the packages locally, there is a `build.sh` script. It expects
that all the dependency repositories are cloned in the parent folder of this repository's folder.

## Dependencies Chart

The color of the blocks indicates whether the package recipes exist and/or succeed to build
Expand Down
70 changes: 70 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

set -e # exit on error
set -x # echo on

CLEAN_BUILD=${CLEAN_BUILD:-0}

MAKEPKG_OPTIONS="--syncdeps --rmdeps --noconfirm --noprogressbar --nocheck --force --install"
if [ "$CLEAN_BUILD" = 1 ] ; then
MAKEPKG_OPTIONS="$MAKEPKG_OPTIONS --cleanbuild"
fi

pacman -R mingw-w64-cross-gcc --noconfirm || true
pacman -R mingw-w64-cross-winpthreads --noconfirm || true
pacman -R mingw-w64-cross-crt --noconfirm || true
pacman -R mingw-w64-cross-windows-default-manifest --noconfirm || true
pacman -R mingw-w64-cross-gcc-stage1 --noconfirm || true
pacman -R mingw-w64-cross-binutils --noconfirm || true
pacman -R mingw-w64-cross-headers --noconfirm || true

pacman -S --noconfirm base-devel

echo "::group::Build mingw-w64-cross-headers"
pushd ../MSYS2-packages/mingw-w64-cross-headers
makepkg $MAKEPKG_OPTIONS
popd
echo "::endgroup::"

echo "::group::Build mingw-w64-cross-binutils"
pushd ../MSYS2-packages/mingw-w64-cross-binutils
makepkg $MAKEPKG_OPTIONS
popd
echo "::endgroup::"

echo "::group::Build mingw-w64-cross-gcc-stage1"
pushd ../MSYS2-packages/mingw-w64-cross-gcc-stage1
makepkg $MAKEPKG_OPTIONS
popd
echo "::endgroup::"

echo "::group::Build mingw-w64-cross-windows-default-manifest"
pushd ../MSYS2-packages/mingw-w64-cross-windows-default-manifest
makepkg $MAKEPKG_OPTIONS
popd
echo "::endgroup::"

echo "::group::Build mingw-w64-cross-crt"
pushd ../MSYS2-packages/mingw-w64-cross-crt
pacman -S --noconfirm mingw-w64-cross-winpthreads
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/

makepkg $MAKEPKG_OPTIONS
popd
echo "::endgroup::"

echo "::group::Build mingw-w64-cross-winpthreads"
pushd ../MSYS2-packages/mingw-w64-cross-winpthreads
makepkg $MAKEPKG_OPTIONS
popd
echo "::endgroup::"

echo "::group::Build mingw-w64-cross-gcc"
pushd ../MSYS2-packages/mingw-w64-cross-gcc
makepkg ${MAKEPKG_OPTIONS//--install/}
pacman -R mingw-w64-cross-gcc-stage1 --noconfirm || true
pacman -U *.pkg.tar.zst --noconfirm
popd
echo "::endgroup::"

0 comments on commit 1eefe17

Please sign in to comment.