Skip to content

Commit 662b7d4

Browse files
authored
Merge pull request #8477 from danoli3/linux-packages
Linux [scripts fix]
2 parents c152acc + bbc2f46 commit 662b7d4

File tree

5 files changed

+72
-51
lines changed

5 files changed

+72
-51
lines changed

scripts/dev/download_pg.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ cd "$SCRIPT_DIR"
161161

162162
OUTDIR=../../
163163

164+
ZIP="zip"
164165
if [[ $BLEEDING_EDGE = 1 ]] ; then
165166
VER=latest
166167
fi
@@ -169,19 +170,22 @@ if [[ $TAG != "" ]] ; then
169170
VER="$TAG"
170171
fi
171172

173+
if [ "$PLATFORM" == "linux" ]; then
174+
ZIP="tar.bz2"
175+
fi
172176
if [ "$PLATFORM" == "vs" ]; then
173177
EXT=".exe"
174178
else
175179
EXT=".app"
176180
fi
181+
177182
OUTPUT=projectGenerator
178183
if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
179184
GUI="-gui"
180185
else
181186
GUI=""
182187
fi
183-
PKG="projectGenerator-${PLATFORM}${GUI}.zip"
184-
188+
PKG="projectGenerator-${PLATFORM}${GUI}.${ZIP}"
185189
echo " openFrameworks download_pg.sh"
186190

187191
cd ../../
@@ -204,8 +208,10 @@ if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
204208
else
205209
mkdir -p "${OUTDIR}${OUTPUT}"
206210
tar xjf "$PKG" -C "${OUTDIR}${OUTPUT}"
207-
mv "${OUTDIR}/${OUTPUT}/projectGenerator-osx/projectGenerator$EXT" "${OUTDIR}/${OUTPUT}/projectGenerator$EXT"
208-
rm -rf "${OUTDIR}/${OUTPUT}/projectGenerator-osx/"
211+
if [ "$PLATFORM" == "osx" ]; then
212+
mv "${OUTDIR}/${OUTPUT}/projectGenerator-osx/projectGenerator$EXT" "${OUTDIR}/${OUTPUT}/projectGenerator$EXT"
213+
rm -rf "${OUTDIR}/${OUTPUT}/projectGenerator-osx/"
214+
fi
209215
fi
210216

211217
if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
@@ -220,6 +226,8 @@ if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
220226
# else
221227
# echo "Warning: chmod command not found, skipping permission adjustment."
222228
# fi
229+
elif [ "$PLATFORM" == "linux" ]; then
230+
chmod +x "${OUTDIR}/${OUTPUT}/projectGenerator"
223231
else
224232
if ! command -v rsync &> /dev/null; then
225233
cp -arX "${OUTDIR}/${OUTPUT}/projectGenerator$EXT/Contents/Resources/app/app/projectGenerator" "${OUTDIR}/${OUTPUT}/projectGenerator"

