diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77189eb..e8c0711 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: key: ${{ steps.restore-cache.outputs.cache-primary-key }} - name: Build/test mediaFX run: | - MEDIAFX_TEST= builders/Darwin/mediafx-build.sh + MEDIAFX_TEST= builders/mediafx-build.sh - name: Upload Failed Artifacts if: failure() uses: actions/upload-artifact@v3 diff --git a/CMakeLists.txt b/CMakeLists.txt index 76d9e5b..c8f6d1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.21) project(mediaFX VERSION 1.0.0 LANGUAGES CXX) -find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia Qml Quick ShaderTools QUIET OPTIONAL_COMPONENTS Quick3D WebEngineQuick) +find_package(Qt6 6.6 REQUIRED COMPONENTS Core Gui Multimedia Qml Quick ShaderTools QUIET OPTIONAL_COMPONENTS Quick3D WebEngineQuick) qt_standard_project_setup() qt_policy(SET QTP0001 NEW) diff --git a/builders/Darwin/env b/builders/Darwin/env new file mode 100644 index 0000000..a029c72 --- /dev/null +++ b/builders/Darwin/env @@ -0,0 +1,5 @@ +# Copyright (C) 2024 Andrew Wason +# SPDX-License-Identifier: GPL-3.0-or-later + +export QTDIR=${BUILD_ROOT}/installed/${QT_VER}/macos +export PATH=${QTDIR}/bin:$PATH \ No newline at end of file diff --git a/builders/Darwin/install-qt6.sh b/builders/Darwin/install-qt6.sh index 3331d00..07c0726 100755 --- a/builders/Darwin/install-qt6.sh +++ b/builders/Darwin/install-qt6.sh @@ -6,11 +6,12 @@ set -u CURRENT=${BASH_SOURCE%/*} source "$CURRENT/../versions" +INSTALLDIR=${QTDIR%/*/*} ( - mkdir -p "${BUILD_ROOT:?}" && cd "$BUILD_ROOT" - python3 -m venv --clear "build/qtvenv" || exit 1 - "build/qtvenv/bin/pip" install --upgrade --upgrade-strategy eager aqtinstall || exit 1 - "build/qtvenv/bin/python" -m aqt install-qt mac desktop ${QT_VER} --modules qtmultimedia qtquick3d qtshadertools qtquicktimeline qtquickeffectmaker -O "$BUILD_ROOT/installed" || exit 1 - "build/qtvenv/bin/python" -m aqt install-tool mac desktop tools_qtcreator_gui qt.tools.qtcreator_gui -O "$BUILD_ROOT/installed/${QT_VER}/macos/bin" || exit 1 - "build/qtvenv/bin/python" -m aqt install-src mac desktop ${QT_VER} --archives qtbase qtdeclarative qtmultimedia qtquicktimeline -O "$BUILD_ROOT/installed" || exit 1 + cd "$BUILD_ROOT" + python3 -m venv --clear "qtvenv" || exit 1 + "qtvenv/bin/pip" install --upgrade --upgrade-strategy eager aqtinstall || exit 1 + "qtvenv/bin/python" -m aqt install-qt mac desktop ${QT_VER} --modules qtmultimedia qtquick3d qtshadertools qtquicktimeline qtquickeffectmaker -O "${INSTALLDIR}" || exit 1 + "qtvenv/bin/python" -m aqt install-tool mac desktop tools_qtcreator_gui qt.tools.qtcreator_gui -O "${QTDIR}/bin" || exit 1 + "qtvenv/bin/python" -m aqt install-src mac ${QT_VER} --archives qtbase qtdeclarative qtmultimedia qtquicktimeline -O "${INSTALLDIR}" || exit 1 ) diff --git a/builders/Darwin/mediafx-build.sh b/builders/Darwin/mediafx-build.sh deleted file mode 100755 index 7ca63e3..0000000 --- a/builders/Darwin/mediafx-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2023 Andrew Wason -# SPDX-License-Identifier: GPL-3.0-or-later - -CURRENT=${BASH_SOURCE%/*} -source "$CURRENT/../versions" -INSTALL_ROOT="${BUILD_ROOT:?}/installed/${QT_VER:?}/macos" -BUILD_TYPE=${BUILD_TYPE:-Release} - -MEDIAFX_ROOT="$(cd "$(dirname "${CURRENT}")/../"; pwd)" - -MEDIAFX_BUILD="${BUILD_ROOT}/build/mediafx/${BUILD_TYPE}" -mkdir -p "$MEDIAFX_BUILD" - -PATH=${INSTALL_ROOT:?}/bin:$PATH - -cd "$MEDIAFX_BUILD" -(cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE --install-prefix "$INSTALL_ROOT" "$MEDIAFX_ROOT" && cmake --build . && cmake --install .) || exit 1 -if [[ -v MEDIAFX_TEST ]]; then - make test CTEST_OUTPUT_ON_FAILURE=1 ARGS="${MEDIAFX_TEST}" || exit 1 -fi \ No newline at end of file diff --git a/builders/Linux/Dockerfile b/builders/Linux/Dockerfile index 650be51..58ae432 100644 --- a/builders/Linux/Dockerfile +++ b/builders/Linux/Dockerfile @@ -37,7 +37,7 @@ RUN apt-get -y update \ fontconfig fonts-liberation COPY --from=build /usr/local/Qt /usr/local/Qt/ - +ENV QTDIR /usr/local/Qt/${QT_VER}/gcc_64 ENV PATH /usr/local/Qt/${QT_VER}/gcc_64/bin:$PATH ENV QT_VER=${QT_VER} @@ -51,4 +51,4 @@ WORKDIR /mediafx/build/Linux COPY entrypoint.sh xvfb.sh /entrypoint/ ENTRYPOINT ["/entrypoint/entrypoint.sh"] -CMD ["/mediafx/builders/Linux/mediafx-build.sh"] \ No newline at end of file +CMD ["/mediafx/builders/mediafx-build.sh"] \ No newline at end of file diff --git a/builders/Linux/docker-run.sh b/builders/Linux/docker-run.sh index 1bac644..a1c1add 100755 --- a/builders/Linux/docker-run.sh +++ b/builders/Linux/docker-run.sh @@ -2,7 +2,7 @@ # Copyright (C) 2023 Andrew Wason # SPDX-License-Identifier: GPL-3.0-or-later -MOUNT="$(dirname $(dirname "$(cd "${BASH_SOURCE%/*}"; pwd)"))" +MOUNT="$(cd "${BASH_SOURCE%/*/*/*}"; pwd)" # opengl or vulkan TARGET=${TARGET:-opengl} diff --git a/builders/Linux/env b/builders/Linux/env new file mode 100644 index 0000000..5f1d7bf --- /dev/null +++ b/builders/Linux/env @@ -0,0 +1,6 @@ +# Copyright (C) 2024 Andrew Wason +# SPDX-License-Identifier: GPL-3.0-or-later + +export GALLIUM_DRIVER=softpipe +export LIBGL_ALWAYS_SOFTWARE=1 +export DRI_NO_MSAA=1 \ No newline at end of file diff --git a/builders/Linux/iwyu.sh b/builders/Linux/iwyu.sh index f282eda..6a18fd4 100755 --- a/builders/Linux/iwyu.sh +++ b/builders/Linux/iwyu.sh @@ -4,10 +4,10 @@ set -e -sudo mkdir -p /mediafx/build/Linux && sudo chown mediafx /mediafx/build/ /mediafx/build/Linux +sudo mkdir -p /mediafx/build/Linux cd /mediafx/build/Linux if [ ! -f "qt${QT_VER}.imp" ]; then curl -O https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/clang_13/mapgen/iwyu-mapgen-qt.py - python3 iwyu-mapgen-qt.py /usr/local/Qt/${QT_VER}/gcc_64/include > qt${QT_VER}.imp + python3 iwyu-mapgen-qt.py ${QTDIR}/include > qt${QT_VER}.imp fi -CC="clang-13" CXX="clang++-13" cmake -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="/usr/bin/iwyu;-Xiwyu;--mapping_file=/mediafx/build/Linux/qt${QT_VER}.imp;-Xiwyu;--cxx17ns;-Xiwyu;--no_comments" --install-prefix /usr/local/Qt/${QT_VER}/gcc_64 ../.. && exec cmake --build . --parallel 4 +CC="clang-13" CXX="clang++-13" cmake -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="/usr/bin/iwyu;-Xiwyu;--mapping_file=/mediafx/build/Linux/qt${QT_VER}.imp;-Xiwyu;--cxx17ns;-Xiwyu;--no_comments" --install-prefix ${QTDIR} ../.. && exec cmake --build . --parallel 4 diff --git a/builders/Linux/mediafx-build.sh b/builders/Linux/mediafx-build.sh deleted file mode 100755 index 751258f..0000000 --- a/builders/Linux/mediafx-build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2023 Andrew Wason -# SPDX-License-Identifier: GPL-3.0-or-later - -CURRENT=${BASH_SOURCE%/*} -source "$CURRENT/../versions" -BUILD_TYPE=${BUILD_TYPE:-Release} -MEDIAFX_BUILD="${BUILD_ROOT:?}/${BUILD_TYPE}" -mkdir -p "$MEDIAFX_BUILD" -cd "$MEDIAFX_BUILD" -(cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE --install-prefix /usr/local/Qt/${QT_VER:?}/gcc_64 ../../.. && cmake --build . && sudo cmake --install .) || exit 1 -if [[ -v MEDIAFX_TEST ]]; then - export GALLIUM_DRIVER=softpipe - export LIBGL_ALWAYS_SOFTWARE=1 - export DRI_NO_MSAA=1 - make test CTEST_OUTPUT_ON_FAILURE=1 ARGS="${MEDIAFX_TEST}" || exit 1 -fi \ No newline at end of file diff --git a/builders/mediafx-build.sh b/builders/mediafx-build.sh new file mode 100755 index 0000000..09061ef --- /dev/null +++ b/builders/mediafx-build.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Copyright (C) 2023 Andrew Wason +# SPDX-License-Identifier: GPL-3.0-or-later + +CURRENT=${BASH_SOURCE%/*} +source "$CURRENT/versions" + +BUILD_TYPE=${BUILD_TYPE:-Release} +MEDIAFX_BUILD="${BUILD_ROOT}/${BUILD_TYPE}" +mkdir -p "$MEDIAFX_BUILD" +cd "$MEDIAFX_BUILD" +(cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE --install-prefix "${QTDIR}" ../../.. && cmake --build . && sudo cmake --install .) || exit 1 +if [[ -v MEDIAFX_TEST ]]; then + make test CTEST_OUTPUT_ON_FAILURE=1 ARGS="${MEDIAFX_TEST}" || exit 1 +fi \ No newline at end of file diff --git a/builders/versions b/builders/versions index 71e5fde..81ef33d 100644 --- a/builders/versions +++ b/builders/versions @@ -2,3 +2,4 @@ export QT_VER=6.6.1 BUILD_ROOT="${BASH_SOURCE%/*}/../build/$(uname)" mkdir -p "${BUILD_ROOT}" export BUILD_ROOT=$(cd "${BUILD_ROOT}"; pwd) +source "${BASH_SOURCE%/*}/$(uname)/env" diff --git a/src/MediaFX/session.cpp b/src/MediaFX/session.cpp index 0cb3fae..6288e29 100644 --- a/src/MediaFX/session.cpp +++ b/src/MediaFX/session.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include