Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions scripts/dev/download_pg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ cd "$SCRIPT_DIR"

OUTDIR=../../

ZIP="zip"
if [[ $BLEEDING_EDGE = 1 ]] ; then
VER=latest
fi
Expand All @@ -169,19 +170,22 @@ if [[ $TAG != "" ]] ; then
VER="$TAG"
fi

if [ "$PLATFORM" == "linux" ]; then
ZIP="tar.bz2"
fi
if [ "$PLATFORM" == "vs" ]; then
EXT=".exe"
else
EXT=".app"
fi

OUTPUT=projectGenerator
if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
GUI="-gui"
else
GUI=""
fi
PKG="projectGenerator-${PLATFORM}${GUI}.zip"

PKG="projectGenerator-${PLATFORM}${GUI}.${ZIP}"
echo " openFrameworks download_pg.sh"

cd ../../
Expand All @@ -204,8 +208,10 @@ if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
else
mkdir -p "${OUTDIR}${OUTPUT}"
tar xjf "$PKG" -C "${OUTDIR}${OUTPUT}"
mv "${OUTDIR}/${OUTPUT}/projectGenerator-osx/projectGenerator$EXT" "${OUTDIR}/${OUTPUT}/projectGenerator$EXT"
rm -rf "${OUTDIR}/${OUTPUT}/projectGenerator-osx/"
if [ "$PLATFORM" == "osx" ]; then
mv "${OUTDIR}/${OUTPUT}/projectGenerator-osx/projectGenerator$EXT" "${OUTDIR}/${OUTPUT}/projectGenerator$EXT"
rm -rf "${OUTDIR}/${OUTPUT}/projectGenerator-osx/"
fi
fi

