Skip to content

Commit

Permalink
Adds optional "--tag" argument to download_libs
Browse files Browse the repository at this point in the history
Allows downloading of semver versions of libs such as `0.10.1`
openframeworks#6623
  • Loading branch information
drfuzzyness committed Oct 26, 2020
1 parent f9cb24b commit 551eeff
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 35 deletions.
82 changes: 48 additions & 34 deletions scripts/dev/download_libs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -e
VER=master
VERSION=""
BRANCH=master
PLATFORM=""
ARCH=""
OVERWRITE=1
Expand All @@ -12,7 +13,10 @@ cat << EOF
Options:
-v, --version VERSION OF version to download the libraries for. Defaults to master
-t, --tag VERSION OF version (semver tag) to download the libraries for. Defaults to nightly dev
Examples: "0.10.0", "0.10.0RC4", "0.11.0"
See all options at: http://ci.openframeworks.cc/libs/
-v, --version BRANCH OF branch to download the libraries for. Defaults to master
-p, --platform PLATFORM Platorm among: android, emscritpen, ios, linux, linux64, linuxarmv6l, linuxarmv7l, msys2, osx, tvos, vs2015, vs2017
If not specified tries to autodetect the platform.
-a, --arch ARCH Architecture:
Expand All @@ -29,8 +33,14 @@ EOF
}

download(){
echo "Downloading $1"
wget ci.openframeworks.cc/libs/$1 $SILENT_ARGS
if [-z "$VERSION"]
then
echo "Downloading latest $1"
wget ci.openframeworks.cc/libs/$1 $SILENT_ARGS
else
echo "Downloading $VERSION $1"
wget ci.openframeworks.cc/libs/$VERSION/$1 $SILENT_ARGS
fi
}

# trap any script errors and exit
Expand Down Expand Up @@ -60,7 +70,11 @@ while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-v|--version)
VER="$2"
BRANCH="$2"
shift # past argument
;;
-t|--tag)
VERSION="$2"
shift # past argument
;;
-p|--platform)
Expand Down Expand Up @@ -153,41 +167,41 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"

if [ "$ARCH" == "" ] && [ "$PLATFORM" == "vs2015" ]; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}_32_1.zip \
openFrameworksLibs_${VER}_${PLATFORM}_32_2.zip \
openFrameworksLibs_${VER}_${PLATFORM}_32_3.zip \
openFrameworksLibs_${VER}_${PLATFORM}_32_4.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_1.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_2.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_3.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_4.zip"
PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_32_1.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_32_2.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_32_3.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_32_4.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_1.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_2.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_3.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_4.zip"
elif [ "$ARCH" == "" ] && [ "$PLATFORM" == "vs2017" ]; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}_32_1.zip \
openFrameworksLibs_${VER}_${PLATFORM}_32_2.zip \
openFrameworksLibs_${VER}_${PLATFORM}_32_3.zip \
openFrameworksLibs_${VER}_${PLATFORM}_32_4.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_1.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_2.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_3.zip \
openFrameworksLibs_${VER}_${PLATFORM}_64_4.zip"
PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_32_1.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_32_2.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_32_3.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_32_4.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_1.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_2.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_3.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_64_4.zip"
elif [ "$PLATFORM" == "msys2" ]; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}_mingw${ARCH}.zip"
PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_mingw${ARCH}.zip"
elif [ "$PLATFORM" == "vs2015" ] || [ "$PLATFORM" == "vs2017" ]; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_1.zip \
openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_2.zip \
openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_3.zip \
openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_4.zip"
PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_1.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_2.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_3.zip \
openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_4.zip"
elif [ "$ARCH" == "" ] && [[ "$PLATFORM" == "osx" || "$PLATFORM" == "ios" || "$PLATFORM" == "tvos" ]]; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}1.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}2.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}3.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}4.tar.bz2"
PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}1.tar.bz2 \
openFrameworksLibs_${BRANCH}_${PLATFORM}2.tar.bz2 \
openFrameworksLibs_${BRANCH}_${PLATFORM}3.tar.bz2 \
openFrameworksLibs_${BRANCH}_${PLATFORM}4.tar.bz2"
elif [ "$ARCH" == "" ] && [ "$PLATFORM" == "android" ]; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}armv7.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}arm64.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}x86.tar.bz2"
PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}armv7.tar.bz2 \
openFrameworksLibs_${BRANCH}_${PLATFORM}arm64.tar.bz2 \
openFrameworksLibs_${BRANCH}_${PLATFORM}x86.tar.bz2"
else # Linux
PKGS="openFrameworksLibs_${VER}_${PLATFORM}${ARCH}.tar.bz2"
PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}${ARCH}.tar.bz2"
fi

for PKG in $PKGS; do
Expand Down
7 changes: 6 additions & 1 deletion scripts/vs/download_libs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# Which will load the visual studio 2015 libraries
param(
[String]$ver="master",
[String]$platform="vs2017"
[String]$platform="vs2017",
[String]$tag=""
)
$currentPath = $pwd
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
Expand All @@ -14,6 +15,10 @@ $libsDir = $scriptPath + "\..\..\libs"
function DownloadPackage{
$pkg = $args[0]
$url = "http://ci.openframeworks.cc/libs/$pkg"
if(-Not [string]::IsNullOrEmpty($tag)) {
$url = "http://ci.openframeworks.cc/libs/$tag/$pkg"
}

If(Test-Path "$pkg") {
echo "Deleting old package"
Remove-Item $pkg
Expand Down

0 comments on commit 551eeff

Please # to comment.