Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/omnipackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Linux packages (omnipackage)

on:
workflow_dispatch:
push:
branches: [main]

jobs:
list-distros:
runs-on: ubuntu-24.04
outputs:
distros: ${{ steps.get-distros.outputs.distros }}
steps:
- name: Install omnipackage
run: |
echo 'deb https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04 stable/' | sudo tee /etc/apt/sources.list.d/omnipackage_omnipackage.list
curl -fsSL https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04/stable/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/omnipackage_omnipackage.gpg > /dev/null
sudo apt-get update
sudo apt-get install -y omnipackage

- uses: actions/checkout@v6

- name: Get distro list
id: get-distros
run: echo "distros=$(omnipackage info --list-distros . --format json)" >> "$GITHUB_OUTPUT"

release:
needs: [list-distros]
runs-on: ubuntu-24.04
concurrency:
group: omnipackage-${{ matrix.distro }}
cancel-in-progress: false
strategy:
fail-fast: false
matrix:
distro: ${{ fromJson(needs.list-distros.outputs.distros) }}
steps:
- name: Install omnipackage
run: |
echo 'deb https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04 stable/' | sudo tee /etc/apt/sources.list.d/omnipackage_omnipackage.list
curl -fsSL https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04/stable/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/omnipackage_omnipackage.gpg > /dev/null
sudo apt-get update
sudo apt-get install -y omnipackage

- uses: actions/checkout@v6
with:
submodules: recursive

- run: echo "${{ secrets.OMNIPACKAGE_DOTENV }}" > .env

- name: Release packages for ${{ matrix.distro }}
run: omnipackage release . --distros "${{ matrix.distro }}" --repository "R2 test repo"
212 changes: 212 additions & 0 deletions .omnipackage/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# omnipackage config: native DEB/RPM packages for Librum (Qt6/QML e-book reader).
# Docs: https://docs.omnipackage.org
#
# Build notes:
# - Heavy dep mupdf (libs/mupdf) builds via scripts/mupdfwrap.py with a Python venv that
# pip-installs libclang/swig — the build container needs network (omnipackage has it).
# - Internal libs install to a hardcoded `lib`; the spec relocates them to %{_libdir} on lib64.
# - Matrix is limited to distros shipping Qt >= 6.5.
#
# To publish later: generate a signing key (omnipackage gpg generate ... --format base64),
# set GPG_KEY, and add a `repositories:` block (see the init scaffold / mpz config).

# Real version lives in app_info.json (project(Librum VERSION 0.1) in CMakeLists is stale).
version_extractors:
- name: stable
provider: "file"
file:
file: "app_info.json"
regex: '"currentVersion":\s*"([0-9.]+)"'
- name: git
provider: "shell"
shell:
command: printf '0.99~next.%s.%s' $(git log -1 --format='%cd %h' --date=format:'%Y%m%d%H%M%S')

common: &common
package_name: "librum"
maintainer: "Oleg Antonyan <oleg.b.antonyan@gmail.com>"
homepage: "https://librumreader.com"
description: "Modern e-book reader and library manager (Qt6/QML)"

repositories:
- name: R2 test repo
provider: s3
gpg_private_key_base64: "${GPG_PRIVATE_KEY_BASE64}"
<<: *common
s3:
bucket: repositories-test
path_in_bucket: "librum"
bucket_public_url: "https://repositories-test.omnipackage.org"
endpoint: "${CLOUDFLARE_R2_ENDPOINT}"
access_key_id: "${CLOUDFLARE_R2_ACCESS_KEY_ID}"
secret_access_key: "${CLOUDFLARE_R2_SECRET_ACCESS_KEY}"
region: auto
force_path_style: true
cloudflare_zone_id: "${CLOUDFLARE_ZONE_ID}"
cloudflare_api_token: "${CLOUDFLARE_API_TOKEN}"

- name: Local test
gpg_private_key_base64: "${GPG_PRIVATE_KEY_BASE64}"
provider: localfs
<<: *common
localfs:
path: "${HOME}/librum-repositories"


# Files/dirs skipped when staging the source tree (gitignore-style; applies to rpm and deb).
ignore_source_files:
- .git
- .env
- .DS_Store
- "*.log"
- /build
- /libs/mupdf/build # stale host artifacts; the container rebuilds mupdf in-tree
- "venv-mupdfwrap-*"

