From 7b2bde673e766c5b9581dc477695d044b643ccb6 Mon Sep 17 00:00:00 2001 From: lebatuananh Date: Wed, 15 Jul 2026 11:49:18 +0900 Subject: [PATCH] feat(linux): add DEB/RPM packaging and expand installation docs - Add CPack DEB generator (Ubuntu 24.04+/Debian 12+) with proper dependencies - Add CPack RPM generator (Fedora 38+/openSUSE Tumbleweed) - Add custom cmake targets: deb, rpm - Update GitHub Actions to build and upload .deb/.rpm artifacts - Include .deb/.rpm in release upload step - Expand README.md Installation section with per-platform instructions - Add deploy/linux/INSTALL.md with detailed Linux install guide Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build.yml | 30 ++++++++- .gitignore | 1 + README.md | 86 ++++++++++++++++++++++--- cmake/PackagingLinux.cmake | 51 +++++++++++++++ deploy/linux/INSTALL.md | 125 ++++++++++++++++++++++++++++++++++++ 5 files changed, 283 insertions(+), 10 deletions(-) create mode 100644 deploy/linux/INSTALL.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f004c1fd5..21fc6fd55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: if: runner.os == 'Linux' run: | echo "DISTRIBUTION=AppImage" >> "$GITHUB_ENV" - sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse libxcb-cursor-dev libcups2-dev libcurl4-openssl-dev + sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse libxcb-cursor-dev libcups2-dev libcurl4-openssl-dev rpm - name: Configure run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DAPP_DISTRIBUTION=${{ env.DISTRIBUTION }} @@ -144,6 +144,10 @@ jobs: if: runner.os == 'Linux' run: cmake --build build --target appimage --parallel + - name: Build Linux DEB and RPM packages + if: runner.os == 'Linux' + run: cmake --build build --target deb rpm + - name: Upload Windows zip Package uses: actions/upload-artifact@v6 if: runner.os == 'Windows' @@ -172,6 +176,20 @@ jobs: name: NotepadAI-Linux-AppImage-${{ steps.qt.outputs.suffix }} path: ${{ github.workspace }}/build/NotepadAI*.AppImage + - name: Upload Linux DEB package + uses: actions/upload-artifact@v6 + if: runner.os == 'Linux' + with: + name: NotepadAI-Linux-DEB-${{ steps.qt.outputs.suffix }} + path: ${{ github.workspace }}/build/NotepadAI*.deb + + - name: Upload Linux RPM package + uses: actions/upload-artifact@v6 + if: runner.os == 'Linux' + with: + name: NotepadAI-Linux-RPM-${{ steps.qt.outputs.suffix }} + path: ${{ github.workspace }}/build/NotepadAI*.rpm + release: name: Publish GitHub Release runs-on: ubuntu-latest @@ -223,6 +241,16 @@ jobs: "NotepadAI-${TAG}-${suffix}-x86_64.AppImage" gh release upload "$TAG" "NotepadAI-${TAG}-${suffix}-x86_64.AppImage" + # Linux DEB + mv "NotepadAI-Linux-DEB-${suffix}"/NotepadAI*.deb \ + "NotepadAI-${TAG}-${suffix}-amd64.deb" + gh release upload "$TAG" "NotepadAI-${TAG}-${suffix}-amd64.deb" + + # Linux RPM + mv "NotepadAI-Linux-RPM-${suffix}"/NotepadAI*.rpm \ + "NotepadAI-${TAG}-${suffix}-x86_64.rpm" + gh release upload "$TAG" "NotepadAI-${TAG}-${suffix}-x86_64.rpm" + # macOS dmg mv "NotepadAI-macOS-${suffix}"/NotepadAI*.dmg \ "NotepadAI-${TAG}-${suffix}.dmg" diff --git a/.gitignore b/.gitignore index 9f7006b05..41e3cd7db 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,4 @@ __cmake_systeminformation .ninja_lock .ninja_log build.ninja +.claude/settings.local.json diff --git a/README.md b/README.md index 85c197825..30f39792d 100644 --- a/README.md +++ b/README.md @@ -34,24 +34,92 @@ You can define mini-apps — small HTML/JS tools that run in a native WebView in ## Installation -Grab a binary from the [Releases](https://github.com/nullmastermind/NotepadAI/releases) page. +Download from the [Releases](https://github.com/nullmastermind/NotepadAI/releases) page. -| Platform | Format | -|----------|--------| -| Windows | Installer (.exe) or portable zip | -| Linux | AppImage | -| macOS | Disk image (.dmg) | +### Windows -## Building from source +Download the installer (.exe) or the portable zip. The installer registers file associations and adds a Start Menu shortcut. The portable zip runs from any folder with no install step. -You need CMake 3.21+, Qt 6.5+, Ninja, and a C++20 compiler (MSVC, clang-cl, GCC, or Clang). +### macOS + +Download the disk image (.dmg), open it, and drag NotepadAI to Applications. + +### Linux + +#### AppImage (all distributions) + +AppImage runs on any x86_64 Linux distribution without installation. + +Requirements: FUSE 2 (`libfuse2`). Ubuntu 22.04+ and Fedora 38+ include it. On Ubuntu 24.04: + +```bash +sudo apt-get install libfuse2 +``` + +Run: + +```bash +chmod +x NotepadAI-*.AppImage +./NotepadAI-*.AppImage +``` + +To integrate with your desktop, move to `~/.local/bin/` and use a tool like `appimaged`. + +#### DEB package (Ubuntu 24.04+ / Debian 12+) + +```bash +sudo apt install ./NotepadAI-*-amd64.deb +``` + +Uninstall: `sudo apt remove notepadai` + +#### RPM package (Fedora 38+ / openSUSE Tumbleweed) + +Fedora: + +```bash +sudo dnf install ./NotepadAI-*-x86_64.rpm +``` + +openSUSE: + +```bash +sudo zypper install ./NotepadAI-*-x86_64.rpm +``` + +Uninstall: `sudo dnf remove notepadai` or `sudo zypper remove notepadai` + +### Building from source + +You need CMake 3.21+, Qt 6.5+, Ninja, and a C++20 compiler. + +Ubuntu/Debian build deps: + +```bash +sudo apt-get install cmake ninja-build \ + qt6-base-dev qt6-base-private-dev libqt6core5compat6-dev \ + libxkbcommon-dev libxcb-cursor-dev libcups2-dev libcurl4-openssl-dev +``` + +Fedora build deps: + +```bash +sudo dnf install cmake ninja-build \ + qt6-qtbase-devel qt6-qt5compat-devel \ + libxkbcommon-devel libxcb-devel +``` + +Build: ```bash +git clone https://github.com/nullmastermind/NotepadAI.git +cd NotepadAI cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel +sudo cmake --install build --prefix /usr/local ``` -For platform-specific details and packaging on Windows, macOS, and Linux, see [doc/Building.md](doc/Building.md). +For packaging details see [doc/Building.md](doc/Building.md). ## Multi-instance and portable mode diff --git a/cmake/PackagingLinux.cmake b/cmake/PackagingLinux.cmake index fd1a20a49..2eab9495c 100644 --- a/cmake/PackagingLinux.cmake +++ b/cmake/PackagingLinux.cmake @@ -88,3 +88,54 @@ add_custom_target(appimage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} DEPENDS appdir download_linuxdeploy ) + +# --------------------------------------------------------------------------- +# CPack shared metadata +# --------------------------------------------------------------------------- +set(CPACK_PACKAGE_NAME "notepadai") +set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") +set(CPACK_PACKAGE_CONTACT "NotepadAI Maintainers ") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "AI-powered text editor") +set(CPACK_PACKAGE_DESCRIPTION + "NotepadAI is an AI-powered cross-platform text editor built with Qt6.") +set(CPACK_PACKAGE_FILE_NAME "NotepadAI-${PROJECT_VERSION}-Linux-x86_64") + +# --------------------------------------------------------------------------- +# CPack DEB configuration +# --------------------------------------------------------------------------- +set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "NotepadAI Maintainers ") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/nullmastermind/NotepadAI") +set(CPACK_DEBIAN_PACKAGE_DEPENDS + "libqt6core6 (>= 6.5), libqt6gui6 (>= 6.5), libqt6widgets6 (>= 6.5), libqt6network6 (>= 6.5), libqt6printsupport6 (>= 6.5), libqt6concurrent6 (>= 6.5), libxkbcommon0, libxcb-cursor0") +set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libsecret-1-0") +set(CPACK_DEBIAN_PACKAGE_SECTION "editors") +set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") + +# --------------------------------------------------------------------------- +# CPack RPM configuration +# --------------------------------------------------------------------------- +set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64") +set(CPACK_RPM_PACKAGE_LICENSE "GPL-3.0-or-later") +set(CPACK_RPM_PACKAGE_VENDOR "NotepadAI") +set(CPACK_RPM_PACKAGE_URL "https://github.com/nullmastermind/NotepadAI") +set(CPACK_RPM_PACKAGE_DESCRIPTION + "NotepadAI is an AI-powered cross-platform text editor built with Qt6.") +set(CPACK_RPM_PACKAGE_REQUIRES "qt6-qtbase >= 6.5, libxkbcommon, libsecret") +set(CPACK_RPM_PACKAGE_GROUP "Applications/Editors") + +include(CPack) + +# Custom target: build .deb package +add_custom_target(deb + COMMAND ${CMAKE_CPACK_COMMAND} -G DEB + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Building DEB package" +) + +# Custom target: build .rpm package +add_custom_target(rpm + COMMAND ${CMAKE_CPACK_COMMAND} -G RPM + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Building RPM package" +) diff --git a/deploy/linux/INSTALL.md b/deploy/linux/INSTALL.md new file mode 100644 index 000000000..feddc3f94 --- /dev/null +++ b/deploy/linux/INSTALL.md @@ -0,0 +1,125 @@ +# Installing NotepadAI on Linux + +NotepadAI is available for Linux in three pre-built formats and can also be built from source. + +## AppImage (Universal — all distributions) + +AppImage runs on any x86_64 Linux distribution without installation. + +**Requirements:** FUSE 2 (`libfuse2`) must be available. Ubuntu 22.04+ and Fedora 38+ include it. On Ubuntu 24.04 install it with: + +```bash +sudo apt-get install libfuse2 +``` + +**Steps:** + +```bash +# Download the AppImage from the GitHub releases page +chmod +x NotepadAI-*.AppImage +./NotepadAI-*.AppImage +``` + +To integrate with your desktop launcher, move the file to `~/.local/bin/` and create a `.desktop` shortcut, or use a tool like `appimaged`. + +--- + +## DEB package (Ubuntu 24.04+ / Debian 12+) + +The .deb package installs NotepadAI as a native system package and integrates with `apt`. + +**Supported distributions:** + +- Ubuntu 24.04 (Noble) and later +- Debian 12 (Bookworm) and later + +These distributions ship Qt 6.5+ in their official repositories, which is required by the package. +For older Ubuntu/Debian versions use the AppImage instead. + +**Install:** + +```bash +# Download NotepadAI-*-amd64.deb from the GitHub releases page +sudo apt install ./NotepadAI-*-amd64.deb +``` + +**Uninstall:** + +```bash +sudo apt remove notepadai +``` + +--- + +## RPM package (Fedora 38+ / openSUSE Tumbleweed) + +**Supported distributions:** + +- Fedora 38 and later +- openSUSE Tumbleweed + +**Install on Fedora:** + +```bash +# Download NotepadAI-*-x86_64.rpm from the GitHub releases page +sudo dnf install ./NotepadAI-*-x86_64.rpm +``` + +**Install on openSUSE:** + +```bash +sudo zypper install ./NotepadAI-*-x86_64.rpm +``` + +**Uninstall on Fedora:** + +```bash +sudo dnf remove notepadai +``` + +**Uninstall on openSUSE:** + +```bash +sudo zypper remove notepadai +``` + +--- + +## Build from source + +**Build dependencies:** + +- CMake 3.21 or later +- Ninja +- Qt 6.5 or later (qtbase, qtnetwork, qt5compat modules) +- A C++17-capable compiler (GCC 11+ or Clang 13+) +- `libxkbcommon-dev`, `libxcb-cursor-dev` + +On Ubuntu/Debian: + +```bash +sudo apt-get install cmake ninja-build \ + qt6-base-dev qt6-base-private-dev libqt6core5compat6-dev \ + libxkbcommon-dev libxcb-cursor-dev \ + libcups2-dev libcurl4-openssl-dev +``` + +On Fedora: + +```bash +sudo dnf install cmake ninja-build \ + qt6-qtbase-devel qt6-qt5compat-devel \ + libxkbcommon-devel libxcb-devel +``` + +**Build and install:** + +```bash +git clone https://github.com/nullmastermind/NotepadAI.git +cd NotepadAI +cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release +cmake --build build --parallel +sudo cmake --install build --prefix /usr/local +``` + +The binary will be at `/usr/local/bin/NotepadAI`.