### Install libopenshot Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Install the compiled libopenshot library, headers, and other files to the system. The default installation path is /usr/local/, but a custom prefix can be specified. ```bash cmake --install build ``` ```bash cmake --install build --prefix /opt/libopenshot ``` -------------------------------- ### Build and Install Unittest++ Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Downloads, configures, builds, and installs the Unittest++ framework using CMake and mingw32-make, specifying a custom installation prefix. ```bash cmake -G "MSYS Makefiles" ../ -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_INSTALL_PREFIX:PATH=/usr mingw32-make install ``` -------------------------------- ### Build and Install libopenshot-audio Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Manually build and install the libopenshot-audio component. This includes creating a build directory, configuring with CMake, compiling, and installing. ```bash cd [libopenshot-audio repo folder] mkdir build cd build cmake ../ make make install ./src/openshot-audio-test-sound (This should play a test sound) ``` -------------------------------- ### Build and Install libopenshot-audio Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Compile and install the libopenshot-audio library. This process involves configuring the build with CMake, compiling the code, and then installing the library to the default location or a specified prefix. ```bash cd /path/to/cloned/libopenshot-audio # Tell CMake to examine the source tree in the current directory (./) # and write a configuration for it in a build subdirectory (build/) cmake -B build -S . # This has cmake compile all of the default build targets in build/ cmake --build build # This should play a test sound ./build/src/openshot-audio-demo # This tells CMake to install everything that was compiled in build/ cmake --install build ``` ```bash # Install to an /opt subdirectory cmake --install build --prefix /opt/libopenshot-audio # When configuring libopenshot in the next section, give it that location: cmake -B build -S . -DOpenShotAudio_ROOT=/opt/libopenshot-audio ``` -------------------------------- ### Compile and Install libopenshot on Linux Source: https://github.com/openshot/libopenshot/blob/develop/INSTALL.md Execute these commands in your terminal to build, test, and install libopenshot. Ensure you are in the libopenshot repository directory before starting. ```shell cd [libopenshot repo directory] cmake -B build -S . cmake --build build cmake --build build --target test cmake --install build ``` -------------------------------- ### Build and Install babl with Meson Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Clones the babl repository, configures the build using Meson with a specified installation prefix for either 64-bit or 32-bit MSYS2 environments, and then installs it. ```bash git clone https://gitlab.gnome.org/GNOME/babl.git cd babl meson build --prefix=C:/msys64/mingw64 (or `--prefix=C:/msys64/mingw32` for a 32 bit build) cd build Meson install ``` -------------------------------- ### Test libopenshot-audio Installation Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-MAC.md Run the provided test executable to verify that libopenshot-audio has been compiled and installed correctly. ```bash ./src/openshot-audio-test-sound (This should play a test sound) ``` -------------------------------- ### Install libopenshot Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Execute 'make install' to copy compiled binary and header files to system directories, making libopenshot available for other projects. ```bash make install ``` -------------------------------- ### Install libopenshot to system directories Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Copy compiled binaries and header files to system installation paths so other projects can locate and link against libopenshot. Also installs Python 3 bindings. ```bash mingw32-make install ``` -------------------------------- ### Install Qt6 Dependencies on Ubuntu Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Install the Qt6 development stack for building against Qt6 on Ubuntu 24.04 or newer. This is an alternative to installing Qt5 development packages. ```bash sudo apt install qt6-base-dev qt6-base-dev-tools qt6-tools-dev qt6-svg-dev ``` -------------------------------- ### Install Catch2 for Unit Tests (Ubuntu 22.04) Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Install the Catch2 testing framework from the standard Ubuntu repositories for compiling unit tests. ```bash sudo apt install catch2 ``` -------------------------------- ### Install Header Files Source: https://github.com/openshot/libopenshot/blob/develop/src/CMakeLists.txt Installs all .h files from the current directory to the include path for libopenshot. ```cmake install(DIRECTORY . COMPONENT devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot FILES_MATCHING PATTERN "*.h") ``` -------------------------------- ### Install libopenshot Dependencies on Ubuntu Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Install required development packages and libraries for libopenshot using a daily PPA. This command installs packages for Qt5. ```bash sudo add-apt-repository ppa:openshot.developers/libopenshot-daily sudo apt-get update sudo apt-get install openshot-qt \ cmake \ libx11-dev \ libasound2-dev \ libavcodec-dev \ libavdevice-dev \ libavfilter-dev \ libavformat-dev \ libavresample-dev \ libavutil-dev \ libbabl-dev \ libfdk-aac-dev \ libfreetype6-dev \ libjsoncpp-dev \ libmagick++-dev \ libopenshot-audio-dev \ libswscale-dev \ libunittest++-dev \ libxcursor-dev \ libxinerama-dev \ libxrandr-dev \ libzmq3-dev \ pkg-config \ python3-dev \ qtbase5-dev \ qtmultimedia5-dev \ swig \ python3-zmq \ python3-pyqt5.qtwebengine ``` -------------------------------- ### Install Python Bindings and Wrapper Script Source: https://github.com/openshot/libopenshot/blob/develop/bindings/python/CMakeLists.txt This installs the compiled Python wrapper target and the generated 'openshot.py' script to the determined Python module installation path. ```cmake install(TARGETS ${_pyopenshot_target} DESTINATION ${PYTHON_MODULE_PATH} ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openshot.py DESTINATION ${PYTHON_MODULE_PATH} ) ``` -------------------------------- ### Build and Install OpenCV Source: https://github.com/openshot/libopenshot/wiki/Mac-Build-Instructions After configuring with CMake, use 'make' to build OpenCV and 'make install' to install it. The '-j9' flag specifies the number of parallel jobs for faster compilation. ```bash make -j9 make install ``` -------------------------------- ### Build and Install libopenshot-audio Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-MAC.md Manually compile and install the libopenshot-audio library, as it is not available through package managers. This process involves creating a build directory, configuring with CMake, and then compiling and installing. ```bash cd [libopenshot-audio repo folder] mkdir build cd build cmake -d -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ../ (CLang must be used due to GNU incompatible Objective-C code in some of the Apple frameworks) make make install ``` -------------------------------- ### Install Dependencies with Homebrew Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-MAC.md Install necessary development tools and libraries for libopenshot using the Homebrew package manager. ```bash brew install gcc48 --enable-all-languages brew install ffmpeg brew install librsvg brew install swig brew install doxygen brew install unittest-cpp --cc=gcc-4.8. You must specify the c++ compiler with the --cc flag to be 4.7 or 4.8. brew install qt5 brew install cmake brew install zeromq brew install babl ``` -------------------------------- ### Create Example Executable Source: https://github.com/openshot/libopenshot/blob/develop/examples/CMakeLists.txt Builds the 'openshot-example' executable from Example.cpp. Defines the path to test media files for compilation. ```cmake add_executable(openshot-example Example.cpp) # Define path to test input files file(TO_NATIVE_PATH "${PROJECT_SOURCE_DIR}/examples/" TEST_MEDIA_PATH) target_compile_definitions(openshot-example PRIVATE -DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" ) # Link test executable to the new library target_link_libraries(openshot-example openshot) ``` -------------------------------- ### Create HTML Example Executable Source: https://github.com/openshot/libopenshot/blob/develop/examples/CMakeLists.txt Builds the 'openshot-html-example' executable from ExampleHtml.cpp and links it against the openshot library and Qt GUI component. ```cmake add_executable(openshot-html-example ExampleHtml.cpp) target_link_libraries(openshot-html-example openshot Qt${QT_VERSION_MAJOR}::Gui) ``` -------------------------------- ### Build and Install libopenshot-audio Source: https://github.com/openshot/libopenshot/wiki/Mac-Build-Instructions Manually build and install libopenshot-audio on macOS. This involves navigating to the repository, creating a build directory, configuring with CMake, and then compiling and installing. ```bash $ cd [libopenshot-audio repo folder] $ mkdir build $ cd build $ cmake -d -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" -DCMAKE_SHARED_LINKER_FLAGS="-stdlib=libc++" -D"CMAKE_BUILD_TYPE:STRING=Release" ../ $ make $ make install $ ./src/openshot-audio-test-sound (This should play a test sound) ``` -------------------------------- ### Install Dependencies with Homebrew Source: https://github.com/openshot/libopenshot/wiki/Mac-Build-Instructions Install required libraries and tools for libopenshot using the Homebrew package manager. Ensure your Homebrew packages are up-to-date before installing. ```bash # Download packages using Homebrew $ brew install ffmpeg librsvg swig doxygen unittest-cpp qt5 cmake zeromq libomp python@3.7 librsvg mktorrent # Download ZMQ C++ header file manually $ curl https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp --output /usr/local/include/zmq.hpp ``` -------------------------------- ### Build and Install Unittest++ Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Clones the unittest-cpp repository, builds it using CMake with MSYS Makefiles, and installs it. Requires setting the UNITTEST_DIR environment variable. ```bash git clone https://github.com/unittest-cpp/unittest-cpp.git cd unittest-cpp/builds cmake -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_INSTALL_PREFIX:PATH=/usr ../ make make install ``` -------------------------------- ### Build libopenshot-audio on Linux Source: https://github.com/openshot/libopenshot/blob/develop/INSTALL.md These commands compile and install the libopenshot-audio library. After building, you can run a test sound to verify the installation. ```sh cd [libopenshot-audio repo folder] camke -B build -S . camke --build build ./build/src/openshot-audio-test-sound (This should play a test sound) camke --install build ``` -------------------------------- ### Install OpenShot Target Source: https://github.com/openshot/libopenshot/blob/develop/src/CMakeLists.txt Installs the 'openshot' target with runtime, development, and library components to specified destinations. ```cmake install(TARGETS openshot COMPONENT runtime ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot) ``` -------------------------------- ### Install 32-Bit MSYS2 Packages Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Installs essential development tools and libraries for 32-bit Windows builds using pacman. Includes toolchain, ffmpeg, swig, cmake, doxygen, zeromq, python3 with pyqt5, pyzmq, cx_freeze, and rust. ImageMagick is optional. ```bash pacman -S --needed --disable-download-timeout \ base-devel git \ mingw-w64-i686-toolchain \ mingw32/mingw-w64-i686-ffmpeg \ mingw32/mingw-w64-i686-swig \ mingw32/mingw-w64-i686-cmake \ mingw32/mingw-w64-i686-doxygen \ mingw32/mingw-w64-i686-zeromq \ mingw32/mingw-w64-i686-python3-pyqt5 \ mingw32/mingw-w64-i686-python3-pip \ mingw32/mingw-w64-i686-python3-pyzmq \ mingw32/mingw-w64-i686-python3-cx_Freeze \ mingw32/mingw-w64-i686-rust # Install ImageMagick if needed (OPTIONAL and NOT NEEDED) pacman -S --needed mingw32/mingw-w64-i686-imagemagick ``` -------------------------------- ### Install Ruby Bindings Source: https://github.com/openshot/libopenshot/blob/develop/bindings/ruby/CMakeLists.txt Installs the compiled Ruby wrapper target to the determined Ruby module installation path. This makes the 'openshot' Ruby gem available for use. ```cmake install(TARGETS ${_rbopenshot_target} DESTINATION ${RUBY_MODULE_PATH} ) ``` -------------------------------- ### Build libopenshot on Mac Source: https://github.com/openshot/libopenshot/wiki/Mac-Build-Instructions Use these commands to configure, build, and install the libopenshot library. Ensure all dependencies are installed before running these commands. ```bash cd [libopenshot repo folder] mkdir build cd build cmake -d -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_PREFIX_PATH=/usr/local/opt/qt/ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" -DCMAKE_SHARED_LINKER_FLAGS="-stdlib=libc++" -D"CMAKE_INSTALL_RPATH_USE_LINK_PATH=1" -D"ENABLE_RUBY=0" -D"CMAKE_BUILD_TYPE:STRING=Release" ../ make ``` -------------------------------- ### Build libopenshot on Windows Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Navigate to the libopenshot repository, create a build directory, and configure the build using CMake with MSYS Makefiles. Then, compile and install the library. ```bash cd [libopenshot repo folder] mkdir build cd build cmake -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_INSTALL_PREFIX:PATH=/mingw64 ../ make make install ``` -------------------------------- ### Install 64-Bit MSYS2 Dependencies Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Install essential build tools and libraries for libopenshot on a 64-bit Windows system using pacman. This includes toolchain, ffmpeg, swig, cmake, doxygen, zeromq, python3 with PyQt5, pyzmq, cx_Freeze, and rust. ```bash pacman -S --needed --disable-download-timeout \ base-devel git \ mingw-w64-x86_64-toolchain \ mingw64/mingw-w64-x86_64-ffmpeg \ gw64/mingw-w64-x86_64-swig \ gw64/mingw-w64-x86_64-cmake \ gw64/mingw-w64-x86_64-doxygen \ gw64/mingw-w64-x86_64-zeromq \ gw64/mingw-w64-x86_64-python3-pyqt5 \ gw64/mingw-w64-x86_64-python3-pip \ gw64/mingw-w64-x86_64-python3-pyzmq \ gw64/mingw-w64-x86_64-python3-cx_Freeze \ gw64/mingw-w64-x86_64-rust ``` -------------------------------- ### Manually Install Catch2 for Unit Tests (Ubuntu 20.04) Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Manually install Catch2 version 2.13.0 from a downloaded .deb package for older Ubuntu versions that do not have it in their standard repositories. ```bash wget https://launchpad.net/ubuntu/+archive/primary/+files/catch2_2.13.0-1_all.deb sudo dpkg -i catch2_2.13.0-1_all.deb ``` -------------------------------- ### Build Resvg with Qt Backend Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Clones the resvg repository and builds it with the 'qt-backend' feature using Cargo. Supports both 64-bit and 32-bit Qt installations. Installs the DLL and headers. ```bash git clone https://github.com/RazrFalcon/resvg cd resvg/capi QT_DIR="C:\\msys64\\mingw64\\" cargo build --verbose --release --features="qt-backend" **OR** QT_DIR="C:\\msys32\\mingw32\\" cargo build --verbose --release --features="qt-backend" cd ../ # copy all required files into the system directories cp target/release/resvg.dll /usr/lib/ mkdir -p /usr/include/resvg/ cp capi/include/*.h /usr/include/resvg/ ``` -------------------------------- ### Install ZMQ++ Header Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Instructs to manually download and copy the zmq.hpp header file into the MSYS2 mingw64 include directory. ```bash NOTE: Download and copy zmq.hpp into the /c/msys64/mingw64/include/ folder ``` -------------------------------- ### Install 64-Bit MSYS2 Dependencies Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Installs a comprehensive set of development tools and libraries required for building OpenShot on a 64-bit Windows system using MSYS2. ```bash pacman -S --needed --noconfirm \ mingw-w64-x86_64-rust base-devel mingw-w64-x86_64-toolchain \ mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-qt5 mingw-w64-x86_64-python3-pyqt5 \ mingw-w64-x86_64-swig mingw-w64-x86_64-cmake mingw-w64-x86_64-doxygen \ mingw-w64-x86_64-python3-pip mingw-w64-i686-zeromq mingw-w64-x86_64-python3-pyzmq \ mingw-w64-x86_64-python3-cx_Freeze mingw-w64-x86_64-ninja mingw-w64-x86_64-catch \ mingw-w64-x86_64-python3-PyOpenGL mingw-w64-clang-x86_64-python-pyopengl-accelerate \ mingw-w64-x86_64-python-pyopengl-accelerate mingw-w64-x86_64-python-pywin32 git # Install ImageMagick if needed (OPTIONAL and NOT NEEDED) pacman -S mingw64/mingw-w64-x86_64-imagemagick ``` -------------------------------- ### Build and Install OpenCV Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Clones OpenCV and its contrib modules, checks out specific versions, configures the build with CMake for release, Python 3 support, and MSYS Makefiles, then builds and installs. ```bash git clone https://github.com/opencv/opencv cd opencv/ git checkout '4.3.0' cd .. git clone https://github.com/opencv/opencv_contrib cd opencv_contrib/ git checkout '4.3.0' cd .. cd opencv mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=OFF -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D OPENCV_GENERATE_PKGCONFIG=ON -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=ON -G "MSYS Makefiles" .. make -j4 -i (-i ignores errors on MSYS2 which happens for some reason) make install -i ``` -------------------------------- ### Install libopenshot Dependencies on Ubuntu Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Install required development packages for libopenshot using a daily PPA. Includes core libraries, multimedia codecs, and development tools. ```bash sudo add-apt-repository ppa:openshot.developers/libopenshot-daily sudo apt-get update sudo apt-get install \ cmake \ pkg-config \ libopenshot-audio-dev \ libx11-dev \ libfreetype6-dev \ libasound2-dev \ libavcodec-dev \ libavformat-dev \ libavutil-dev \ libswresample-dev \ libswscale-dev \ libpostproc-dev \ libfdk-aac-dev \ libjsoncpp-dev \ libzmq3-dev \ qtbase5-dev \ libqt5svg5-dev \ libbabl-dev \ libopencv-dev \ libprotobuf-dev \ protobuf-compiler \ python3-dev \ swig \ libmagick++-dev ``` -------------------------------- ### Install Optional OpenShot Dependencies Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Install additional packages required for building libopenshot for use with OpenShot or for specific Python integrations. ```bash sudo apt-get install \ openshot-qt \ python3-zmq \ python3-pyqt5.qtwebengine ``` -------------------------------- ### Install 32-Bit MSYS2 Dependencies Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Installs a comprehensive set of development tools and libraries required for building OpenShot on a 32-bit Windows system using MSYS2. ```bash pacman -S --needed --noconfirm \ mingw-w64-i686-rust mingw-w64-i686-toolchain mingw-w64-i686-ffmpeg \ mingw-w64-i686-qt5 mingw-w64-i686-python3-pyqt5 mingw-w64-i686-swig \ mingw-w64-i686-cmake mingw-w64-i686-doxygen mingw-w64-i686-python3-pip \ mingw-w64-i686-zeromq mingw-w64-i686-python3-pyzmq mingw-w64-i686-python3-cx_Freeze \ mingw-w64-i686-ninja mingw-w64-i686-catch mingw-w64-i686-python-pyopengl \ mingw-w64-i686-python-pyopengl-accelerate mingw-w64-i686-python-pywin32 # Install ImageMagick if needed (OPTIONAL and NOT NEEDED) pacman -S mingw32/mingw-w32-x86_32-imagemagick ``` -------------------------------- ### Install FFmpeg from Source on Mac Source: https://github.com/openshot/libopenshot/wiki/Mac-Build-Instructions If packaging OpenShot for Mac, you may need to install a custom version of FFmpeg. This process involves uninstalling the existing FFmpeg, editing its formula to remove specific dependencies (like tesseract), and then reinstalling from source. ```bash brew uninstall ffmpeg brew edit ffmpeg # remove lines related to tesseract brew install ffmpeg -s # install ffmpeg from source (with no tesseract dependency) ``` -------------------------------- ### Configure libopenshot Build with Custom Qt Path Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Configure the libopenshot build process using CMake, specifying a custom installation path for Qt 5. This is necessary if Qt is installed in a non-standard location. ```bash cmake -B build -S . -DCMAKE_PREFIX_PATH=$HOME/Qt/5.15.0/gcc_64/ ``` -------------------------------- ### Build and Install libopenshot-audio Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Compiles the libopenshot-audio library using CMake and make within the MSYS2 environment. Requires setting the LIBOPENSHOT_AUDIO_DIR environment variable. ```bash cd [libopenshot-audio repo folder] mkdir build cd build cmake -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_INSTALL_PREFIX:PATH=/usr ../ make make install openshot-audio-test-sound (This should play a test sound) ``` -------------------------------- ### Clone and build OpenCV Source: https://github.com/openshot/libopenshot/wiki/Mac-Build-Instructions Steps to clone the OpenCV and opencv_contrib repositories, checkout specific versions, and prepare for building. This includes installing Python build server dependencies. ```bash git clone https://github.com/opencv/opencv cd opencv/ git checkout '4.3.0' cd .. git clone https://github.com/opencv/opencv_contrib cd opencv_contrib/ git checkout '4.3.0' cd .. cd opencv mkdir build cd build/ # NOTE: If re-building DELETE THE CONTENTS OF THIS FOLDER # Install Python build server dependencies python3 -m pip install numpy zmq tinys3 github3.py cx_Freeze ``` -------------------------------- ### Compile libopenshot Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-MAC.md Execute this command after configuring the build to compile the library. Resolve any dependency errors by installing missing packages and re-running. ```bash make ``` -------------------------------- ### Configure libopenshot Build with CMake Flags Source: https://github.com/openshot/libopenshot/wiki/Linux-Build-Instructions Example of passing optional CMake flags to adjust build options, such as enabling HDRI for ImageMagick or disabling tests. ```bash cmake -DMAGICKCORE_HDRI_ENABLE=1 -DENABLE_TESTS=1 ../ ``` -------------------------------- ### Set up Qt5 and PyQt5 for openshot-qt Source: https://github.com/openshot/libopenshot/wiki/Mac-Build-Instructions Commands to set up a specific version of Qt5 and compile SIP and PyQt5 with custom configurations. This is necessary when Homebrew's PyQt does not support QtWebEngine. ```bash mkdir /usr/local/qt5.15.x/ cd /usr/local/qt5.15.x/ # Extract the Qt, Sip, PyQt, and PyQtWebEngine folders to this location. # Update Mac Deployment Target # sudo nano qt5.15/clang_64/mkspecs/macx-clang/qmake.conf # sudo nano qt5.15/clang_64/mkspecs/macx-g++/qmake.conf QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13 QMAKE_MAC_SDK = macosx10.13 load(qt_config) # Compile SIP with PyQt5 support (and specific deployment target) # SIP 4.19.23 required python3 configure.py --deployment-target 10.13 -p macx-g++ --sip-module PyQt5.sip make make install # Compile PyQt5 (with custom SIP and custom Qt install locations) QMAKESPEC="macx-g++" ARCHFLAGS="-arch x86_64" MACOSX_DEPLOYMENT_TARGET=10.13 python3 configure.py -q /usr/local/qt5.15.x/qt5.15/5.15.0/clang_64/bin/qmake --disable "QtWebKitWidgets QtWebKit QtPositioning QtTest EngionIo" --sip "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/bin/sip" make make install # Compile PyQtWebEngine (separate download) QMAKESPEC="macx-g++" ARCHFLAGS="-arch x86_64" MACOSX_DEPLOYMENT_TARGET=10.13 python3 configure.py -q /usr/local/qt5.15.x/qt5.15/5.15.0/clang_64/bin/qmake --sip "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/bin/sip" # Remove port_v2/__init__.py rm /usr/local/lib/python3.7/site-packages/PyQt5/uic/port_v2/__init__.py # Fix RPath for installed PyQt5 libraries # by creating symlinks inside the /site-packages/PyQt5/lib/ folder cd [openshot-qt repo folder] python3 installer/fix_qt5_rpath.py ``` -------------------------------- ### Compile libopenshot Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Navigate to the libopenshot repository, create a build directory, and run CMake and Make to compile the library. Repeat if dependency errors occur. ```bash cd [libopenshot repo directory] mkdir -p build cd build cmake ../ make ``` -------------------------------- ### Install Python PIP Dependencies Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Installs required Python packages using pip3 for OpenShot development. Ensure Python 3.7 is active if downgrading. ```bash pip3 install httplib2 tinys3 github3.py==0.9.6 requests ``` -------------------------------- ### Downgrade MSYS2 Python to 3.7 Source: https://github.com/openshot/libopenshot/wiki/Windows-Build-Instructions Downloads and installs Python 3.7.5 for MSYS2, necessary for compatibility with prebuilt OpenShot installations when using a self-built libopenshot.dll. ```bash curl -O http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python3-3.7.5-1-any.pkg.tar.xz pacman -U mingw-w64-x86_64-python3-3.7.5-1-any.pkg.tar.xz ``` -------------------------------- ### Build libopenshot-audio on Windows with MinGW Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Compile libopenshot-audio from source using CMake and MinGW Makefiles. Works in both Windows command prompt and MSYS2 prompt. ```bash cd [libopenshot-audio repo folder] mkdir build cd build cmake -G "MinGW Makefiles" ../ mingw32-make mingw32-make install openshot-audio-test-sound (This should play a test sound) ``` -------------------------------- ### Generate libopenshot Documentation Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Run 'make doc' to automatically generate HTML documentation for libopenshot using Doxygen. The output is located in build/doc/html/. ```bash make doc ``` -------------------------------- ### Create Player Executable Source: https://github.com/openshot/libopenshot/blob/develop/examples/CMakeLists.txt Builds the 'openshot-player' executable from qt-demo/main.cpp. Enables AUTOMOC and WIN32_EXECUTABLE properties. ```cmake add_executable(openshot-player qt-demo/main.cpp) set_target_properties(openshot-player PROPERTIES AUTOMOC ON WIN32_EXECUTABLE ON ) # Link test executable to the new library target_link_libraries(openshot-player openshot) ``` -------------------------------- ### Install Python PIP Dependencies Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Installs various Python libraries required for OpenShot's functionality, including HTTP clients, cloud storage access, and GUI components. ```bash pip3 install httplib2 pip3 install slacker pip3 install tinys3 pip3 install github3.py pip3 install requests pip3 install meson pip3 install PyOpenGL pip3 install PyOpenGL-accelerate ``` -------------------------------- ### Determine Python Module Installation Path Source: https://github.com/openshot/libopenshot/blob/develop/bindings/python/CMakeLists.txt This section determines the installation path for Python modules, checking environment variables and system-specific defaults, falling back to calculated paths if necessary. ```cmake if (NOT DEFINED PYTHON_MODULE_PATH AND DEFINED $ENV{PYTHON_MODULE_PATH}) set(PYTHON_MODULE_PATH $ENV{PYTHON_MODULE_PATH}) endif() if (NOT DEFINED PYTHON_MODULE_PATH) if (WIN32 OR APPLE) set (PYTHON_MODULE_PATH "python") endif() if (UNIX AND NOT APPLE) set(PYTHON_MODULE_PATH "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages") if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${PYTHON_MODULE_PATH}") execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; p=sysconfig.get_path('platlib', scheme='posix_prefix'); p=p[5:] if p.startswith('/usr/') else p.lstrip('/'); print(p)" OUTPUT_VARIABLE PYTHON_MODULE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) endif() endif() endif() message(STATUS "PYTHON_MODULE_PATH: ${CMAKE_INSTALL_PREFIX}/${PYTHON_MODULE_PATH}") ``` -------------------------------- ### Run Unit Tests for libopenshot Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Execute the 'make test' command in the build directory to run all unit tests and verify the library's functionality. ```bash make test ``` -------------------------------- ### Determine Ruby Module Installation Path Source: https://github.com/openshot/libopenshot/blob/develop/bindings/ruby/CMakeLists.txt Determines the installation path for the Ruby module. It first checks for a predefined RUBY_MODULE_PATH variable, then falls back to environment variables or default paths based on the operating system. For Unix-like systems, it dynamically finds the path using the Ruby executable. ```cmake if (NOT DEFINED RUBY_MODULE_PATH AND DEFINED $ENV{RUBY_MODULE_PATH}) set(RUBY_MODULE_PATH $ENV{RUBY_MODULE_PATH}) endif() if (NOT DEFINED RUBY_MODULE_PATH) if (WIN32 OR APPLE) set (RUBY_MODULE_PATH "ruby") endif() if (UNIX AND NOT APPLE) ### FIND THE RUBY INTERPRETER (AND THE LOAD_PATH FOLDER) execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "dir = RbConfig::CONFIG['vendorarchdir']" -e "dir.start_with?(RbConfig::CONFIG['prefix']) && dir.sub!(RbConfig::CONFIG['prefix']+'/', '')" -e "p dir" OUTPUT_VARIABLE RUBY_MODULE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE ) # Ruby quotes its output strings string(REPLACE "\"" "" RUBY_MODULE_PATH "${RUBY_MODULE_PATH}") endif() endif() ``` -------------------------------- ### Configure and Build libopenshot with CMake Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-MAC.md Use this command to configure the build with specific compiler and library paths. Adjust paths for Qt and Python to match your system. ```bash $ cd [libopenshot repo folder] $ mkdir build $ cd build $ cmake -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.4.2/ -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/include/python3.3m/ -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/ ../ -D"CMAKE_BUILD_TYPE:STRING=Debug" ``` -------------------------------- ### Verify Python Bindings Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-MAC.md Import the openshot module in a Python interpreter to confirm that the Python bindings were installed correctly. ```python python3 (or python) >>> import openshot ``` -------------------------------- ### Build and Install ReSVG Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-WINDOWS.md Clones the ReSVG repository, builds the C API release version using Cargo for either 64-bit or 32-bit MSYS2 environments, and then copies the necessary DLL and header files to system directories. ```bash git clone https://github.com/RazrFalcon/resvg cd resvg/crates/c-api QT_DIR="C:\\msys64\\mingw64\" cargo build --verbose --release **OR** QT_DIR="C:\\msys64\\mingw32\" cargo build --verbose --release cd ../../ # copy all required files into the system directories cp target/release/resvg.dll /usr/lib/ mkdir -p /usr/include/resvg/ cp crates/c-api/*.h /usr/include/resvg/ ``` -------------------------------- ### Verify Python 3 Bindings Source: https://github.com/openshot/libopenshot/blob/develop/doc/INSTALL-LINUX.md Import the 'openshot' module in a Python 3 interpreter to confirm that the Python bindings were installed correctly. ```python python3 >>> import openshot ```