# Fedora / RHEL family naming.
fedora_rpm: &fedora_rpm
<<: *common
build_dependencies:
- gcc-c++
- cmake
- make
- git
- unzip # mupdf docx_template_build.py shells out to unzip
- qt6-qtbase-devel
- qt6-qtdeclarative-devel
- qt6-qttools-devel
- libjpeg-turbo-devel
- mesa-libGL-devel
- python3
- python3-pip
- pkgconf-pkg-config
runtime_dependencies:
- qt6-qtsvg # dlopened SVG imageformat plugin (app icons are SVG)
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

# openSUSE (package names differ from Fedora).
opensuse_rpm: &opensuse_rpm
<<: *common
build_dependencies:
- gcc-c++
- cmake
- make
- git
- unzip # mupdf docx_template_build.py shells out to unzip
- qt6-base-devel
- qt6-declarative-devel
- qt6-linguist-devel
- qt6-tools-devel
- libjpeg8-devel
- Mesa-libGL-devel
- python3
- python3-pip
- pkg-config
runtime_dependencies:
- qt6-declarative-imports # QML import trees are a separate pkg, NOT auto-pulled here
- libQt6Svg6 # bundles the SVG imageformat plugin on openSUSE
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

# Enterprise Linux 10 (Alma/Rocky): Qt6 lives in CRB(+EPEL), enabled after the base image,
# so it can't go in build_dependencies (installed before before_build_script).
el_rpm: &el_rpm
<<: *common
build_dependencies:
- gcc-c++
- cmake
- make
- git
- unzip # mupdf docx_template_build.py shells out to unzip
before_build_script: >-
dnf install -y epel-release &&
dnf install -y --nobest --enablerepo=crb
qt6-qtbase-devel qt6-qtdeclarative-devel qt6-qttools-devel
libjpeg-turbo-devel mesa-libGL-devel python3 python3-pip pkgconf-pkg-config
runtime_dependencies:
- qt6-qtsvg
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

# Mageia (Mandriva naming) — DISABLED, not in `builds:` below. Two blockers:
# 1. cauldron repo metadata currently 404s on all mirrors (rolling-dev resync flakiness).
# 2. Mageia uses lib64-style names (qtbase6-common-devel, lib64qt6core-devel, lib64qt6quick-devel,
# lib64qt6qml-devel, lib64qt6tools-devel, ...) — the Fedora-style names below are placeholders.
# To re-enable: wait for the repo to recover, fix names via `omnipackage portal mageia_cauldron`,
# then add `- { distro: "mageia_cauldron", <<: *mageia_rpm }` to builds.
mageia_rpm: &mageia_rpm
<<: *common
build_dependencies:
- gcc-c++
- cmake
- make
- git
- unzip
- qtbase6-common-devel
- lib64qt6core-devel
- lib64qt6gui-devel
- lib64qt6widgets-devel
- lib64qt6network-devel
- lib64qt6qml-devel
- lib64qt6quick-devel
- lib64qt6tools-devel
- lib64jpeg-devel
- python3
- python3-pip
- pkgconf
runtime_dependencies:
- lib64qt6svg-devel
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

# Debian / Ubuntu (Qt6).
deb: &deb
<<: *common
build_dependencies:
- build-essential
- cmake
- git
- unzip # mupdf docx_template_build.py shells out to unzip
- qt6-base-dev
- qt6-declarative-dev
- qt6-tools-dev
- qt6-l10n-tools
- libjpeg-dev
- libgl-dev
- python3
- python3-venv
- python3-pip
- pkg-config
runtime_dependencies:
- qml6-module-qtquick
- qml6-module-qtquick-controls
- qml6-module-qtquick-dialogs
- qml6-module-qtquick-layouts
- qml6-module-qtquick-shapes
- qml6-module-qtcore
- qml6-module-qt-labs-platform
- qml6-module-qt-labs-qmlmodels
- qml6-module-qtqml-models
- qml6-module-qtqml-workerscript
- qt6-svg-plugins # ships the SVG imageformat plugin (libqsvg.so)
deb:
debian_templates: ".omnipackage/deb"

