Skip to content

Commit

Permalink
macos: update deployment files
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Jan 7, 2025
1 parent 062e26d commit cf254bd
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 73 deletions.
129 changes: 73 additions & 56 deletions platforms/macos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,70 +15,87 @@ else()
endif()
install(CODE "execute_process(COMMAND sed -i -e \"s/__QLC_VERSION__/${APPVERSION}/g\" ${INSTALLROOT}/Info.plist)")

# install Qt library frameworks
#set(QT_FRAMEWORKS_DIR ${_qt5_root_dir}/../../Frameworks) # homebrew
set(QT_FRAMEWORKS_DIR ${_qt5_root_dir}/..)
set(QT_FRAMEWORK_NAMES
"QtCore"
"QtDBus"
"QtGui"
"QtMultimedia"
"QtMultimediaWidgets"
"QtNetwork"
"QtOpenGL"
"QtPrintSupport"
"QtScript"
"QtSerialPort"
"QtSvg"
"QtWidgets"
"QtWebSockets"
)
# Loop through each framework and copy it to installation
foreach(FW_NAME IN LISTS QT_FRAMEWORK_NAMES)
# install each framework Version file
install(FILES ${QT_FRAMEWORKS_DIR}/${FW_NAME}.framework/Versions/5/${FW_NAME}
DESTINATION ${INSTALLROOT}/${LIBSDIR}/${FW_NAME}.framework/Versions/5)
endforeach()

# install Qt plugins
set(QT_PLUGINS_DIR ${_qt5_root_dir}/../../plugins)
# imageformats
install(FILES ${QT_PLUGINS_DIR}/imageformats/libqgif.dylib DESTINATION ${INSTALLROOT}/${PLUGINDIR}/imageformats)
install(FILES ${QT_PLUGINS_DIR}/imageformats/libqjpeg.dylib DESTINATION ${INSTALLROOT}/${PLUGINDIR}/imageformats)
install(FILES ${QT_PLUGINS_DIR}/imageformats/libqsvg.dylib DESTINATION ${INSTALLROOT}/${PLUGINDIR}/imageformats)
# multimedia
install(FILES ${QT_PLUGINS_DIR}/mediaservice/libqavfmediaplayer.dylib DESTINATION ${INSTALLROOT}/${PLUGINDIR}/mediaservice)
install(FILES ${QT_PLUGINS_DIR}/mediaservice/libqtmedia_audioengine.dylib DESTINATION ${INSTALLROOT}/${PLUGINDIR}/mediaservice)
# platforms
install(FILES ${QT_PLUGINS_DIR}/platforms/libqcocoa.dylib DESTINATION ${INSTALLROOT}/${PLUGINDIR}/platforms)
# styles
install(FILES ${QT_PLUGINS_DIR}/styles/libqmacstyle.dylib DESTINATION ${INSTALLROOT}/${PLUGINDIR}/styles)
set(APPLE_CODESIGN_ENTITLEMENTS "qlcplus.entitlements")

# Starting with arm64 macOS Apple will require ad-hoc code signatures,
# which can be generated by setting the identity to a single dash (-).
# These only include a checksum for verifying integrity, not an actual
# signature.
if(NOT APPLE_CODESIGN_IDENTITY)
set(APPLE_CODESIGN_IDENTITY -)
endif()

# install support libraries
install(FILES ${FFTW3_LIBDIR}/libfftw3.3.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
set(FFTW_LIBNAME "libfftw3.3.dylib")
set(OGG_LIBNAME "libogg.0.dylib")
set(FLAC_LIBNAME "libFLAC.12.dylib")
set(OPUS_LIBNAME "libopus.0.dylib")
set(MPG123_LIBNAME "libmpg123.0.dylib")
set(LAME_LIBNAME "libmp3lame.0.dylib")
set(VORBIS_LIBNAME "libvorbis.0.dylib")
set(VORBISENC_LIBNAME "libvorbisenc.2.dylib")

install(FILES ${FFTW3_LIBDIR}/${FFTW_LIBNAME} DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${LIBFTDI1_libftdi1_LIBDIR}/libftdi1.2.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${LIBFTDI1_libftdi1_LIBDIR}/libftdi1.2.5.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${LIBUSB1_LIBDIR}/libusb-1.0.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${MAD_LIBDIR}/libmad.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${SNDFILE_LIBDIR}/libsndfile.1.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${SNDFILE_LIBDIR}/libsndfile.1.0.37.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})

