@@ -100,7 +100,9 @@ elif [ "$TARGET" = "macOS" ]; then
100
100
mv vlc-$VLC_VERSION .0-win64/* /sdk/lib/pkgconfig lib
101
101
rm -rf ./vlc-$VLC_VERSION .0-win64*
102
102
else
103
- wget https://download.videolan.org/pub/videolan/vlc/$VLC_VERSION .0/macosx/vlc-$VLC_VERSION .0.dmg
103
+ # wget https://download.videolan.org/pub/videolan/vlc/$VLC_VERSION.0/macosx/vlc-$VLC_VERSION.0.dmg
104
+ # get a recent universal .dmg instead of early x86_64 .dmg
105
+ wget https://download.videolan.org/pub/videolan/vlc/3.0.18/macosx/vlc-3.0.18-universal.dmg
104
106
# extracting contents of a .dmg file using 7-zip is more of a hack, and while it works 7z exits with an error code we want to suppress
105
107
7z x " *.dmg" " */VLC.app/Contents/MacOS" || true
106
108
mv * /VLC.app/Contents/MacOS/lib ..
@@ -126,13 +128,32 @@ elif [ "$TARGET" = "macOS" ]; then
126
128
# fix library symlink
127
129
ln -sf libvlccore.* .dylib libvlccore.dylib
128
130
cd ../..
131
+
132
+ # compile x86_64 version, stash it, then clean up
133
+ make OS=macOS
134
+ mkdir x86_64
135
+ mv libpause_click_plugin.dylib x86_64
136
+ make OS=macOS clean
137
+
138
+ # cross-compile arm64 version, stash it
139
+ sed -i " " " s|CC = cc|CC = cc -target arm64-apple-macos10.12|" Makefile
129
140
make OS=macOS
141
+ mkdir arm64
142
+ mv libpause_click_plugin.dylib arm64
143
+
144
+ # merge x86_64 and arm64 versions
145
+ mkdir universal
146
+ lipo arm64/libpause_click_plugin.dylib x86_64/libpause_click_plugin.dylib -create -output universal/libpause_click_plugin.dylib
147
+
148
+ # get ready to compile x86_64 version again
149
+ sed -i " " " s|CC = cc -target arm64-apple-macos10.12|CC = cc|" Makefile
150
+
130
151
if [ " $VLC_VERSION " = " 4.0" ]; then
131
152
echo " $LATEST_MACOS_DIR_URL " > VLC_DOWNLOAD_URL.txt
132
153
echo_nightly_readme " $( cat VLC_DOWNLOAD_URL.txt) " > " README.txt"
133
154
zip -j vlc-$VLC_VERSION -macosx.zip libpause_click_plugin.dylib VLC_DOWNLOAD_URL.txt README.txt
134
155
else
135
- zip -j vlc-$VLC_VERSION -macosx.zip libpause_click_plugin.dylib
156
+ zip vlc-$VLC_VERSION -macosx.zip x86_64/libpause_click_plugin.dylib arm64/libpause_click_plugin.dylib universal/ libpause_click_plugin.dylib
136
157
fi
137
158
mkdir artifacts
138
159
cp -a vlc-$VLC_VERSION -macosx.zip artifacts
0 commit comments