# Only distros shipping Qt >= 6.5 (excludes Debian 12, Ubuntu 24.04, EL <=9, Leap 15.x, Fedora <=41).
builds:
- { distro: "fedora_42", <<: *fedora_rpm }
- { distro: "fedora_43", <<: *fedora_rpm }
- { distro: "fedora_44", <<: *fedora_rpm }
- { distro: "fedora_rawhide", <<: *fedora_rpm }
- { distro: "opensuse_tumbleweed", <<: *opensuse_rpm }
- { distro: "opensuse_16.0", <<: *opensuse_rpm }
- { distro: "almalinux_10", <<: *el_rpm }
- { distro: "rockylinux_10", <<: *el_rpm }
# mageia_cauldron disabled — see the mageia_rpm anchor note above (broken repo + unverified names)
- { distro: "debian_13", <<: *deb }
- { distro: "debian_testing", <<: *deb }
- { distro: "debian_unstable", <<: *deb }
- { distro: "ubuntu_25.04", <<: *deb }
- { distro: "ubuntu_25.10", <<: *deb }
- { distro: "ubuntu_26.04", <<: *deb }
5 changes: 5 additions & 0 deletions .omnipackage/deb/changelog.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ package_name }} ({{ version }}-0) stable; urgency=low

* Release {{ version }}

-- {{ maintainer }} {{ current_time_rfc2822 }}
1 change: 1 addition & 0 deletions .omnipackage/deb/compat.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
13
15 changes: 15 additions & 0 deletions .omnipackage/deb/control.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Source: {{ package_name }}
Section: text
Priority: optional
Maintainer: {{ maintainer }}
Build-Depends: debhelper (>= 13), {{ build_dependencies | join: ', ' }}
Standards-Version: 4.6.2
Homepage: {{ homepage }}

Package: {{ package_name }}
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, {{ runtime_dependencies | join: ', ' }}
Description: {{ description }}
Librum is a modern e-book reader and personal library manager.
It supports common formats (pdf, epub and more), themes, and a built-in
online library synced across devices.
30 changes: 30 additions & 0 deletions .omnipackage/deb/rules.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/make -f
# debian.rules — CMake build rules for Librum. Indents are TABS, not spaces!
# -*- makefile -*-

export DESTROOT=$(CURDIR)/debian/{{ package_name }}
# export DH_VERBOSE=1

%:
dh $@ --parallel --buildsystem=cmake

override_dh_auto_configure:
# Packaging-only QML fix (see .omnipackage/patch-qml.sh) — required for Qt 6.11+.
sh .omnipackage/patch-qml.sh
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF

# Tests are off; nothing to run.
override_dh_auto_test:

override_dh_auto_install:
dh_auto_install
install -Dm644 com.librumreader.librum.metainfo.xml \
$(DESTROOT)/usr/share/metainfo/com.librumreader.librum.metainfo.xml
rm -rf $(DESTROOT)/usr/include $(DESTROOT)/usr/lib/cmake

# The internal libs and bundled libmupdfcpp.so have no shlibs entries (unversioned/private);
# resolve them within the package tree and tolerate the missing dependency info.
override_dh_shlibdeps:
dh_shlibdeps -l$(DESTROOT)/usr/lib -- --ignore-missing-info
20 changes: 20 additions & 0 deletions .omnipackage/patch-qml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
# Build-time, packaging-only QML fix — runs against the STAGED source inside the build
# container, never the committed repo. Invoked from specfile.spec.liquid (%prep) and
# deb/rules.liquid (before configure).
#
# Why: several QML files use IconImage, a type from the *private* QtQuick.Controls.impl
# module, while importing only QtQuick.Controls. Qt < 6.11 leaked that type into the public
# namespace so it resolved; Qt 6.11+ does not -> runtime "IconImage is not a type" and a
# broken UI (first seen on openSUSE Tumbleweed). Injecting the missing import is safe on all
# Qt 6 (the impl module has existed since Qt 6.0; verified working on Qt 6.8 too).
#
# Idempotent: only patches files that use IconImage and lack the impl import.
set -eu

for f in $(grep -rlE '\bIconImage\b' src --include='*.qml' 2>/dev/null || true); do
if ! grep -q 'QtQuick\.Controls\.impl' "$f"; then
sed -i '/^import QtQuick\.Controls$/a import QtQuick.Controls.impl' "$f"
echo "patch-qml: added QtQuick.Controls.impl import to $f"
fi
done
Loading