Skip to content

Commit

Permalink
Use system macdeployqt
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Aug 12, 2023
1 parent 3af3d4a commit 00ff724
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ if(APPLE)
add_subdirectory(3rdparty/SPMediaKeyTap)
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
add_subdirectory(3rdparty/macdeployqt)
add_subdirectory(ext/macdeploycheck)
endif()

Expand Down
4 changes: 2 additions & 2 deletions cmake/Dmg.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#find_program(MACDEPLOYQT_EXECUTABLE NAMES macdeployqt PATHS /usr/local/opt/qt6/bin /usr/local/opt/qt5/bin /usr/local/bin REQUIRED)
set(MACDEPLOYQT_EXECUTABLE "${CMAKE_BINARY_DIR}/3rdparty/macdeployqt/macdeployqt")
find_program(MACDEPLOYQT_EXECUTABLE NAMES macdeployqt PATHS /usr/local/opt/qt6/bin /usr/local/opt/qt5/bin /usr/local/bin REQUIRED)
if(MACDEPLOYQT_EXECUTABLE)
message(STATUS "Found macdeployqt: ${MACDEPLOYQT_EXECUTABLE}")
else()
Expand All @@ -21,6 +20,7 @@ if(MACDEPLOYQT_EXECUTABLE)
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/strawberry.app/Contents/{Frameworks,Resources}
COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/Info.plist ${CMAKE_BINARY_DIR}/strawberry.app/Contents/
COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/strawberry.icns ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Resources/
COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macgstcopy.sh ${CMAKE_BINARY_DIR}/strawberry.app
COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -verbose=3 -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/strawberry-tagreader
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS strawberry strawberry-tagreader copy_gstreamer_plugins macdeployqt
Expand Down
59 changes: 44 additions & 15 deletions dist/macos/macgstcopy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ if [ "$1" = "" ]; then
fi
bundledir=$1

if [ "$GIO_EXTRA_MODULES" = "" ]; then
echo "Error: Set the GIO_EXTRA_MODULES environment variable to the path containing libgiognutls.so."
exit 1
if [ "${GIO_EXTRA_MODULES}" = "" ]; then
if [ -d "/usr/local/lib/gio/modules" ]; then
GIO_EXTRA_MODULES="/usr/local/lib/gio/modules"
elif [ -d "/opt/local/lib/gio/modules" ]; then
GIO_EXTRA_MODULES="/opt/local/lib/gio/modules"
else
echo "Error: Set the GIO_EXTRA_MODULES environment variable to the path containing libgiognutls.so."
exit 1
fi
fi

if [ "$GST_PLUGIN_SCANNER" = "" ]; then
echo "Error: Set the GST_PLUGIN_SCANNER environment variable to the gst-plugin-scanner."
exit 1
if [ "${GST_PLUGIN_SCANNER}" = "" ]; then
if [ -d "/usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner" ]; then
GST_PLUGIN_SCANNER="/usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner"
elif [ -d "/opt/local/libexec/gstreamer-1.0/gst-plugin-scanner" ]; then
GST_PLUGIN_SCANNER="/opt/local/libexec/gstreamer-1.0/gst-plugin-scanner"
else
echo "Error: Set the GST_PLUGIN_SCANNER environment variable to the gst-plugin-scanner."
exit 1
fi
fi

if [ "$GST_PLUGIN_PATH" = "" ]; then
echo "Error: Set the GST_PLUGIN_PATH environment variable to the path containing gstreamer plugins."
exit 1
if [ "${GST_PLUGIN_PATH}" = "" ] || ! [ -d "${GST_PLUGIN_PATH}" ]; then
if [ -d "/usr/local/lib/gstreamer-1.0" ]; then
GST_PLUGIN_PATH="/usr/local/lib/gstreamer-1.0"
elif [ -d "/opt/local/lib/gstreamer-1.0" ]; then
GST_PLUGIN_PATH="/opt/local/lib/gstreamer-1.0"
else
echo "Error: Set the GST_PLUGIN_PATH environment variable to the path containing gstreamer plugins."
exit 1
fi
fi

mkdir -p "${bundledir}/Contents/PlugIns/gio-modules" || exit 1
Expand All @@ -30,7 +48,14 @@ if ! [ -f "${GIO_EXTRA_MODULES}/libgiognutls.so" ]; then
echo "Error: Missing ${GIO_EXTRA_MODULES}/libgiognutls.so."
exit 1
fi

if ! [ -f "${GIO_EXTRA_MODULES}/libgioopenssl.so" ]; then
echo "Error: Missing ${GIO_EXTRA_MODULES}/libgioopenssl.so"
exit 1
fi

cp -v -f "${GIO_EXTRA_MODULES}/libgiognutls.so" "${bundledir}/Contents/PlugIns/gio-modules/" || exit 1
cp -v -f "${GIO_EXTRA_MODULES}/libgioopenssl.so" "${bundledir}/Contents/PlugIns/gio-modules/" || exit 1

if ! [ -f "${GST_PLUGIN_SCANNER}" ]; then
echo "Error: Missing ${GST_PLUGIN_SCANNER}"
Expand Down Expand Up @@ -58,13 +83,15 @@ libgstcdio.dylib
libgstcoreelements.dylib
libgstdash.dylib
libgstequalizer.dylib
libgstflac.dylib
libgstfaac.dylib
libgstfaad.dylib
libgstfdkaac.dylib
libgstflac.dylib
libgstgio.dylib
libgsthls.dylib
libgsticydemux.dylib
libgstid3demux.dylib
libgstid3tag.dylib
libgstisomp4.dylib
libgstlame.dylib
libgstlibav.dylib
Expand All @@ -85,13 +112,15 @@ libgstspectrum.dylib
libgstspeex.dylib
libgsttaglib.dylib
libgsttcp.dylib
libgsttwolame.dylib
libgsttypefindfunctions.dylib
libgstudp.dylib
libgstvolume.dylib
libgstvorbis.dylib
libgstwavenc.dylib
libgstwavpack.dylib
libgstwavparse.dylib
libgstxingmux.dylib;
libgstxingmux.dylib
"

gst_plugins=$(echo "$gst_plugins" | tr '\n' ' ' | sed -e 's/^ //g' | sed -e 's/ / /g')
Expand All @@ -105,7 +134,7 @@ do
fi
done

if [ -f "/usr/local/lib/libbrotlicommon.1.dylib" ]; then
mkdir -p ${bundledir}/Contents/Frameworks
cp -v -f "/usr/local/lib/libbrotlicommon.1.dylib" "${bundledir}/Contents/Frameworks/"
fi
#if [ -f "/usr/local/lib/libbrotlicommon.1.dylib" ]; then
#mkdir -p ${bundledir}/Contents/Frameworks
#cp -v -f "/usr/local/lib/libbrotlicommon.1.dylib" "${bundledir}/Contents/Frameworks/"
#fi

0 comments on commit 00ff724

Please sign in to comment.