Skip to content

Commit 2b8372d

Browse files
authored
Merge pull request #118 from pablogventura/feature/flatpak-manifest-ci-docs
Flatpak: runtime refresh, tag CI bundle, README, Boost without tests
2 parents 1c7d396 + fb3e1f6 commit 2b8372d

4 files changed

Lines changed: 74 additions & 11 deletions

File tree

.github/workflows/flatpak.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Build the in-repo Flatpak manifest on release tags (smoke test + downloadable bundle).
2+
# This does not publish to Flathub; see README and https://github.com/ScanTailor-Advanced/scantailor-advanced/issues/105
3+
name: Flatpak
4+
5+
on:
6+
push:
7+
tags:
8+
- "v*"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
flatpak:
16+
runs-on: ubuntu-22.04
17+
timeout-minutes: 120
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Flatpak tools
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y flatpak flatpak-builder
25+
26+
- name: Add Flathub remote
27+
run: |
28+
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
29+
30+
- name: Cache flatpak-builder
31+
uses: actions/cache@v4
32+
with:
33+
path: .flatpak-builder
34+
key: flatpak-builder-${{ hashFiles('flatpak/org.scantailor.Advanced.json') }}-${{ runner.os }}
35+
36+
- name: Build Flatpak
37+
run: |
38+
flatpak-builder --user --repo=repo --force-clean build-dir flatpak/org.scantailor.Advanced.json --install-deps-from=flathub
39+
40+
- name: Create single-file bundle
41+
run: |
42+
flatpak build-bundle repo "ScanTailor-Advanced-${{ github.ref_name }}.flatpak" org.scantailor.Advanced
43+
44+
- name: Upload bundle
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: ScanTailor-Advanced-flatpak-${{ github.ref_name }}
48+
path: "*.flatpak"
49+
if-no-files-found: error

CMakeLists.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ endif()
7070

7171
st_set_default_build_type(Release)
7272

73+
# Must be set before Boost (Flatpak and other chroot builds use -DBUILD_TESTS=OFF; issue #61).
74+
option(BUILD_TESTS "Build unit tests (math_tests, imageproc_tests, core_tests, foundation_tests, qt_tests)" ON)
75+
7376
if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
7477
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
7578
endif()
@@ -193,15 +196,21 @@ if (WIN32)
193196
endif()
194197
set(Boost_USE_MULTITHREADED ON)
195198

196-
find_package(Boost 1.60 COMPONENTS unit_test_framework REQUIRED)
199+
if (BUILD_TESTS)
200+
find_package(Boost 1.60 COMPONENTS unit_test_framework REQUIRED)
201+
else()
202+
find_package(Boost 1.60 REQUIRED)
203+
endif()
197204

198205
include_directories(${Boost_INCLUDE_DIRS})
199206
add_definitions(-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
200-
if (NOT Boost_USE_STATIC_LIBS)
201-
if (WIN32)
202-
add_dynamic_library_locations(Boost::unit_test_framework)
207+
if (BUILD_TESTS)
208+
if (NOT Boost_USE_STATIC_LIBS)
209+
if (WIN32)
210+
add_dynamic_library_locations(Boost::unit_test_framework)
211+
endif()
212+
add_definitions(-DBOOST_TEST_DYN_LINK)
203213
endif()
204-
add_definitions(-DBOOST_TEST_DYN_LINK)
205214
endif()
206215

207216
#=================================== Qt ===================================#
@@ -266,8 +275,6 @@ if (WIN32 AND MSVC)
266275
add_definitions(-DNOMINMAX)
267276
endif()
268277

269-
# Option to disable tests for offline/chroot builds where Boost or test deps may be missing (issue #61).
270-
option(BUILD_TESTS "Build unit tests (math_tests, imageproc_tests, core_tests, foundation_tests, qt_tests)" ON)
271278
if (BUILD_TESTS)
272279
enable_testing()
273280
endif()

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,16 @@ Go to [this repository](https://github.com/ScanTailor-Advanced/scantailor-libs-b
7676

7777
**Linux – Wayland (issue #97):** If you see rendering issues (blank or corrupted windows) when running under Wayland, try starting the application with `QT_QPA_PLATFORM=xcb` to use the X11 compatibility layer.
7878

79-
**Linux – Flatpak / Flathub (issue #105):** End users should prefer **pre-built** binaries from [GitHub Releases](https://github.com/ScanTailor-Advanced/scantailor-advanced/releases) when available (`.deb` / AppImage on tagged releases). A Flatpak manifest for **maintainers** is in `flatpak/org.scantailor.Advanced.json` (`flatpak-builder --user --force-clean build flatpak/org.scantailor.Advanced.json`). Publishing on Flathub needs a **new** application ID (e.g. `org.scantailor.Advanced`) so it does not replace the legacy `com.github._4lex4.*` app.
79+
**Linux – Flatpak / Flathub ([issue #105](https://github.com/ScanTailor-Advanced/scantailor-advanced/issues/105)):**
80+
81+
| | |
82+
|--|--|
83+
| **Day-to-day binaries** | Prefer [GitHub Releases](https://github.com/ScanTailor-Advanced/scantailor-advanced/releases) when the project publishes `.deb` / AppImage (or other) builds for a tagged version. |
84+
| **Install from Flathub** | There is **no** official Flathub listing yet for this fork under the new ID. Shipping there requires a maintainer to follow [Flathub submission](https://docs.flathub.org/docs/for-app-authors/submission/) (separate repo/PR to [flathub/flathub](https://github.com/flathub/flathub)), AppStream metainfo, screenshots, and reviewer feedback. The in-repo manifest is meant to make that step mostly mechanical; issue [#105](https://github.com/ScanTailor-Advanced/scantailor-advanced/issues/105) tracks coordination. |
85+
| **Local Flatpak (maintainers / QA)** | Manifest: [`flatpak/org.scantailor.Advanced.json`](flatpak/org.scantailor.Advanced.json). Example: `flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo` then `flatpak-builder --user --install-deps-from=flathub --force-clean build-dir flatpak/org.scantailor.Advanced.json` (installs the KDE runtime/SDK from Flathub on first run). |
86+
| **CI smoke build** | On each **`v*` tag** push (and via **workflow dispatch**), [`.github/workflows/flatpak.yml`](.github/workflows/flatpak.yml) runs `flatpak-builder` and uploads a **`.flatpak` bundle** as a workflow artifact for smoke testing. This is **not** the Flathub build pipeline. |
87+
88+
**Application ID:** the manifest uses `org.scantailor.Advanced` so it does **not** replace the legacy `com.github._4lex4.*` Flatpak. Author docs: [for app authors](https://docs.flathub.org/docs/for-app-authors/).
8089

8190
**Community examples / test data:** See also [scantailor-testing](https://github.com/ImageProcessing-ElectronicPublications/scantailor-testing) (community repository; issue [#43](https://github.com/ScanTailor-Advanced/scantailor-advanced/issues/43)).
8291

flatpak/org.scantailor.Advanced.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"id": "org.scantailor.Advanced",
33
"runtime": "org.kde.Platform",
4-
"runtime-version": "5.15-22.08",
4+
"runtime-version": "5.15-24.08",
55
"sdk": "org.kde.Sdk",
6-
"base": "org.kde.Sdk",
7-
"base-version": "5.15-22.08",
86
"command": "scantailor",
97
"finish-args": [
108
"--share=ipc",

0 commit comments

Comments
 (0)