How To Use the macOS SDK

  1. Download and install the following:
  2. Extract the Shotcut SDK .txz file from the folder $HOME/Projects.
  3. Edit the includedir and libdir keys in the mltframework-7.pc and mlt++-7.pc files in $HOME/Projects/Shotcut/Contents/Frameworks/lib/pkgconfig to have the proper prefix: $HOME/Projects/Shotcut/Contents/Frameworks/ (you need to expand $HOME yourself).
  4. Create a symbolic link $HOME/Projects/Shotcut.app pointing to $HOME/Projects/Shotcut.
  5. In Qt Creator open $HOME/Projects/Shotcut/src/shotcut/CMakeLists.txt.
  6. In the Shotcut project configuration screen find Build Settings.
  7. Under Build Environment, add or edit the key/value pairs:
    • PKG_CONFIG_PATH = ${HOME}/Projects/Shotcut/Contents/Frameworks/lib/pkgconfig
  8. Under CMake > Current Configuration add or edit the key/value pairs:
    • CMAKE_INSTALL_PREFIX = ~/Projects
    • CMAKE_INSTALL_RPATH = @executable_path/../Frameworks
    • CMAKE_INSTALL_RPATH_USE_LINK_PATH = ON

    Alternatively, in Addtional CMake options enter -DCMAKE_INSTALL_PREFIX=~/Projects -DCMAKE_INSTALL_RPATH=@executable_path/../Frameworks -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON and click Run CMake.

  9. In the Shotcut project configuration screen find Run Settings.
    • Under Run > Run configuration click Add > Custom Executable > Executable add $HOME/Projects/Shotcut/Contents/MacOS/Shotcut
    • Under Run Environment > Details add the following environment variables:
    • Set QML2_IMPORT_PATH to ${QTDIR}/qml
    • Set QT_PLUGIN_PATH to ${QTDIR}/plugins
  1. After clicking Run, you can confirm the newly built executable is the one that is running from the About dialog: the version will be today’s date.

Rebuilding Dependencies

You still might need to get some dependencies from MacPorts (or Homebrew, untested).

You can use the following command to revise all of the pkg-config files to your installation path:

for f in ~/Projects/Shotcut/Contents/Frameworks/lib/pkgconfig/*.pc; do sed -i .bak -e "s,/Users/ddennedy/shotcut-sdk/shotcut/build,$HOME/Projects/Shotcut/Contents/Frameworks," -e 's,Frameworks/lib,Frameworks,' -e 's,${exec_prefix}/lib,${exec_prefix},' $f ; done

You might want to put the following into ~/.profile or a setup script:

export PATH="$HOME/Projects/Shotcut/Contents/MacOS:$PATH"
export QTDIR="$HOME/Qt/6.4.2/macos"
export PKG_CONFIG_PATH="$HOME/Projects/Shotcut/Contents/Frameworks/lib/pkgconfig"
export CFLAGS="-I/opt/local/include -DRELOCATABLE"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L/opt/local/lib/libomp"

You should make separate build directories instead of trying to reuse the in-tree build.

Search

Recent Posts

About

Shotcut is a free, open source, cross-platform video editor for Windows, Mac and Linux. Major features include support for a wide range of formats; no import required meaning native timeline editing; Blackmagic Design support for input and preview monitoring; and resolution support to 4k.

Social Links

Copyright © 2011-2024 by Meltytech, LLC
Shotcut is a trademark of Meltytech, LLC.