diff --git a/.github/workflows/qt-linux.yml b/.github/workflows/qt-linux.yml index 92a2e9dd4..0c757641a 100644 --- a/.github/workflows/qt-linux.yml +++ b/.github/workflows/qt-linux.yml @@ -1,33 +1,59 @@ # Build a Qt project on Ubuntu -name: Build on Ubuntu (old) +name: Build on Ubuntu on: push: - branches: [ develop ] + branches: [ dev ] pull_request: - branches: [ develop ] + branches: [ dev ] jobs: build: - if: false # Disable for now - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 + - name: Install Qt uses: jurplel/install-qt-action@v4 with: + cache: true version: '5.12.12' host: 'linux' target: 'desktop' - modules: 'gui core serialport network opengl xml' + install-deps: true + modules: 'qtwebengine' + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + liblo-dev liblo-tools \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-libav \ + gstreamer1.0-vaapi \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-base-apps \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-x \ + gstreamer1.0-tools + - name: qmake run: qmake . + - name: make - run: make + run: make -j$(nproc) + - name: make check run: make check + - uses: actions/upload-artifact@v7 + with: + name: linux-build + path: mapmap + # - name: make distcheck # run: make distcheck diff --git a/.github/workflows/qt-macos.yml b/.github/workflows/qt-macos.yml index a6f4f986c..a96c516e6 100644 --- a/.github/workflows/qt-macos.yml +++ b/.github/workflows/qt-macos.yml @@ -3,30 +3,106 @@ name: Build on macOS on: push: - branches: [ develop ] + branches: [ dev ] pull_request: - branches: [ develop ] + branches: [ dev ] jobs: build: - if: false # Disable for now - + if: false # ARM64 cannot build QT5 apps runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 + + - name: Cache Homebrew + id: cache-brew + uses: actions/cache/restore@v5 + with: + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/pkg-config + /opt/homebrew/Cellar/gstreamer + /opt/homebrew/Cellar/gst-plugins-base + /opt/homebrew/Cellar/gst-plugins-good + /opt/homebrew/Cellar/gst-plugins-bad + /opt/homebrew/Cellar/gst-plugins-ugly + /opt/homebrew/Cellar/gst-libav + /opt/homebrew/Cellar/orc + key: brew-gstreamer-${{ runner.os }}-v1 + - name: Install Qt uses: jurplel/install-qt-action@v4 with: + cache: true version: '5.12.12' + host: 'mac' target: 'desktop' - modules: 'gui core serialport network opengl xml' + install-deps: true + modules: 'qtwebengine' + + - name: Install dependencies + if: steps.cache-brew.outputs.cache-hit != 'true' + run: | + brew install pkg-config orc \ + gstreamer \ + gst-plugins-base \ + gst-plugins-good \ + gst-plugins-bad \ + gst-plugins-ugly \ + gst-libav + + - name: Set environment + run: | + GST_PC=$(find /opt/homebrew/Cellar/gstreamer -name '*.pc' | head -1 | xargs dirname) + ORC_PC=$(find /opt/homebrew/Cellar/orc -name '*.pc' 2>/dev/null | head -1 | xargs dirname) + echo "PKG_CONFIG_PATH=${GST_PC}:${ORC_PC}:${PKG_CONFIG_PATH:-}" >> $GITHUB_ENV + + - name: Fake GStreamer framework + run: | + GST_CELLAR=$(find /opt/homebrew/Cellar/gstreamer -maxdepth 1 -mindepth 1 -type d | head -1) + sudo mkdir -p "/Library/Frameworks/GStreamer.framework/Versions/1.0" + sudo ln -sf "${GST_CELLAR}/lib/libgstreamer-1.0.dylib" "/Library/Frameworks/GStreamer.framework/GStreamer" + sudo ln -sf "${GST_CELLAR}/lib/libgstreamer-1.0.dylib" "/Library/Frameworks/GStreamer.framework/Versions/1.0/GStreamer" + sudo mkdir -p "/Library/Frameworks/GStreamer.framework/Versions/1.0/Headers" + sudo ln -sf "${GST_CELLAR}/include/gstreamer-1.0/gst" "/Library/Frameworks/GStreamer.framework/Versions/1.0/Headers/gst" + - name: qmake - run: qmake . + run: | + GST_FLAGS=$(pkg-config --cflags gstreamer-1.0 gstreamer-app-1.0 gstreamer-pbutils-1.0) + GST_LIBS=$(pkg-config --libs gstreamer-1.0 gstreamer-app-1.0 gstreamer-pbutils-1.0) + qmake . \ + "QMAKE_CXXFLAGS+=${GST_FLAGS}" \ + "QMAKE_LFLAGS+=${GST_LIBS}" \ + "LIBS-=-F /Library/Frameworks/ -framework GStreamer" \ + "LIBS-=-framework OpenGL -framework GLUT" + - name: make - run: make + run: make -j$(sysctl -n hw.logicalcpu) + - name: make check run: make check + - uses: actions/upload-artifact@v4 + with: + name: macos-build + path: MapMap + # - name: make distcheck # run: make distcheck + + - name: Always cache brew + if: always() && steps.cache-brew.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + key: ${{ steps.cache-brew.outputs.cache-primary-key }} + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/pkg-config + /opt/homebrew/Cellar/gstreamer + /opt/homebrew/Cellar/gst-plugins-base + /opt/homebrew/Cellar/gst-plugins-good + /opt/homebrew/Cellar/gst-plugins-bad + /opt/homebrew/Cellar/gst-plugins-ugly + /opt/homebrew/Cellar/gst-libav + /opt/homebrew/Cellar/orc diff --git a/.github/workflows/qt-windows.yml b/.github/workflows/qt-windows.yml index 563fb6ab6..343c9e6f5 100644 --- a/.github/workflows/qt-windows.yml +++ b/.github/workflows/qt-windows.yml @@ -3,32 +3,75 @@ name: Build on Windows on: push: - branches: [ develop ] + branches: [ dev ] pull_request: - branches: [ develop ] + branches: [ dev ] jobs: build: - if: false # Disable for now - - runs-on: windows-2019 + runs-on: windows-2022 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + - name: Install Qt - uses: jurplel/install-qt-action@v2 + uses: jurplel/install-qt-action@v4 with: + cache: true version: '5.12.12' host: 'windows' target: 'desktop' arch: 'win64_msvc2017_64' - modules: 'gui core serialport network opengl xml' + install-deps: true + modules: 'qtwebengine' + + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + sdk: 10.0.22621.0 + + - name: Cache GStreamer + id: cache-gstreamer + uses: actions/cache/restore@v5 + with: + path: C:\Program Files\gstreamer + key: gstreamer-1.0-msvc-x86_64 + - name: Install GStreamer + if: steps.cache-gstreamer.outputs.cache-hit != 'true' + run: choco install gstreamer gstreamer-devel -y + - name: Set GStreamer env + run: echo "GSTREAMER_1_0_ROOT_X86=C:\Program Files\gstreamer\1.0\msvc_x86_64" >> $env:GITHUB_ENV + - name: qmake - run: qmake . + run: qmake . -spec win32-msvc + - name: make - run: make + run: nmake + - name: make check - run: make check + run: nmake check + + - name: Deploy Qt + run: windeployqt --release --no-system-d3d-compiler "MapMap\MapMap.exe" + + - name: Copy GStreamer DLLs + run: | + Copy-Item "C:\Program Files\gstreamer\1.0\msvc_x86_64\bin\*.dll" -Destination "MapMap\" -Force + New-Item -ItemType Directory -Force -Path "MapMap\plugins" + Copy-Item "C:\Program Files\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0\*.dll" -Destination "MapMap\plugins\" -Force + + - uses: actions/upload-artifact@v7 + with: + name: windows-build + path: MapMap/ # - name: make distcheck # run: make distcheck + + - name: Always cache gstreamer + if: always() && steps.cache-gstreamer.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + key: ${{ steps.cache-gstreamer.outputs.cache-primary-key }} + path: C:\Program Files\gstreamer diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml index bdfa0ac97..49b3c3d94 100644 --- a/.github/workflows/ubuntu-build.yml +++ b/.github/workflows/ubuntu-build.yml @@ -3,17 +3,18 @@ name: Build on Ubuntu on: push: - branches: [ develop, master ] + branches: [ dev, master ] pull_request: - branches: [ develop, master ] + branches: [ dev, master ] jobs: build: + if: false # does not need to be ran runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install system dependencies run: | @@ -52,3 +53,8 @@ jobs: - name: Run tests run: make check || true + + - uses: actions/upload-artifact@v4 + with: + name: linux-build + path: mapmap diff --git a/mapmap.pro b/mapmap.pro index e6e3e16a2..82773b4b6 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -9,6 +9,7 @@ VERSION = 0.6.3 TARGET = mapmap DEFINES += UNICODE QT_THREAD_SUPPORT QT_CORE_LIB QT_GUI_LIB QT_MESSAGELOGCONTEXT +win32: DEFINES += NOMINMAX WIN32_LEAN_AND_MEAN QOSC_LIBRARY include(src/core/core.pri) include(src/shape/shape.pri) @@ -56,6 +57,14 @@ unix:!macx { QMAKE_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 QMAKE_CXXFLAGS += -Wno-expansion-to-defined } +win32 { + GSTREAMER_ROOT = $$(GSTREAMER_1_0_ROOT_MSVC_X86_64) + INCLUDEPATH += $$GSTREAMER_ROOT/include/gstreamer-1.0 + INCLUDEPATH += $$GSTREAMER_ROOT/include/glib-2.0 + INCLUDEPATH += $$GSTREAMER_ROOT/lib/glib-2.0/include + LIBS += -L$$GSTREAMER_ROOT/lib -lgstreamer-1.0 -lglib-2.0 -lgobject-2.0 + QMAKE_CXXFLAGS += /FI"windows.h" +} CONFIG -= qtquickcompiler diff --git a/src/gui/ShapeGraphicsItem.cpp b/src/gui/ShapeGraphicsItem.cpp index 37d94e832..256936199 100644 --- a/src/gui/ShapeGraphicsItem.cpp +++ b/src/gui/ShapeGraphicsItem.cpp @@ -482,7 +482,7 @@ void MeshTextureGraphicsItem::_buildCacheQuadItem(CacheQuadItem& item, const Qua // if (stop) { - item.subQuads.append( (CacheQuadMapping){ inputQuad, outputQuad } ); + item.subQuads.append({inputQuad, outputQuad}); } else // subdivide { diff --git a/src/src.pri b/src/src.pri index 76a3b1ea2..a8453258e 100644 --- a/src/src.pri +++ b/src/src.pri @@ -51,7 +51,7 @@ macx { # Windows-specific: win32 { DEFINES += WIN32 - TARGET = ../../../MapMap/MapMap # Just for release + TARGET = ../MapMap/MapMap # Just for release GST_HOME = $$quote($$(GSTREAMER_1_0_ROOT_X86)) isEmpty(GST_HOME) { message(\"GSTREAMER_1_0_ROOT_X86\" not detected ...) @@ -65,14 +65,15 @@ win32 { $${GST_HOME}/lib/glib-2.0/include \ $${GST_HOME}/include/gstreamer-1.0 - LIBS += $${GST_HOME}/lib/gstapp-1.0.lib \ - $${GST_HOME}/lib/gstbase-1.0.lib \ - $${GST_HOME}/lib/gstpbutils-1.0.lib \ - $${GST_HOME}/lib/gstreamer-1.0.lib \ - $${GST_HOME}/lib/gobject-2.0.lib \ - $${GST_HOME}/lib/glib-2.0.lib \ - $${GST_HOME}/lib/gstaudio-1.0.lib \ - $${GST_HOME}/lib/gstvideo-1.0.lib \ + LIBS += -L"$${GST_HOME}/lib" \ + -lgstapp-1.0 \ + -lgstbase-1.0 \ + -lgstpbutils-1.0 \ + -lgstreamer-1.0 \ + -lgobject-2.0 \ + -lglib-2.0 \ + -lgstaudio-1.0 \ + -lgstvideo-1.0 \ -lopengl32 CONFIG -= debug