From bce66be1375daaa10af52e2d411a0f48a9e73bf3 Mon Sep 17 00:00:00 2001 From: Fatih Bakal Date: Tue, 28 Apr 2026 17:11:39 +0300 Subject: [PATCH 1/5] Wayland fixes --- .github/workflows/build.yml | 9 +++++---- .gitignore | 10 ++++++++++ CMakeLists.txt | 13 +++++++------ doc/Building.md | 38 ++++++++++++++++++++++++++++++++++++- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8aed5f92f..68a8e5917 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ on: branches: - master tags: - - '*' + - "*" pull_request: env: @@ -29,7 +29,7 @@ jobs: uses: jurplel/install-qt-action@v4 with: version: ${{ matrix.qt_version }} - modules: 'qt5compat' + modules: "qt5compat" cache: true - name: Setup Visual Studio Tools @@ -42,12 +42,13 @@ jobs: if: runner.os == 'Windows' uses: repolevedavaj/install-nsis@v1.1.0 with: - nsis-version: '3.11' + nsis-version: "3.11" - name: Setup Linux if: runner.os == 'Linux' run: | echo "DISTRIBUTION=AppImage" >> "$GITHUB_ENV" + echo "EXTRA_PLATFORM_PLUGINS=libqwayland-generic.so" >> "$GITHUB_ENV" sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse libxcb-cursor-dev libcups2-dev - name: Configure @@ -102,7 +103,7 @@ jobs: needs: [build] if: github.repository == 'dail8859/NotepadNext' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 83fe960dc..9f7006b05 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,10 @@ target_wrapper.* # QtCtreator CMake CMakeLists.txt.user* +CMakeCache. +cmake_install.cmake +Makefile +__cmake_systeminformation *.pyc @@ -61,3 +65,9 @@ CMakeLists.txt.user* ._* .cpm-cache/ + +# ninja +.ninja_deps +.ninja_lock +.ninja_log +build.ninja diff --git a/CMakeLists.txt b/CMakeLists.txt index ef7749883..1f4a055ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,15 +17,15 @@ set(CMAKE_CXX_EXTENSIONS OFF) add_compile_definitions(SCI_OWNREGEX) if(MSVC) - # https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio - add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) - add_compile_options(/guard:cf) - add_link_options(/guard:cf) + # https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio + add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + add_compile_options(/guard:cf) + add_link_options(/guard:cf) endif() if(UNIX AND NOT APPLE) - add_compile_options(-fstack-protector-strong -D_FORTIFY_SOURCE=2) - add_link_options(-Wl,-z,relro -Wl,-z,now) + add_compile_options(-fstack-protector-strong -D_FORTIFY_SOURCE=2) + add_link_options(-Wl,-z,relro -Wl,-z,now) endif() find_package(Qt6 @@ -37,6 +37,7 @@ find_package(Qt6 Network PrintSupport Core5Compat + WaylandClient #Majority of the linux desktop uses wayland. ) set(CMAKE_AUTORCC ON) diff --git a/doc/Building.md b/doc/Building.md index 90df7f875..e34b32a54 100644 --- a/doc/Building.md +++ b/doc/Building.md @@ -37,8 +37,44 @@ This section specifically describes how to build Notepad Next using Microsoft's 1. Qt Creator will build and run the project. # Linux +Here's instructions for ubuntu/debian. Should be same across all distros as long as you get the packages. -TODO +```sh +export DISTRIBUTION=AppImage +export EXTRA_PLATFORM_PLUGINS="libqwayland-generic.so" + +sudo apt update +sudo apt install -y \ + cmake \ + ninja-build \ + file \ + libxkbcommon-dev \ + libxkbcommon-x11-0 \ + fuse \ + libxcb-cursor-dev \ + libcups2-dev \ + libglib2.0-0 \ + libglib2.0-dev \ + libproxy1v5 \ + libproxy-dev \ + qt6-base-dev \ + qt6-base-dev-tools \ + qt6-tools-dev \ + qt6-tools-dev-tools \ + qt6-wayland \ + qt6-wayland-dev \ + libqt6waylandclient6 \ + qml6-module-qtwayland-compositor \ + libqt6core5compat6 \ + libqt6core5compat6-dev \ + qt6-base-private-dev + +cmake -S . -B build \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DAPP_DISTRIBUTION=$DISTRIBUTION +cmake --build build --target appimage --parallel +``` # MacOS From 330a677fdd87ebba1bd16e6c9ea68c9e5c5fe3b7 Mon Sep 17 00:00:00 2001 From: Fatih Bakal Date: Tue, 28 Apr 2026 17:15:17 +0300 Subject: [PATCH 2/5] Forgot about cross compiling --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f4a055ce..661a1bb8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,6 @@ find_package(Qt6 Network PrintSupport Core5Compat - WaylandClient #Majority of the linux desktop uses wayland. ) set(CMAKE_AUTORCC ON) From 1b9ea9eee61a799f2fbfdea138d2d2c1e25e0972 Mon Sep 17 00:00:00 2001 From: Twig6943 <119701717+Twig6943@users.noreply.github.com> Date: Thu, 30 Apr 2026 04:27:44 +0300 Subject: [PATCH 3/5] hopefully fix? --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68a8e5917..fd93a5594 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,14 @@ jobs: if: runner.os == 'Linux' run: | echo "DISTRIBUTION=AppImage" >> "$GITHUB_ENV" - echo "EXTRA_PLATFORM_PLUGINS=libqwayland-generic.so" >> "$GITHUB_ENV" + + # Qt 6.10+ renamed wayland plugins + if [[ "${{ matrix.qt_version }}" == "6.10" ]]; then + echo "EXTRA_PLATFORM_PLUGINS=libqwayland.so" >> "$GITHUB_ENV" + else + echo "EXTRA_PLATFORM_PLUGINS=libqwayland-generic.so" >> "$GITHUB_ENV" + fi + sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse libxcb-cursor-dev libcups2-dev - name: Configure From 8e10f5614ad83919fcdbc93d71ea9b1721e76a85 Mon Sep 17 00:00:00 2001 From: Twig6943 <119701717+Twig6943@users.noreply.github.com> Date: Thu, 30 Apr 2026 04:28:14 +0300 Subject: [PATCH 4/5] Add workflow_dispatch --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd93a5594..29503cda4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ name: Build Notepad Next on: + workflow_dispatch: push: branches: - master From 598130ddb9239aca937696a7f3823fa691f5e006 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Thu, 30 Apr 2026 21:34:27 -0400 Subject: [PATCH 5/5] Cleanup [skip ci] --- .github/workflows/build.yml | 7 +++---- CMakeLists.txt | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29503cda4..3d0ac8648 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: branches: - master tags: - - "*" + - '*' pull_request: env: @@ -30,7 +30,7 @@ jobs: uses: jurplel/install-qt-action@v4 with: version: ${{ matrix.qt_version }} - modules: "qt5compat" + modules: 'qt5compat' cache: true - name: Setup Visual Studio Tools @@ -43,7 +43,7 @@ jobs: if: runner.os == 'Windows' uses: repolevedavaj/install-nsis@v1.1.0 with: - nsis-version: "3.11" + nsis-version: '3.11' - name: Setup Linux if: runner.os == 'Linux' @@ -111,7 +111,6 @@ jobs: needs: [build] if: github.repository == 'dail8859/NotepadNext' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 661a1bb8e..ef7749883 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,15 +17,15 @@ set(CMAKE_CXX_EXTENSIONS OFF) add_compile_definitions(SCI_OWNREGEX) if(MSVC) - # https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio - add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) - add_compile_options(/guard:cf) - add_link_options(/guard:cf) + # https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio + add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + add_compile_options(/guard:cf) + add_link_options(/guard:cf) endif() if(UNIX AND NOT APPLE) - add_compile_options(-fstack-protector-strong -D_FORTIFY_SOURCE=2) - add_link_options(-Wl,-z,relro -Wl,-z,now) + add_compile_options(-fstack-protector-strong -D_FORTIFY_SOURCE=2) + add_link_options(-Wl,-z,relro -Wl,-z,now) endif() find_package(Qt6