SparkNotePad

Native Build & Packaging Guide — Debian 12+ & Ubuntu 22.04+

1. Overview & Lineage

SparkNotePad is a fast, versatile native Linux and macOS desktop text editor built on the Scintilla 5.6.7 and Lexilla 5.5.4 editing engines with a native Qt 6 GUI (no Win32 emulation, no Wine layer).

This guide provides step-by-step native compilation and .deb packaging instructions for:

Lineage & Upstream Reference: This document incorporates native Linux build strategies established in upstream projects and community reference implementations, notably Jeremie Conte’s NotepadNext-native-linux (BUILD-UBUNTU-26.04.md), adapted for SparkNotePad’s architecture.


2. Build Dependencies

Install the required system compilers, CMake, Qt6 development libraries, and X11/XCB headers.

2.1 Ubuntu 24.04 LTS (Noble), Ubuntu 26.04 LTS & Debian 13 (Trixie)

sudo apt update
sudo apt install -y \
    build-essential cmake ninja-build pkgconf \
    qt6-base-dev qt6-base-private-dev qt6-base-dev-tools \
    qt6-5compat-dev qt6-tools-dev qt6-tools-dev-tools linguist-qt6 \
    libgl1-mesa-dev libxkbcommon-dev libxkbcommon-x11-0 \
    libfontconfig1-dev libfreetype6-dev libxcb1-dev libxcb-cursor-dev \
    dpkg-dev rpm

2.2 Ubuntu 22.04 LTS (Jammy) & Debian 12 (Bookworm)

On Ubuntu 22.04 and Debian 12, install the standard Qt6 developer packages:

sudo apt update
sudo apt install -y \
    build-essential g++-12 cmake ninja-build pkg-config \
    qt6-base-dev qt6-base-dev-tools \
    qt6-5compat-dev qt6-tools-dev qt6-tools-dev-tools linguist-qt6 \
    libgl1-mesa-dev libxkbcommon-dev libxkbcommon-x11-0 \
    libfontconfig1-dev libfreetype6-dev libxcb1-dev libxcb-cursor-dev \
    dpkg-dev rpm

(On Ubuntu 22.04, g++-12 provides optimal C++20 standard library support for Scintilla and Lexilla).


3. Vendored & Automatic Dependencies (CPM)

SparkNotePad vendors core editing algorithms directly within thirdparty/ for reproducibility and offline stability:

Auxiliary Qt utilities are retrieved automatically via CPM (CMake Package Manager) during CMake configuration (internet connection required only on the first configure):


4. Technical Portage Notes & Workarounds

4.1 Qt-Advanced-Docking-System & Qt6::GuiPrivate on Qt ≥ 6.9

As documented in NotepadNext-native-linux/BUILD-UBUNTU-26.04.md:

4.2 glibc Backward Compatibility Invariant


5. Compilation & Build Steps

# 1. Clone repository
git clone https://github.com/alsyundawy/SparkNotePad.git
cd SparkNotePad

# 2. Configure CMake Release build
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release

# 3. Build executable in parallel
cmake --build build --parallel "$(nproc)"

# 4. Run binary directly
./build/src/SparkNotePad

Binary hardening flags (RELRO, -z now, -fstack-protector-strong, -D_FORTIFY_SOURCE=2) are enabled automatically by the root CMakeLists.txt.


6. Packaging as .deb & .rpm

# Generate Debian package (.deb)
cmake --build build --target deb

# Generate Red Hat package (.rpm)
cmake --build build --target rpm

The resulting files will be placed in build/:

6.1 Inspect Package Metadata

# Inspect generated Debian package control metadata:
dpkg-deb -I build/sparknotepad_1.3.5_amd64.deb

# Verify file contents inside .deb:
dpkg-deb -c build/sparknotepad_1.3.5_amd64.deb

7. Installing with Automated Dependency Resolution

To install the .deb package while automatically resolving and downloading all required dependencies from APT repositories:

# ✅ Recommended APT installation command (local file):
sudo apt install ./build/sparknotepad_1.3.5_amd64.deb

Why apt install ./file.deb instead of dpkg -i?
dpkg -i is a low-level unpacker that cannot query APT repository mirrors. sudo apt install ./file.deb calculates the full dependency graph and automatically downloads required Qt6 libraries (libqt6widgets6, qt6-qpa-plugins, etc.) just like sudo dnf install ./file.rpm does on Fedora.