mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
copy required gstreamer plugins and setup env vars for macOS
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build macOS x86_64
|
||||
name: Build macOS
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -14,7 +14,14 @@ env:
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
runs-on: macos-15-intel
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- runner: macos-15-intel
|
||||
arch: x86_64
|
||||
- runner: macos-14
|
||||
arch: arm64
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -34,7 +41,7 @@ jobs:
|
||||
# ls "${QT_ROOT_DIR}/lib/pkgconfig"
|
||||
# macOS on Apple Silicon uses /opt/homebrew, Intel Macs use /usr/local
|
||||
# echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:${PKG_CONFIG_PATH:-}" >> "$GITHUB_ENV"
|
||||
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH:-}" >> "$GITHUB_ENV"
|
||||
echo "PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig:${PKG_CONFIG_PATH:-}" >> "$GITHUB_ENV"
|
||||
echo "CMAKE_PREFIX_PATH=${QT_ROOT_DIR}/lib/cmake:${CMAKE_PREFIX_PATH:-}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Set up Go
|
||||
@@ -139,10 +146,33 @@ jobs:
|
||||
run: |
|
||||
macdeployqt build/iDescriptor.app -qmldir=qml -verbose=2
|
||||
|
||||
# Bundle GStreamer
|
||||
GST_PLUGIN_DIR="build/iDescriptor.app/Contents/Frameworks/gstreamer"
|
||||
mkdir -p "${GST_PLUGIN_DIR}"
|
||||
|
||||
PLUGINS=(
|
||||
"libgstapp"
|
||||
"libgstaudioconvert"
|
||||
"libgstautodetect"
|
||||
"libgstavi"
|
||||
"libgstcoreelements"
|
||||
"libgstlevel"
|
||||
"libgstlibav"
|
||||
"libgstosxaudio"
|
||||
"libgstplayback"
|
||||
"libgstvolume"
|
||||
)
|
||||
|
||||
for plugin in "${PLUGINS[@]}"; do
|
||||
cp "$(brew --prefix)/lib/gstreamer-1.0/${plugin}.dylib" "${GST_PLUGIN_DIR}/"
|
||||
done
|
||||
|
||||
cp "$(brew --prefix)/libexec/gstreamer-1.0/gst-plugin-scanner" "build/iDescriptor.app/Contents/Frameworks/"
|
||||
|
||||
# Bundle libjxl_cms
|
||||
cp /usr/local/lib/libjxl_cms.0.11.dylib build/iDescriptor.app/Contents/Frameworks/
|
||||
cp "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/
|
||||
install_name_tool -id "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl_cms.0.11.dylib
|
||||
install_name_tool -change "/usr/local/lib/libjxl_cms.0.11.dylib" "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl.0.11.dylib
|
||||
install_name_tool -change "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl.0.11.dylib
|
||||
|
||||
install_name_tool -add_rpath "@executable_path/../Frameworks" build/iDescriptor.app/Contents/MacOS/iDescriptor
|
||||
|
||||
@@ -151,5 +181,5 @@ jobs:
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: iDescriptor-macOS
|
||||
name: iDescriptor-macOS-${{ matrix.arch }}
|
||||
path: build/*.dmg
|
||||
@@ -59,6 +59,19 @@ int main(int argc, char *argv[])
|
||||
qputenv("GST_PLUGIN_SCANNER_1_0", gstPluginScannerPath.toUtf8());
|
||||
qDebug() << "GST_PLUGIN_SCANNER_1_0=" << gstPluginScannerPath;
|
||||
printf("GST_PLUGIN_SCANNER_1_0=%s\n", gstPluginScannerPath.toUtf8().data());
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
QString appPath = QCoreApplication::applicationDirPath();
|
||||
QString frameworksPath =
|
||||
QDir::toNativeSeparators(appPath + "/../Frameworks");
|
||||
QString gstPluginPath =
|
||||
QDir::toNativeSeparators(frameworksPath + "/gstreamer");
|
||||
QString gstPluginScannerPath =
|
||||
QDir::toNativeSeparators(frameworksPath + "/gst-plugin-scanner");
|
||||
|
||||
qputenv("DYLD_LIBRARY_PATH", frameworksPath.toUtf8());
|
||||
qputenv("GST_PLUGIN_SCANNER_1_0", gstPluginScannerPath.toUtf8());
|
||||
qputenv("GST_PLUGIN_SYSTEM_PATH_1_0", gstPluginPath.toUtf8());
|
||||
#endif
|
||||
QCoreApplication::setOrganizationName("iDescriptor");
|
||||
// QCoreApplication::setOrganizationDomain("iDescriptor.com");
|
||||
|
||||
Reference in New Issue
Block a user