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: [master]

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"
156 changes: 156 additions & 0 deletions .omnipackage/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# omnipackage configuration — generated by `omnipackage init`.
# Docs: https://docs.omnipackage.org
#
# REQUIRED EDITS before first build:
# 1. Generate a GPG key for signing packages:
# omnipackage gpg generate -n "Your Name" -e you@example.com --format base64
# Put the printed value into the GPG_KEY environment variable (e.g. in .env).
# 2. Configure at least one repository below (S3 bucket or local fs).
# 3. Add your CMake-discovered libraries to `build_dependencies` (Qt, Boost, etc.).
# 4. Trim the `builds:` list to the distros you actually ship.
#
# Liquid tags ({{ ... }}, {% ... %}) are rendered at *build* time — leave them as-is.

# Reads the version from CMakeLists.txt: `project(<name> VERSION x.y.z LANGUAGES …)`.
# If your project version lives elsewhere, point this at that file.
version_extractors:
- name: default
provider: "file"
file:
file: "CMakeLists.txt"
regex: 'project\([^)]*VERSION ([0-9.]+)'

common: &common
package_name: "notepadnext"
maintainer: "Oleg Antonyan <oleg.b.antonyan@gmail.com>"
homepage: https://github.com/dail8859/NotepadNext
description: "A cross-platform, reimplementation of Notepad++"

# Files/dirs to skip when staging the source tree into the build container.
# Excludes apply to both rpm and deb. Patterns are gitignore-style:
# "name" matches any file/dir of that name at any depth
# "/name" matches only at the source root (anchored)
# "*.ext" basename glob, matches at any depth
ignore_source_files:
- .git
- .env
- .DS_Store
- "*.log"
- "*.o"
- "*.a"
- /build
- /CMakeCache.txt
- /CMakeFiles
- /.cpm-cache

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

- name: R2 test repo
provider: s3
gpg_private_key_base64: "${GPG_PRIVATE_KEY_BASE64}"
<<: *common
s3:
bucket: repositories-test
path_in_bucket: "notepadnext"
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}"
# Qt6 modules: Core/Gui/Widgets/Network/PrintSupport (qtbase) + Core5Compat +
# LinguistTools (lrelease) at build. `git` is needed because CPM fetches a few
# bundled deps from GitHub at configure time. Package names differ per family.

# Fedora / RHEL family.
fedora_rpm: &fedora_rpm
<<: *common
build_dependencies:
- gcc-c++
- cmake
- make
- git
- qt6-qtbase-devel
- qt6-qtbase-private-devel # GuiPrivate, required by bundled ADS
- qt6-qttools-devel
- qt6-qt5compat-devel
- mesa-libGL-devel
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

# openSUSE (Qt6 package names differ from Fedora).
opensuse_rpm: &opensuse_rpm
<<: *common
build_dependencies:
- gcc-c++
- cmake
- make
- git
- qt6-base-devel
- qt6-base-private-devel # GuiPrivate, required by bundled ADS
- qt6-tools-devel
- qt6-linguist-devel
- qt6-qt5compat-devel
- Mesa-libGL-devel
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

# AlmaLinux / Rocky 10: Qt6 comes from EPEL/CRB, set up before the build.
el_rpm: &el_rpm
<<: *common
build_dependencies:
- gcc-c++
- cmake
- make
- git
before_build_script: >-
dnf install -y epel-release &&
dnf install -y --nobest --enablerepo=crb
qt6-qtbase-devel qt6-qtbase-private-devel qt6-qttools-devel qt6-qt5compat-devel mesa-libGL-devel
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

# Debian / Ubuntu.
deb: &deb
<<: *common
build_dependencies:
- build-essential
- cmake
- git
- qt6-base-dev
- qt6-base-private-dev # GuiPrivate, required by bundled ADS
- qt6-tools-dev
- qt6-l10n-tools
- qt6-5compat-dev
- libgl-dev
deb:
debian_templates: ".omnipackage/deb"