scripts/dev/downloader.sh

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
VERSION=4.5.0
2+
VERSION=4.6.0
33
printDownloaderHelp() {
44
cat <<EOF
55
@@ -25,27 +25,24 @@ printDownloaderHelp() {
2525
2626
EOF
2727
}
28-
28+
VERBOSE=0
2929
validate_url() {
3030
if [[ $1 =~ ^https?://.+ ]]; then
3131
return 0
3232
else
3333
return 1
3434
fi
3535
}
36-
3736
convert_bytes_to_mb() {
3837
bytes=$1
3938
mb=$((bytes / 1024 / 1024))
4039
echo "${mb}MB"
4140
}
42-
4341
CHECK_RESULT=0
4442
MAX_REDIRECTS=20
4543
RETRY_MAX=20
4644
RETRY_DELAY_S=1
4745
EXTRA_ARGS=""
48-
4946
# ansi console escape codes
5047
CON_DEFAULT="\033[0m"
5148
CON_WHITE="\033[37m"
@@ -55,7 +52,6 @@ CON_RED="\033[31m"
5552
CON_YELLOW="\033[33m"
5653
CON_YELLOW_GREEN="\033[33m"
5754
CON_GREEN="\033[32m"
58-
5955
echoError() {
6056
echo -e "$CON_BOLD$CON_RED$1$CON_DEFAULT"
6157
}
@@ -70,15 +66,21 @@ check_remote_vs_local() {
7066
LOCAL_FILE="$1"
7167
REMOTE_URL="$2"
7268
USE_WGET2="$3"
73-
echo " [downloader] check if local == remote: [$REMOTE_URL]"
69+
if [[ $VERBOSE == 1 ]]; then
70+
echo " [downloader] check if local == remote: [$REMOTE_URL]"
71+
fi
7472
if [ ! -f "$LOCAL_FILE" ]; then
75-
echo " [downloader] No download cache"
76-
echo " [downloader] Proceeding with download. "
73+
if [[ $VERBOSE == 1 ]]; then
74+
echo " [downloader] No download cache"
75+
fi
76+
echo " [downloader] Downloading ..."
7777
CHECK_RESULT=0
7878
return
7979
else
80-
echo " [downloader] Found download cache."
81-
echo " [cache] [$LOCAL_FILE]"
80+
if [[ $VERBOSE == 1 ]]; then
81+
echo " [downloader] Found download cache."
82+
echo " [cache] [$LOCAL_FILE]"
83+
fi
8284
fi
8385
REMOTE_URL=$(echo "$REMOTE_URL" | sed 's/[[:space:]]*$//')
8486
LocalSize=$(wc -c <"$LOCAL_FILE" | tr -d '[:space:]')
@@ -90,7 +92,9 @@ check_remote_vs_local() {
9092
LocalSizeMB=$(convert_bytes_to_mb $LocalSize)
9193
RemoteSizeMB=$(convert_bytes_to_mb $RemoteSize)
9294

93-
echo " [downloader] Remote size:[${RemoteSizeMB}] | Local size:[${LocalSizeMB}]"
95+
if [[ $VERBOSE == 1 ]]; then
96+
echo " [downloader] Remote size:[${RemoteSizeMB}] | Local size:[${LocalSizeMB}]"
97+
fi
9498
if [ -z "$modified" ]; then
9599
echo " [downloader] failed to retrieve last-modified header from remote ["$REMOTE_URL"] ... Proceeding with download"
96100
CHECK_RESULT=0
@@ -104,7 +108,7 @@ check_remote_vs_local() {
104108
fi
105109
if [ $? -ne 0 ]; then
106110
echo " [downloader] Error in converting Remote modification time [report this openFrameworks devs]."
107-
echo " [downloader] ... Proceeding with download"
111+
echo " [downloader] Downloading ... [$REMOTE_URL]"
108112
CHECK_RESULT=0
109113
rm -f $LOCAL_FILE
110114
return
@@ -119,28 +123,30 @@ check_remote_vs_local() {
119123
fi
120124
if [ $? -ne 0 ]; then
121125
echo " [downloader] Error in converting Local modification time [report this openFrameworks devs]."
122-
echo " [downloader] ... Proceeding with download"
126+
echo " [downloader] Downloading: [$REMOTE_URL]"
123127
CHECK_RESULT=0
124128
rm -f $LOCAL_FILE
125129
return
126130
fi
127131
if [ "$LocalSize" != "$RemoteSize" ]; then
128-
echo " [downloader] Remote size bits:[${RemoteSize}] | Local size bits:[${LocalSize}]"
129-
echo " [downloader] File sizes differ between remote and local file."
130-
echo " [downloader] ... Proceeding with download"
132+
if [[ $VERBOSE == 1 ]]; then
133+
echo " [downloader] Remote size bits:[${RemoteSize}] | Local size bits:[${LocalSize}]"
134+
fi
135+
echo " [downloader] File sizes differ between remote and local file. Downloading: [$REMOTE_URL]"
131136
CHECK_RESULT=0
132137
rm -f $LOCAL_FILE
133138
return
134139
fi
135140
if [ "$local_ctime" -lt "$remote_ctime" ]; then
136-
echo " [downloader] Remote modification Time:[${remote_ctime}] | Local modification Time:[${local_ctime}]"
137-
echo " [downloader] Remote file is newer."
138-
echo " [downloader] ... Proceeding with download"
141+
if [[ $VERBOSE == 1 ]]; then
142+
echo " [downloader] Remote modification Time:[${remote_ctime}] | Local modification Time:[${local_ctime}]"
143+
fi
144+
echo " [downloader] Remote file is newer. Downloading: [$REMOTE_URL]"
139145
CHECK_RESULT=0
140146
rm -f $LOCAL_FILE
141147
return
142148
fi
143-
echo " [downloader] No need to download again. Every bit matters."
149+
echo " [downloader] Cached. No need to download again: [$REMOTE_URL]"
144150
CHECK_RESULT=1
145151
return
146152
}
@@ -311,7 +317,9 @@ downloader() {
311317
fi
312318
# [options]
313319
if [[ "$COMPRESSION" == "1" ]]; then
314-
echo " [downloader] enabled brotli/zlib losslesss compression response"
320+
if [[ $VERBOSE == 1 ]]; then
321+
echo " [downloader] enabled brotli/zlib losslesss compression response"
322+
fi
315323
elif [[ "$COMPRESSION" == "0" ]] && [[ $CURL == 1 && $CURL_INSTALLED == 1 ]] && [[ $WGET2 == 0 || $WGET2_INSTALLED == 0 ]]; then
316324
EXTRA_ARGS+="-Z "
317325
fi
@@ -389,7 +397,9 @@ downloader() {
389397
URLS_TO_DOWNLOAD=$(echo "$URLS_TO_DOWNLOAD" | sed 's/[[:space:]]*$//')
390398
echo
391399
if [ -z "$URLS_TO_DOWNLOAD" ]; then
392-
echo " [downloader] No URLS to download, continue..."
400+
if [[ $VERBOSE == 1 ]]; then
401+
echo " [downloader] No URLS to download, continue..."
402+
fi
393403
else
394404
if [[ "${SILENT}" == 1 ]]; then
395405
if [[ $WGET2 == 1 ]] && [[ $WGET2_INSTALLED == 1 ]]; then
@@ -407,16 +417,22 @@ downloader() {
407417
fi
408418
else
409419
if [[ $WGET2 == 1 ]] && [[ $WGET2_INSTALLED == 1 ]]; then
410-
echo " [downloader] [wget2] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS"
420+
if [[ $VERBOSE == 1 ]]; then
421+
echo " [downloader] [wget2] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS"
422+
fi
411423
echo ""
412424
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}
413425
elif [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]]; then
414-
echo " [downloader] [cURL] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS ${CONNECTION_EXTRA_ARGS[@]}]"
426+
if [[ $VERBOSE == 1 ]]; then
427+
echo " [downloader] [cURL] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS ${CONNECTION_EXTRA_ARGS[@]}]"
428+
fi
415429
echo
416430
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}
417431

418432
elif [[ $WGET == 1 ]] && [[ $WGET_INSTALLED == 1 ]]; then
419-
echo " [downloader] [wget] [$FILENAME] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS]"
433+
if [[ $VERBOSE == 1 ]]; then
434+
echo " [downloader] [wget] [$FILENAME] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS]"
435+
fi
420436
echo
421437
wget -nv --progress=bar -N --tries=${RETRY_MAX} --retry-connrefused --waitretry=${RETRY_DELAY_S} ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD}
422438
else
@@ -427,11 +443,15 @@ downloader() {
427443
if [[ "$CLOSE_CONNECTION" == "1" ]]; then
428444
if [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]] || [[ $CURL == 1 && $WGET2 == 1 ]]; then
429445
if [[ ${#FORWARDED_URLS[@]} -eq 0 ]]; then
430-
echo " [downloader] No active connections to close"
446+
if [[ $VERBOSE == 1 ]]; then
447+
echo " [downloader] No active connections to close"
448+
fi
431449
else
432450
FIRST_URL="${FORWARDED_URLS[0]}"
433451
FIRST_URL=$(echo "$FIRST_URL" | sed 's/[[:space:]]*$//')
434-
echo " [downloader] Closing the ports yarr url:[$FIRST_URL]"
452+
if [[ $VERBOSE == 1 ]]; then
453+
echo " [downloader] Closing the ports yarr url:[$FIRST_URL]"
454+
fi
435455
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}
436456
fi
437457
fi

scripts/linux/debian/install_dependencies.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,10 @@ apt-get install -y \
4848
libassimp-dev librtaudio-dev libglfw3-dev \
4949
liburiparser-dev libcurl4-openssl-dev libpugixml-dev libpoco-dev \
5050
libgconf-2-4 brotli liblapack-dev libblas-dev \
51-
\
52-
# ---- X11 bits used by GLFW (often missing) ----
5351
libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev \
54-
xorgproto \
55-
\
56-
# ---- Wayland stack for GLFW ----
57-
libwayland-dev wayland-protocols libxkbcommon-dev libxkbcommon-x11-dev \
58-
libdecor-0-dev \
59-
\
60-
# ---- GL loader/plumbing (recommended) ----
61-
libglvnd-dev \
62-
\
63-
# ---- useful tools (optional) ----
64-
mesa-utils
52+
xorgproto libwayland-dev wayland-protocols libxkbcommon-dev libxkbcommon-x11-dev \
53+
libdecor-0-dev libglvnd-dev mesa-utils
54+
6555
exit_code=$?
6656
if [ $exit_code != 0 ]; then
6757
echo "error installing dependencies, there could be an error with your internet connection"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
cd $SCRIPT_DIR
4+
if [ ! -z ${BITS+x} ]; then
5+
../dev/download_pg.sh -p linux -a $BITS -n $@
6+
else
7+
../dev/download_pg.sh -p linux $@
8+
fi

scripts/linux/fedora/install_dependencies.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,12 @@ dnf install -y \
2323
gtk2-devel libXrandr-devel libXi-devel opencv-devel libX11-devel \
2424
assimp-devel rtaudio-devel gtk3-devel glfw-devel uriparser-devel \
2525
curl-devel pugixml-devel poco-devel brotli \
26-
\
27-
# ---- Added for GLFW / X11 / Wayland completeness ----
2826
wayland-devel wayland-protocols-devel \
2927
libxkbcommon-devel libxkbcommon-x11-devel \
3028
libdecor-devel xorg-x11-proto-devel \
3129
mesa-libGL-devel mesa-libGLU-devel mesa-libEGL-devel mesa-libGLES-devel \
3230
libXcursor-devel libXinerama-devel libXext-devel \
33-
fftw-devel \
34-
\
35-
# ---- Optional runtime components (for testing) ----
36-
xorg-x11-server-Xwayland mesa-dri-drivers libdecor
31+
fftw-devel xorg-x11-server-Xwayland mesa-dri-drivers libdecor
3732

3833
exit_code=$?
3934
if [ $exit_code != 0 ]; then

0 commit comments

Comments
 (0)