Skip to content

Commit 43a9027

Browse files
committed
Dawn / MetalANGLE as optional modules from apothecary latest-modular
Dawn and MetalANGLE are no longer in the core libs packages; apothecary publishes them per library and target on its latest-modular release (oF_<lib>_<target>_<arch>[_gcc<N>].tar.bz2, .zip for Visual Studio). - scripts/dev/download_modules.sh: downloads modules for a platform, verifies SHA-256 against the release digests and unpacks them into libs/; Apple installs every Apple target that is published, and modules not built for a platform yet are skipped (--require to fail instead) - download_libs.sh --modules dawn,metalangle (or OF_LIB_MODULES) runs it after the core libs, so the platform scripts take it too - paths: modular packages install per target (lib/macos, lib/ios, lib/tvos) and MetalANGLE as MetalANGLE.xcframework; the core xcconfigs, makefiles and the macOS template's core build script now point there - CI: build-macos-renderers downloads the modules and builds backendBenchExample with OF_USE_DAWN=1 and OF_USE_ANGLE=1
1 parent 2301191 commit 43a9027

10 files changed

Lines changed: 220 additions & 13 deletions

File tree

‎.github/workflows/of.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,33 @@ jobs:
438438
DEVELOPER_DIR: "/Applications/Xcode.app/Contents/Developer"
439439
SDKROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
440440

441+
# Dawn / MetalANGLE are optional modules (apothecary latest-modular), not in the
442+
# core libs package: download them and build with each renderer
443+
build-macos-renderers:
444+
runs-on: macos-15
445+
strategy:
446+
fail-fast: false
447+
matrix:
448+
renderer: [DAWN, ANGLE]
449+
steps:
450+
- uses: actions/checkout@v6
451+
- name: ccache
452+
uses: hendrikmuhs/ccache-action@v1.2.23
453+
with:
454+
key: osx-renderer-${{ matrix.renderer }}
455+
- name: Download libs and modules
456+
run: ./scripts/osx/download_libs.sh -t $RELEASE --modules dawn,metalangle
457+
- name: Build backendBenchExample with OF_USE_${{ matrix.renderer }}=1
458+
run: |
459+
set -e
460+
cd examples/gl/backendBenchExample
461+
cp ../../../scripts/templates/osx/Makefile ../../../scripts/templates/osx/config.make .
462+
make -j3 Release OF_USE_${{ matrix.renderer }}=1
463+
ls -d bin/backendBenchExample.app
464+
env:
465+
DEVELOPER_DIR: "/Applications/Xcode.app/Contents/Developer"
466+
SDKROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
467+
441468
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
442469
build-android:
443470
runs-on: ubuntu-24.04

