Skip to content

Commit

Permalink
Add Cygwin repositories to update-sources.sh (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex authored Jun 5, 2024
1 parent bf5c380 commit ad8113a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ "$RUN_BOOTSTRAP" = 1 ]; then
fi

if [ "$UPDATE_SOURCES" = 1 ]; then
.github/scripts/update_sources.sh
.github/scripts/update-sources.sh
fi

if [[ "$PLATFORM" =~ cygwin ]]; then
Expand Down
13 changes: 7 additions & 6 deletions .github/scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ TESTS_PACKAGE_NAME=${TESTS_PACKAGE_NAME:-$TOOLCHAIN_NAME-tests.tar.gz}
FFMPEG_PATH=${FFMPEG_PATH:-~/ffmpeg}
FFMPEG_TESTS_PATH=${FFMPEG_TESTS_PATH:-~/ffmpeg-tests}

DEBUG=${DEBUG:-0}
CCACHE=${CCACHE:-0}
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-0}
UPDATE_SOURCES=${UPDATE_SOURCES:-0}
RUN_CONFIG=${RUN_CONFIG:-1}
RUN_INSTALL=${RUN_INSTALL:-1}
DEBUG=${DEBUG:-0} # Enable debug build.
CCACHE=${CCACHE:-0} # Enable usage of ccache.
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-0} # Bootstrap dependencies during the build.
UPDATE_SOURCES=${UPDATE_SOURCES:-0} # Update source code repositories.
RESET_SOURCES=${RESET_SOURCES:-0} # Reset source code repositories before update.
RUN_CONFIG=${RUN_CONFIG:-1} # Run configuration step.
RUN_INSTALL=${RUN_INSTALL:-1} # Run installation step.

PATH=$PATH:$TOOLCHAIN_PATH/bin

Expand Down
40 changes: 40 additions & 0 deletions .github/scripts/update-sources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

source `dirname ${BASH_SOURCE[0]}`/config.sh

function update_repository() {
DIRECTORY=$1
REPOSITORY=$2
BRANCH=$3
if ! [ -d $DIRECTORY ]; then
git clone $REPOSITORY -b $BRANCH --single-branch --depth 1 $DIRECTORY
git submodule init
git submodule update
else
pushd $DIRECTORY
if [ "$RESET_SOURCES" = 1 ]; then
git reset --hard
git clean -fdx
git switch $BRANCH
fi
git pull
git submodule update
popd
fi
}

echo "::group::Update source code repositories"
mkdir -p "$SOURCE_PATH"

cd "$SOURCE_PATH"
update_repository "$BINUTILS_VERSION" https://github.com/Windows-on-ARM-Experiments/binutils-woarm64.git woarm64
update_repository "$GCC_VERSION" https://github.com/Windows-on-ARM-Experiments/gcc-woarm64.git woarm64
update_repository "$MINGW_VERSION" https://github.com/Windows-on-ARM-Experiments/mingw-woarm64.git woarm64
if [[ "$PLATFORM" =~ cygwin ]]; then
update_repository "$CYGWIN_VERSION" https://github.com/Windows-on-ARM-Experiments/newlib-cygwin.git main
update_repository cygwin-packages https://github.com/Windows-on-ARM-Experiments/cygwin-packages.git main
update_repository "$COCOM_VERSION" https://git.code.sf.net/p/cocom/git master
fi
echo "::endgroup::"

echo 'Success!'
14 changes: 0 additions & 14 deletions .github/scripts/update_sources.sh

This file was deleted.

0 comments on commit ad8113a

Please sign in to comment.