if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
Expand All @@ -220,6 +226,8 @@ if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
# else
# echo "Warning: chmod command not found, skipping permission adjustment."
# fi
elif [ "$PLATFORM" == "linux" ]; then
chmod +x "${OUTDIR}/${OUTPUT}/projectGenerator"
else
if ! command -v rsync &> /dev/null; then
cp -arX "${OUTDIR}/${OUTPUT}/projectGenerator$EXT/Contents/Resources/app/app/projectGenerator" "${OUTDIR}/${OUTPUT}/projectGenerator"
Expand Down
76 changes: 48 additions & 28 deletions scripts/dev/downloader.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
VERSION=4.5.0
VERSION=4.6.0
printDownloaderHelp() {
cat <<EOF

Expand All @@ -25,27 +25,24 @@ printDownloaderHelp() {

EOF
}

VERBOSE=0
validate_url() {
if [[ $1 =~ ^https?://.+ ]]; then
return 0
else
return 1
fi
}

convert_bytes_to_mb() {
bytes=$1
mb=$((bytes / 1024 / 1024))
echo "${mb}MB"
}

CHECK_RESULT=0
MAX_REDIRECTS=20
RETRY_MAX=20
RETRY_DELAY_S=1
EXTRA_ARGS=""

# ansi console escape codes
CON_DEFAULT="\033[0m"
CON_WHITE="\033[37m"
Expand All @@ -55,7 +52,6 @@ CON_RED="\033[31m"
CON_YELLOW="\033[33m"
CON_YELLOW_GREEN="\033[33m"
CON_GREEN="\033[32m"

echoError() {
echo -e "$CON_BOLD$CON_RED$1$CON_DEFAULT"
}
Expand All @@ -70,15 +66,21 @@ check_remote_vs_local() {
LOCAL_FILE="$1"
REMOTE_URL="$2"
USE_WGET2="$3"
echo " [downloader] check if local == remote: [$REMOTE_URL]"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] check if local == remote: [$REMOTE_URL]"
fi
if [ ! -f "$LOCAL_FILE" ]; then
echo " [downloader] No download cache"
echo " [downloader] Proceeding with download. "
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] No download cache"
fi
echo " [downloader] Downloading ..."
CHECK_RESULT=0
return
else
echo " [downloader] Found download cache."
echo " [cache] [$LOCAL_FILE]"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] Found download cache."
echo " [cache] [$LOCAL_FILE]"
fi
fi
REMOTE_URL=$(echo "$REMOTE_URL" | sed 's/[[:space:]]*$//')
LocalSize=$(wc -c <"$LOCAL_FILE" | tr -d '[:space:]')
Expand All @@ -90,7 +92,9 @@ check_remote_vs_local() {
LocalSizeMB=$(convert_bytes_to_mb $LocalSize)
RemoteSizeMB=$(convert_bytes_to_mb $RemoteSize)

echo " [downloader] Remote size:[${RemoteSizeMB}] | Local size:[${LocalSizeMB}]"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] Remote size:[${RemoteSizeMB}] | Local size:[${LocalSizeMB}]"
fi
if [ -z "$modified" ]; then
echo " [downloader] failed to retrieve last-modified header from remote ["$REMOTE_URL"] ... Proceeding with download"
CHECK_RESULT=0
Expand All @@ -104,7 +108,7 @@ check_remote_vs_local() {
fi
if [ $? -ne 0 ]; then
echo " [downloader] Error in converting Remote modification time [report this openFrameworks devs]."
echo " [downloader] ... Proceeding with download"
echo " [downloader] Downloading ... [$REMOTE_URL]"
CHECK_RESULT=0
rm -f $LOCAL_FILE
return
Expand All @@ -119,28 +123,30 @@ check_remote_vs_local() {
fi
if [ $? -ne 0 ]; then
echo " [downloader] Error in converting Local modification time [report this openFrameworks devs]."
echo " [downloader] ... Proceeding with download"
echo " [downloader] Downloading: [$REMOTE_URL]"
CHECK_RESULT=0
rm -f $LOCAL_FILE
return
fi
if [ "$LocalSize" != "$RemoteSize" ]; then
echo " [downloader] Remote size bits:[${RemoteSize}] | Local size bits:[${LocalSize}]"
echo " [downloader] File sizes differ between remote and local file."
echo " [downloader] ... Proceeding with download"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] Remote size bits:[${RemoteSize}] | Local size bits:[${LocalSize}]"
fi
echo " [downloader] File sizes differ between remote and local file. Downloading: [$REMOTE_URL]"
CHECK_RESULT=0
rm -f $LOCAL_FILE
return
fi
if [ "$local_ctime" -lt "$remote_ctime" ]; then
echo " [downloader] Remote modification Time:[${remote_ctime}] | Local modification Time:[${local_ctime}]"
echo " [downloader] Remote file is newer."
echo " [downloader] ... Proceeding with download"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] Remote modification Time:[${remote_ctime}] | Local modification Time:[${local_ctime}]"
fi
echo " [downloader] Remote file is newer. Downloading: [$REMOTE_URL]"
CHECK_RESULT=0
rm -f $LOCAL_FILE
return
fi
echo " [downloader] No need to download again. Every bit matters."
echo " [downloader] Cached. No need to download again: [$REMOTE_URL]"
CHECK_RESULT=1
return
}
Expand Down Expand Up @@ -311,7 +317,9 @@ downloader() {
fi
# [options]
if [[ "$COMPRESSION" == "1" ]]; then
echo " [downloader] enabled brotli/zlib losslesss compression response"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] enabled brotli/zlib losslesss compression response"
fi
elif [[ "$COMPRESSION" == "0" ]] && [[ $CURL == 1 && $CURL_INSTALLED == 1 ]] && [[ $WGET2 == 0 || $WGET2_INSTALLED == 0 ]]; then
EXTRA_ARGS+="-Z "
fi
Expand Down Expand Up @@ -389,7 +397,9 @@ downloader() {
URLS_TO_DOWNLOAD=$(echo "$URLS_TO_DOWNLOAD" | sed 's/[[:space:]]*$//')
echo
if [ -z "$URLS_TO_DOWNLOAD" ]; then
echo " [downloader] No URLS to download, continue..."
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] No URLS to download, continue..."
fi
else
if [[ "${SILENT}" == 1 ]]; then
if [[ $WGET2 == 1 ]] && [[ $WGET2_INSTALLED == 1 ]]; then
Expand All @@ -407,16 +417,22 @@ downloader() {
fi
else
if [[ $WGET2 == 1 ]] && [[ $WGET2_INSTALLED == 1 ]]; then
echo " [downloader] [wget2] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] [wget2] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS"
fi
echo ""
wget2 -N -c --no-tcp-fastopen --progress=bar --force-progress --tries=${RETRY_MAX} --max-redirect=${MAX_REDIRECTS} --retry-connrefused --waitretry=${RETRY_DELAY_S} --timeout=1500 ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD}
elif [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]]; then
echo " [downloader] [cURL] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS ${CONNECTION_EXTRA_ARGS[@]}]"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] [cURL] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS ${CONNECTION_EXTRA_ARGS[@]}]"
fi
echo
curl -Z -L --retry ${RETRY_MAX} --retry-delay ${RETRY_DELAY_S} --max-redirs ${MAX_REDIRECTS} --progress-bar --header "Connection: close" ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD}

