Skip to content

Commit da57438

Browse files
committed
Cross-compile and create arm64 and universal versions for 3.0
1 parent bc44973 commit da57438

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.travis/script.sh

+23-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ elif [ "$TARGET" = "macOS" ]; then
100100
mv vlc-$VLC_VERSION.0-win64/*/sdk/lib/pkgconfig lib
101101
rm -rf ./vlc-$VLC_VERSION.0-win64*
102102
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
104106
# 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
105107
7z x "*.dmg" "*/VLC.app/Contents/MacOS" || true
106108
mv */VLC.app/Contents/MacOS/lib ..
@@ -126,13 +128,32 @@ elif [ "$TARGET" = "macOS" ]; then
126128
# fix library symlink
127129
ln -sf libvlccore.*.dylib libvlccore.dylib
128130
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
129140
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+
130151
if [ "$VLC_VERSION" = "4.0" ]; then
131152
echo "$LATEST_MACOS_DIR_URL" > VLC_DOWNLOAD_URL.txt
132153
echo_nightly_readme "$(cat VLC_DOWNLOAD_URL.txt)" > "README.txt"
133154
zip -j vlc-$VLC_VERSION-macosx.zip libpause_click_plugin.dylib VLC_DOWNLOAD_URL.txt README.txt
134155
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
136157
fi
137158
mkdir artifacts
138159
cp -a vlc-$VLC_VERSION-macosx.zip artifacts

0 commit comments

Comments
 (0)