‎libs/openFrameworksCompiled/project/ios/CoreOF.xcconfig‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_OFXIOS) $(HEADER_UTF8) $(HEADER_FREETYPE
4848

4949
OF_CORE_FRAMEWORKS = -framework AudioToolbox -framework Accelerate -framework AVFoundation -framework CoreAudio -framework CoreGraphics -framework CoreLocation -framework CoreMotion -framework CoreMedia -framework CoreVideo -framework Foundation -framework GameController -framework GLKit -framework MapKit -framework OpenAL -framework OpenGLES -framework UIKit -framework Security -framework CFNetwork -framework QuartzCore -framework CoreHaptics -framework Metal -framework MetalKit
5050

51-
OF_DAWN_LIBS[sdk=iphoneos*] = "$(OF_PATH)/libs/dawn/lib/macos/dawn.xcframework/ios-arm64/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
52-
OF_DAWN_LIBS[sdk=iphonesimulator*] = "$(OF_PATH)/libs/dawn/lib/macos/dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
51+
OF_DAWN_LIBS[sdk=iphoneos*] = "$(OF_PATH)/libs/dawn/lib/ios/dawn.xcframework/ios-arm64/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
52+
OF_DAWN_LIBS[sdk=iphonesimulator*] = "$(OF_PATH)/libs/dawn/lib/ios/dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
5353

5454
// App link line for OF_USE_ANGLE=1. OpenGLES and GLKit stay off so gl* resolves to MetalANGLE.
5555
OF_ANGLE_APP_FRAMEWORKS = -framework AudioToolbox -framework Accelerate -framework AVFoundation -framework CoreAudio -framework CoreGraphics -framework CoreLocation -framework CoreMotion -framework CoreMedia -framework CoreVideo -framework Foundation -framework GameController -framework MapKit -framework OpenAL -framework UIKit -framework Security -framework CFNetwork -framework QuartzCore -framework CoreHaptics -framework Metal -framework MetalKit -framework IOSurface
56-
OF_ANGLE_LIBS[sdk=iphoneos*] = "$(OF_PATH)/libs/metalangle/lib/macos/metalangle.xcframework/ios-arm64/MetalANGLE.a"
57-
OF_ANGLE_LIBS[sdk=iphonesimulator*] = "$(OF_PATH)/libs/metalangle/lib/macos/metalangle.xcframework/ios-arm64_x86_64-simulator/MetalANGLE.a"
56+
OF_ANGLE_LIBS[sdk=iphoneos*] = "$(OF_PATH)/libs/metalangle/lib/ios/MetalANGLE.xcframework/ios-arm64/MetalANGLE.a"
57+
OF_ANGLE_LIBS[sdk=iphonesimulator*] = "$(OF_PATH)/libs/metalangle/lib/ios/MetalANGLE.xcframework/ios-arm64_x86_64-simulator/MetalANGLE.a"
5858

5959

6060
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) GLES_SILENCE_DEPRECATION=1 GLM_FORCE_CTOR_INIT GLM_ENABLE_EXPERIMENTAL