#pkg_check_modules(FLAC IMPORTED_TARGET flac)
#pkg_check_modules(OGG IMPORTED_TARGET ogg)
#pkg_check_modules(OPUS IMPORTED_TARGET opus)
#pkg_check_modules(MPG123 IMPORTED_TARGET libmpg123)
#pkg_check_modules(LAME IMPORTED_TARGET lame)
#pkg_check_modules(VORBIS IMPORTED_TARGET vorbis)
#pkg_check_modules(VORBISENC IMPORTED_TARGET vorbisenc)
#install(FILES ${FLAC_LIBDIR}/libFLAC.12.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
#install(FILES ${OGG_LIBDIR}/libogg.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
#install(FILES ${OGG_LIBDIR}/libogg.0.8.5.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
#install(FILES ${OPUS_LIBDIR}/libopus.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
#install(FILES ${MPG123_LIBDIR}/libmpg123.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
#install(FILES ${LAME_LIBDIR}/libmp3lame.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
#install(FILES ${VORBIS_LIBDIR}/libvorbis.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
#install(FILES ${VORBISENC_LIBDIR}/libvorbisenc.2.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
pkg_check_modules(FLAC IMPORTED_TARGET flac)
pkg_check_modules(OGG IMPORTED_TARGET ogg)
pkg_check_modules(OPUS IMPORTED_TARGET opus)
pkg_check_modules(MPG123 IMPORTED_TARGET libmpg123)
#pkg_check_modules(LAME IMPORTED_TARGET lame) # lame doesn't have a pkg-config file...well done
pkg_check_modules(VORBIS IMPORTED_TARGET vorbis)
pkg_check_modules(VORBISENC IMPORTED_TARGET vorbisenc)

install(FILES ${OGG_LIBDIR}/${OGG_LIBNAME} DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${FLAC_LIBDIR}/${FLAC_LIBNAME} DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${OPUS_LIBDIR}/${OPUS_LIBNAME} DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${MPG123_LIBDIR}/${MPG123_LIBNAME} DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${VORBIS_LIBDIR}/${VORBIS_LIBNAME} DESTINATION ${INSTALLROOT}/${LIBSDIR})
install(FILES ${VORBISENC_LIBDIR}/${VORBISENC_LIBNAME} DESTINATION ${INSTALLROOT}/${LIBSDIR})
# this is ugly, thanks to lame developers
install(FILES /opt/homebrew/Cellar/lame/3.100/lib/libmp3lame.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})

# fix dylib lookup paths
install(CODE "execute_process(COMMAND install_name_tool -change
/opt/homebrew/opt/fftw/lib/${FFTW_LIBNAME}
@executable_path/../Frameworks/${FFTW_LIBNAME}
${INSTALLROOT}/${BINDIR}/qlcplus)")
install(CODE "execute_process(COMMAND install_name_tool -change
/opt/homebrew/opt/fftw/lib/${FFTW_LIBNAME}
@executable_path/../Frameworks/${FFTW_LIBNAME}
${INSTALLROOT}/${BINDIR}/qlcplus-fixtureeditor)")

