-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac ARM/Universal binary support request #81
Comments
We rely on the CI to make macOS builds, and neither Travis-CI nor GitHub Actions provide macOS ARM runners, so this is not something that can be easily added. If someone figures out how to cross-compile the plugin from x86-64 macOS to ARM macOS on the CI -- please feel free to contribute. It's not something I want to do myself and I wouldn't be able to test the resulting binaries as I don't own an ARM mac.
Not sure if anything changed for ARM, but for x86-64 we had to piece the SDK together by combining files from macOS and Windows SDKs like so: brew update
brew install p7zip
mkdir -p tmp/tmp
cd tmp/tmp
wget https://download.videolan.org/pub/videolan/vlc/3.0.0/macosx/vlc-3.0.0.dmg
# 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
7z x "*.dmg" "*/VLC.app/Contents/MacOS" || true
mv */VLC.app/Contents/MacOS/lib ..
mv */VLC.app/Contents/MacOS/include ..
cd ..
rm -rf ./tmp
# in contrast to Windows VLC including a very nice and complete sdk directory,
# macOS VLC doesn't package .pc files, plugin headers and in 2.1.0 libvlc_version.h is not generated off libvlc_version.h.in.
# it just packages libvlc.dylib, libvlccore.dylib and libvlc headers.
# we grab the missing pieces from the Windows VLC, there shouldn't be anything platform-specific in those so it should work
wget https://download.videolan.org/pub/videolan/vlc/3.0.0/win64/vlc-3.0.0-win64.7z -O vlc-3.0.0-win64.7z
7z x "*.7z" -o* "*/sdk"
mv vlc-3.0.0-win64/*/sdk/include/vlc/libvlc_version.h include/vlc/
mv vlc-3.0.0-win64/*/sdk/include/vlc/plugins include/vlc
mv vlc-3.0.0-win64/*/sdk/lib/pkgconfig lib
rm -rf ./vlc-3.0.0-win64*
# fix paths in .pc files
sed -i "" "s|^prefix=.*|prefix=$PWD|g" lib/pkgconfig/*.pc
export PKG_CONFIG_PATH="${PWD}/lib/pkgconfig"
cd lib
# fix library symlink
ln -sf libvlccore.*.dylib libvlccore.dylib
cd ../..
make OS=macOS
zip -j vlc-3.0-macosx.zip libpause_click_plugin.dylib |
Sorry for the late response but I could get it running in no time! I just had to download an arm64 disk image instead of an intel one:
After compiling the arm64 version, it just worked, but I could also use
|
It was not so clear to me, can you make an usage instruction explained in detail for this? I have a mac M1 Arm and I've been able to use pause_click only with the Intel version! Thanks in advance! |
If you trust me, you can use this: Just unzip it and copy the arm64/universal version into an arm64/universal version of VLC and it will work. If you don't trust me, you will have to compile the plugin yourself. I had Xcode and Homebrew installed. You will need to download the https://github.com/nurupo/vlc-pause-click-plugin/releases/tag/2.2.0 source tar.gz file, unpack it, then save nurupo's script as a file, change line 5 to download the arm64 DMG instead of the intel DMG, then run it. You will need to be familiar with saving and running shell scripts. |
If you've been using the intel version of VLC and you want to switch to the arm64 version: Get the arm64 version of VLC running first, then shut it down and copy the plugin. If you copy the plugin first before getting the arm64 version to run, then the app verification will fail and you will need to delete the app and reinstall from the DMG again. |
Thank you so much, after having tried a bunch of methods, this is literally the first time I got it to work. You should make a PR to the main repo with this fix. |
Making
Proof-of-concept script (inefficient because it downloads the SDK twice, dumb because I don't really understand build procedures or Make): #!/bin/bash
brew update
brew install p7zip
rm -rf tmp
make OS=macOS clean
mkdir -p tmp/tmp
cd tmp/tmp
wget https://download.videolan.org/pub/videolan/vlc/3.0.0/macosx/vlc-3.0.0.dmg
# 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
7z x "*.dmg" "*/VLC.app/Contents/MacOS" || true
mv */VLC.app/Contents/MacOS/lib ..
mv */VLC.app/Contents/MacOS/include ..
cd ..
rm -rf ./tmp
# in contrast to Windows VLC including a very nice and complete sdk directory,
# macOS VLC doesn't package .pc files, plugin headers and in 2.1.0 libvlc_version.h is not generated off libvlc_version.h.in.
# it just packages libvlc.dylib, libvlccore.dylib and libvlc headers.
# we grab the missing pieces from the Windows VLC, there shouldn't be anything platform-specific in those so it should work
wget https://download.videolan.org/pub/videolan/vlc/3.0.0/win64/vlc-3.0.0-win64.7z -O vlc-3.0.0-win64.7z
7z x "*.7z" -o* "*/sdk"
mv vlc-3.0.0-win64/*/sdk/include/vlc/libvlc_version.h include/vlc/
mv vlc-3.0.0-win64/*/sdk/include/vlc/plugins include/vlc
mv vlc-3.0.0-win64/*/sdk/lib/pkgconfig lib
rm -rf ./vlc-3.0.0-win64*
# fix paths in .pc files
sed -i "" "s|^prefix=.*|prefix=$PWD|g" lib/pkgconfig/*.pc
export PKG_CONFIG_PATH="${PWD}/lib/pkgconfig"
cd lib
# fix library symlink
ln -sf libvlccore.*.dylib libvlccore.dylib
cd ../..
make OS=macOS
mkdir x86_64
mv libpause_click_plugin.dylib x86_64
rm -rf tmp
make OS=macOS clean
mkdir -p tmp/tmp
cd tmp/tmp
wget https://get.videolan.org/vlc/3.0.17.3/macosx/vlc-3.0.17.3-arm64.dmg
# 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
7z x "*.dmg" "*/VLC.app/Contents/MacOS" || true
mv */VLC.app/Contents/MacOS/lib ..
mv */VLC.app/Contents/MacOS/include ..
cd ..
rm -rf ./tmp
# in contrast to Windows VLC including a very nice and complete sdk directory,
# macOS VLC doesn't package .pc files, plugin headers and in 2.1.0 libvlc_version.h is not generated off libvlc_version.h.in.
# it just packages libvlc.dylib, libvlccore.dylib and libvlc headers.
# we grab the missing pieces from the Windows VLC, there shouldn't be anything platform-specific in those so it should work
wget https://download.videolan.org/pub/videolan/vlc/3.0.0/win64/vlc-3.0.0-win64.7z -O vlc-3.0.0-win64.7z
7z x "*.7z" -o* "*/sdk"
mv vlc-3.0.0-win64/*/sdk/include/vlc/libvlc_version.h include/vlc/
mv vlc-3.0.0-win64/*/sdk/include/vlc/plugins include/vlc
mv vlc-3.0.0-win64/*/sdk/lib/pkgconfig lib
rm -rf ./vlc-3.0.0-win64*
# fix paths in .pc files
sed -i "" "s|^prefix=.*|prefix=$PWD|g" lib/pkgconfig/*.pc
export PKG_CONFIG_PATH="${PWD}/lib/pkgconfig"
cd lib
# fix library symlink
ln -sf libvlccore.*.dylib libvlccore.dylib
cd ../..
sed -i "" "s|CC = cc|CC = cc -target arm64-apple-macos10.12|" Makefile
make OS=macOS
mkdir arm64
mv libpause_click_plugin.dylib arm64
mkdir universal
lipo arm64/libpause_click_plugin.dylib x86_64/libpause_click_plugin.dylib -create -output universal/libpause_click_plugin.dylib
sed -i "" "s|CC = cc -target arm64-apple-macos10.12|CC = cc|" Makefile
|
Is your feature request related to a problem? Please describe
Plugin doesn’t function when running arm64 binary or universal binary of VLC on an M1 Mac
Describe the solution you'd like
Plugin would come in 3 versions: intel, arm64, universal, same as how VLC binaries are distributed
Describe alternatives you've considered
Or it could come in 2 versions: intel and arm64
Tried to figure out if I could compile it for myself but I could’t figure out how to get the SDK for VLC 3.0
Additional context
In the mean time if you could update the documentation for VLC 3.0 macOS compilation that would be cool too
The text was updated successfully, but these errors were encountered: