From c9d0b888fb083f86d8cacd29ce3d6d6d42d52756 Mon Sep 17 00:00:00 2001 From: mouzedrift <43358824+mouzedrift@users.noreply.github.com> Date: Sat, 28 Feb 2026 01:50:49 +0100 Subject: [PATCH] Fix broken deb package & refactor CI --- .github/workflows/ci.yml | 147 +++++++++++++++----------------- CMakeLists.txt | 20 ++++- assets/CMakeLists.txt | 4 + assets/relive-qt-editor.desktop | 28 ++++++ 4 files changed, 119 insertions(+), 80 deletions(-) create mode 100644 assets/CMakeLists.txt create mode 100644 assets/relive-qt-editor.desktop diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63c0c63..6c271d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,28 +1,15 @@ name: CI -on: - push: - pull_request: +on: [push, pull_request] # build setting(s) env: CONFIGURATION: Release jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - name: Windows32 - - os: windows-latest - name: Windows64 - - os: ubuntu-22.04 - name: Linux - - os: macos-26-intel - name: macOS-intel + build-windows32: + runs-on: windows-latest + name: Windows32 steps: - name: Checkout repository recursively @@ -30,117 +17,121 @@ jobs: with: submodules: recursive - # ====================================== - # Windows32 - # ====================================== - - - name: 'Windows32: Install Qt 5.15.2' - if: runner.os == 'Windows' + - name: 'Install Qt 5.15.2' uses: jurplel/install-qt-action@v4 with: version: '5.15.2' arch: 'win32_msvc2019' - - name: 'Windows32: Build' - if: matrix.name == 'Windows32' + - name: 'Build' run: | mkdir build cd build - cmake .. -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A Win32 + cmake -S .. -B . -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A Win32 cmake --build . --config $env:CONFIGURATION cd $env:CONFIGURATION mkdir deploy move qt-editor.exe ./deploy windeployqt ./deploy/qt-editor.exe --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw --no-svg --dir ./deploy --plugindir ./deploy/plugins - # ====================================== - # Windows64 - # ====================================== + - name: 'Upload Artifact' + uses: actions/upload-artifact@v7 + with: + name: Windows32-${{ env.CONFIGURATION }}-qt-editor + path: build\${{ env.CONFIGURATION }}\deploy + + build-windows64: + runs-on: windows-latest + name: Windows64 + + steps: + - name: Checkout repository recursively + uses: actions/checkout@v4 + with: + submodules: recursive - - name: 'Windows64: Install Qt 5.15.2' - if: runner.os == 'Windows' + - name: 'Install Qt 5.15.2' uses: jurplel/install-qt-action@v4 with: version: '5.15.2' arch: 'win64_msvc2019_64' - - name: 'Windows64: Build' - if: matrix.name == 'Windows64' + - name: 'Build' run: | mkdir build cd build - cmake .. -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A x64 + cmake -S .. -B . -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A x64 cmake --build . --config $env:CONFIGURATION cd $env:CONFIGURATION mkdir deploy move qt-editor.exe ./deploy windeployqt ./deploy/qt-editor.exe --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw --no-svg --dir ./deploy --plugindir ./deploy/plugins - - # ====================================== - # Linux - # ====================================== - - name: 'Linux: Install Qt 5.15.2' - if: matrix.name == 'Linux' + - name: 'Upload Artifact' + uses: actions/upload-artifact@v7 + with: + name: Windows64-${{ env.CONFIGURATION }}-qt-editor + path: build\${{ env.CONFIGURATION }}\deploy + + build-linux: + runs-on: ubuntu-22.04 + name: Linux + + steps: + - name: Checkout repository recursively + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: 'Install Qt 5.15.2' uses: jurplel/install-qt-action@v4 with: version: '5.15.2' arch: 'gcc_64' - - name: 'Linux: Build' - if: matrix.name == 'Linux' + - name: 'Build' run: | mkdir build cd build - cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION + cmake -S .. -B . -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION make -j$(nproc) cpack -G DEB - # ====================================== - # macOS-intel - # ====================================== + - name: 'Upload Artifact' + uses: actions/upload-artifact@v7 + with: + name: Linux-${{ env.CONFIGURATION }}-qt-editor.deb + path: build/relive-qt-editor-0.1.1-Linux.deb + archive: false + + build-macos-intel: + runs-on: macos-26-intel + name: macOS Intel + + steps: + - name: Checkout repository recursively + uses: actions/checkout@v4 + with: + submodules: recursive - - name: 'macOS-intel: Install Qt 5.15.2' - if: matrix.name == 'macOS-intel' + - name: 'Install Qt 5.15.2' uses: jurplel/install-qt-action@v4 with: version: '5.15.2' arch: 'clang_64' - # TODO: mac artifacts - # cpack -G DragNDrop - - - name: 'macOS-intel: Build' - if: matrix.name == 'macOS-intel' + - name: 'Build' run: | mkdir build cd build - cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake -S .. -B . -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DCMAKE_POLICY_VERSION_MINIMUM=3.5 make -j4 - # ====================================== - # Artifacts - # ====================================== - - - name: 'Windows: Upload qt-editor binaries' - if: runner.os == 'Windows' - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }}-${{ env.CONFIGURATION }}-qt-editor - path: build\${{ env.CONFIGURATION }}\deploy - - - name: 'Linux: Upload qt-editor deb' - if: matrix.name == 'Linux' - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }}-${{ env.CONFIGURATION }}-qt-editor.deb - path: build/qt-editor-0.1.1-Linux.deb - - # TODO + # TODO: mac artifacts + # cpack -G DragNDrop - # - name: 'macOS-intel: Upload relive dmg' - # if: matrix.name == 'macOS-intel' - # uses: actions/upload-artifact@v4 + # - name: 'Upload Artifact' + # uses: actions/upload-artifact@v7 # with: - # name: ${{ matrix.name }}-${{ env.CONFIGURATION }}-relive.dmg - # path: build/relive-0.1-Darwin.dmg + # name: Intel-${{ env.CONFIGURATION }}-relive.dmg + # path: build/relive-0.1-Darwin.dmg \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 3032bfc..67562eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,12 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# without this the editor will crash on startup: +# qt-editor: symbol lookup error: qt-editor: undefined symbol: _ZdlPvm, version Qt_5 +if(UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-sized-deallocation") +endif() + # QtCreator supports the following variables for Android, which are identical to qmake Android variables. # Check https://doc.qt.io/qt/deployment-android.html for more information. # They need to be set before the find_package( ...) calls below. @@ -31,6 +37,7 @@ set(TS_FILES qt-editor_en_GB.ts qt-editor_German.ts) add_subdirectory(3rdParty/libmodplug) add_subdirectory(3rdParty/alive_reversing/Source/Tools/relive_api) +add_subdirectory(assets) include_directories(3rdParty/libmodplug/src) include_directories(3rdParty/jsonxx) @@ -145,9 +152,18 @@ endif() target_link_libraries(qt-editor PUBLIC relive_api Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Multimedia modplug jsonxx) -set(CPACK_PACKAGE_NAME "qt-editor") +set(CPACK_PACKAGE_NAME "relive-qt-editor") set(CPACK_PACKAGE_CONTACT "nemin@oddwords.hu") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://aliveteam.github.io/") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "qtdeclarative5-dev, qtmultimedia5-dev, qttools5-dev") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5core5a, libqt5gui5, libqt5widgets5, libqt5network5, libqt5multimedia5") +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "An Open-Source Level Editor for Abe's Oddysee and Abe's Exoddus. +Team R.E.L.I.V.E. proudly presents the replacement for the legacy Paul's Level Editor. + . +Compared to the old editor it allows for editing far more kinds of objects, removes the arbitrary limitations the original engine imposed, and features a vastly improved user interface.") + +if(UNIX) + set_target_properties(qt-editor PROPERTIES OUTPUT_NAME relive-qt-editor) + install(TARGETS qt-editor DESTINATION bin) +endif() INCLUDE(CPack) \ No newline at end of file diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt new file mode 100644 index 0000000..82cc7de --- /dev/null +++ b/assets/CMakeLists.txt @@ -0,0 +1,4 @@ +if(UNIX) + install(FILES "${CMAKE_SOURCE_DIR}/Source/rsc/icons/icon.png" DESTINATION share/pixmaps/ RENAME relive-qt-editor.png) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/relive-qt-editor.desktop" DESTINATION share/applications/) +endif() diff --git a/assets/relive-qt-editor.desktop b/assets/relive-qt-editor.desktop new file mode 100644 index 0000000..98fb8c6 --- /dev/null +++ b/assets/relive-qt-editor.desktop @@ -0,0 +1,28 @@ +[Desktop Entry] + +# The type as listed above +Type=Application + +# The version of the desktop entry specification to which this file complies +Version=1.0 + +# The name of the application +Name=relive-qt-editor + +# A comment which can/will be used as a tooltip +Comment=An Open-Source Level Editor for Abe's Oddysee and Abe's Exoddus + +# The path to the folder in which the executable is run +Path=/usr/bin/ + +# The executable of the application, possibly with arguments. +Exec=relive-qt-editor + +# The name of the icon that will be used to display this entry +Icon=relive-qt-editor.png + +# Describes whether this application needs to be run in a terminal or not +Terminal=false + +# Describes the categories in which this entry should be shown +Categories=Utility \ No newline at end of file