#install(FILES ${FFTW3_LIBDIR}/libpcre2-16.0.dylib DESTINATION ${INSTALLROOT}/${LIBSDIR})
# more deps: libzstd.1.dylib #libgthread-2.0.0.dylib #libglib-2.0.0.dylib #libintl.8.dylib
# libpng16.16.dylib #libqjpeg.dylib #libjpeg.8.dylib #libmp3lame.0.dylib
install(CODE "execute_process(COMMAND install_name_tool -change
@loader_path/../../../../opt/libogg/lib/${OGG_LIBNAME}
@executable_path/../Frameworks/${OGG_LIBNAME}
${INSTALLROOT}/${LIBSDIR}/libsndfile.1.dylib)")
install(CODE "execute_process(COMMAND install_name_tool -change
@loader_path/../../../../opt/libvorbis/lib/${VORBISENC_LIBNAME}
@executable_path/../Frameworks/${VORBISENC_LIBNAME}
${INSTALLROOT}/${LIBSDIR}/libsndfile.1.dylib)")
install(CODE "execute_process(COMMAND install_name_tool -change
@loader_path/../../../../opt/flac/lib/${FLAC_LIBNAME}
@executable_path/../Frameworks/${FLAC_LIBNAME}
${INSTALLROOT}/${LIBSDIR}/libsndfile.1.dylib)")
install(CODE "execute_process(COMMAND install_name_tool -change
@loader_path/../../../../opt/opus/lib/${OPUS_LIBNAME}
@executable_path/../Frameworks/${OPUS_LIBNAME}
${INSTALLROOT}/${LIBSDIR}/libsndfile.1.dylib)")
install(CODE "execute_process(COMMAND install_name_tool -change
@loader_path/../../../../opt/mpg123/lib/${MPG123_LIBNAME}
@executable_path/../Frameworks/${MPG123_LIBNAME}
${INSTALLROOT}/${LIBSDIR}/libsndfile.1.dylib)")
install(CODE "execute_process(COMMAND install_name_tool -change
@loader_path/../../../../opt/lame/lib/${LAME_LIBNAME}
@executable_path/../Frameworks/${LAME_LIBNAME}
${INSTALLROOT}/${LIBSDIR}/libsndfile.1.dylib)")
install(CODE "execute_process(COMMAND install_name_tool -change
@loader_path/../../../../opt/libvorbis/lib/${VORBIS_LIBNAME}
@executable_path/../Frameworks/${VORBIS_LIBNAME}
${INSTALLROOT}/${LIBSDIR}/libsndfile.1.dylib)")
3 changes: 0 additions & 3 deletions platforms/macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
<key>NSLocalNetworkUsageDescription</key>
<string>Access the local network for DMX-related protocols</string>

<key>com.apple.developer.networking.multicast</key>
<true/>

<key>CFBundleDocumentTypes</key>
<array>
<dict>
Expand Down
14 changes: 0 additions & 14 deletions platforms/macos/dmg/README

This file was deleted.

49 changes: 49 additions & 0 deletions platforms/macos/qlcplus.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- APP SANDBOX ENTITLEMENTS
See https://developer.apple.com/documentation/security/app_sandbox for details.
-->
<!-- Enable the App Sandbox -->
<key>com.apple.security.app-sandbox</key>
<true/>
<!-- Allow interacting with the microphone -->
<key>com.apple.security.device.microphone</key>
<true/>
<!-- Allow interacting with USB devices -->
<key>com.apple.security.device.usb</key>
<true/>
<!-- Allow opening outgoing network connections -->
<key>com.apple.security.network.client</key>
<true/>
<!-- Allow access to multicast networking (for E1.31) -->
<key>com.apple.developer.networking.multicast</key>
<true/>
<!-- Allow access to files selected with an Open/Save dialog -->
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<!-- Persists access permission for files selected with an Open/Save dialog across restarts -->
<key>com.apple.security.files.bookmarks.app-scope</key>
<true/>

<!-- HARDENED RUNTIME ENTITLEMENTS
See https://developer.apple.com/documentation/security/hardened_runtime for details.
-->
<!-- Allow interacting with the microphone -->
<key>com.apple.security.device.audio-input</key>
<true/>
<!-- Allow execution of JIT-compiled code
This is necessary for RGB Scripts that use Qt's JavaScript JIT compiler.
-->
<key>com.apple.security.cs.allow-jit</key>
<true/>
<!-- Allow unsigned executable memory
This is necessary for RGB Scripts that use Qt's JavaScript JIT compiler.
-->
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>

0 comments on commit cf254bd

Please sign in to comment.