‎libs/openFrameworksCompiled/project/macos/CoreOF.xcconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_FREEIMAGE) $(HEADER_UTF8) $(HEADER_JSON
7373
OF_DAWN_LIBS = "$(OF_PATH)/libs/dawn/lib/macos/dawn.xcframework/macos-arm64_x86_64/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
7474

7575
// Link these from Project.xcconfig when OF_USE_ANGLE=1. Drop OpenGL.framework so its gl* symbols do not collide with MetalANGLE.
76-
OF_ANGLE_LIBS = "$(OF_PATH)/libs/metalangle/lib/macos/metalangle.xcframework/macos-arm64_x86_64/MetalANGLE.a"
76+
OF_ANGLE_LIBS = "$(OF_PATH)/libs/metalangle/lib/macos/MetalANGLE.xcframework/macos-arm64_x86_64/MetalANGLE.a"
7777
OF_ANGLE_APP_FRAMEWORKS = -framework Accelerate -framework AppKit -framework ApplicationServices -framework AudioToolbox -framework AVFoundation -framework Cocoa -framework CoreAudio -framework CoreFoundation -framework CoreMedia -framework CoreServices -framework CoreVideo -framework Foundation -framework IOKit -framework QuartzCore -framework Security -framework CFNetwork -framework SystemConfiguration -framework Metal -framework MetalKit -framework IOSurface
7878

7979
OF_CORE_FRAMEWORKS = -framework Accelerate -framework AppKit -framework ApplicationServices -framework AudioToolbox -framework AVFoundation -framework Cocoa -framework CoreAudio -framework CoreFoundation -framework CoreMedia -framework CoreServices -framework CoreVideo -framework Foundation -framework IOKit -framework OpenGL -framework QuartzCore -framework Security -framework CFNetwork -framework SystemConfiguration -framework Metal

‎libs/openFrameworksCompiled/project/macos/config.macos.default.mk‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ ifeq ($(OF_USE_ANGLE),1)
240240
PLATFORM_CFLAGS += -I$(OF_ROOT)/libs/metalangle/include
241241
PLATFORM_CFLAGS += -I$(OF_ROOT)/libs/metal/include
242242
PLATFORM_LDFLAGS += -ObjC
243-
PLATFORM_LDFLAGS += $(OF_ROOT)/libs/metalangle/lib/macos/metalangle.xcframework/macos-arm64_x86_64/MetalANGLE.a
243+
PLATFORM_LDFLAGS += $(OF_ROOT)/libs/metalangle/lib/macos/MetalANGLE.xcframework/macos-arm64_x86_64/MetalANGLE.a
244244
endif
245245

246246
##########################################################################################

‎libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_FREETYPE) $(HEADER_FREETYPE2) $(HEADER_G
5353
OF_DAWN_LIBS = "$(OF_PATH)/libs/dawn/lib/macos/dawn.xcframework/macos-arm64_x86_64/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
5454

5555
// OF_USE_ANGLE=1. OpenGL.framework is omitted so its gl* symbols do not collide with MetalANGLE.
56-
OF_ANGLE_LIBS = "$(OF_PATH)/libs/metalangle/lib/macos/metalangle.xcframework/macos-arm64_x86_64/MetalANGLE.a"
56+
OF_ANGLE_LIBS = "$(OF_PATH)/libs/metalangle/lib/macos/MetalANGLE.xcframework/macos-arm64_x86_64/MetalANGLE.a"
5757
OF_ANGLE_APP_FRAMEWORKS = -framework Accelerate -framework AppKit -framework ApplicationServices -framework AudioToolbox -framework AVFoundation -framework Cocoa -framework CoreAudio -framework CoreFoundation -framework CoreMedia -framework CoreServices -framework CoreVideo -framework Foundation -framework IOKit -framework QuartzCore -framework Security -framework CFNetwork -framework SystemConfiguration -framework Metal -framework MetalKit -framework IOSurface
5858

5959
OF_CORE_FRAMEWORKS = -framework Accelerate -framework AppKit -framework ApplicationServices -framework AudioToolbox -framework AVFoundation -framework Cocoa -framework CoreAudio -framework CoreFoundation -framework CoreMedia -framework CoreServices -framework CoreVideo -framework Foundation -framework IOKit -framework OpenGL -framework QuartzCore -framework Security -framework CFNetwork -framework SystemConfiguration -framework Metal

‎libs/openFrameworksCompiled/project/osx/config.osx.default.mk‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ ifeq ($(OF_USE_ANGLE),1)
242242
PLATFORM_CFLAGS += -I$(OF_ROOT)/libs/metalangle/include
243243
PLATFORM_CFLAGS += -I$(OF_ROOT)/libs/metal/include
244244
PLATFORM_LDFLAGS += -ObjC
245-
PLATFORM_LDFLAGS += $(OF_ROOT)/libs/metalangle/lib/macos/metalangle.xcframework/macos-arm64_x86_64/MetalANGLE.a
245+
PLATFORM_LDFLAGS += $(OF_ROOT)/libs/metalangle/lib/macos/MetalANGLE.xcframework/macos-arm64_x86_64/MetalANGLE.a
246246
endif
247247

248248
##########################################################################################

‎libs/openFrameworksCompiled/project/tvOS/CoreOF.xcconfig‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_OFXIOS) $(HEADER_UTF8) $(HEADER_FREETYPE
4444
OF_CORE_FRAMEWORKS = -framework AudioToolbox -framework Accelerate -framework AVFoundation -framework CoreAudio -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework Foundation -framework GameController -framework GLKit -framework MapKit -framework OpenAL -framework OpenGLES -framework UIKit -framework Security -framework CFNetwork -framework QuartzCore -framework Metal -framework MetalKit
4545

4646
// Opt-in. Pass OF_USE_DAWN=1 or OF_USE_ANGLE=1 to both the static lib and the app.
47-
OF_DAWN_LIBS[sdk=appletvos*] = "$(OF_PATH)/libs/dawn/lib/macos/dawn.xcframework/tvos-arm64/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
48-
OF_DAWN_LIBS[sdk=appletvsimulator*] = "$(OF_PATH)/libs/dawn/lib/macos/dawn.xcframework/tvos-arm64_x86_64-simulator/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
49-
OF_ANGLE_LIBS[sdk=appletvos*] = "$(OF_PATH)/libs/metalangle/lib/macos/metalangle.xcframework/tvos-arm64/MetalANGLE.a"
50-
OF_ANGLE_LIBS[sdk=appletvsimulator*] = "$(OF_PATH)/libs/metalangle/lib/macos/metalangle.xcframework/tvos-arm64_x86_64-simulator/MetalANGLE.a"
47+
OF_DAWN_LIBS[sdk=appletvos*] = "$(OF_PATH)/libs/dawn/lib/tvos/dawn.xcframework/tvos-arm64/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
48+
OF_DAWN_LIBS[sdk=appletvsimulator*] = "$(OF_PATH)/libs/dawn/lib/tvos/dawn.xcframework/tvos-arm64_x86_64-simulator/libwebgpu_dawn.a" -framework Metal -framework MetalKit -framework IOSurface
49+
OF_ANGLE_LIBS[sdk=appletvos*] = "$(OF_PATH)/libs/metalangle/lib/tvos/MetalANGLE.xcframework/tvos-arm64/MetalANGLE.a"
50+
OF_ANGLE_LIBS[sdk=appletvsimulator*] = "$(OF_PATH)/libs/metalangle/lib/tvos/MetalANGLE.xcframework/tvos-arm64_x86_64-simulator/MetalANGLE.a"
5151
// OpenGLES and GLKit collide with MetalANGLE's gl* symbols.
5252
OF_ANGLE_APP_FRAMEWORKS = -framework AudioToolbox -framework Accelerate -framework AVFoundation -framework CoreAudio -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework Foundation -framework GameController -framework MapKit -framework OpenAL -framework UIKit -framework Security -framework CFNetwork -framework QuartzCore -framework Metal -framework MetalKit -framework IOSurface
5353

‎scripts/dev/download_libs.sh‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ cat << EOF
4343
--full-clean Also remove shared include/ (and bin/ for vs|msys2) for libs being
4444
installed. Use for a hard reset of one platform install; not needed
4545
for multi-platform side-by-side installs.
46+
--modules LIST Also install optional library modules from apothecary's latest-modular
47+
release, e.g. --modules dawn,metalangle (default: \$OF_LIB_MODULES).
48+
Modules not built for this platform yet are skipped.
4649
--skip-sha Do not verify package SHA-256 against GitHub release digests
4750
--require-sha Fail if a package has no digest or local hash tools are missing
4851
-s, --silent Silent download progress
@@ -183,6 +186,10 @@ while [[ $# -gt 0 ]]; do
183186
-vs|--vs2026)
184187
VS_2026=1
185188
;;
189+
--modules)
190+
MODULES="$2"
191+
shift # past argument
192+
;;
186193
-h|--help)
187194
printHelp
188195
exit 0
@@ -678,3 +685,15 @@ elif [[ "$SHA_STATUS" == "skipped" || "$SHA_STATUS" == "no-digest" || "$SHA_STAT
678685
else
679686
echo " openFrameworks download_libs and install complete!"
680687
fi
688+
689+
# optional modules (dawn, metalangle, ...) are separate packages on latest-modular
690+
MODULES="${MODULES:-${OF_LIB_MODULES:-}}"
691+
if [ -n "$MODULES" ]; then
692+
MODULE_ARGS=(-p "$PLATFORM")
693+
case "$PLATFORM" in
694+
vs|emscripten|msys2) [ -n "$ARCH" ] && MODULE_ARGS+=(-a "$ARCH") ;;
695+
esac
696+
[ "$SILENT_ARGS" == "1" ] && MODULE_ARGS+=(-s)
697+
[ "$NO_SSL" == "1" ] && MODULE_ARGS+=(-k)
698+
"$SCRIPT_DIR/download_modules.sh" "${MODULE_ARGS[@]}" "$MODULES" || exit 1
699+
fi

‎scripts/dev/download_modules.sh‎

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
#!/usr/bin/env bash
2+
# Downloads optional library modules (e.g. dawn, metalangle) that are not part
3+
# of the core openFrameworksLibs packages. apothecary publishes them per library
4+
# on its latest-modular release as oF_<lib>_<target>_<arch>[_gcc<N>].tar.bz2
5+
# (.zip for Visual Studio / MSYS2); each one unpacks to libs/<lib>/.
6+
#
7+
# Modules that aren't built for a target yet are skipped with a note.
8+
#
9+
# Usage: download_modules.sh -p <platform> [-a <arch>] [-t <tag>] [--require] <module> [<module>...]
10+
# download_modules.sh -p macos dawn metalangle
11+
# OF_LIB_MODULES=dawn,metalangle scripts/macos/download_libs.sh (via download_libs.sh --modules)
12+
13+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
14+
OF_ROOT="$( cd "$SCRIPT_DIR/../.." && pwd )"
15+
REPO="openframeworks/apothecary"
16+
TAG="latest-modular"
17+
PLATFORM=""
18+
ARCH=""
19+
REQUIRE=0
20+
SILENT_ARGS=""
21+
NO_SSL=""
22+
MODULES=()
23+
24+
. "$SCRIPT_DIR/downloader.sh"
25+
. "$SCRIPT_DIR/sha_verify.sh"
26+
27+
printHelp(){
28+
sed -n '2,13p' "$0" | sed 's/^# \{0,1\}//'
29+
cat <<EOF
30+
31+
Options:
32+
-p, --platform PLATFORM osx | macos | ios | tvos | vs | msys2 | linux64 | linuxaarch64 | linuxarmv6l | linuxarmv7l | emscripten
33+
-a, --arch ARCH vs: 64 | arm64 | arm64ec; emscripten: 32 | 64; msys2: ucrt64 | clang64 | clangarm64
34+
-t, --tag TAG apothecary release (default latest-modular)
35+
--require fail if a module isn't built for this platform (default: skip it)
36+
-s, --silent / -k, --no-ssl passed to the downloader
37+
EOF
38+
}
39+
40+
while [[ $# -gt 0 ]]; do
41+
case "$1" in
42+
-p|--platform) PLATFORM="$2"; shift 2 ;;
43+
-a|--arch) ARCH="$2"; shift 2 ;;
44+
-t|--tag) TAG="$2"; shift 2 ;;
45+
--require) REQUIRE=1; shift ;;
46+
-s|--silent) SILENT_ARGS="-s"; shift ;;
47+
-k|--no-ssl) NO_SSL="-k"; shift ;;
48+
-h|--help) printHelp; exit 0 ;;
49+
-*) echo "Unknown option $1"; printHelp; exit 1 ;;
50+
*) IFS=', ' read -r -a list <<< "$1"; MODULES+=("${list[@]}"); shift ;;
51+
esac
52+
done
53+
54+
if [[ ${#MODULES[@]} -eq 0 ]]; then
55+
echo "No modules given"; printHelp; exit 1
56+
fi
57+
[[ -z "$PLATFORM" ]] && { echo "No platform given (-p)"; exit 1; }
58+
59+
# candidate package suffixes for this platform, most specific first; the first
60+
# one published on the release is used. Apple installs every Apple target that
61+
# is built, like the core macos package covers all of them.
62+
candidateSuffixes(){
63+
local gcc
64+
case "$PLATFORM" in
65+
osx|macos|ios|tvos|catos|xros)
66+
echo "osx_64.tar.bz2|ios_64.tar.bz2|tvos_64.tar.bz2|catos_64.tar.bz2|xros_64.tar.bz2" ;;
67+
vs)
68+
case "$(echo "${ARCH:-64}" | tr '[:upper:]' '[:lower:]')" in
69+
arm64ec) echo "vs_arm64ec.zip" ;;
70+
arm64) echo "vs_arm64.zip" ;;
71+
*) echo "vs_64.zip" ;;
72+
esac ;;
73+
msys2)
74+
echo "msys2_$(echo "${ARCH:-${MSYSTEM:-ucrt64}}" | tr '[:upper:]' '[:lower:]').zip" ;;
75+
emscripten)
76+
echo "emscripten_${ARCH:-32}.tar.bz2" ;;
77+
linux64|linuxaarch64|linuxarmv6l|linuxarmv7l)
78+
gcc=$(gcc -dumpversion 2>/dev/null | cut -d. -f1)
79+
local first=gcc14 second=gcc10
80+
[[ -n "$gcc" && "$gcc" -lt 14 ]] && { first=gcc10; second=gcc14; }
81+
case "$PLATFORM" in
82+
linux64) echo "linux_64_${first}.tar.bz2 linux_64_${second}.tar.bz2" ;;
83+
linuxaarch64) echo "linux_arm64_${first}.tar.bz2 linux_arm64_${second}.tar.bz2 linux_aarch64_gcc10.tar.bz2" ;;
84+
linuxarmv6l) echo "linux_armv6l_gcc10.tar.bz2" ;;
85+
linuxarmv7l) echo "linux_armv7l_gcc10.tar.bz2" ;;
86+
esac ;;
87+
*) echo "" ;;
88+
esac
89+
}
90+
91+
MAP=$(mktemp 2>/dev/null || mktemp -t ofmodmap)
92+
HAVE_MAP=0
93+
fetchGithubReleaseDigests "$REPO" "$TAG" "$MAP" && HAVE_MAP=1
94+
95+
isPublished(){
96+
local asset="$1"
97+
if [[ $HAVE_MAP -eq 1 ]]; then
98+
[[ -n "$(lookupDigest "$MAP" "$asset")" ]]
99+
else
100+
curl -fsIL -o /dev/null "https://github.com/$REPO/releases/download/$TAG/$asset"
101+
fi
102+
}
103+
104+
mkdir -p "$OF_ROOT/libs/download"
105+
cd "$OF_ROOT/libs/download" || exit 1
106+
107+
failed=0
108+
installed=()
109+
for module in "${MODULES[@]}"; do
110+
[[ -z "$module" ]] && continue
111+
groups=$(candidateSuffixes)
112+
if [[ -z "$groups" ]]; then
113+
echo " ! [$module] modules aren't published for platform $PLATFORM"
114+
[[ $REQUIRE -eq 1 ]] && failed=1
115+
continue
116+
fi
117+
found_any=0
118+
# "|" separates targets that are all installed (Apple); spaces separate
119+
# alternatives for one target (first published wins)
120+
IFS='|' read -r -a targets <<< "$groups"
121+
for alternatives in "${targets[@]}"; do
122+
asset=""
123+
for suffix in $alternatives; do
124+
if isPublished "oF_${module}_${suffix}"; then asset="oF_${module}_${suffix}"; break; fi
125+
done
126+
[[ -z "$asset" ]] && continue
127+
found_any=1
128+
echo " [$module] downloading $asset"
129+
rm -f "$asset"
130+
downloader "https://github.com/$REPO/releases/download/$TAG/$asset" $SILENT_ARGS $NO_SSL
131+
if [[ ! -s "$asset" ]]; then
132+
echo " ! [$module] download failed: $asset"; failed=1; continue
133+
fi
134+
if [[ $HAVE_MAP -eq 1 ]] && ! verifyPackagesAgainstMap "$asset" "$MAP" "GitHub apothecary $TAG digests"; then
135+
echo " ! [$module] SHA-256 mismatch: $asset"; rm -f "$asset"; failed=1; continue
136+
fi
137+
# replace the lib/<target> folders this package contains, keep the module's other targets
138+
case "$asset" in
139+
*.zip) entries=$(unzip -Z1 "$asset") ;;
140+
*) entries=$(tar -tjf "$asset") ;;
141+
esac
142+
for libdir in $(echo "$entries" | awk -F/ 'NF>=4 && $2=="lib" && $3!="" {print $1"/lib/"$3}' | sort -u); do
143+
rm -rf "$OF_ROOT/libs/$libdir"
144+
done
145+
case "$asset" in
146+
*.zip) unzip -qo "$asset" -d "$OF_ROOT/libs/" ;;
147+
*) tar -xjf "$asset" -C "$OF_ROOT/libs/" ;;
148+
esac || { echo " ! [$module] could not unpack $asset"; failed=1; continue; }
149+
installed+=("$asset")
150+
done
151+
if [[ $found_any -eq 0 ]]; then
152+
echo " ~ [$module] not built for $PLATFORM yet on $TAG — skipped"
153+
[[ $REQUIRE -eq 1 ]] && failed=1
154+
fi
155+
done
156+
rm -f "$MAP"
157+
158+
if [[ ${#installed[@]} -gt 0 ]]; then
159+
echo " openFrameworks modules installed: ${installed[*]}"
160+
fi
161+
exit $failed

0 commit comments

Comments
 (0)