# NotepadNext hard-requires Qt6 + Core5Compat (no Qt5 fallback), so only distros
# shipping Qt6 with the qt5compat module and a C++20 compiler are targeted.
builds:
- { distro: "fedora_40", <<: *fedora_rpm }
- { distro: "fedora_41", <<: *fedora_rpm }
- { 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 }
- { distro: "debian_12", <<: *deb }
- { distro: "debian_13", <<: *deb }
- { distro: "debian_testing", <<: *deb }
- { distro: "debian_unstable", <<: *deb }
- { distro: "ubuntu_24.04", <<: *deb }
- { distro: "ubuntu_25.04", <<: *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 @@
10
11 changes: 11 additions & 0 deletions .omnipackage/deb/control.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Source: {{ package_name }}
Priority: optional
Maintainer: {{ maintainer }}
Build-Depends: debhelper (>= 8.0.0), {{ build_dependencies | join: ', ' }}
Standards-Version: 3.9.4
Homepage: {{ homepage }}

Package: {{ package_name }}
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, {{ runtime_dependencies | join: ', ' }}
Description: {{ description }}
21 changes: 21 additions & 0 deletions .omnipackage/deb/rules.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/make -f
# debian.rules — Debian build rules for a CMake project. Indents are TABS.
# -*- makefile -*-

# Raw cmake (not dh_auto_configure) so CPM can fetch bundled deps at configure time
# (dh_auto_configure forces FETCHCONTENT_FULLY_DISCONNECTED=ON). Install only the
# 'notepadnext' component so the bundled ADS library's own install rules (headers,
# static lib, cmake config) are left out.
%:
dh $@

override_dh_auto_configure:
cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr

override_dh_auto_build:
cmake --build _build --parallel

override_dh_auto_test:

override_dh_auto_install:
DESTDIR=$(CURDIR)/debian/{{ package_name }} cmake --install _build --component notepadnext
52 changes: 52 additions & 0 deletions .omnipackage/specfile.spec.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# RPM spec template rendered at build time. Adjust install paths for any
# additional resources your CMake project installs (icons, .desktop files).
Name: {{ package_name }}
Version: {{ version }}
Release: 1%{?dist}
Summary: {{ description }}
License: GPL-3.0-or-later
URL: {{ homepage }}
Source0: {{ source_folder_name }}.tar.gz
Vendor: OmniPackage

BuildRequires: {{ build_dependencies | join: ' ' }}
{% if runtime_dependencies.size > 0 %}
Requires: {{ runtime_dependencies | join: ', ' }}
{% endif %}

%define debug_package %{nil}
%define _build_id_links none

%description
{{ description }}


%prep
%setup -q


%build
# CPM fetches bundled deps from GitHub at configure time (needs git + network).
cmake -S . -B _build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build _build %{?_smp_mflags}


%install
# --component notepadnext: ship only the app, not the bundled ADS lib's install files.
DESTDIR=%{buildroot} cmake --install _build --component notepadnext


%files
%license LICENSE
%{_bindir}/NotepadNext
%{_datadir}/applications/NotepadNext.desktop
%{_datadir}/icons/hicolor/scalable/apps/NotepadNext.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/NotepadNext.svg
%{_datadir}/metainfo/com.github.dail8859.NotepadNext.metainfo.xml


%changelog
* Tue Jun 02 2026 {{ maintainer }}
- Initial package release
19 changes: 18 additions & 1 deletion cmake/Packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,22 @@ if(APPLE)
endif()

if(UNIX AND NOT APPLE)
include(${CMAKE_CURRENT_LIST_DIR}/PackagingLinux.cmake OPTIONAL)
# Install rules for native Linux packages (rpm/deb via omnipackage). Tagged
# with a component so `cmake --install --component notepadnext` ships only the
# app, skipping the bundled ADS library's own install rules (headers/static lib).
include(GNUInstallDirs)
install(TARGETS NotepadNext RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT notepadnext)
install(FILES ${PROJECT_SOURCE_DIR}/deploy/linux/NotepadNext.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT notepadnext)
install(FILES ${PROJECT_SOURCE_DIR}/deploy/linux/com.github.dail8859.NotepadNext.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo COMPONENT notepadnext)
install(FILES ${PROJECT_SOURCE_DIR}/icon/NotepadNext.svg
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps COMPONENT notepadnext)
install(FILES ${PROJECT_SOURCE_DIR}/icon/NotepadNext.svg
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes COMPONENT notepadnext)

# AppImage build machinery (needs qmake) — only when explicitly requested.
if(APP_DISTRIBUTION)
include(${CMAKE_CURRENT_LIST_DIR}/PackagingLinux.cmake OPTIONAL)
endif()
endif()
18 changes: 2 additions & 16 deletions cmake/PackagingLinux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,8 @@ endif()
message(STATUS "Using qmake for AppImage packaging: ${APPIMAGE_QMAKE}")
list(APPEND APPIMAGE_ENV_VARS QMAKE=${APPIMAGE_QMAKE})

install(TARGETS NotepadNext
RUNTIME DESTINATION bin
)
install(FILES
${PROJECT_SOURCE_DIR}/deploy/linux/NotepadNext.desktop
DESTINATION share/applications
)
install(FILES
${PROJECT_SOURCE_DIR}/icon/NotepadNext.svg
DESTINATION share/icons/hicolor/scalable/apps
)
install(FILES
${PROJECT_SOURCE_DIR}/icon/NotepadNext.svg
DESTINATION share/icons/hicolor/scalable/mimetypes
)

# Install rules live in Packaging.cmake (always-on for Linux); this file is the
# AppImage builder only. The targets below reuse those install rules via AppDir.
add_custom_target(appdir
COMMAND ${CMAKE_COMMAND}
--install .
Expand Down