elif [[ $WGET == 1 ]] && [[ $WGET_INSTALLED == 1 ]]; then
echo " [downloader] [wget] [$FILENAME] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS]"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] [wget] [$FILENAME] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS]"
fi
echo
wget -nv --progress=bar -N --tries=${RETRY_MAX} --retry-connrefused --waitretry=${RETRY_DELAY_S} ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD}
else
Expand All @@ -427,11 +443,15 @@ downloader() {
if [[ "$CLOSE_CONNECTION" == "1" ]]; then
if [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]] || [[ $CURL == 1 && $WGET2 == 1 ]]; then
if [[ ${#FORWARDED_URLS[@]} -eq 0 ]]; then
echo " [downloader] No active connections to close"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] No active connections to close"
fi
else
FIRST_URL="${FORWARDED_URLS[0]}"
FIRST_URL=$(echo "$FIRST_URL" | sed 's/[[:space:]]*$//')
echo " [downloader] Closing the ports yarr url:[$FIRST_URL]"
if [[ $VERBOSE == 1 ]]; then
echo " [downloader] Closing the ports yarr url:[$FIRST_URL]"
fi
curl -I -L --retry-connrefused --insecure --silent --head --max-time 1 --retry ${RETRY_MAX} ${CLOSE_EXTRA_ARGS} --no-keepalive --header "Connection: close" --retry-delay ${RETRY_DELAY_S} --max-redirs ${MAX_REDIRECTS} ${FIRST_URL}
fi
fi
Expand Down
16 changes: 3 additions & 13 deletions scripts/linux/debian/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,10 @@ apt-get install -y \
libassimp-dev librtaudio-dev libglfw3-dev \
liburiparser-dev libcurl4-openssl-dev libpugixml-dev libpoco-dev \
libgconf-2-4 brotli liblapack-dev libblas-dev \
\
# ---- X11 bits used by GLFW (often missing) ----
libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev \
xorgproto \
\
# ---- Wayland stack for GLFW ----
libwayland-dev wayland-protocols libxkbcommon-dev libxkbcommon-x11-dev \
libdecor-0-dev \
\
# ---- GL loader/plumbing (recommended) ----
libglvnd-dev \
\
# ---- useful tools (optional) ----
mesa-utils
xorgproto libwayland-dev wayland-protocols libxkbcommon-dev libxkbcommon-x11-dev \
libdecor-0-dev libglvnd-dev mesa-utils

exit_code=$?
if [ $exit_code != 0 ]; then
echo "error installing dependencies, there could be an error with your internet connection"
Expand Down
8 changes: 8 additions & 0 deletions scripts/linux/download_projectGenerator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $SCRIPT_DIR
if [ ! -z ${BITS+x} ]; then
../dev/download_pg.sh -p linux -a $BITS -n $@
else
../dev/download_pg.sh -p linux $@
fi
7 changes: 1 addition & 6 deletions scripts/linux/fedora/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@ dnf install -y \
gtk2-devel libXrandr-devel libXi-devel opencv-devel libX11-devel \
assimp-devel rtaudio-devel gtk3-devel glfw-devel uriparser-devel \
curl-devel pugixml-devel poco-devel brotli \
\
# ---- Added for GLFW / X11 / Wayland completeness ----
wayland-devel wayland-protocols-devel \
libxkbcommon-devel libxkbcommon-x11-devel \
libdecor-devel xorg-x11-proto-devel \
mesa-libGL-devel mesa-libGLU-devel mesa-libEGL-devel mesa-libGLES-devel \
libXcursor-devel libXinerama-devel libXext-devel \
fftw-devel \
\
# ---- Optional runtime components (for testing) ----
xorg-x11-server-Xwayland mesa-dri-drivers libdecor
fftw-devel xorg-x11-server-Xwayland mesa-dri-drivers libdecor

exit_code=$?
if [ $exit_code != 0 ]; then
Expand Down
Loading