diff --git a/.github/workflows/package-ubuntu-20.04.yml b/.github/workflows/package-ubuntu-20.04.yml index fd96661c..96f4e03c 100644 --- a/.github/workflows/package-ubuntu-20.04.yml +++ b/.github/workflows/package-ubuntu-20.04.yml @@ -7,8 +7,8 @@ on: workflow_dispatch: env: - MUPDF_VERSION: 1.23.3 - MUPDF_SHA256SUM: f57e68b4532d089354497cc685a4faccea2dfdc84b7681c3608abfb6a338e7e9 + MUPDF_VERSION: 1.24.2 + MUPDF_SHA256SUM: b86ba258c5cc6711367e4bbe2d283389a33ac19f00a513462f6c60d05b00601c jobs: package: @@ -42,23 +42,24 @@ jobs: - name: Configure with Qt5 + Poppler run: > - cmake - -B build_qt5_poppler - -DUSE_MUPDF=OFF - -DUSE_POPPLER=ON - -DUSE_QTPDF=OFF - -DUSE_EXTERNAL_RENDERER=OFF - -DLINK_MUJS=OFF - -DLINK_GUMBO=OFF - -DUSE_TRANSLATIONS=ON - -DQT_VERSION_MAJOR=5 - -DQT_VERSION_MINOR=12 - -DGIT_VERSION=OFF - -DCMAKE_BUILD_TYPE='Release' - -DCPACK_GENERATOR='DEB;' - -DCMAKE_INSTALL_PREFIX='/usr' - -DCMAKE_INSTALL_SYSCONFDIR='/etc' - -DINSTALL_LICENSE=OFF + cmake + -B build_qt5_poppler + -DUBUNTU_VERSION=20.04 + -DUSE_MUPDF=OFF + -DUSE_POPPLER=ON + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=OFF + -DLINK_GUMBO=OFF + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=5 + -DQT_VERSION_MINOR=12 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF - name: Build with Qt5 + Poppler run: cmake --build build_qt5_poppler @@ -77,23 +78,24 @@ jobs: - name: Configure with Qt5 + MuPDF run: > - cmake - -B build_qt5_mupdf - -DUSE_MUPDF=ON - -DUSE_POPPLER=OFF - -DUSE_QTPDF=OFF - -DUSE_EXTERNAL_RENDERER=OFF - -DLINK_MUJS=OFF - -DLINK_GUMBO=OFF - -DUSE_TRANSLATIONS=ON - -DQT_VERSION_MAJOR=5 - -DQT_VERSION_MINOR=12 - -DGIT_VERSION=OFF - -DCMAKE_BUILD_TYPE='Release' - -DCPACK_GENERATOR='DEB;' - -DCMAKE_INSTALL_PREFIX='/usr' - -DCMAKE_INSTALL_SYSCONFDIR='/etc' - -DINSTALL_LICENSE=OFF + cmake + -B build_qt5_mupdf + -DUBUNTU_VERSION=20.04 + -DUSE_MUPDF=ON + -DUSE_POPPLER=OFF + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=OFF + -DLINK_GUMBO=OFF + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=5 + -DQT_VERSION_MINOR=12 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF - name: Build with Qt5 + MuPDF run: cmake --build build_qt5_mupdf @@ -132,6 +134,7 @@ jobs: run: > cmake -B build_qt5_mupdf_small + -DUBUNTU_VERSION=20.04 -DUSE_MUPDF=ON -DUSE_POPPLER=OFF -DUSE_QTPDF=OFF diff --git a/.github/workflows/package-ubuntu-22.04.yml b/.github/workflows/package-ubuntu-22.04.yml index 29e5c357..18f33304 100644 --- a/.github/workflows/package-ubuntu-22.04.yml +++ b/.github/workflows/package-ubuntu-22.04.yml @@ -7,8 +7,8 @@ on: workflow_dispatch: env: - MUPDF_VERSION: 1.23.3 - MUPDF_SHA256SUM: f57e68b4532d089354497cc685a4faccea2dfdc84b7681c3608abfb6a338e7e9 + MUPDF_VERSION: 1.24.2 + MUPDF_SHA256SUM: b86ba258c5cc6711367e4bbe2d283389a33ac19f00a513462f6c60d05b00601c jobs: package: @@ -50,23 +50,24 @@ jobs: - name: Configure with Qt5 + Poppler run: > - cmake - -B build_qt5_poppler - -DUSE_MUPDF=OFF - -DUSE_POPPLER=ON - -DUSE_QTPDF=OFF - -DUSE_EXTERNAL_RENDERER=OFF - -DLINK_MUJS=ON - -DLINK_GUMBO=ON - -DUSE_TRANSLATIONS=ON - -DQT_VERSION_MAJOR=5 - -DQT_VERSION_MINOR=15 - -DGIT_VERSION=OFF - -DCMAKE_BUILD_TYPE='Release' - -DCPACK_GENERATOR='DEB;' - -DCMAKE_INSTALL_PREFIX='/usr' - -DCMAKE_INSTALL_SYSCONFDIR='/etc' - -DINSTALL_LICENSE=OFF + cmake + -B build_qt5_poppler + -DUBUNTU_VERSION=22.04 + -DUSE_MUPDF=OFF + -DUSE_POPPLER=ON + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=ON + -DLINK_GUMBO=ON + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=5 + -DQT_VERSION_MINOR=15 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF - name: Build with Qt5 + Poppler run: cmake --build build_qt5_poppler @@ -85,23 +86,24 @@ jobs: - name: Configure with Qt5 + MuPDF run: > - cmake - -B build_qt5_mupdf - -DUSE_MUPDF=ON - -DUSE_POPPLER=OFF - -DUSE_QTPDF=OFF - -DUSE_EXTERNAL_RENDERER=OFF - -DLINK_MUJS=ON - -DLINK_GUMBO=ON - -DUSE_TRANSLATIONS=ON - -DQT_VERSION_MAJOR=5 - -DQT_VERSION_MINOR=15 - -DGIT_VERSION=OFF - -DCMAKE_BUILD_TYPE='Release' - -DCPACK_GENERATOR='DEB;' - -DCMAKE_INSTALL_PREFIX='/usr' - -DCMAKE_INSTALL_SYSCONFDIR='/etc' - -DINSTALL_LICENSE=OFF + cmake + -B build_qt5_mupdf + -DUBUNTU_VERSION=22.04 + -DUSE_MUPDF=ON + -DUSE_POPPLER=OFF + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=ON + -DLINK_GUMBO=ON + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=5 + -DQT_VERSION_MINOR=15 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF - name: Build with Qt5 + MuPDF run: cmake --build build_qt5_mupdf @@ -120,23 +122,24 @@ jobs: - name: Configure with Qt6 + MuPDF run: > - cmake - -B build_qt6_mupdf - -DUSE_MUPDF=ON - -DUSE_POPPLER=OFF - -DUSE_QTPDF=OFF - -DUSE_EXTERNAL_RENDERER=OFF - -DLINK_MUJS=ON - -DLINK_GUMBO=ON - -DUSE_TRANSLATIONS=ON - -DQT_VERSION_MAJOR=6 - -DQT_VERSION_MINOR=2 - -DGIT_VERSION=OFF - -DCMAKE_BUILD_TYPE='Release' - -DCPACK_GENERATOR='DEB;' - -DCMAKE_INSTALL_PREFIX='/usr' - -DCMAKE_INSTALL_SYSCONFDIR='/etc' - -DINSTALL_LICENSE=OFF + cmake + -B build_qt6_mupdf + -DUBUNTU_VERSION=22.04 + -DUSE_MUPDF=ON + -DUSE_POPPLER=OFF + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=ON + -DLINK_GUMBO=ON + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=6 + -DQT_VERSION_MINOR=2 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF - name: Build with Qt6 + MuPDF run: cmake --build build_qt6_mupdf @@ -175,6 +178,7 @@ jobs: run: > cmake -B build_qt5_mupdf_small + -DUBUNTU_VERSION=22.04 -DUSE_MUPDF=ON -DUSE_POPPLER=OFF -DUSE_QTPDF=OFF @@ -214,6 +218,7 @@ jobs: run: > cmake -B build_qt6_mupdf_small + -DUBUNTU_VERSION=22.04 -DUSE_MUPDF=ON -DUSE_POPPLER=OFF -DUSE_QTPDF=OFF diff --git a/.github/workflows/package-ubuntu-24.04.yml b/.github/workflows/package-ubuntu-24.04.yml new file mode 100644 index 00000000..846b726a --- /dev/null +++ b/.github/workflows/package-ubuntu-24.04.yml @@ -0,0 +1,303 @@ +name: "Package for Ubuntu 24.04" + +on: + push: + tags: + - "v*" + workflow_dispatch: + +env: + MUPDF_VERSION: 1.24.2 + MUPDF_SHA256SUM: b86ba258c5cc6711367e4bbe2d283389a33ac19f00a513462f6c60d05b00601c + +jobs: + package: + name: Package + runs-on: ubuntu-24.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: > + sudo apt-get update -y; + sudo apt-get install -y --no-install-recommends + cmake + g++ + lunzip + zlib1g-dev + libmupdf-dev + libmujs-dev + libgumbo-dev + libfreetype-dev + freeglut3-dev + libharfbuzz-dev + libjpeg-dev + libopenjp2-7-dev + libjbig2dec0-dev + libqt6svg6-dev + qt6-multimedia-dev + qt6-tools-dev + libpoppler-qt6-dev + libqt5svg5-dev + qtmultimedia5-dev + qttools5-dev + libpoppler-qt5-dev + + + - name: Configure with Qt5 + Poppler + run: > + cmake + -B build_qt5_poppler + -DUBUNTU_VERSION=24.04 + -DUSE_MUPDF=OFF + -DUSE_POPPLER=ON + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=ON + -DLINK_GUMBO=ON + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=5 + -DQT_VERSION_MINOR=15 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF + + - name: Build with Qt5 + Poppler + run: cmake --build build_qt5_poppler + + - name: Package with Qt5 + Poppler + run: | + cpack --config build_qt5_poppler/CPackConfig.cmake + mv beamerpresenter-poppler-qt5-x86_64.deb beamerpresenter-poppler-qt5-noble-x86_64.deb + + - name: Archive package with Qt5 + Poppler + uses: actions/upload-artifact@v3 + with: + name: beamerpresenter-poppler-qt5-noble-x86_64.deb + path: /home/runner/work/BeamerPresenter/BeamerPresenter/beamerpresenter-poppler-qt5-noble-x86_64.deb + + + - name: Configure with Qt6 + Poppler + run: > + cmake + -B build_qt6_poppler + -DUBUNTU_VERSION=24.04 + -DUSE_MUPDF=OFF + -DUSE_POPPLER=ON + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=ON + -DLINK_GUMBO=ON + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=6 + -DQT_VERSION_MINOR=4 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF + + - name: Build with Qt6 + Poppler + run: cmake --build build_qt6_poppler + + - name: Package with Qt6 + Poppler + run: | + cpack --config build_qt6_poppler/CPackConfig.cmake + mv beamerpresenter-poppler-qt6-x86_64.deb beamerpresenter-poppler-qt6-noble-x86_64.deb + + - name: Archive package with Qt6 + Poppler + uses: actions/upload-artifact@v3 + with: + name: beamerpresenter-poppler-qt6-noble-x86_64.deb + path: /home/runner/work/BeamerPresenter/BeamerPresenter/beamerpresenter-poppler-qt6-noble-x86_64.deb + + + - name: Configure with Qt5 + MuPDF + run: > + cmake + -B build_qt5_mupdf + -DUBUNTU_VERSION=24.04 + -DUSE_MUPDF=ON + -DUSE_POPPLER=OFF + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=ON + -DLINK_GUMBO=ON + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=5 + -DQT_VERSION_MINOR=15 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF + + - name: Build with Qt5 + MuPDF + run: cmake --build build_qt5_mupdf + + - name: Package with Qt5 + MuPDF + run: | + cpack --config build_qt5_mupdf/CPackConfig.cmake + mv beamerpresenter-mupdf-qt5-x86_64.deb beamerpresenter-mupdf-qt5-noble-x86_64.deb + + - name: Archive package with Qt5 + MuPDF + uses: actions/upload-artifact@v3 + with: + name: beamerpresenter-mupdf-qt5-noble-x86_64.deb + path: /home/runner/work/BeamerPresenter/BeamerPresenter/beamerpresenter-mupdf-qt5-noble-x86_64.deb + + + - name: Configure with Qt6 + MuPDF + run: > + cmake + -B build_qt6_mupdf + -DUBUNTU_VERSION=24.04 + -DUSE_MUPDF=ON + -DUSE_POPPLER=OFF + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=ON + -DLINK_GUMBO=ON + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=6 + -DQT_VERSION_MINOR=4 + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF + + - name: Build with Qt6 + MuPDF + run: cmake --build build_qt6_mupdf + + - name: Package with Qt6 + MuPDF + run: | + cpack --config build_qt6_mupdf/CPackConfig.cmake + mv beamerpresenter-mupdf-qt6-x86_64.deb beamerpresenter-mupdf-qt6-noble-x86_64.deb + + - name: Archive package with Qt6 + MuPDF + uses: actions/upload-artifact@v3 + with: + name: beamerpresenter-mupdf-qt6-noble-x86_64.deb + path: /home/runner/work/BeamerPresenter/BeamerPresenter/beamerpresenter-mupdf-qt6-noble-x86_64.deb + + + - name: Download and unpack MuPDF + run: | + wget -q https://mupdf.com/downloads/archive/mupdf-${{ env.MUPDF_VERSION }}-source.tar.lz + sha256sum -c - <<< "${{ env.MUPDF_SHA256SUM }} mupdf-${{ env.MUPDF_VERSION }}-source.tar.lz" + tar -xf "mupdf-${{ env.MUPDF_VERSION }}-source.tar.lz" + + - name: Build MuPDF + run : | + cd "mupdf-${{ env.MUPDF_VERSION }}-source" + rm -rf thirdparty/{freeglut,freetype,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib} + CFLAGS+=' -fPIC -ffat-lto-objects' + CXXFLAGS+=' -fPIC' + USE_SYSTEM_LIBS='yes' + XCFLAGS+=' -DTOFU -DTOFU_CJK -DTOFU_SIL -DFZ_ENABLE_JS=0' + export CFLAGS CXXFLAGS USE_SYSTEM_LIBS XCFLAGS + make build=release libs + + + - name: Configure with Qt5 + small MuPDF + run: > + cmake + -B build_qt5_mupdf_small + -DUBUNTU_VERSION=24.04 + -DUSE_MUPDF=ON + -DUSE_POPPLER=OFF + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=OFF + -DLINK_GUMBO=ON + -DMUPDF_LIB_PATH="$(pwd)/mupdf-${{ env.MUPDF_VERSION }}-source/build/release/libmupdf.a" + -DMUPDF_THIRD_LIB_PATH="$(pwd)/mupdf-${{ env.MUPDF_VERSION }}-source/build/release/libmupdf-third.a" + -DMUPDF_INCLUDE_DIR="$(pwd)/mupdf-${{ env.MUPDF_VERSION }}-source/include" + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=5 + -DQT_VERSION_MINOR=15 + -DMARK_AS_SMALL=ON + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF + + - name: Build with Qt5 + small MuPDF + run: cmake --build build_qt5_mupdf_small + + - name: Package with Qt5 + small MuPDF + run: | + cpack --config build_qt5_mupdf_small/CPackConfig.cmake + mv beamerpresenter-mupdf-small-qt5-x86_64.deb beamerpresenter-mupdf-small-qt5-noble-x86_64.deb + + - name: Archive package with Qt5 + small MuPDF + uses: actions/upload-artifact@v3 + with: + name: beamerpresenter-mupdf-small-qt5-noble-x86_64.deb + path: /home/runner/work/BeamerPresenter/BeamerPresenter/beamerpresenter-mupdf-small-qt5-noble-x86_64.deb + + + - name: Configure with Qt6 + small MuPDF + run: > + cmake + -B build_qt6_mupdf_small + -DUBUNTU_VERSION=24.04 + -DUSE_MUPDF=ON + -DUSE_POPPLER=OFF + -DUSE_QTPDF=OFF + -DUSE_EXTERNAL_RENDERER=OFF + -DLINK_MUJS=OFF + -DLINK_GUMBO=ON + -DMUPDF_LIB_PATH="$(pwd)/mupdf-${{ env.MUPDF_VERSION }}-source/build/release/libmupdf.a" + -DMUPDF_THIRD_LIB_PATH="$(pwd)/mupdf-${{ env.MUPDF_VERSION }}-source/build/release/libmupdf-third.a" + -DMUPDF_INCLUDE_DIR="$(pwd)/mupdf-${{ env.MUPDF_VERSION }}-source/include" + -DUSE_TRANSLATIONS=ON + -DQT_VERSION_MAJOR=6 + -DQT_VERSION_MINOR=4 + -DMARK_AS_SMALL=ON + -DGIT_VERSION=OFF + -DCMAKE_BUILD_TYPE='Release' + -DCPACK_GENERATOR='DEB;' + -DCMAKE_INSTALL_PREFIX='/usr' + -DCMAKE_INSTALL_SYSCONFDIR='/etc' + -DINSTALL_LICENSE=OFF + + - name: Build with Qt6 + small MuPDF + run: cmake --build build_qt6_mupdf_small + + - name: Package with Qt6 + small MuPDF + run: | + cpack --config build_qt6_mupdf_small/CPackConfig.cmake + mv beamerpresenter-mupdf-small-qt6-x86_64.deb beamerpresenter-mupdf-small-qt6-noble-x86_64.deb + + - name: Archive package with Qt6 + small MuPDF + uses: actions/upload-artifact@v3 + with: + name: beamerpresenter-mupdf-small-qt6-noble-x86_64.deb + path: /home/runner/work/BeamerPresenter/BeamerPresenter/beamerpresenter-mupdf-small-qt6-noble-x86_64.deb + + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + beamerpresenter-mupdf-small-qt5-noble-x86_64.deb + beamerpresenter-mupdf-small-qt6-noble-x86_64.deb + beamerpresenter-mupdf-qt5-noble-x86_64.deb + beamerpresenter-mupdf-qt6-noble-x86_64.deb + beamerpresenter-poppler-qt5-noble-x86_64.deb + beamerpresenter-poppler-qt6-noble-x86_64.deb + draft: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index e97199ee..dff9f1ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Define available build/config types set(QT_VERSION_MAJOR 6 CACHE STRING "Qt major version") # Minor Qt version is required for defining dependencies when packaging -set(QT_VERSION_MINOR 6 CACHE STRING "Qt minor version") +set(QT_VERSION_MINOR 7 CACHE STRING "Qt minor version") # Check if the required Qt libraries are available find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) @@ -220,19 +220,20 @@ set(CPACK_STRIP_FILES ON) MATH(EXPR QT_VERSION_MINOR_PLUS "${QT_VERSION_MINOR} + 1") if (CPACK_GENERATOR MATCHES "DEB") - # configure debian package (tested in Ubuntu 20.04 and Ubuntu 22.04) + set(UBUNTU_VERSION "24.04" CACHE STRING "Ubuntu version, used for dependencies") + # configure debian package (tested in Ubuntu 20.04, 22.04, and 24.04) # # Required packages for building: # * cmake # * git (only when building mainline version) # * zlib1g-dev - # * qtmultimedia5-dev (qt6-multimedia-dev for Qt 6) - # * libqt5svg5-dev (libqt6svg6-dev for Qt 6) - # * qttools5-dev (qt6-tools-dev and qt6-tools-dev-tools for Qt 6) - # * libqt6opengl6-dev (for Qt 6) - # * libgl1-mesa-dev (for Qt 6) + # * qtmultimedia5-dev or qt6-multimedia-dev + # * libqt5svg5-dev or libqt6svg6-dev + # * qttools5-dev or (qt6-tools-dev and qt6-tools-dev-tools) + # * libqt6opengl6-dev (Qt 6 only) + # * libgl1-mesa-dev (Qt 6 only) # For poppler: - # * libpoppler-qt5-dev + # * libpoppler-qt5-dev or libpoppler-qt6-dev # For MuPDF: # * libmupdf-dev # * libfreetype-dev @@ -251,11 +252,14 @@ if (CPACK_GENERATOR MATCHES "DEB") if (USE_MUPDF) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libfreetype6, libharfbuzz0b, libjpeg8, libopenjp2-7, libjbig2dec0") if (LINK_GUMBO) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libgumbo1") + if ("${UBUNTU_VERSION}" GREATER_EQUAL "24.04") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libgumbo2") + else() + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libgumbo1") + endif() endif() if (LINK_MUJS) - # Ugly workaround: Ubuntu 23.10 uses Qt 6.4 and libmujs3. Ubuntu 22.04 uses Qt 6.2 and libmujs1. - if (QT_VERSION_MINOR GREATER_EQUAL 4) + if ("${UBUNTU_VERSION}" GREATER_EQUAL "23.10") set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libmujs3") else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libmujs1") @@ -263,7 +267,15 @@ if (CPACK_GENERATOR MATCHES "DEB") endif() endif() if (USE_POPPLER) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libpoppler-qt${QT_VERSION_MAJOR}-1 (>= 0.86.1)") + if ("${UBUNTU_VERSION}" GREATER_EQUAL "24.04") + if ("${QT_VERSION_MAJOR}" EQUAL "5") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libpoppler-qt5-1t64") + elseif ("${QT_VERSION_MAJOR}" EQUAL "6") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libpoppler-qt6-3t64") + endif() + else() + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libpoppler-qt${QT_VERSION_MAJOR}-1") + endif() endif() if (USE_QTPDF) set(QT_PDF_PACKAGE "libqt${QT_VERSION_MAJOR}pdf${QT_VERSION_MAJOR}") diff --git a/INSTALL.md b/INSTALL.md index 4b920401..57bffdd8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,13 +4,15 @@ You can choose the PDF engine (Poppler, MuPDF, Qt PDF) and the major Qt version It is recommended to use Qt 6 (if available) because of noticable improvements when including videos in a presentation. BeamerPresenter can be found in the official [Nix repositories](https://search.nixos.org/packages?channel=unstable&type=packages&query=BeamerPresenter) and in the [AUR](https://aur.archlinux.org/packages/beamerpresenter) (also as a [mainline version](https://aur.archlinux.org/packages/beamerpresenter-git)). -The [releases](https://github.com/stiglers-eponym/BeamerPresenter/releases) include packages for Arch/Manjaro/Endeavour, Ubuntu 22.04, Ubuntu 20.04, and flatpak. +The [releases](https://github.com/stiglers-eponym/BeamerPresenter/releases) include packages for Arch/Manjaro/Endeavour, Ubuntu (24.04, 22.04 and 20.04), and flatpak. These packages can be installed as shown in the following example, which uses Poppler as PDF engine (after downloading the corresponding file): ```sh -# Ubuntu 20.04: -sudo apt install ./beamerpresenter-poppler-0.2.4-qt5-focal-x86_64.deb +# Ubuntu 24.04: +sudo apt install ./beamerpresenter-poppler-0.2.4-qt6-noble-x86_64.deb # Ubuntu 22.04: sudo apt install ./beamerpresenter-poppler-0.2.4-qt5-jammy-x86_64.deb +# Ubuntu 20.04: +sudo apt install ./beamerpresenter-poppler-0.2.4-qt5-focal-x86_64.deb # Arch/Manjaro/Endeavour sudo pacman -U beamerpresenter-poppler-qt6-0.2.4-1-x86_64.pkg.tar.zst # Flatpak @@ -36,7 +38,7 @@ When installing BeamerPresenter you need to choose a PDF engine from MuPDF, Popp ## Requirements -Building is currently tested in Arch Linux, Xubuntu 20.04, Kubuntu 22.04, Xubuntu 23.10, Fedora 38, and MinGW-w64 in MSYS2 (Windows). +Building is currently tested in Arch Linux, Xubuntu 20.04, Kubuntu 24.04 and 22.04, Fedora 38, and MinGW-w64 in MSYS2 (Windows). In order to compile BeamerPresenter you need to have CMake, zlib and Qt 5/6 including the multimedia and SVG modules installed. For translations you also need the linguist tools. @@ -46,30 +48,30 @@ Qt versions since 5.12 (for Qt 5) or 6.2 (Qt 6) are supported. ### Dependencies in Ubuntu * `cmake` (only for building) * cmake requires a compiler (e.g. `g++`) and a build system (e.g. Unix makefiles or ninja) -* `zlib1g-dev` (after the installation you can remove `zlib1g-dev` and keep only `zlib1g`) -* `qt6-multimedia-dev` (after the installation, you can remove `qt6-multimedia6-dev` and keep only `libqt6multimediawidgets6`) - * for Qt 5 in Ubuntu 20.04: install `qtmultimedia5-dev`, and keep `libqt5multimedia5` and `libqt5multimediawidgets5` after the installation -* `libqt6svg6-dev` (after the installation, you can remove `libqt6svg6-dev` and keep only `libqt6svg6`) - * when using Qt 5: `libqt5svg5-dev` and keep `libqt5svg5` after the installation -* `qt6-tools-dev`, `qt6-tools-dev-tools`, and `qt6-l10n-tools` (only for building and only when creating translations. You can disable translations with `-DUSE_TRANSLATIONS=OFF` in the [CMake command](#configure)) - * for Qt 5: `qttools5-dev` -* optional and only for Qt 5: `gstreamer1.0-libav` and `libqt5multimedia5-plugins` (for showing videos, when using Qt 5) - -When compiling with Poppler (only available with Qt 5): -* `libpoppler-qt5-dev`: version 0.86.1 or later. (after the installation you can remove `libpoppler-qt5-dev` and keep only `libpoppler-qt5-1` +* `zlib1g-dev` +* `qt6-multimedia-dev` (Qt 6) or qtmultimedia5-dev (Qt 5) +* `libqt6svg6-dev` (Qt 6) or `libqt5svg5-dev` (Qt 5) +* for translations (only for building, you can disable translations with `-DUSE_TRANSLATIONS=OFF` in the [CMake command](#configure)) + * Qt 6: `qt6-tools-dev`, `qt6-tools-dev-tools`, and `qt6-l10n-tools` + * Qt 5: `qttools5-dev` +* optional, only for Qt 5: `gstreamer1.0-libav` and `libqt5multimedia5-plugins` (for showing videos) + +When compiling with Poppler: +* Qt 5: `libpoppler-qt5-dev`, version 0.86.1 or later +* Qt 6: `libpoppler-qt6-dev` When compiling with MuPDF: * `libmupdf-dev` (only for building) -* `libfreetype-dev` (after the installation you can remove `libfreetype-dev` and keep only `libfreetype6`) -* `libharfbuzz-dev` (after the installation you can remove `libharfbuzz-dev` and keep only `libharfbuzz0b`) -* `libjpeg-dev` (after the installation you can remove `libjpeg-dev` and keep only `libjpeg8`) -* `libopenjp2-7-dev` (after the installation you can remove `libopenjp2-7-dev` and keep only `libopenjp2-7`) -* `libjbig2dec0-dev` (after the installation you can remove `libjbig2dec0-dev` and keep only `libjbig2dec0`) -* only Ubuntu ≥21.10: `libmujs-dev` (after the installation you can remove `libmujs-dev` and keep only `libmujs1` or `libmujs3`) -* only Ubuntu ≥22.04: `libgumbo-dev` (after the installation you can remove `libgumbo-dev` and keep only `libgumbo1`) +* `libfreetype-dev` +* `libharfbuzz-dev` +* `libjpeg-dev` +* `libopenjp2-7-dev` +* `libjbig2dec0-dev` +* only Ubuntu ≥21.10: `libmujs-dev` +* only Ubuntu ≥22.04: `libgumbo-dev` -When compiling with Qt PDF (only Qt 5 and Ubuntu >= 21.04): -* `qtpdf5-dev` (after the installation you can remove `qtpdf5-dev` and keep only `libqt5pdf5`) +When compiling with Qt PDF: +* `qtpdf5-dev` (Qt 5) or `qtpdf6-dev` (Qt 6) ### Dependencies in Arch Linux/Manjaro/Endeavour Replace qt6 with qt5 in all package names if you want to use Qt 5. @@ -80,10 +82,10 @@ Replace qt6 with qt5 in all package names if you want to use Qt 5. * `qt6-tools` (only for building and only when creating translations. You can disable translations with `-DUSE_TRANSLATIONS=OFF` in the [CMake command](#configure)) When compiling with Poppler: -* `poppler-qt5` +* `poppler-qt6` When compiling with MuPDF: -* `libmupdf` (only for building, tested versions: 1.16.1 – 1.23.4) +* `libmupdf` (tested versions: 1.16.1 – 1.24.0) * `jbig2dec` * `openjpeg2` * `gumbo-parser` @@ -184,6 +186,7 @@ Other options are added in the form `-DOPTION=VALUE` as listed below. | `CMAKE_INSTALL_PREFIX` | /usr | install prefix. If not specified, this will be /usr/local in Linux | | `CMAKE_INSTALL_SYSCONFDIR` | /etc | system configuration directory | | `GENERATE_MANPAGES` | ON | Generate man pages and include them in installation | +| `UBUNTU_VERSION` | 24.04 | Adjust package dependencies to given Ubuntu version when building debian package | ### Build and install After configuring with CMake, you can build the project (add ` -j 4` for compiling with 4 CPU cores) diff --git a/packaging/README.md b/packaging/README.md index c6aab89a..de3dc1aa 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -24,11 +24,11 @@ Install the build dependencies. Make sure you select all of the lines below whic sudo apt install --no-install-recommends cmake zlib1g-dev libmupdf-dev libfreetype-dev libharfbuzz-dev libjpeg-dev libopenjp2-7-dev libjbig2dec0-dev # When using Qt 5: sudo apt install --no-install-recommends qtmultimedia5-dev qttools5-dev libpoppler-qt5-dev -# Ubuntu 21.10 (only relevant for MuPDF): +# Ubuntu == 21.10 (only relevant for MuPDF): sudo apt install --no-install-recommends libmujs-dev -# Ubuntu 22.04 (only relevant for MuPDF): +# Ubuntu >= 22.04 (only relevant for MuPDF): sudo apt install --no-install-recommends libmujs-dev libgumbo-dev -# When using Qt 6 (only Ubuntu 22.04): +# When using Qt 6 (only Ubuntu >= 22.04): sudo apt install --no-install-recommends qt6-multimedia-dev libqt6opengl6-dev libgl1-mesa-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools ``` @@ -41,11 +41,12 @@ cd BeamerPresenter-0.2.4 ``` Now configure the package using CMake. This requires the configuration of the Qt version (major and minor version), and the PDF engine (Poppler or MuPDF). The Qt minor version is only needed for version checking of dependencies. -For building BeamerPresenter with poppler in Ubuntu 20.04 with Qt 5.12 use: +For building BeamerPresenter with poppler in Ubuntu 24.04 with Qt6.4 use: ```sh mkdir -p build_dir cmake \ -B build_dir \ + -DUBUNTU_VERSION=24.04 \ -DCMAKE_BUILD_TYPE='Release' \ -DGIT_VERSION=OFF \ -DUSE_POPPLER=ON \ @@ -53,19 +54,19 @@ cmake \ -DUSE_QTPDF=OFF \ -DUSE_EXTERNAL_RENDERER=OFF \ -DLINK_MUPDF_THIRD=ON \ - -DLINK_MUJS=OFF \ - -DLINK_GUMBO=OFF \ + -DLINK_MUJS=ON \ + -DLINK_GUMBO=ON \ -DUSE_TRANSLATIONS=ON \ - -DQT_VERSION_MAJOR=5 \ - -DQT_VERSION_MINOR=12 \ + -DQT_VERSION_MAJOR=6 \ + -DQT_VERSION_MINOR=4 \ -DINSTALL_LICENSE=OFF \ -DCPACK_GENERATOR='DEB;' \ -DCMAKE_INSTALL_PREFIX='/usr' \ -DCMAKE_INSTALL_SYSCONFDIR='/etc' ``` * to use MuPDF instead of Poppler: set `-DUSE_POPPLER=OFF` and `-DUSE_MUPDF=ON` -* in Ubuntu 21.10: set `-DQT_VERSION_MINOR=15`, `-DLINK_MUJS=ON`, and `-DLINK_MUPDF_THIRD=OFF` -* in Ubuntu 22.04: set `-DLINK_MUJS=ON` and `-DLINK_GUMBO=ON` +* in Ubuntu 21.10: set `-DQT_VERSION_MAJOR=5`, `-DQT_VERSION_MINOR=15`, and `-DLINK_MUPDF_THIRD=OFF` +* in Ubuntu 22.04: * when using Qt 5: set `-DQT_VERSION_MINOR=15` * when using Qt 6: set `-DQT_VERSION_MAJOR=6` and `-DQT_VERSION_MINOR=2` @@ -80,7 +81,7 @@ cpack --config build_dir/CPackConfig.cmake Now you can install the package: ```sh -sudo apt install ./beamerpresenter-poppler-0.2.4-qt5.12-x86_64.deb +sudo apt install ./beamerpresenter-poppler-0.2.4-qt6.4-x86_64.deb ``` diff --git a/src/preferences.h b/src/preferences.h index aab449aa..e2459cdf 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -87,9 +87,9 @@ class Preferences : public QObject // DRAWING /// Maximum number of steps in drawing history of currently visible slide. - int history_length_visible_slides; + int history_length_visible_slides = 50; /// Maximum number of steps in drawing history of hidden slide. - int history_length_hidden_slides; + int history_length_hidden_slides = 20; /// Define how should drawings be assigned to overlays. OverlayDrawingMode overlay_mode = Cumulative; @@ -158,10 +158,10 @@ class Preferences : public QObject /// Maximally allowed memory size in bytes. /// Negative numbers are interpreted as infinity. - float max_memory{-1.}; + float max_memory = -1.; /// Maximally allowed number of pages in cache. /// Negative numbers are interpreted as infinity. - int max_cache_pages{-1}; + int max_cache_pages = -1; // INTERACTION /// Map key combinations to actions for global keyboard shortcuts.