Skip to content

Commit

Permalink
build: remove special chars from zlib version keeping just major.mino…
Browse files Browse the repository at this point in the history
…r.patch
  • Loading branch information
JCMais committed Nov 12, 2023
1 parent 20200b7 commit 309c108
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ orbs:
default: '3.0.7'
zlib-version:
type: string
default: '1.2.11'
default: '1.2.13'
before-build:
description: 'Steps that will be executed before the build'
type: steps
Expand Down
8 changes: 7 additions & 1 deletion scripts/ci/build-zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ if [[ -f $build_folder/lib/libz.a ]] && [[ -z $FORCE_REBUILD || $FORCE_REBUILD !
fi

if [ ! -d $2/source/$1 ]; then
$curr_dirname/download-and-unpack.sh https://github.com/madler/zlib/archive/v$1.tar.gz $2
# zlib version may be in the format 1.2.13.1-motley
# so we need to strip everything but major.minor.patch (removing the .1-motley part), and if we don't find it after that, we then need to try just major.minor
git_version_full = $(echo $1 | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)\..*/\1/')
git_version_major_minor = $(echo $1 | sed -E 's/([0-9]+\.[0-9]+).*/\1/')

$curr_dirname/download-and-unpack.sh https://github.com/madler/zlib/archive/v${git_version_full}.tar.gz $2 || \
$curr_dirname/download-and-unpack.sh https://github.com/madler/zlib/archive/v${git_version_major_minor}.tar.gz $2 ||

mv $2/zlib-$1 $2/source/$1
cd $2/source/$1
Expand Down

0 comments on commit 309c108

Please sign in to comment.