From 1eefe1742bbbcda4a4c3e2a3338dfae63e555eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Wed, 22 May 2024 16:43:12 +0200 Subject: [PATCH] Add script for local build (#5) Add script for local build --- .gitignore | 1 + README.md | 5 ++++ build.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 .gitignore create mode 100644 build.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d67604 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.code-workspace diff --git a/README.md b/README.md index 28906f0..6de1b55 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..e6cc81a --- /dev/null +++ b/build.sh @@ -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::"