From 83ed4485374e20750288574f546417d05644d7ad Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 16 Apr 2022 18:15:20 +0300 Subject: [PATCH 01/78] CMake support for Qt5 This commit brings CMake support for the Qt5 build of NotepadNext. To build use: ``` cmake -S . -B cbuild -G Ninja cmake --buid cbuild ``` Building using `qmake` on my machine takes 1:37, and using `cmake/ninja` it takes about 0:53. As part of the changes - I am using external dependencies - using CPM (https://github.com/cpm-cmake/CPM.cmake). Some sub projects had no CMake support - and thus I forked them, and added cmake support so I add them. This is a big issue I need to fix over time. Note I have made 2 modifications to the code: 1. In NotepadNextApplication.cpp - when using CPM, the lua bridge include is under a subdirectory. I could have fixed the internal fork to behave like this, but I opted to make as minimal changes to the app's code. Instead, I use a hack. 2. When using upstreams Lua (the forked version I have made...), the include `lua.hpp` is not availble. The original code had that file inside the library - which is a big no-no. We do not modify upstream's code. Instead - I copied this into the apps main code. Note that this branch can still be compiled using QMake. When the build stabilizes - it should be easy to remove all submodules and internal forks, and keep the CMake build only. (the only code this repo will have is the main app). This was tested under Debian, using Qt5. I will have to test this under Windows (can test the mingw and CL builds). I cannot test this under OSX, as I don't own a Mac (I am open to donations!). Adding Qt6 will be also "trivial" - just fixing all the forks I have done, and then the main app. It will take some time. Note: The initial cmake takes time, as part of the configuration the code will git/clone the code from scintilla. This is a one time task - not to affect you until you clan up the build/_deps directory. --- CMakeLists.txt | 42 +++++++ CPM.cmake | 21 ++++ doc/Building.md | 25 ++++ src/NotepadNext/CMakeLists.txt | 138 +++++++++++++++++++++ src/NotepadNext/NotepadNextApplication.cpp | 12 ++ src/NotepadNext/lua.hpp | 9 ++ 6 files changed, 247 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 CPM.cmake create mode 100644 src/NotepadNext/CMakeLists.txt create mode 100644 src/NotepadNext/lua.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..8567bc55b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.20) + +project(NotepadPlusPlusNext) + + +# Setup singleapplication - we want the GUI application, not console +set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") + +# setup ADS - we don't need to build the examples +set(BUILD_EXAMPLES CACHE BOOL False) +set(BUILD_STATIC CACHE BOOL False) + +# seetup lua bridge, we want C++ 17 support +set(LUABRIDGE_CXX17 CACHE BOOL true) + +include(CPM.cmake) + +CPMAddPackage("gh:vinniefalco/LuaBridge#2.6") +CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.2") +CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.2") + +# TODO: why can't I use gitlab, which seems to tbe the real upstream? +# TODO: pin a specific tag +CPMAddPackage("gh:freedesktop/uchardet#master") + +#add_subdirectory(src/lua) +# this a a repack of the 5.3.4 upstream version with a cmake file +CPMAddPackage("gh:elcuco/lua#v5.3.4-cmake") + +# this a a repack of the upstream#62e0ce7 with a cmake file +CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") + +# this a a repack of the upstream#52820d5 with a cmake file (upstream does +# not support building the library, but only unit tests) +CPMAddPackage("gh:elcuco/editorconfig-core-qt#3bf1e539f3b2d2a8cdd19ed55a2c8b4f4a704dea") + +# this a a repack of the upstream#rel5-2-0 with a cmake file +CPMAddPackage("gh:elcuco/scintilla-code#5cd77e59") +CPMAddPackage("gh:elcuco/lexilla#15fd70899bdcbd788bc9131d40ff085ad9bffa8d") + +add_subdirectory(src/NotepadNext) + diff --git a/CPM.cmake b/CPM.cmake new file mode 100644 index 000000000..a10f92624 --- /dev/null +++ b/CPM.cmake @@ -0,0 +1,21 @@ +set(CPM_DOWNLOAD_VERSION 0.35.0) + +if(CPM_SOURCE_CACHE) + # Expand relative path. This is important if the provided path contains a tilde (~) + get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +endif() + +if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) + message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") + file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} + ) +endif() + +include(${CPM_DOWNLOAD_LOCATION}) diff --git a/doc/Building.md b/doc/Building.md index 80b3a0a9c..d6c15f917 100644 --- a/doc/Building.md +++ b/doc/Building.md @@ -56,3 +56,28 @@ If encountered `/usr/lib/qt5/bin/lrelease not found` error. Please install `qtto ``` sudo apt-get install qttools5-dev-tools ``` +# CMake support + +To build this project using CMake (currently the official way is QMake), you should type this +on the command line (tested on Linux, but should work on Windows as well as OSX): + +``` +cmake -S . -B cbuild -G Ninja +cmake --build cbuild +``` + +If you are using Visual Studio - you can open the directory containing the source +and then use CMake directly on Visual Studio, no addons needed (as Visual Studio 2019 +and above have really good support for CMake). + +Using CLion should be similar - just open the directory inside CLion and you +should be ready to code. + +Currently CMake uses CPM to pull all 3rd parties (originally 3rd parties where +a mix of submodules and in-repo code). The initial config should take a large time +(the main time consumer is cloning of scintilla). + +A future goal is to move all 3rd party dependencies to conan or vcpkg (or some +other package manager). This will also give us pre-compiled 3rd parties which +will reduce compile times as we will use pre-compiled binaries - and will ease the +ability to gain build-reproducability. diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt new file mode 100644 index 000000000..15a588f7d --- /dev/null +++ b/src/NotepadNext/CMakeLists.txt @@ -0,0 +1,138 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt5 COMPONENTS Widgets PrintSupport REQUIRED) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +add_definitions(-DAPP_VERSION="0.4.9") +add_definitions(-DAPP_COPYRIGHT="Copyright 2019-2022 Justin Dailey") +add_definitions(-DCMAKE_EXPERIMENTAL) + +add_executable(NotepadNext + ColorPickerDelegate.cpp + ComboBoxDelegate.cpp + DockedEditor.cpp + EditorManager.cpp + EditorPrintPreviewRenderer.cpp + Finder.cpp + IFaceTable.cpp + IFaceTableMixer.cpp + LanguageKeywordsModel.cpp + LanguagePropertiesModel.cpp + LanguageStylesModel.cpp + LuaExtension.cpp + LuaState.cpp + MacroRecorder.cpp + NotepadNextApplication.cpp + NppImporter.cpp + QRegexSearch.cpp + QuickFindWidget.cpp + RecentFilesListManager.cpp + SciIFaceTable.cpp + ScintillaNext.cpp + Settings.cpp + SpinBoxDelegate.cpp + decorators/ApplicationDecorator.cpp + decorators/AutoCompletion.cpp + decorators/AutoIndentation.cpp + decorators/BetterMultiSelection.cpp + decorators/EditorConfigAppDecorator.cpp + decorators/SurroundSelection.cpp + docks/EditorInspectorDock.cpp + dialogs/FindReplaceDialog.cpp + docks/FolderAsWorkspaceDock.cpp + docks/LanguageInspectorDock.cpp + docks/LuaConsoleDock.cpp + dialogs/MacroRunDialog.cpp + dialogs/MacroSaveDialog.cpp + dialogs/MainWindow.cpp + dialogs/PreferencesDialog.cpp + main.cpp + decorators/BraceMatch.cpp + decorators/EditorDecorator.cpp + decorators/HighlightedScrollBar.cpp + decorators/LineNumbers.cpp + decorators/SmartHighlighter.cpp + widgets/EditorInfoStatusBar.cpp + widgets/StatusLabel.cpp + + ColorPickerDelegate.h + ComboBoxDelegate.h + DockedEditor.h + DockedEditorTitleBar.h + EditorManager.h + EditorPrintPreviewRenderer.h + Finder.h + FocusWatcher.h + IFaceTable.h + IFaceTableMixer.h + LanguageKeywordsModel.h + LanguagePropertiesModel.h + LanguageStylesModel.h + LuaExtension.h + LuaState.h + MacroRecorder.h + NotepadNextApplication.h + NppImporter.h + QRegexSearch.h + QuickFindWidget.h + RecentFilesListManager.h + SciIFaceTable.h + ScintillaNext.h + Settings.h + SpinBoxDelegate.h + decorators/ApplicationDecorator.h + decorators/AutoCompletion.h + decorators/AutoIndentation.h + decorators/BetterMultiSelection.h + decorators/EditorConfigAppDecorator.h + decorators/SurroundSelection.h + docks/EditorInspectorDock.h + dialogs/FindReplaceDialog.h + docks/FolderAsWorkspaceDock.h + docks/LanguageInspectorDock.h + docks/LuaConsoleDock.h + dialogs/MacroRunDialog.h + dialogs/MacroSaveDialog.h + dialogs/MainWindow.h + dialogs/PreferencesDialog.h + decorators/BraceMatch.h + decorators/EditorDecorator.h + decorators/HighlightedScrollBar.h + decorators/LineNumbers.h + decorators/SmartHighlighter.h + widgets/EditorInfoStatusBar.h + widgets/StatusLabel.h + + QuickFindWidget.ui + docks/EditorInspectorDock.ui + docks/FolderAsWorkspaceDock.ui + docks/LanguageInspectorDock.ui + dialogs/MainWindow.ui + dialogs/FindReplaceDialog.ui + docks/LuaConsoleDock.ui + dialogs/MacroRunDialog.ui + dialogs/MacroSaveDialog.ui + dialogs/PreferencesDialog.ui + resources.qrc + scripts.qrc +) + +target_link_libraries(NotepadNext Qt5::Widgets Qt5::PrintSupport + libuchardet + lua + LuaBridge + qtadvanceddocking + SingleApplication + QSimpleUpdater + editorconfig-core-qt + lexzilla + scintilla-qt-edit +) +target_include_directories(NotepadNext PRIVATE decorators dialogs docks widgets src) + +# For some reason - this library slips the linking part. +if(UNIX AND NOT APPLE) + target_link_libraries(NotepadNext xcb) +endif() diff --git a/src/NotepadNext/NotepadNextApplication.cpp b/src/NotepadNext/NotepadNextApplication.cpp index bcb52882b..e7ccda16f 100644 --- a/src/NotepadNext/NotepadNextApplication.cpp +++ b/src/NotepadNext/NotepadNextApplication.cpp @@ -26,7 +26,19 @@ #include "LuaState.h" #include "lua.hpp" + +// This is the only fix needed for CMake. +// When you include a CMake project, properly, the includes will get +// subdirectory to avoid name collision (imagine two sub-projects having +// an "assert.h" file). +// Some of the 3rd parties have been fixed manually to avoid this, but as +// the internal code/git-sub-modules will get removed - these kind of hacks +// will get removed, and all includes will have a prefix. +#if defined(CMAKE_EXPERIMENTAL) +#include "LuaBridge/LuaBridge.h" +#else #include "LuaBridge.h" +#endif #include "EditorConfigAppDecorator.h" diff --git a/src/NotepadNext/lua.hpp b/src/NotepadNext/lua.hpp new file mode 100644 index 000000000..4d85c4cf8 --- /dev/null +++ b/src/NotepadNext/lua.hpp @@ -0,0 +1,9 @@ +// lua.hpp +// Lua header files for C++ +// <> not supplied automatically because Lua also compiles as C++ + +extern "C" { +#include +#include +#include +} From a16754390944bd60f8b60a8d5b1d92bda4341e97 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 17 Apr 2022 00:33:33 +0300 Subject: [PATCH 02/78] Fix clang build * NotepadNext - moved compile defines to the main target, no longer visible to the whole project * Main - Fixed clang building - using C++ 17 globally fixed building using clang (it seems GCC defaults to 17, while clang not). * Updates to 3rd parties. --- CMakeLists.txt | 24 +++++++++++++----------- src/NotepadNext/CMakeLists.txt | 19 +++++++++++++++---- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8567bc55b..69cfac21d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,30 +2,31 @@ cmake_minimum_required(VERSION 3.20) project(NotepadPlusPlusNext) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Setup singleapplication - we want the GUI application, not console +# setup singleapplication - we want the GUI application, not console set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") # setup ADS - we don't need to build the examples set(BUILD_EXAMPLES CACHE BOOL False) set(BUILD_STATIC CACHE BOOL False) -# seetup lua bridge, we want C++ 17 support +# setup lua bridge, we want C++ 17 support set(LUABRIDGE_CXX17 CACHE BOOL true) include(CPM.cmake) +# note: when using "gl" - you canot link to a branch, only tag/sha1 +# note: latest tag is 0.0.7 - way too old to be usable +# note: gitlab requires a user, so I am using the githab mirror +CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210") CPMAddPackage("gh:vinniefalco/LuaBridge#2.6") CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.2") CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.2") -# TODO: why can't I use gitlab, which seems to tbe the real upstream? -# TODO: pin a specific tag -CPMAddPackage("gh:freedesktop/uchardet#master") - -#add_subdirectory(src/lua) # this a a repack of the 5.3.4 upstream version with a cmake file -CPMAddPackage("gh:elcuco/lua#v5.3.4-cmake") +CPMAddPackage("gh:elcuco/lua#v5.3.4-cmake-v2") # this a a repack of the upstream#62e0ce7 with a cmake file CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") @@ -35,8 +36,9 @@ CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") CPMAddPackage("gh:elcuco/editorconfig-core-qt#3bf1e539f3b2d2a8cdd19ed55a2c8b4f4a704dea") # this a a repack of the upstream#rel5-2-0 with a cmake file -CPMAddPackage("gh:elcuco/scintilla-code#5cd77e59") -CPMAddPackage("gh:elcuco/lexilla#15fd70899bdcbd788bc9131d40ff085ad9bffa8d") +CPMAddPackage("gh:elcuco/scintilla-code#7f4f74fcf4e667c63368f59ef7979d9069a1b941") -add_subdirectory(src/NotepadNext) +# this a a repack of the upstream#rel5-1-5 with a cmake file +CPMAddPackage("gh:elcuco/lexilla#rel-5-1-5-cmake2") +add_subdirectory(src/NotepadNext) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 15a588f7d..9257ea64a 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -5,10 +5,6 @@ set(CMAKE_AUTOUIC ON) find_package(Qt5 COMPONENTS Widgets PrintSupport REQUIRED) set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_definitions(-DAPP_VERSION="0.4.9") -add_definitions(-DAPP_COPYRIGHT="Copyright 2019-2022 Justin Dailey") -add_definitions(-DCMAKE_EXPERIMENTAL) - add_executable(NotepadNext ColorPickerDelegate.cpp ComboBoxDelegate.cpp @@ -131,6 +127,21 @@ target_link_libraries(NotepadNext Qt5::Widgets Qt5::PrintSupport scintilla-qt-edit ) target_include_directories(NotepadNext PRIVATE decorators dialogs docks widgets src) +target_compile_definitions(NotepadNext PRIVATE SCI_OWNREGEX) +target_compile_definitions(NotepadNext PRIVATE APP_VERSION="0.5.0") +target_compile_definitions(NotepadNext PRIVATE APP_COPYRIGHT="Copyright 2019-2022 Justin Dailey") +target_compile_definitions(NotepadNext PRIVATE CMAKE_EXPERIMENTAL) + +if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + target_compile_options(NotepadNext PRIVATE -Wall -Wextra -pedantic --warn-no-unused-variable -Wformat -Wformat-security) +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + target_compile_options(NotepadNext PRIVATE -Wall -Wextra -pedantic --warn-no-unused-variable -Wformat -Wformat-security) +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + MESSAGE("Intel") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + target_compile_options(NotepadNext PRIVATE /utf-8 /guard:cf) + target_link_options(NotepadNex PRIVATE /guard:cf) +endif() # For some reason - this library slips the linking part. if(UNIX AND NOT APPLE) From d6f1a0f0cbf8d64c43f69efffc8158f05dca9e1f Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 17 Apr 2022 20:09:12 +0300 Subject: [PATCH 03/78] Uprade lua to v5.4.4 --- CMakeLists.txt | 2 +- src/NotepadNext/LuaExtension.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69cfac21d..ab7f22bd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.2") CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.2") # this a a repack of the 5.3.4 upstream version with a cmake file -CPMAddPackage("gh:elcuco/lua#v5.3.4-cmake-v2") +CPMAddPackage("gh:elcuco/lua#v5.4.4-cmake2") # this a a repack of the upstream#62e0ce7 with a cmake file CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") diff --git a/src/NotepadNext/LuaExtension.cpp b/src/NotepadNext/LuaExtension.cpp index dda0405f0..8e8efba33 100644 --- a/src/NotepadNext/LuaExtension.cpp +++ b/src/NotepadNext/LuaExtension.cpp @@ -41,6 +41,11 @@ IFaceTableMixer ifacemixer; #define EOFMARK "" #define marklen (sizeof(EOFMARK)/sizeof(char) - 1) +// This got removed in LUA v5.4.4 +#ifndef LUA_QL +#define LUA_QL(x) "'" x "'" +#endif + static bool call_function(lua_State *L, int nargs, bool ignoreFunctionReturnValue); // Helper function from SciTE From bed2be643c089e1edb687c8a56590f3f636c001f Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 17 Apr 2022 22:00:31 +0300 Subject: [PATCH 04/78] update luabridge + SingleApplication --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab7f22bd6..360b533ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,12 @@ include(CPM.cmake) # note: latest tag is 0.0.7 - way too old to be usable # note: gitlab requires a user, so I am using the githab mirror CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210") -CPMAddPackage("gh:vinniefalco/LuaBridge#2.6") + +# Using a modern sha1, 2.6 is 2 years old +CPMAddPackage("gh:vinniefalco/LuaBridge#efb62e5be5c12d75e085357072039db9199f7ebf") + CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.2") -CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.2") +CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.4") # this a a repack of the 5.3.4 upstream version with a cmake file CPMAddPackage("gh:elcuco/lua#v5.4.4-cmake2") From 5bf8e88b77e9859d1332315c081518130f6ad01f Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 18 Apr 2022 22:44:11 +0300 Subject: [PATCH 05/78] Update scintilla related libs - they no longer add the NDEBUG hack --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 360b533ee..90bb62ff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,9 +39,9 @@ CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") CPMAddPackage("gh:elcuco/editorconfig-core-qt#3bf1e539f3b2d2a8cdd19ed55a2c8b4f4a704dea") # this a a repack of the upstream#rel5-2-0 with a cmake file -CPMAddPackage("gh:elcuco/scintilla-code#7f4f74fcf4e667c63368f59ef7979d9069a1b941") +CPMAddPackage("gh:elcuco/scintilla-code#rel-5-2-0-cmake") # this a a repack of the upstream#rel5-1-5 with a cmake file -CPMAddPackage("gh:elcuco/lexilla#rel-5-1-5-cmake2") +CPMAddPackage("gh:elcuco/lexilla#rel-5-1-5-cmake3") add_subdirectory(src/NotepadNext) From f9891b7e4f22a94e46dfaab6bf2b754b1adc9378 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 18 Apr 2022 23:09:44 +0300 Subject: [PATCH 06/78] Move to newer scintilla Updated upstreams scintilla. Both scintilla and Lexzilla. I also added demos of how to use the moving branches, instead of tags. From the other side, all I do is `git checkout cmake-support && git pull origin master` so things are easy. When I get a new tag upstream, I merge and re-tag with `-cmake` suffix. Seems easy and maintainable. --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90bb62ff3..2ee71a749 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,10 +38,15 @@ CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") # not support building the library, but only unit tests) CPMAddPackage("gh:elcuco/editorconfig-core-qt#3bf1e539f3b2d2a8cdd19ed55a2c8b4f4a704dea") -# this a a repack of the upstream#rel5-2-0 with a cmake file -CPMAddPackage("gh:elcuco/scintilla-code#rel-5-2-0-cmake") +# this a a repack of the upstream#rel5-2-2 with a cmake file +CPMAddPackage("gh:elcuco/scintilla-code#rel-5-2-2-cmake") -# this a a repack of the upstream#rel5-1-5 with a cmake file -CPMAddPackage("gh:elcuco/lexilla#rel-5-1-5-cmake3") +# this a a repack of the upstream#rel5-1-6 with a cmake file +CPMAddPackage("gh:elcuco/lexilla#rel-5-1-6-cmake") + +# Instead of the two above, you can use a moving branch. Both track +# upstream `master`. Seem to compile and work. +#CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") +#CPMAddPackage("gh:elcuco/lexilla#cmake-support") add_subdirectory(src/NotepadNext) From 83929a2d5aaaa165f936a6fc575c2096ba9db4b6 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 19:55:50 +0300 Subject: [PATCH 07/78] Build cmake-qt5 We will check Qt6, soon. Meanwhile, as Qt5 on debian is known to work - lets use it. I am not building the app image yet. --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31702affd..cbc29e2a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,38 @@ on: jobs: + build-linux-cmake-qt5: + strategy: + fail-fast: false + matrix: + config: + - + qt_version: "5.15.2" + modules: "" + os: ubuntu-18.04 + + runs-on: ${{ matrix.config.os }} + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: ${{ matrix.config.qt_version }} + modules: ${{ matrix.config.modules }} + + - name: Setup + run: sudo apt-get install libxkbcommon-dev + + - name: Compile + run: | + cmake -S . -B cbuild -G Ninja + cmake --build cbuild + + build-linux: strategy: fail-fast: false From e8d13be802955baf32e462778e76b1596db3a308 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 20:02:10 +0300 Subject: [PATCH 08/78] on setup - install ninja, as this is not available by default --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cbc29e2a0..01cb7976a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: modules: ${{ matrix.config.modules }} - name: Setup - run: sudo apt-get install libxkbcommon-dev + run: sudo apt-get install libxkbcommon-dev ninja-build - name: Compile run: | From ee266aff1a85aacbd0f7bf502d2e5711705f96b8 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 20:06:15 +0300 Subject: [PATCH 09/78] fix setup step --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01cb7976a..0d42fd5e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: modules: ${{ matrix.config.modules }} - name: Setup - run: sudo apt-get install libxkbcommon-dev + run: sudo apt-get install libxkbcommon-dev ninja-build - name: Compile run: | @@ -71,7 +71,7 @@ jobs: modules: ${{ matrix.config.modules }} - name: Setup - run: sudo apt-get install libxkbcommon-dev ninja-build + run: sudo apt-get install libxkbcommon-dev - name: Compile run: | From 849d9b28686257691e34ff594d28ea869a8a289f Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 23:20:22 +0300 Subject: [PATCH 10/78] Lets build on Windows, I hope --- .github/workflows/build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d42fd5e9..95f1f16bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,10 @@ jobs: qt_version: "5.15.2" modules: "" os: ubuntu-18.04 + - + qt_version: "5.15.2" + modules: "" + os: windows-latest runs-on: ${{ matrix.config.os }} @@ -33,8 +37,18 @@ jobs: version: ${{ matrix.config.qt_version }} modules: ${{ matrix.config.modules }} - - name: Setup - run: sudo apt-get install libxkbcommon-dev ninja-build + - name: Install Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Setup (Linux) + run: sudo apt-get install libxkbcommon-dev + if: matrix.os == 'ubuntu-18.04' + + - name: Setup VS tools + uses: egor-tensin/vs-shell@v2 + if: matrix.os == 'windows-latest' + with: + arch: x64 - name: Compile run: | From 194b1062ff2029f7d794c1f74fa8635a6fbf66e0 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 23:34:04 +0300 Subject: [PATCH 11/78] Lets build on Windows, I hope (2) --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95f1f16bc..8d2f81da7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,12 +41,12 @@ jobs: uses: seanmiddleditch/gha-setup-ninja@master - name: Setup (Linux) - run: sudo apt-get install libxkbcommon-dev if: matrix.os == 'ubuntu-18.04' + run: sudo apt-get install libxkbcommon-dev - name: Setup VS tools - uses: egor-tensin/vs-shell@v2 if: matrix.os == 'windows-latest' + uses: egor-tensin/vs-shell@v2 with: arch: x64 From 4f6476388f8f7c2390a260fbcd1258f838bc159a Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 23:45:32 +0300 Subject: [PATCH 12/78] Support OSX, and fix ubuntu/windows setup (maybe?) --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d2f81da7..8b8559b84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,10 @@ jobs: qt_version: "5.15.2" modules: "" os: windows-latest + - + qt_version: "5.15.2" + modules: "" + os: osx-latest runs-on: ${{ matrix.config.os }} @@ -41,11 +45,11 @@ jobs: uses: seanmiddleditch/gha-setup-ninja@master - name: Setup (Linux) - if: matrix.os == 'ubuntu-18.04' + if: startsWith (matrix.config.os, 'ubuntu') run: sudo apt-get install libxkbcommon-dev - - name: Setup VS tools - if: matrix.os == 'windows-latest' + - name: Setup VS tools (Windows) + if: startsWith (matrix.config.os, 'windows') uses: egor-tensin/vs-shell@v2 with: arch: x64 From 0eea772976b83a5eeac828af13d1b96c2dac0049 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 23:54:20 +0300 Subject: [PATCH 13/78] Track the scintilla branch, and not a tag, as the tag does not build on MSVC --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ee71a749..98d58d3f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,14 +39,14 @@ CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") CPMAddPackage("gh:elcuco/editorconfig-core-qt#3bf1e539f3b2d2a8cdd19ed55a2c8b4f4a704dea") # this a a repack of the upstream#rel5-2-2 with a cmake file -CPMAddPackage("gh:elcuco/scintilla-code#rel-5-2-2-cmake") +#CPMAddPackage("gh:elcuco/scintilla-code#rel-5-2-2-cmake") # this a a repack of the upstream#rel5-1-6 with a cmake file CPMAddPackage("gh:elcuco/lexilla#rel-5-1-6-cmake") # Instead of the two above, you can use a moving branch. Both track # upstream `master`. Seem to compile and work. -#CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") +CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") #CPMAddPackage("gh:elcuco/lexilla#cmake-support") add_subdirectory(src/NotepadNext) From 2c68a8985310b4b381c7161ac104ddaee92dff7c Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 19 Apr 2022 23:54:40 +0300 Subject: [PATCH 14/78] OOPS, macos, not osx.... --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b8559b84..256a48d9b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - qt_version: "5.15.2" modules: "" - os: osx-latest + os: macos-latest runs-on: ${{ matrix.config.os }} From bab61e9896f8f85fe6a014b6449bb24722393da0 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Wed, 20 Apr 2022 00:01:32 +0300 Subject: [PATCH 15/78] Fix linking on MSVC --- src/NotepadNext/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 9257ea64a..e1ddfbaaf 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -140,7 +140,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") MESSAGE("Intel") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") target_compile_options(NotepadNext PRIVATE /utf-8 /guard:cf) - target_link_options(NotepadNex PRIVATE /guard:cf) + target_link_options(NotepadNext PRIVATE /guard:cf) endif() # For some reason - this library slips the linking part. From 17b76fbd0aa8dedfd943c090cdb4c6b62ec9844a Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Wed, 20 Apr 2022 00:07:17 +0300 Subject: [PATCH 16/78] Disable windows build - until I have a proper fix for it --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 256a48d9b..27520e0ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,10 +19,10 @@ jobs: qt_version: "5.15.2" modules: "" os: ubuntu-18.04 - - - qt_version: "5.15.2" - modules: "" - os: windows-latest + #- + #qt_version: "5.15.2" + #modules: "" + #os: windows-latest - qt_version: "5.15.2" modules: "" From 48e85825321199c7e1a1fccfc7ed2df11c8d131f Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 24 Apr 2022 21:41:26 +0300 Subject: [PATCH 17/78] Fix the name of github task --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27520e0ac..f4e4be66b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: - build-linux-cmake-qt5: + cmake-build: strategy: fail-fast: false matrix: From 7726b03339351cf9b0d67f96f4371fcf7507d7dd Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 25 Apr 2022 22:54:54 +0300 Subject: [PATCH 18/78] Use static builds for all libraries Also - prepare for creating appimage - added an install target. --- CMakeLists.txt | 35 +++++++++++++++++++++------------- src/NotepadNext/CMakeLists.txt | 13 ++++++++++--- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98d58d3f3..086f7c73c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,12 +5,19 @@ project(NotepadPlusPlusNext) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# uchardet setup +set(BUILD_BINARY OFF) +set(USE_BUILD_SHARED_LIBS CACHE BOOL OFF) +set(BUILD_STATICCACHE OFF) + # setup singleapplication - we want the GUI application, not console set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") # setup ADS - we don't need to build the examples -set(BUILD_EXAMPLES CACHE BOOL False) -set(BUILD_STATIC CACHE BOOL False) +set(BUILD_EXAMPLES OFF) +set(BUILD_STATIC ON) +set(BUILD_CACHE ON) +set(USE_BUILD_SHARED_LIBS OFF) # setup lua bridge, we want C++ 17 support set(LUABRIDGE_CXX17 CACHE BOOL true) @@ -28,25 +35,27 @@ CPMAddPackage("gh:vinniefalco/LuaBridge#efb62e5be5c12d75e085357072039db9199f7ebf CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.2") CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.4") -# this a a repack of the 5.3.4 upstream version with a cmake file -CPMAddPackage("gh:elcuco/lua#v5.4.4-cmake2") - -# this a a repack of the upstream#62e0ce7 with a cmake file -CPMAddPackage("gh:elcuco/QSimpleUpdater#3b13dba") +# this a a repack of the 8426d9b4d4df1da3c5b2d759e509ae1c50a86667 upstream version with a cmake file +CPMAddPackage("gh:elcuco/lua#9f06e8ad5b562d71c10fb38e6213c2a07465191a") +#include(lua.cmake) # this a a repack of the upstream#52820d5 with a cmake file (upstream does # not support building the library, but only unit tests) -CPMAddPackage("gh:elcuco/editorconfig-core-qt#3bf1e539f3b2d2a8cdd19ed55a2c8b4f4a704dea") +CPMAddPackage("gh:elcuco/editorconfig-core-qt#ffd7d12657fb543a480b5c924cd450c31d107c72") + +# this a a repack of the upstream#62e0ce7 with a cmake file +CPMAddPackage("gh:elcuco/QSimpleUpdater#3407c2d257cc2c1758f864df7aa8657addc5e73f") -# this a a repack of the upstream#rel5-2-2 with a cmake file -#CPMAddPackage("gh:elcuco/scintilla-code#rel-5-2-2-cmake") +# this a a repack of the upstream#f85a8baec6f401d481341ead87f39d9fe9d284ec with a cmake file +CPMAddPackage("gh:elcuco/scintilla-code#27dca0231d437db3c1c1aedf8afd243d1854ee6c") -# this a a repack of the upstream#rel5-1-6 with a cmake file -CPMAddPackage("gh:elcuco/lexilla#rel-5-1-6-cmake") +# TODO - should we backport this to a stable release? +# this a a repack of the upstream#0bd13d84b3fef7a72553ab95c43d0d4c9677f70f with a cmake file +CPMAddPackage("gh:elcuco/lexilla#270fb410dd7518736141c9c9c84880b938d957a7") # Instead of the two above, you can use a moving branch. Both track # upstream `master`. Seem to compile and work. -CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") +#CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") #CPMAddPackage("gh:elcuco/lexilla#cmake-support") add_subdirectory(src/NotepadNext) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index e1ddfbaaf..61880ce1d 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -116,18 +116,17 @@ add_executable(NotepadNext ) target_link_libraries(NotepadNext Qt5::Widgets Qt5::PrintSupport - libuchardet + libuchardet_static lua LuaBridge qtadvanceddocking SingleApplication QSimpleUpdater editorconfig-core-qt - lexzilla scintilla-qt-edit + lexzilla ) target_include_directories(NotepadNext PRIVATE decorators dialogs docks widgets src) -target_compile_definitions(NotepadNext PRIVATE SCI_OWNREGEX) target_compile_definitions(NotepadNext PRIVATE APP_VERSION="0.5.0") target_compile_definitions(NotepadNext PRIVATE APP_COPYRIGHT="Copyright 2019-2022 Justin Dailey") target_compile_definitions(NotepadNext PRIVATE CMAKE_EXPERIMENTAL) @@ -147,3 +146,11 @@ endif() if(UNIX AND NOT APPLE) target_link_libraries(NotepadNext xcb) endif() + +include(GNUInstallDirs) +install(TARGETS NotepadNext) +install(FILES ../../deploy/linux/NotepadNext.desktop + DESTINATION share/applications) +install(FILES ../../icon/NotepadNext.svg + DESTINATION share/icons/hicolor/scalable/mimetypes) + From d1ac7a6f867ff641ce56a8693910f2f68891f3e2 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 25 Apr 2022 22:55:32 +0300 Subject: [PATCH 19/78] Create an AppImage - Switch to gnu-makefiles - as I learn how to handle ninja install - Added a new artifact for Linux/Qt5/AppImage/CMake. Matrix is now larger :) --- .github/workflows/build.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4e4be66b..ee12da2c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,8 +41,10 @@ jobs: version: ${{ matrix.config.qt_version }} modules: ${{ matrix.config.modules }} + # disable meanwhile, until I understand how to fix the install prefix with ninja - name: Install Ninja uses: seanmiddleditch/gha-setup-ninja@master + if: false - name: Setup (Linux) if: startsWith (matrix.config.os, 'ubuntu') @@ -56,9 +58,26 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -G Ninja - cmake --build cbuild + cmake -S . -B cbuild + cmake --build cbuild --parallel $(nproc) + - name: Create App Image + if: startsWith (matrix.config.os, 'ubuntu') + run: | + make -C cbuild install INSTALL_ROOT=AppDir + cd cbuild + + wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" + wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" + chmod +x linuxdeploy*.AppImage + export OUTPUT=NotepadNext-x86_64.AppImage + ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage + - name: Upload AppImage + if: startsWith (matrix.config.os, 'ubuntu') + uses: actions/upload-artifact@v2 + with: + name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }}-cmake-AppImage + path: ${{ github.workspace }}/cbuild/NotepadNext-x86_64.AppImage build-linux: strategy: From 1757daf7a336debfd5d43892d37f311a7d84c04b Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 25 Apr 2022 23:08:11 +0300 Subject: [PATCH 20/78] Attempt to fix cmake install --- src/NotepadNext/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 61880ce1d..9b4bf564a 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -149,8 +149,8 @@ endif() include(GNUInstallDirs) install(TARGETS NotepadNext) -install(FILES ../../deploy/linux/NotepadNext.desktop +install(FILES ${CMAKE_SOURCE_DIR}/deploy/linux/NotepadNext.desktop DESTINATION share/applications) -install(FILES ../../icon/NotepadNext.svg +install(FILES ${CMAKE_SOURCE_DIR}/icon/NotepadNext.svg DESTINATION share/icons/hicolor/scalable/mimetypes) From d9368bc8b40280ab93d60e223c5e3f9340836b99 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 26 Apr 2022 18:08:13 +0300 Subject: [PATCH 21/78] Attempt to fix make install --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee12da2c1..ebbcb88ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,7 @@ jobs: - name: Create App Image if: startsWith (matrix.config.os, 'ubuntu') run: | - make -C cbuild install INSTALL_ROOT=AppDir + make -C cbuild DESTDIR=AppDir install cd cbuild wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" From c0bb613667b984788751b70c2c85ca6e5ca60bdf Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 26 Apr 2022 18:55:12 +0300 Subject: [PATCH 22/78] Attempt to use a more specific path for installing app? --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebbcb88ce..da11bcb38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,13 +64,14 @@ jobs: - name: Create App Image if: startsWith (matrix.config.os, 'ubuntu') run: | - make -C cbuild DESTDIR=AppDir install + make -C cbuild DESTDIR=${{ github.workspace }}/cbuild/AppDir install cd cbuild - wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" + chmod +x linuxdeploy*.AppImage export OUTPUT=NotepadNext-x86_64.AppImage + find . ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage - name: Upload AppImage if: startsWith (matrix.config.os, 'ubuntu') From 3b0945499aca1631a47be4026418d6005f764b98 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 26 Apr 2022 22:31:37 +0300 Subject: [PATCH 23/78] at this stage, honestly, I have no idea what I am doing --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da11bcb38..86ef56c5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,8 +68,10 @@ jobs: cd cbuild wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" - chmod +x linuxdeploy*.AppImage + pwd + ls -lah + export OUTPUT=NotepadNext-x86_64.AppImage find . ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage From c9315bfc79cfad144b63655e4c52444b27c4052e Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Wed, 27 Apr 2022 20:48:01 +0300 Subject: [PATCH 24/78] another attempt of fixing the github install --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86ef56c5f..2835af8e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: - name: Compile run: | cmake -S . -B cbuild - cmake --build cbuild --parallel $(nproc) + cmake --build cbuild --parallel $(nproc) -DCMAKE_INSTALL_PREFIX:PATH=/usr/ - name: Create App Image if: startsWith (matrix.config.os, 'ubuntu') From dbe2a272a51292200711a55ea459373f7b768494 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Wed, 27 Apr 2022 20:51:25 +0300 Subject: [PATCH 25/78] another attempt of fixing the github install (2) --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2835af8e4..f28151bab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,8 +58,8 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild - cmake --build cbuild --parallel $(nproc) -DCMAKE_INSTALL_PREFIX:PATH=/usr/ + cmake -S . -B cbuild -DCMAKE_INSTALL_PREFIX:PATH=/usr/ + cmake --build cbuild --parallel $(nproc) - name: Create App Image if: startsWith (matrix.config.os, 'ubuntu') From 2b1d97d4fbf1256319ac62e8f4f098b88930c6d5 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 17 Jul 2022 23:33:16 +0300 Subject: [PATCH 26/78] Fix build - as new files were added to qmake build --- src/NotepadNext/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 9b4bf564a..24f4331b5 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -4,6 +4,7 @@ set(CMAKE_AUTOUIC ON) find_package(Qt5 COMPONENTS Widgets PrintSupport REQUIRED) set(CMAKE_INCLUDE_CURRENT_DIR ON) +add_compile_definitions(APP_DISTRIBUTION="local") add_executable(NotepadNext ColorPickerDelegate.cpp @@ -25,10 +26,19 @@ add_executable(NotepadNext QRegexSearch.cpp QuickFindWidget.cpp RecentFilesListManager.cpp + RecentFilesListManager.h + RecentFilesListMenuBuilder.cpp + RecentFilesListMenuBuilder.h SciIFaceTable.cpp ScintillaNext.cpp Settings.cpp SpinBoxDelegate.cpp + UndoAction.h + UndoAction.cpp + ScintillaCommenter.h + ScintillaCommenter.cpp + SelectionTracker.h + SelectionTracker.cpp decorators/ApplicationDecorator.cpp decorators/AutoCompletion.cpp decorators/AutoIndentation.cpp @@ -111,6 +121,11 @@ add_executable(NotepadNext dialogs/MacroRunDialog.ui dialogs/MacroSaveDialog.ui dialogs/PreferencesDialog.ui + + docks/SearchResultsDock.cpp + docks/SearchResultsDock.h + docks/SearchResultsDock.ui + resources.qrc scripts.qrc ) From 86822cef090fd5831b2394b4c2f5bf917e43de3a Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 17 Jul 2022 23:36:52 +0300 Subject: [PATCH 27/78] Move new macro to the hpp file, this reduces the changes on main code --- src/NotepadNext/LuaExtension.cpp | 5 ----- src/NotepadNext/lua.hpp | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NotepadNext/LuaExtension.cpp b/src/NotepadNext/LuaExtension.cpp index 8e8efba33..dda0405f0 100644 --- a/src/NotepadNext/LuaExtension.cpp +++ b/src/NotepadNext/LuaExtension.cpp @@ -41,11 +41,6 @@ IFaceTableMixer ifacemixer; #define EOFMARK "" #define marklen (sizeof(EOFMARK)/sizeof(char) - 1) -// This got removed in LUA v5.4.4 -#ifndef LUA_QL -#define LUA_QL(x) "'" x "'" -#endif - static bool call_function(lua_State *L, int nargs, bool ignoreFunctionReturnValue); // Helper function from SciTE diff --git a/src/NotepadNext/lua.hpp b/src/NotepadNext/lua.hpp index 4d85c4cf8..a90b62948 100644 --- a/src/NotepadNext/lua.hpp +++ b/src/NotepadNext/lua.hpp @@ -7,3 +7,8 @@ extern "C" { #include #include } + +// This got removed in LUA v5.4.4 +#ifndef LUA_QL +#define LUA_QL(x) "'" x "'" +#endif From 6c33eab34df0caaece3a52d538ac04501d4cbadb Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 18 Jul 2022 11:54:42 +0300 Subject: [PATCH 28/78] re-enable windows build --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f28151bab..a90f708e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,10 +19,10 @@ jobs: qt_version: "5.15.2" modules: "" os: ubuntu-18.04 - #- - #qt_version: "5.15.2" - #modules: "" - #os: windows-latest + - + qt_version: "5.15.2" + modules: "" + os: windows-latest - qt_version: "5.15.2" modules: "" From 47e15580061da0d5fafb328ba90d04ccbdb413f4 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 18 Jul 2022 23:39:30 +0300 Subject: [PATCH 29/78] Fix Qt6 support Fixed cmake to compile using Qt6. I think I did not break Qt5. --- CMakeLists.txt | 17 ++++++++++++----- src/NotepadNext/CMakeLists.txt | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 086f7c73c..8c6d3258f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(BUILD_STATICCACHE OFF) # setup singleapplication - we want the GUI application, not console set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") + # setup ADS - we don't need to build the examples set(BUILD_EXAMPLES OFF) set(BUILD_STATIC ON) @@ -33,6 +34,8 @@ CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210" CPMAddPackage("gh:vinniefalco/LuaBridge#efb62e5be5c12d75e085357072039db9199f7ebf") CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.2") + +set(QT_DEFAULT_MAJOR_VERSION 6) CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.4") # this a a repack of the 8426d9b4d4df1da3c5b2d759e509ae1c50a86667 upstream version with a cmake file @@ -41,21 +44,25 @@ CPMAddPackage("gh:elcuco/lua#9f06e8ad5b562d71c10fb38e6213c2a07465191a") # this a a repack of the upstream#52820d5 with a cmake file (upstream does # not support building the library, but only unit tests) -CPMAddPackage("gh:elcuco/editorconfig-core-qt#ffd7d12657fb543a480b5c924cd450c31d107c72") +CPMAddPackage("gh:elcuco/editorconfig-core-qt#8363919") # this a a repack of the upstream#62e0ce7 with a cmake file -CPMAddPackage("gh:elcuco/QSimpleUpdater#3407c2d257cc2c1758f864df7aa8657addc5e73f") +CPMAddPackage("gh:elcuco/QSimpleUpdater#dfbbd8db78cf3c40df5fb3ee9b5a75cd50cae185") # this a a repack of the upstream#f85a8baec6f401d481341ead87f39d9fe9d284ec with a cmake file -CPMAddPackage("gh:elcuco/scintilla-code#27dca0231d437db3c1c1aedf8afd243d1854ee6c") +CPMAddPackage("gh:elcuco/scintilla-code#923fac200dd228256ca263361c974f78402d2461") # TODO - should we backport this to a stable release? # this a a repack of the upstream#0bd13d84b3fef7a72553ab95c43d0d4c9677f70f with a cmake file CPMAddPackage("gh:elcuco/lexilla#270fb410dd7518736141c9c9c84880b938d957a7") -# Instead of the two above, you can use a moving branch. Both track -# upstream `master`. Seem to compile and work. +# Instead of all the above, you can use a moving branch. All track +# upstream `master`. +#CPMAddPackage("gh:elcuco/editorconfig-core-qt#cmake-support") +#CPMAddPackage("gh:elcuco/lua#9f06e8ad5b562d71c10fb38e6213c2a07465191a") +#CPMAddPackage("gh:elcuco/QSimpleUpdater#cmake-support") #CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") #CPMAddPackage("gh:elcuco/lexilla#cmake-support") +#CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") add_subdirectory(src/NotepadNext) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 24f4331b5..f9f2750f8 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -2,7 +2,12 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt5 COMPONENTS Widgets PrintSupport REQUIRED) +find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets PrintSupport REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets PrintSupport ) +if (Qt6_FOUND) + find_package(Qt6 REQUIRED COMPONENTS Core5Compat) +endif() + set(CMAKE_INCLUDE_CURRENT_DIR ON) add_compile_definitions(APP_DISTRIBUTION="local") @@ -130,7 +135,7 @@ add_executable(NotepadNext scripts.qrc ) -target_link_libraries(NotepadNext Qt5::Widgets Qt5::PrintSupport +target_link_libraries(NotepadNext Qt::Widgets Qt::PrintSupport libuchardet_static lua LuaBridge @@ -141,6 +146,11 @@ target_link_libraries(NotepadNext Qt5::Widgets Qt5::PrintSupport scintilla-qt-edit lexzilla ) + +if (Qt6_FOUND) + target_link_libraries(NotepadNext Qt6::Core5Compat) +endif() + target_include_directories(NotepadNext PRIVATE decorators dialogs docks widgets src) target_compile_definitions(NotepadNext PRIVATE APP_VERSION="0.5.0") target_compile_definitions(NotepadNext PRIVATE APP_COPYRIGHT="Copyright 2019-2022 Justin Dailey") From 49c5869933c283fafbed9e38f96643824dd0a666 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 18 Jul 2022 23:45:24 +0300 Subject: [PATCH 30/78] Use Qt6 on CI Due to a stupidity found in SimpleApplication - this is not trivial to automatically Qt version. This is because we need to tell that project, the Qt version we want... I can workaround it, but not now. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a90f708e7..6686c2378 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,15 +16,15 @@ jobs: matrix: config: - - qt_version: "5.15.2" + qt_version: "6.2.4" modules: "" os: ubuntu-18.04 - - qt_version: "5.15.2" + qt_version: "6.2.4" modules: "" os: windows-latest - - qt_version: "5.15.2" + qt_version: "6.2.4" modules: "" os: macos-latest From 212d5c89edc4ac6def04c7006eb6920b8c2134bc Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 18 Jul 2022 23:50:57 +0300 Subject: [PATCH 31/78] missing compat module... --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6686c2378..e3572ff89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,15 +17,15 @@ jobs: config: - qt_version: "6.2.4" - modules: "" + modules: "qt5compat" os: ubuntu-18.04 - qt_version: "6.2.4" - modules: "" + modules: "qt5compat" os: windows-latest - qt_version: "6.2.4" - modules: "" + modules: "qt5compat" os: macos-latest runs-on: ${{ matrix.config.os }} From e9cfdac467899bb385741516c9c22948c7d5cebd Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 18 Jul 2022 23:59:20 +0300 Subject: [PATCH 32/78] Update ubuntu builder to 20.04 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3572ff89..88d246b01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - qt_version: "6.2.4" modules: "qt5compat" - os: ubuntu-18.04 + os: ubuntu-20.04 - qt_version: "6.2.4" modules: "qt5compat" From b4368bd53e54f45456f0c96307bfc4e9bb26c0fc Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 24 Sep 2022 23:44:21 +0300 Subject: [PATCH 33/78] Fix compilation for version 0.5.5 Added missing source files - and re-ordered the list of files inside the CMakeLists.txt. ALSO: fixed include inside MacroStepTableModel.h - we needed to guard it (How did it work on QMake?) --- src/NotepadNext/CMakeLists.txt | 133 ++++++++++++++------------ src/NotepadNext/MacroStepTableModel.h | 1 + 2 files changed, 73 insertions(+), 61 deletions(-) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index f9f2750f8..2068d4e6f 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -13,126 +13,137 @@ add_compile_definitions(APP_DISTRIBUTION="local") add_executable(NotepadNext ColorPickerDelegate.cpp + ColorPickerDelegate.h ComboBoxDelegate.cpp + ComboBoxDelegate.h + DockedEditor.h DockedEditor.cpp + DebugManager.cpp + DockedEditorTitleBar.h + EditorHexViewerTableModel.cpp + EditorManager.h EditorManager.cpp + EditorPrintPreviewRenderer.h EditorPrintPreviewRenderer.cpp Finder.cpp + Finder.h + FocusWatcher.h IFaceTable.cpp + IFaceTable.h IFaceTableMixer.cpp + IFaceTableMixer.h + LanguageKeywordsModel.h LanguageKeywordsModel.cpp LanguagePropertiesModel.cpp + LanguagePropertiesModel.h LanguageStylesModel.cpp + LanguageStylesModel.h LuaExtension.cpp + LuaExtension.h LuaState.cpp + LuaState.h + main.cpp + Macro.cpp + MacroManager.cpp MacroRecorder.cpp + MacroRecorder.h + MacroStep.cpp + MacroStepTableModel.cpp + MacroListModel.cpp NotepadNextApplication.cpp + NotepadNextApplication.h NppImporter.cpp + NppImporter.h QRegexSearch.cpp + QRegexSearch.h + QuickFindWidget.h QuickFindWidget.cpp + QuickFindWidget.ui RecentFilesListManager.cpp RecentFilesListManager.h RecentFilesListMenuBuilder.cpp RecentFilesListMenuBuilder.h + resources.qrc SciIFaceTable.cpp ScintillaNext.cpp - Settings.cpp - SpinBoxDelegate.cpp - UndoAction.h - UndoAction.cpp + ScintillaNext.h + SciIFaceTable.h ScintillaCommenter.h ScintillaCommenter.cpp SelectionTracker.h + Settings.cpp + Settings.h SelectionTracker.cpp + SpinBoxDelegate.h + SpinBoxDelegate.cpp + scripts.qrc + UndoAction.h + UndoAction.cpp + + decorators/ApplicationDecorator.cpp decorators/AutoCompletion.cpp decorators/AutoIndentation.cpp decorators/BetterMultiSelection.cpp decorators/EditorConfigAppDecorator.cpp decorators/SurroundSelection.cpp - docks/EditorInspectorDock.cpp - dialogs/FindReplaceDialog.cpp - docks/FolderAsWorkspaceDock.cpp - docks/LanguageInspectorDock.cpp - docks/LuaConsoleDock.cpp - dialogs/MacroRunDialog.cpp - dialogs/MacroSaveDialog.cpp - dialogs/MainWindow.cpp - dialogs/PreferencesDialog.cpp - main.cpp decorators/BraceMatch.cpp decorators/EditorDecorator.cpp decorators/HighlightedScrollBar.cpp decorators/LineNumbers.cpp decorators/SmartHighlighter.cpp - widgets/EditorInfoStatusBar.cpp - widgets/StatusLabel.cpp - - ColorPickerDelegate.h - ComboBoxDelegate.h - DockedEditor.h - DockedEditorTitleBar.h - EditorManager.h - EditorPrintPreviewRenderer.h - Finder.h - FocusWatcher.h - IFaceTable.h - IFaceTableMixer.h - LanguageKeywordsModel.h - LanguagePropertiesModel.h - LanguageStylesModel.h - LuaExtension.h - LuaState.h - MacroRecorder.h - NotepadNextApplication.h - NppImporter.h - QRegexSearch.h - QuickFindWidget.h - RecentFilesListManager.h - SciIFaceTable.h - ScintillaNext.h - Settings.h - SpinBoxDelegate.h decorators/ApplicationDecorator.h decorators/AutoCompletion.h decorators/AutoIndentation.h decorators/BetterMultiSelection.h decorators/EditorConfigAppDecorator.h decorators/SurroundSelection.h - docks/EditorInspectorDock.h - dialogs/FindReplaceDialog.h - docks/FolderAsWorkspaceDock.h - docks/LanguageInspectorDock.h - docks/LuaConsoleDock.h - dialogs/MacroRunDialog.h - dialogs/MacroSaveDialog.h - dialogs/MainWindow.h - dialogs/PreferencesDialog.h decorators/BraceMatch.h decorators/EditorDecorator.h decorators/HighlightedScrollBar.h decorators/LineNumbers.h decorators/SmartHighlighter.h - widgets/EditorInfoStatusBar.h - widgets/StatusLabel.h - QuickFindWidget.ui - docks/EditorInspectorDock.ui - docks/FolderAsWorkspaceDock.ui - docks/LanguageInspectorDock.ui + dialogs/FindReplaceDialog.cpp + dialogs/MacroEditorDialog.cpp + dialogs/MacroRunDialog.cpp + dialogs/MacroSaveDialog.cpp + dialogs/MainWindow.cpp + dialogs/PreferencesDialog.cpp + dialogs/FindReplaceDialog.h + dialogs/MacroRunDialog.h + dialogs/MacroSaveDialog.h + dialogs/MainWindow.h + dialogs/PreferencesDialog.h dialogs/MainWindow.ui dialogs/FindReplaceDialog.ui - docks/LuaConsoleDock.ui + dialogs/MacroEditorDialog.ui dialogs/MacroRunDialog.ui dialogs/MacroSaveDialog.ui dialogs/PreferencesDialog.ui + docks/DebugLogDock.cpp + docks/EditorInspectorDock.h + docks/EditorInspectorDock.cpp + docks/EditorInspectorDock.ui + docks/FolderAsWorkspaceDock.cpp + docks/FolderAsWorkspaceDock.h + docks/FolderAsWorkspaceDock.ui + docks/LanguageInspectorDock.cpp + docks/LanguageInspectorDock.h + docks/LanguageInspectorDock.ui + docks/LuaConsoleDock.cpp + docks/LuaConsoleDock.ui + docks/LuaConsoleDock.h + docks/HexViewerDock.cpp docks/SearchResultsDock.cpp docks/SearchResultsDock.h docks/SearchResultsDock.ui - resources.qrc - scripts.qrc + widgets/EditorInfoStatusBar.cpp + widgets/EditorInfoStatusBar.h + widgets/StatusLabel.cpp + widgets/StatusLabel.h ) target_link_libraries(NotepadNext Qt::Widgets Qt::PrintSupport @@ -152,7 +163,7 @@ if (Qt6_FOUND) endif() target_include_directories(NotepadNext PRIVATE decorators dialogs docks widgets src) -target_compile_definitions(NotepadNext PRIVATE APP_VERSION="0.5.0") +target_compile_definitions(NotepadNext PRIVATE APP_VERSION="0.5.5") target_compile_definitions(NotepadNext PRIVATE APP_COPYRIGHT="Copyright 2019-2022 Justin Dailey") target_compile_definitions(NotepadNext PRIVATE CMAKE_EXPERIMENTAL) diff --git a/src/NotepadNext/MacroStepTableModel.h b/src/NotepadNext/MacroStepTableModel.h index 430e84858..bc763465e 100644 --- a/src/NotepadNext/MacroStepTableModel.h +++ b/src/NotepadNext/MacroStepTableModel.h @@ -16,6 +16,7 @@ * along with Notepad Next. If not, see . */ +#pragma once #include From 69f4f68735a1041f4d749706b6d99b8192899028 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 25 Sep 2022 23:05:44 +0300 Subject: [PATCH 34/78] Build using ninja I am now installing using `cmake` which means I can build using ninja again. --- .github/workflows/build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88d246b01..b2a7932dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,6 @@ jobs: # disable meanwhile, until I understand how to fix the install prefix with ninja - name: Install Ninja uses: seanmiddleditch/gha-setup-ninja@master - if: false - name: Setup (Linux) if: startsWith (matrix.config.os, 'ubuntu') @@ -58,22 +57,18 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -DCMAKE_INSTALL_PREFIX:PATH=/usr/ + cmake -S . -B cbuild -DCMAKE_INSTALL_PREFIX:PATH=/usr/ -GNinja cmake --build cbuild --parallel $(nproc) - name: Create App Image if: startsWith (matrix.config.os, 'ubuntu') run: | - make -C cbuild DESTDIR=${{ github.workspace }}/cbuild/AppDir install + cmake --install cbuild --prefix=${{ github.workspace }}/cbuild/AppDir cd cbuild wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" chmod +x linuxdeploy*.AppImage - pwd - ls -lah - export OUTPUT=NotepadNext-x86_64.AppImage - find . ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage - name: Upload AppImage if: startsWith (matrix.config.os, 'ubuntu') From 1e22932247ddb1364c14893d927faacbc275e470 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 25 Sep 2022 23:06:42 +0300 Subject: [PATCH 35/78] Updates to various libraries - build lua without a fork, create a local cmake file for it - ADS - 3.8.2 -> 3.8.3 - ucharder - update upsream sha1 --- CMakeLists.txt | 30 ++++++++++++++++-------------- lua.cmake | 16 ++++++++++++++++ src/NotepadNext/CMakeLists.txt | 4 ++-- 3 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 lua.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c6d3258f..df36756f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,23 +6,26 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # uchardet setup -set(BUILD_BINARY OFF) -set(USE_BUILD_SHARED_LIBS CACHE BOOL OFF) -set(BUILD_STATICCACHE OFF) +set(BUILD_BINARY CACHE BOOL OFF) +set(BUILD_STATICCACHE CACHE BOOL OFF) +set(BUILD_SHARED_LIBS CACHE BOOL OFF) # setup singleapplication - we want the GUI application, not console -set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") - +set(QAPPLICATION_CLASS QApplication) # setup ADS - we don't need to build the examples -set(BUILD_EXAMPLES OFF) -set(BUILD_STATIC ON) -set(BUILD_CACHE ON) -set(USE_BUILD_SHARED_LIBS OFF) +set(BUILD_EXAMPLES CACHE BOOL OFF) +set(BUILD_STATIC CACHE BOOL ON) +set(BUILD_CACHE CACHE BOOL ON) +set(USE_BUILD_SHARED_LIBS CACHE BOOL OFF) # setup lua bridge, we want C++ 17 support set(LUABRIDGE_CXX17 CACHE BOOL true) +# SingleApplication needs this - otherwise it gets confused with Qt5 +set(QT_DEFAULT_MAJOR_VERSION 6) + + include(CPM.cmake) # note: when using "gl" - you canot link to a branch, only tag/sha1 @@ -33,18 +36,17 @@ CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210" # Using a modern sha1, 2.6 is 2 years old CPMAddPackage("gh:vinniefalco/LuaBridge#efb62e5be5c12d75e085357072039db9199f7ebf") -CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.2") +CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.3") -set(QT_DEFAULT_MAJOR_VERSION 6) CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.4") # this a a repack of the 8426d9b4d4df1da3c5b2d759e509ae1c50a86667 upstream version with a cmake file -CPMAddPackage("gh:elcuco/lua#9f06e8ad5b562d71c10fb38e6213c2a07465191a") -#include(lua.cmake) +#CPMAddPackage("gh:elcuco/lua#9f06e8ad5b562d71c10fb38e6213c2a07465191a") +include(lua.cmake) # this a a repack of the upstream#52820d5 with a cmake file (upstream does # not support building the library, but only unit tests) -CPMAddPackage("gh:elcuco/editorconfig-core-qt#8363919") +CPMAddPackage("gh:elcuco/editorconfig-core-qt#6ef2b2db29dad565e43002b64dfbaaf8a6687bc4") # this a a repack of the upstream#62e0ce7 with a cmake file CPMAddPackage("gh:elcuco/QSimpleUpdater#dfbbd8db78cf3c40df5fb3ee9b5a75cd50cae185") diff --git a/lua.cmake b/lua.cmake new file mode 100644 index 000000000..f34ae3887 --- /dev/null +++ b/lua.cmake @@ -0,0 +1,16 @@ +CPMAddPackage("gh:lua/lua#26be27459b11feabed52cf40aaa76f86c7edc977") + +if (lua_ADDED) + set(CMAKE_C_STANDARD 99) + FILE(GLOB lua_sources ${lua_SOURCE_DIR}/*.c) + list(REMOVE_ITEM lua_sources "${lua_SOURCE_DIR}/lua.c" "${lua_SOURCE_DIR}/luac.c" "${lua_SOURCE_DIR}/onelua.c") + add_library(lua STATIC ${lua_sources}) + target_include_directories(lua PUBLIC $) + #target_compile_options("$<$:/utf-8>") + + if (WINDOWS) + target_compile_definitions(lua PRIVATE "-DLUA_USE_WINDOWS") + endif() + + target_compile_definitions(lua PRIVATE "-DLUA_COMPAT_5_2") +endif() diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 2068d4e6f..d45fdbe58 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -80,7 +80,6 @@ add_executable(NotepadNext UndoAction.h UndoAction.cpp - decorators/ApplicationDecorator.cpp decorators/AutoCompletion.cpp decorators/AutoIndentation.cpp @@ -147,7 +146,7 @@ add_executable(NotepadNext ) target_link_libraries(NotepadNext Qt::Widgets Qt::PrintSupport - libuchardet_static + libuchardet lua LuaBridge qtadvanceddocking @@ -155,6 +154,7 @@ target_link_libraries(NotepadNext Qt::Widgets Qt::PrintSupport QSimpleUpdater editorconfig-core-qt scintilla-qt-edit + scintilla-qt-edit-base lexzilla ) From 6c17f3a2894a2c2b0fccc165210b092ffa74b06a Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 25 Sep 2022 23:33:10 +0300 Subject: [PATCH 36/78] Fix build - dont link same library twise - when building on the CI - pass the correct defines, this should work (works on my local setup!) --- .github/workflows/build.yml | 7 ++++++- CMakeLists.txt | 2 -- src/NotepadNext/CMakeLists.txt | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2a7932dc..03aebf72a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,12 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -DCMAKE_INSTALL_PREFIX:PATH=/usr/ -GNinja + cmake -S . -B cbuild -DCMAKE_INSTALL_PREFIX:PATH=/usr/ -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_STATIC=ON \ + -DBUILD_CACHE=ON \ + -DUSE_BUILD_SHARED_LIBS=OFF cmake --build cbuild --parallel $(nproc) - name: Create App Image diff --git a/CMakeLists.txt b/CMakeLists.txt index df36756f9..218938081 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,6 @@ set(BUILD_STATIC CACHE BOOL ON) set(BUILD_CACHE CACHE BOOL ON) set(USE_BUILD_SHARED_LIBS CACHE BOOL OFF) -# setup lua bridge, we want C++ 17 support -set(LUABRIDGE_CXX17 CACHE BOOL true) # SingleApplication needs this - otherwise it gets confused with Qt5 set(QT_DEFAULT_MAJOR_VERSION 6) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index d45fdbe58..bf37d4661 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -154,7 +154,6 @@ target_link_libraries(NotepadNext Qt::Widgets Qt::PrintSupport QSimpleUpdater editorconfig-core-qt scintilla-qt-edit - scintilla-qt-edit-base lexzilla ) From e14db3a42ed358711c44d04527d75fb336080115 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sun, 25 Sep 2022 23:49:10 +0300 Subject: [PATCH 37/78] Fix building on windows Also.. use the default configure path for cmake --- .github/workflows/build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03aebf72a..50990884f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,13 +57,8 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -DCMAKE_INSTALL_PREFIX:PATH=/usr/ -GNinja \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_EXAMPLES=OFF \ - -DBUILD_STATIC=ON \ - -DBUILD_CACHE=ON \ - -DUSE_BUILD_SHARED_LIBS=OFF - cmake --build cbuild --parallel $(nproc) + cmake -S . -B cbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_STATIC=ON -DBUILD_CACHE=ON -DUSE_BUILD_SHARED_LIBS=OFF + cmake --build cbuild - name: Create App Image if: startsWith (matrix.config.os, 'ubuntu') From 4f258acf9840cf5a323cf25494b44c117dfaaae6 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 26 Sep 2022 00:02:43 +0300 Subject: [PATCH 38/78] Debug linux build, lets try building a DMG --- .github/workflows/build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50990884f..9bcaf7236 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,6 +65,7 @@ jobs: run: | cmake --install cbuild --prefix=${{ github.workspace }}/cbuild/AppDir cd cbuild + find . wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" chmod +x linuxdeploy*.AppImage @@ -77,6 +78,18 @@ jobs: name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }}-cmake-AppImage path: ${{ github.workspace }}/cbuild/NotepadNext-x86_64.AppImage + - name: Create DMG + if: startsWith (matrix.config.os, 'macos') + srun: | + cd cbuild + macdeployqt NotepadNext.app -dmg + - name: Upload DMG + if: startsWith (matrix.config.os, 'macos') + uses: actions/upload-artifact@v2 + with: + name: NotepadNext-macOS-Qt${{ matrix.config.qt_version }} + path: ${{ github.workspace }}/cbuild/NotepadNext/NotepadNext.dmg + build-linux: strategy: fail-fast: false From 82ad5128144a263325105fe855736fd3942cbba0 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 26 Sep 2022 00:06:08 +0300 Subject: [PATCH 39/78] Debug linux build, lets try building a DMG (fix) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bcaf7236..aac887611 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,7 @@ jobs: - name: Create DMG if: startsWith (matrix.config.os, 'macos') - srun: | + run: | cd cbuild macdeployqt NotepadNext.app -dmg - name: Upload DMG From 98814e3a99556e1573aeb79be38ac05768eda43f Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 26 Sep 2022 00:18:12 +0300 Subject: [PATCH 40/78] fix mac + ubuntu build images? --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aac887611..8c4d2e45f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,9 +63,8 @@ jobs: - name: Create App Image if: startsWith (matrix.config.os, 'ubuntu') run: | - cmake --install cbuild --prefix=${{ github.workspace }}/cbuild/AppDir + cmake --install cbuild --prefix=${{ github.workspace }}/cbuild/AppDir/usr/ cd cbuild - find . wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" chmod +x linuxdeploy*.AppImage @@ -81,7 +80,7 @@ jobs: - name: Create DMG if: startsWith (matrix.config.os, 'macos') run: | - cd cbuild + cd cbuild/src/NotepadNext macdeployqt NotepadNext.app -dmg - name: Upload DMG if: startsWith (matrix.config.os, 'macos') From 6b43166f4a0d9e6164e812e0cb43290b047cabd9 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 27 Sep 2022 21:20:41 +0300 Subject: [PATCH 41/78] Does this fix the macos build...? --- .github/workflows/build.yml | 3 ++- src/NotepadNext/CMakeLists.txt | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c4d2e45f..99d740aac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,8 @@ jobs: - name: Create DMG if: startsWith (matrix.config.os, 'macos') run: | - cd cbuild/src/NotepadNext + #cd cbuild/src/NotepadNext + cd cbuild macdeployqt NotepadNext.app -dmg - name: Upload DMG if: startsWith (matrix.config.os, 'macos') diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index bf37d4661..eb4a0bcf3 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -182,6 +182,16 @@ if(UNIX AND NOT APPLE) target_link_libraries(NotepadNext xcb) endif() +if(APPLE) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13) + set(MACOSX_BUNDLE_BUNDLE_NAME "NotepadNext") +# set(MACOSX_BUNDLE_BUNDLE_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}) +# set(MACOSX_BUNDLE_LONG_VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}) +# set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) + set(MACOSX_BUNDLE_ICON_FILE ../icon/NotepadNext.icns) + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.github.dail8859.NotepadNext") +endif() + include(GNUInstallDirs) install(TARGETS NotepadNext) install(FILES ${CMAKE_SOURCE_DIR}/deploy/linux/NotepadNext.desktop From 3368536a2cc744953e05f765820443c240f83c7c Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Thu, 29 Sep 2022 17:57:51 +0300 Subject: [PATCH 42/78] Move to a local build system for QSimpleUpdater As we did with LUA, QSimpleUpdater has a local CMake build system, which we just include. No port is needed. I am abandoning the idea of upstreaming the CMake support - as I see for example that LUA is not intersted at this at all. I think SCintilla are in a similar position. If anyone wants to port these libraries to use CMake, they can adpot this code from ours. --- CMakeLists.txt | 9 +++------ qsimpleupdater.cmake | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 qsimpleupdater.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 218938081..a716974d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,21 +33,18 @@ CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210" # Using a modern sha1, 2.6 is 2 years old CPMAddPackage("gh:vinniefalco/LuaBridge#efb62e5be5c12d75e085357072039db9199f7ebf") - CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.3") - CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.4") -# this a a repack of the 8426d9b4d4df1da3c5b2d759e509ae1c50a86667 upstream version with a cmake file -#CPMAddPackage("gh:elcuco/lua#9f06e8ad5b562d71c10fb38e6213c2a07465191a") +# the following libraries have no upstream cmake support, +# so we do own own locally include(lua.cmake) +include(qsimpleupdater.cmake) # this a a repack of the upstream#52820d5 with a cmake file (upstream does # not support building the library, but only unit tests) CPMAddPackage("gh:elcuco/editorconfig-core-qt#6ef2b2db29dad565e43002b64dfbaaf8a6687bc4") -# this a a repack of the upstream#62e0ce7 with a cmake file -CPMAddPackage("gh:elcuco/QSimpleUpdater#dfbbd8db78cf3c40df5fb3ee9b5a75cd50cae185") # this a a repack of the upstream#f85a8baec6f401d481341ead87f39d9fe9d284ec with a cmake file CPMAddPackage("gh:elcuco/scintilla-code#923fac200dd228256ca263361c974f78402d2461") diff --git a/qsimpleupdater.cmake b/qsimpleupdater.cmake new file mode 100644 index 000000000..344d73843 --- /dev/null +++ b/qsimpleupdater.cmake @@ -0,0 +1,26 @@ +CPMAddPackage("gh:alex-spataru/QSimpleUpdater#14c1bef71d26c915eeaa05c988c55bdad98e1d75") + +if (QSimpleUpdater_ADDED) + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTORCC ON) + set(CMAKE_AUTOUIC ON) + + find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Core Gui Network Widgets REQUIRED) + find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network Widgets REQUIRED) + + add_library(QSimpleUpdater STATIC + ${QSimpleUpdater_SOURCE_DIR}/etc/resources/qsimpleupdater.qrc + ${QSimpleUpdater_SOURCE_DIR}/src/Downloader.ui + ${QSimpleUpdater_SOURCE_DIR}/src/Downloader.cpp + ${QSimpleUpdater_SOURCE_DIR}/src/Downloader.h + ${QSimpleUpdater_SOURCE_DIR}/src/Updater.cpp + ${QSimpleUpdater_SOURCE_DIR}/src/Updater.h + ${QSimpleUpdater_SOURCE_DIR}/src/QSimpleUpdater.cpp + ${QSimpleUpdater_SOURCE_DIR}/include/QSimpleUpdater.h + ) + + target_link_libraries(QSimpleUpdater PRIVATE Qt::Widgets Qt::Network) + target_include_directories(QSimpleUpdater PUBLIC ${QSimpleUpdater_SOURCE_DIR}/include/) + target_include_directories(QSimpleUpdater PRIVATE ${QSimpleUpdater_SOURCE_DIR}/src/) + target_compile_definitions(QSimpleUpdater PRIVATE -DQSU_INCLUDE_MOC) +endif() From b418cbad250dbf74abb70c83f857ea1a2dd198a7 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 4 Oct 2022 00:09:40 +0300 Subject: [PATCH 43/78] Simplify build system Now that editor-config-qt cmake support is upstream we can use the upstream repo, instead of the previous port. I also removed all other forks and instead made a local cmake build system (local to the project, a simple include file). Now we are left with a single fork - which is necesary (upstream uses mervurial, and demands python for generting some files on build time - my fork has that as part of the tree). All projects point to the newewst code available on their git - code seems to compile and run, so... yap, ship it. Fixed the app name and also remove lots of craft from the main CMakeFile. Fixed the workflow to use the *.so files generated at build, and disabled the OSX build for now. --- .github/workflows/build.yml | 32 ++++--- CMakeLists.txt | 61 +++--------- lexilla.cmake | 170 +++++++++++++++++++++++++++++++++ qsimpleupdater.cmake | 2 +- src/NotepadNext/CMakeLists.txt | 2 +- 5 files changed, 204 insertions(+), 63 deletions(-) create mode 100644 lexilla.cmake diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2a5c06de..2c32c0ce9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,11 +65,28 @@ jobs: run: | cmake --install cbuild --prefix=${{ github.workspace }}/cbuild/AppDir/usr/ cd cbuild + + # some libraries are not build as static, and are not installed + # so we manually copy them, and later on we copy them to the bundle + mkdir -p AppDir/usr/lib/ + cp -v *.so* \ + AppDir/usr/lib/ + cp -v _deps/editorconfig-core-qt-build/libeditorconfig-core-qt.so \ + AppDir/usr/lib/ + cp -v _deps/scintilla-code-build/libscintilla-qt-edit.so* \ + AppDir/usr/lib/ + wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" chmod +x linuxdeploy*.AppImage + export OUTPUT=NotepadNext-x86_64.AppImage - ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage + export LD_LIBRARY_PATH=AppDir/usr/lib/ + ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage \ + --library AppDir/usr/lib/libeditorconfig-core-qt.so \ + --library AppDir/usr/lib/liblexilla.so \ + --library AppDir/usr/lib/libscintilla-qt-edit.so.5 \ + - name: Upload AppImage if: startsWith (matrix.config.os, 'ubuntu') uses: actions/upload-artifact@v2 @@ -77,19 +94,6 @@ jobs: name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }}-cmake-AppImage path: ${{ github.workspace }}/cbuild/NotepadNext-x86_64.AppImage - - name: Create DMG - if: startsWith (matrix.config.os, 'macos') - run: | - #cd cbuild/src/NotepadNext - cd cbuild - macdeployqt NotepadNext.app -dmg - - name: Upload DMG - if: startsWith (matrix.config.os, 'macos') - uses: actions/upload-artifact@v2 - with: - name: NotepadNext-macOS-Qt${{ matrix.config.qt_version }} - path: ${{ github.workspace }}/cbuild/NotepadNext/NotepadNext.dmg - build-linux: strategy: fail-fast: false diff --git a/CMakeLists.txt b/CMakeLists.txt index a716974d6..8f0a70eb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,65 +1,32 @@ cmake_minimum_required(VERSION 3.20) -project(NotepadPlusPlusNext) +project(NotepadNext) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# uchardet setup -set(BUILD_BINARY CACHE BOOL OFF) -set(BUILD_STATICCACHE CACHE BOOL OFF) -set(BUILD_SHARED_LIBS CACHE BOOL OFF) - -# setup singleapplication - we want the GUI application, not console +# setup SingleApplication set(QAPPLICATION_CLASS QApplication) - -# setup ADS - we don't need to build the examples -set(BUILD_EXAMPLES CACHE BOOL OFF) -set(BUILD_STATIC CACHE BOOL ON) -set(BUILD_CACHE CACHE BOOL ON) -set(USE_BUILD_SHARED_LIBS CACHE BOOL OFF) - - -# SingleApplication needs this - otherwise it gets confused with Qt5 set(QT_DEFAULT_MAJOR_VERSION 6) - include(CPM.cmake) -# note: when using "gl" - you canot link to a branch, only tag/sha1 -# note: latest tag is 0.0.7 - way too old to be usable -# note: gitlab requires a user, so I am using the githab mirror -CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210") - -# Using a modern sha1, 2.6 is 2 years old -CPMAddPackage("gh:vinniefalco/LuaBridge#efb62e5be5c12d75e085357072039db9199f7ebf") -CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3.8.3") -CPMAddPackage("gh:itay-grudev/SingleApplication#v3.3.4") +# uchardet is hosted at gitlab, but CPMAddPackage needs crednetials (?) +CPMAddPackage("gh:freedesktop/uchardet#143b3fe513bad2cc85903ee564fe55ccbe96d86b") +CPMAddPackage("gh:vinniefalco/LuaBridge#9092ace9615d14e3f5926f2e8a3b612ddc6c8efa") +CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3cd6d766f8ddb0dc306e7e7fa5b3e406f84b56c6") +CPMAddPackage("gh:itay-grudev/SingleApplication#f1e15081dc57a9c03f7f4f165677f18802e1437a") +CPMAddPackage("gh:editorconfig/editorconfig-core-qt#af4906ab22dc66c48e8d282708ae434de6928e55") # the following libraries have no upstream cmake support, -# so we do own own locally +# so we do own own locally (internally they clone the upstream repo) include(lua.cmake) include(qsimpleupdater.cmake) +include(lexilla.cmake) -# this a a repack of the upstream#52820d5 with a cmake file (upstream does -# not support building the library, but only unit tests) -CPMAddPackage("gh:elcuco/editorconfig-core-qt#6ef2b2db29dad565e43002b64dfbaaf8a6687bc4") - - -# this a a repack of the upstream#f85a8baec6f401d481341ead87f39d9fe9d284ec with a cmake file -CPMAddPackage("gh:elcuco/scintilla-code#923fac200dd228256ca263361c974f78402d2461") - -# TODO - should we backport this to a stable release? -# this a a repack of the upstream#0bd13d84b3fef7a72553ab95c43d0d4c9677f70f with a cmake file -CPMAddPackage("gh:elcuco/lexilla#270fb410dd7518736141c9c9c84880b938d957a7") - -# Instead of all the above, you can use a moving branch. All track -# upstream `master`. -#CPMAddPackage("gh:elcuco/editorconfig-core-qt#cmake-support") -#CPMAddPackage("gh:elcuco/lua#9f06e8ad5b562d71c10fb38e6213c2a07465191a") -#CPMAddPackage("gh:elcuco/QSimpleUpdater#cmake-support") -#CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") -#CPMAddPackage("gh:elcuco/lexilla#cmake-support") -#CPMAddPackage("gh:elcuco/scintilla-code#cmake-support") +# This is scintilla - which upstream uses mercurial, and as part of the build +# they need python. This fork uses github, and has auto-generated files as +# part of the repo. Apparently - this fork cannot be +CPMAddPackage("gh:elcuco/scintilla-code#c2ce7fd307466c4fc79355d06c445fd7fc60d339") add_subdirectory(src/NotepadNext) diff --git a/lexilla.cmake b/lexilla.cmake new file mode 100644 index 000000000..0890c2b0b --- /dev/null +++ b/lexilla.cmake @@ -0,0 +1,170 @@ +#CPMAddPackage("gh:elcuco/lexilla#270fb410dd7518736141c9c9c84880b938d957a7") + +CPMAddPackage("gh:ScintillaOrg/lexilla#3dbbff6fe2fa53b8d7a3907440e6f8294f8b1eb4") + +if (lexilla_ADDED) + add_library(lexilla + ${lexilla_SOURCE_DIR}/src/Lexilla.cxx + ${lexilla_SOURCE_DIR}/access/LexillaAccess.cxx + ${lexilla_SOURCE_DIR}/access/LexillaAccess.h + ${lexilla_SOURCE_DIR}/lexlib/Accessor.cxx + ${lexilla_SOURCE_DIR}/lexlib/Accessor.h + ${lexilla_SOURCE_DIR}/lexlib/CatalogueModules.h + ${lexilla_SOURCE_DIR}/lexlib/CharacterCategory.cxx + ${lexilla_SOURCE_DIR}/lexlib/CharacterCategory.h + ${lexilla_SOURCE_DIR}/lexlib/CharacterSet.cxx + ${lexilla_SOURCE_DIR}/lexlib/CharacterSet.h + ${lexilla_SOURCE_DIR}/lexlib/DefaultLexer.cxx + ${lexilla_SOURCE_DIR}/lexlib/DefaultLexer.h + ${lexilla_SOURCE_DIR}/lexlib/LexAccessor.cxx + ${lexilla_SOURCE_DIR}/lexlib/LexAccessor.h + ${lexilla_SOURCE_DIR}/lexlib/LexerBase.cxx + ${lexilla_SOURCE_DIR}/lexlib/LexerBase.h + ${lexilla_SOURCE_DIR}/lexlib/LexerModule.cxx + ${lexilla_SOURCE_DIR}/lexlib/LexerModule.h + ${lexilla_SOURCE_DIR}/lexlib/LexerNoExceptions.cxx + ${lexilla_SOURCE_DIR}/lexlib/LexerNoExceptions.h + ${lexilla_SOURCE_DIR}/lexlib/LexerSimple.cxx + ${lexilla_SOURCE_DIR}/lexlib/LexerSimple.h + ${lexilla_SOURCE_DIR}/lexlib/OptionSet.h + ${lexilla_SOURCE_DIR}/lexlib/PropSetSimple.cxx + ${lexilla_SOURCE_DIR}/lexlib/PropSetSimple.h + ${lexilla_SOURCE_DIR}/lexlib/SparseState.h + ${lexilla_SOURCE_DIR}/lexlib/StringCopy.h + ${lexilla_SOURCE_DIR}/lexlib/StyleContext.cxx + ${lexilla_SOURCE_DIR}/lexlib/StyleContext.h + ${lexilla_SOURCE_DIR}/lexlib/SubStyles.h + ${lexilla_SOURCE_DIR}/lexlib/WordList.cxx + ${lexilla_SOURCE_DIR}/lexlib/WordList.h + ${lexilla_SOURCE_DIR}/lexers/LexA68k.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAbaqus.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAda.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAPDL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAsciidoc.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAsm.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAsn1.cxx + ${lexilla_SOURCE_DIR}/lexers/LexASY.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAU3.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAVE.cxx + ${lexilla_SOURCE_DIR}/lexers/LexAVS.cxx + ${lexilla_SOURCE_DIR}/lexers/LexBaan.cxx + ${lexilla_SOURCE_DIR}/lexers/LexBash.cxx + ${lexilla_SOURCE_DIR}/lexers/LexBasic.cxx + ${lexilla_SOURCE_DIR}/lexers/LexBatch.cxx + ${lexilla_SOURCE_DIR}/lexers/LexBibTeX.cxx + ${lexilla_SOURCE_DIR}/lexers/LexBullant.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCaml.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCIL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCLW.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCmake.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCOBOL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCoffeeScript.cxx + ${lexilla_SOURCE_DIR}/lexers/LexConf.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCPP.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCrontab.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCsound.cxx + ${lexilla_SOURCE_DIR}/lexers/LexCSS.cxx + ${lexilla_SOURCE_DIR}/lexers/LexDataflex.cxx + ${lexilla_SOURCE_DIR}/lexers/LexD.cxx + ${lexilla_SOURCE_DIR}/lexers/LexDiff.cxx + ${lexilla_SOURCE_DIR}/lexers/LexDMAP.cxx + ${lexilla_SOURCE_DIR}/lexers/LexDMIS.cxx + ${lexilla_SOURCE_DIR}/lexers/LexECL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexEDIFACT.cxx + ${lexilla_SOURCE_DIR}/lexers/LexEiffel.cxx + ${lexilla_SOURCE_DIR}/lexers/LexErlang.cxx + ${lexilla_SOURCE_DIR}/lexers/LexErrorList.cxx + ${lexilla_SOURCE_DIR}/lexers/LexEScript.cxx + ${lexilla_SOURCE_DIR}/lexers/LexFlagship.cxx + ${lexilla_SOURCE_DIR}/lexers/LexForth.cxx + ${lexilla_SOURCE_DIR}/lexers/LexFortran.cxx + ${lexilla_SOURCE_DIR}/lexers/LexFSharp.cxx + ${lexilla_SOURCE_DIR}/lexers/LexGAP.cxx + ${lexilla_SOURCE_DIR}/lexers/LexGDScript.cxx + ${lexilla_SOURCE_DIR}/lexers/LexGui4Cli.cxx + ${lexilla_SOURCE_DIR}/lexers/LexHaskell.cxx + ${lexilla_SOURCE_DIR}/lexers/LexHex.cxx + ${lexilla_SOURCE_DIR}/lexers/LexHollywood.cxx + ${lexilla_SOURCE_DIR}/lexers/LexHTML.cxx + ${lexilla_SOURCE_DIR}/lexers/LexIndent.cxx + ${lexilla_SOURCE_DIR}/lexers/LexInno.cxx + ${lexilla_SOURCE_DIR}/lexers/LexJSON.cxx + ${lexilla_SOURCE_DIR}/lexers/LexJulia.cxx + ${lexilla_SOURCE_DIR}/lexers/LexKix.cxx + ${lexilla_SOURCE_DIR}/lexers/LexKVIrc.cxx + ${lexilla_SOURCE_DIR}/lexers/LexLaTeX.cxx + ${lexilla_SOURCE_DIR}/lexers/LexLisp.cxx + ${lexilla_SOURCE_DIR}/lexers/LexLout.cxx + ${lexilla_SOURCE_DIR}/lexers/LexLua.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMagik.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMake.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMarkdown.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMatlab.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMaxima.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMetapost.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMMIXAL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexModula.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMPT.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMSSQL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexMySQL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexNim.cxx + ${lexilla_SOURCE_DIR}/lexers/LexNimrod.cxx + ${lexilla_SOURCE_DIR}/lexers/LexNsis.cxx + ${lexilla_SOURCE_DIR}/lexers/LexNull.cxx + ${lexilla_SOURCE_DIR}/lexers/LexOpal.cxx + ${lexilla_SOURCE_DIR}/lexers/LexOScript.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPascal.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPB.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPerl.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPLM.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPO.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPOV.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPowerPro.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPowerShell.cxx + ${lexilla_SOURCE_DIR}/lexers/LexProgress.cxx + ${lexilla_SOURCE_DIR}/lexers/LexProps.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPS.cxx + ${lexilla_SOURCE_DIR}/lexers/LexPython.cxx + ${lexilla_SOURCE_DIR}/lexers/LexRaku.cxx + ${lexilla_SOURCE_DIR}/lexers/LexR.cxx + ${lexilla_SOURCE_DIR}/lexers/LexRebol.cxx + ${lexilla_SOURCE_DIR}/lexers/LexRegistry.cxx + ${lexilla_SOURCE_DIR}/lexers/LexRuby.cxx + ${lexilla_SOURCE_DIR}/lexers/LexRust.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSAS.cxx + ${lexilla_SOURCE_DIR}/lexers/LexScriptol.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSmalltalk.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSML.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSorcus.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSpecman.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSpice.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSQL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexStata.cxx + ${lexilla_SOURCE_DIR}/lexers/LexSTTXT.cxx + ${lexilla_SOURCE_DIR}/lexers/LexTACL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexTADS3.cxx + ${lexilla_SOURCE_DIR}/lexers/LexTAL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexTCL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexTCMD.cxx + ${lexilla_SOURCE_DIR}/lexers/LexTeX.cxx + ${lexilla_SOURCE_DIR}/lexers/LexTxt2tags.cxx + ${lexilla_SOURCE_DIR}/lexers/LexVB.cxx + ${lexilla_SOURCE_DIR}/lexers/LexVerilog.cxx + ${lexilla_SOURCE_DIR}/lexers/LexVHDL.cxx + ${lexilla_SOURCE_DIR}/lexers/LexVisualProlog.cxx + ${lexilla_SOURCE_DIR}/lexers/LexX12.cxx + ${lexilla_SOURCE_DIR}/lexers/LexYAML.cxx + ) + + target_link_libraries(lexilla PRIVATE scintilla-qt-edit) + target_include_directories(lexilla PUBLIC + ${lexilla_SOURCE_DIR}/include/ + ) + target_include_directories(lexilla PRIVATE + ${lexilla_SOURCE_DIR}/access/ + ${lexilla_SOURCE_DIR}/lexlib/ + ${lexilla_SOURCE_DIR}/include/ + ) + set_property(TARGET lexilla PROPERTY VERSION "5.15") + set_property(TARGET lexilla PROPERTY SOVERSION 5 ) +endif() diff --git a/qsimpleupdater.cmake b/qsimpleupdater.cmake index 344d73843..9369717ea 100644 --- a/qsimpleupdater.cmake +++ b/qsimpleupdater.cmake @@ -1,4 +1,4 @@ -CPMAddPackage("gh:alex-spataru/QSimpleUpdater#14c1bef71d26c915eeaa05c988c55bdad98e1d75") +CPMAddPackage("gh:alex-spataru/QSimpleUpdater#62e0ce7dde4c76e7533f2f0ee53f19ee1690c8dd") if (QSimpleUpdater_ADDED) set(CMAKE_AUTOMOC ON) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index eb4a0bcf3..4ca2fefe0 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -154,7 +154,7 @@ target_link_libraries(NotepadNext Qt::Widgets Qt::PrintSupport QSimpleUpdater editorconfig-core-qt scintilla-qt-edit - lexzilla + lexilla ) if (Qt6_FOUND) From 4ece07f5c4a05a58fd088f9be128a5a40d70271c Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 4 Oct 2022 00:13:56 +0300 Subject: [PATCH 44/78] Fix compilation Upstream removed this signal - I commend this just to the the code to compile and later on I will fix it. --- src/NotepadNext/ScintillaNext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NotepadNext/ScintillaNext.cpp b/src/NotepadNext/ScintillaNext.cpp index 8133b8e91..4792870ac 100644 --- a/src/NotepadNext/ScintillaNext.cpp +++ b/src/NotepadNext/ScintillaNext.cpp @@ -55,7 +55,7 @@ ScintillaNext::ScintillaNext(QString name, QWidget *parent) : doc(get_doc()), name(name) { - connect(doc, &ScintillaDocument::lexer_changed, this, &ScintillaNext::lexerChanged); +// connect(this->doc., &ScintillaDocument::lexer_changed, this, &ScintillaNext::lexerChanged); } ScintillaNext::~ScintillaNext() From ff27b7ef6b43d2a78ac2196f3a9a1d2e345eefe6 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 4 Oct 2022 01:21:33 +0300 Subject: [PATCH 45/78] Fix compilation and appimage ? uchardet is not compiling for windows, revert the sha1 appimage is broken, lets try and fix? --- .github/workflows/build.yml | 10 +++++++--- CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12a9745c8..86139ec5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,10 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_STATIC=ON -DBUILD_CACHE=ON -DUSE_BUILD_SHARED_LIBS=OFF + cmake -S . -B cbuild -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_STATIC=ON cmake --build cbuild - name: Create App Image @@ -81,11 +84,12 @@ jobs: chmod +x linuxdeploy*.AppImage export OUTPUT=NotepadNext-x86_64.AppImage - export LD_LIBRARY_PATH=AppDir/usr/lib/ + export LD_LIBRARY_PATH=AppDir/usr/lib/:$LD_LIBRARY_PATH + export DEBUG=1 ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage \ --library AppDir/usr/lib/libeditorconfig-core-qt.so \ --library AppDir/usr/lib/liblexilla.so \ - --library AppDir/usr/lib/libscintilla-qt-edit.so.5 \ + --library AppDir/usr/lib/libscintilla-qt-edit.so.5 - name: Upload AppImage if: startsWith (matrix.config.os, 'ubuntu') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f0a70eb1..5dad35cfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(QT_DEFAULT_MAJOR_VERSION 6) include(CPM.cmake) # uchardet is hosted at gitlab, but CPMAddPackage needs crednetials (?) -CPMAddPackage("gh:freedesktop/uchardet#143b3fe513bad2cc85903ee564fe55ccbe96d86b") +CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210") CPMAddPackage("gh:vinniefalco/LuaBridge#9092ace9615d14e3f5926f2e8a3b612ddc6c8efa") CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3cd6d766f8ddb0dc306e7e7fa5b3e406f84b56c6") CPMAddPackage("gh:itay-grudev/SingleApplication#f1e15081dc57a9c03f7f4f165677f18802e1437a") From 03fbc1f5d55d2b5f66c05ffb299db39c0ff00663 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 4 Oct 2022 01:30:32 +0300 Subject: [PATCH 46/78] Fix windows build, increase qt version --- .github/workflows/build.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86139ec5a..bd653f74e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,15 +16,15 @@ jobs: matrix: config: - - qt_version: "6.2.4" + qt_version: "6.3.1" modules: "qt5compat" os: ubuntu-20.04 - - qt_version: "6.2.4" + qt_version: "6.3.1" modules: "qt5compat" os: windows-latest - - qt_version: "6.2.4" + qt_version: "6.3.1" modules: "qt5compat" os: macos-latest @@ -36,7 +36,7 @@ jobs: submodules: true - name: Install Qt - uses: jurplel/install-qt-action@v2 + uses: jurplel/install-qt-action@v3 with: version: ${{ matrix.config.qt_version }} modules: ${{ matrix.config.modules }} @@ -57,10 +57,7 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_EXAMPLES=OFF \ - -DBUILD_STATIC=ON + cmake -S . -B cbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_STATIC=ON cmake --build cbuild - name: Create App Image From f3b0954154cde8425727e86d687115be0b17e7d3 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 4 Oct 2022 01:41:39 +0300 Subject: [PATCH 47/78] Partly revert b418cbad250dbf74abb70c83f857ea1a2dd198a7 Lets hope this fixes uchardet on windows --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dad35cfd..64becedb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,12 @@ set(QT_DEFAULT_MAJOR_VERSION 6) include(CPM.cmake) +# uchardet setup +set(BUILD_BINARY CACHE BOOL OFF) +set(BUILD_STATICCACHE CACHE BOOL OFF) +set(BUILD_SHARED_LIBS CACHE BOOL OFF) + + # uchardet is hosted at gitlab, but CPMAddPackage needs crednetials (?) CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210") CPMAddPackage("gh:vinniefalco/LuaBridge#9092ace9615d14e3f5926f2e8a3b612ddc6c8efa") From b2bdb2be2a8c54de38f01d47e5b3b7af38ab9598 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 4 Oct 2022 02:05:07 +0300 Subject: [PATCH 48/78] Lexilla is built statically on the CI, wtf --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd653f74e..0986d5661 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: # so we manually copy them, and later on we copy them to the bundle mkdir -p AppDir/usr/lib/ cp -v *.so* \ - AppDir/usr/lib/ + AppDir/usr/lib/ || true cp -v _deps/editorconfig-core-qt-build/libeditorconfig-core-qt.so \ AppDir/usr/lib/ cp -v _deps/scintilla-code-build/libscintilla-qt-edit.so* \ @@ -85,8 +85,9 @@ jobs: export DEBUG=1 ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage \ --library AppDir/usr/lib/libeditorconfig-core-qt.so \ - --library AppDir/usr/lib/liblexilla.so \ - --library AppDir/usr/lib/libscintilla-qt-edit.so.5 + --library AppDir/usr/lib/libscintilla-qt-edit.so.5 \ + + #--library AppDir/usr/lib/liblexilla.so \ - name: Upload AppImage if: startsWith (matrix.config.os, 'ubuntu') From c75f333575ed4453cf38de77afe96e40c943462b Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 4 Oct 2022 02:20:23 +0300 Subject: [PATCH 49/78] all libraries are build statically on ci! --- .github/workflows/build.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0986d5661..0338f4df6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,16 +66,6 @@ jobs: cmake --install cbuild --prefix=${{ github.workspace }}/cbuild/AppDir/usr/ cd cbuild - # some libraries are not build as static, and are not installed - # so we manually copy them, and later on we copy them to the bundle - mkdir -p AppDir/usr/lib/ - cp -v *.so* \ - AppDir/usr/lib/ || true - cp -v _deps/editorconfig-core-qt-build/libeditorconfig-core-qt.so \ - AppDir/usr/lib/ - cp -v _deps/scintilla-code-build/libscintilla-qt-edit.so* \ - AppDir/usr/lib/ - wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" chmod +x linuxdeploy*.AppImage @@ -83,11 +73,7 @@ jobs: export OUTPUT=NotepadNext-x86_64.AppImage export LD_LIBRARY_PATH=AppDir/usr/lib/:$LD_LIBRARY_PATH export DEBUG=1 - ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage \ - --library AppDir/usr/lib/libeditorconfig-core-qt.so \ - --library AppDir/usr/lib/libscintilla-qt-edit.so.5 \ - - #--library AppDir/usr/lib/liblexilla.so \ + ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage - name: Upload AppImage if: startsWith (matrix.config.os, 'ubuntu') From 9170d8f989dc9e8e03a28bce642cab3f0c12b62f Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Thu, 3 Nov 2022 08:36:27 +0200 Subject: [PATCH 50/78] Remove initialization of ADS The main window will manually initialize ADS. I am unsure what this was needed, but as of now, ADS knows how to initialize this for us. This code is does not compile on my CMake build - not in static, and not in shared - so we need to remove it. --- src/NotepadNext/dialogs/MainWindow.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/NotepadNext/dialogs/MainWindow.cpp b/src/NotepadNext/dialogs/MainWindow.cpp index 8331e2d25..d36ff3148 100644 --- a/src/NotepadNext/dialogs/MainWindow.cpp +++ b/src/NotepadNext/dialogs/MainWindow.cpp @@ -74,8 +74,6 @@ MainWindow::MainWindow(NotepadNextApplication *app) : { qInfo(Q_FUNC_INFO); - Q_INIT_RESOURCE(ads); - ui->setupUi(this); qInfo("setupUi Completed"); From 2bd9274b0798ea851d5a389f0b0bde4c2176fcce Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Thu, 3 Nov 2022 10:39:28 +0200 Subject: [PATCH 51/78] Fix build on Windows Main fix is - a new version of ScintillaCode which now properly build statically on Windows (by using `BUILD_SHARED_LIBS` properly). The main build file no longer build tests and examples (except `uchardet` which does not support this upstream). New version of `CPM.cmake` v0.3.5 -> v0.3.6, because WTF not. --- CMakeLists.txt | 20 +++++++++++--------- CPM.cmake | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64becedb6..cff7b63fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,23 +4,25 @@ project(NotepadNext) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +include(CPM.cmake) # setup SingleApplication set(QAPPLICATION_CLASS QApplication) set(QT_DEFAULT_MAJOR_VERSION 6) -include(CPM.cmake) +# setup QDS +set(BUILD_EXAMPLES OFF) -# uchardet setup -set(BUILD_BINARY CACHE BOOL OFF) -set(BUILD_STATICCACHE CACHE BOOL OFF) -set(BUILD_SHARED_LIBS CACHE BOOL OFF) +# setup uchardet +set(BUILD_BINARY OFF) +set(BUILD_STATICCACHE OFF) +set(BUILD_SHARED_LIBS OFF) -# uchardet is hosted at gitlab, but CPMAddPackage needs crednetials (?) +# uchardet is hosted at gitlab, but CPMAddPackage needs credentials (?) CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210") CPMAddPackage("gh:vinniefalco/LuaBridge#9092ace9615d14e3f5926f2e8a3b612ddc6c8efa") -CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#3cd6d766f8ddb0dc306e7e7fa5b3e406f84b56c6") +CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#22f609cfa67edbda2f40a1a87cd38ac4ab289be7") CPMAddPackage("gh:itay-grudev/SingleApplication#f1e15081dc57a9c03f7f4f165677f18802e1437a") CPMAddPackage("gh:editorconfig/editorconfig-core-qt#af4906ab22dc66c48e8d282708ae434de6928e55") @@ -32,7 +34,7 @@ include(lexilla.cmake) # This is scintilla - which upstream uses mercurial, and as part of the build # they need python. This fork uses github, and has auto-generated files as -# part of the repo. Apparently - this fork cannot be -CPMAddPackage("gh:elcuco/scintilla-code#c2ce7fd307466c4fc79355d06c445fd7fc60d339") +# part of the repo. +CPMAddPackage("gh:elcuco/scintilla-code#acea5cf96cf139c05f03c752a19bb76810715f9b") add_subdirectory(src/NotepadNext) diff --git a/CPM.cmake b/CPM.cmake index a10f92624..e51b761e5 100644 --- a/CPM.cmake +++ b/CPM.cmake @@ -1,4 +1,4 @@ -set(CPM_DOWNLOAD_VERSION 0.35.0) +set(CPM_DOWNLOAD_VERSION 0.36.0) if(CPM_SOURCE_CACHE) # Expand relative path. This is important if the provided path contains a tilde (~) From 2f7ef95070da89d450ab840298dca93166978d65 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Thu, 3 Nov 2022 11:18:43 +0200 Subject: [PATCH 52/78] Fix build - new file added Master got a new file, `ZoomEventWatcher` - lets add it. Also - as a bonus, use a newer version of Qt 6.3. --- .github/workflows/build.yml | 4 ++-- src/NotepadNext/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0338f4df6..62d75a703 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,11 +16,11 @@ jobs: matrix: config: - - qt_version: "6.3.1" + qt_version: "6.3.2" modules: "qt5compat" os: ubuntu-20.04 - - qt_version: "6.3.1" + qt_version: "6.3.2" modules: "qt5compat" os: windows-latest - diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 4ca2fefe0..e26bc54c4 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -79,6 +79,8 @@ add_executable(NotepadNext scripts.qrc UndoAction.h UndoAction.cpp + ZoomEventWatcher.h + ZoomEventWatcher.cpp decorators/ApplicationDecorator.cpp decorators/AutoCompletion.cpp From 370731786a1f3a70796e6973283cb43463767a96 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 8 Nov 2022 09:12:34 +0200 Subject: [PATCH 53/78] New files added to the build - FileDialogHelpers --- src/NotepadNext/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index e26bc54c4..85eacec0b 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -27,6 +27,8 @@ add_executable(NotepadNext EditorPrintPreviewRenderer.cpp Finder.cpp Finder.h + FileDialogHelpers.cpp + FileDialogHelpers.h FocusWatcher.h IFaceTable.cpp IFaceTable.h From 91f4094eda07be55cc13baaa19995aaf3620d5c6 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Wed, 9 Nov 2022 18:30:58 +0200 Subject: [PATCH 54/78] Reduce some warnings (#257) 1) Moved a global inline function to be a member (static) - this fixes warnings (as some compilation unit included that file, but did not use that function). 2) Inside a lambda - we are not using a flag - so, lets mark it unused. --- src/NotepadNext/LuaExtension.cpp | 10 +++++----- src/NotepadNext/ScintillaNext.h | 9 +++++---- src/NotepadNext/dialogs/FindReplaceDialog.cpp | 6 +++--- src/NotepadNext/docks/LuaConsoleDock.cpp | 1 + 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/NotepadNext/LuaExtension.cpp b/src/NotepadNext/LuaExtension.cpp index dda0405f0..1a43bf874 100644 --- a/src/NotepadNext/LuaExtension.cpp +++ b/src/NotepadNext/LuaExtension.cpp @@ -44,7 +44,7 @@ IFaceTableMixer ifacemixer; static bool call_function(lua_State *L, int nargs, bool ignoreFunctionReturnValue); // Helper function from SciTE -static int Substitute(std::string &s, const std::string &sFind, const std::string &sReplace) { +[[maybe_unused]] static int Substitute(std::string &s, const std::string &sFind, const std::string &sReplace) { int c = 0; size_t lenFind = sFind.size(); size_t lenReplace = sReplace.size(); @@ -58,7 +58,7 @@ static int Substitute(std::string &s, const std::string &sFind, const std::strin } // Helper function from SciTE -static bool Exists(const char *fileName) { +[[maybe_unused]] static bool Exists(const char *fileName) { bool ret = false; if (fileName && fileName[0]) { FILE *fp = fopen(fileName, "rb"); @@ -127,7 +127,7 @@ inline int absolute_index(lua_State *L, int index) { return ((index < 0) && (index != LUA_REGISTRYINDEX)) ? (lua_gettop(L) + index + 1) : index; } -static int cf_npp_send(lua_State *L) { +[[maybe_unused]] static int cf_npp_send(lua_State *L) { // This is reinstated as a replacement for the old :send, which was removed // due to safety concerns. Is now exposed as npp.SendEditor / npp.SendOutput. // It is rewritten to be typesafe, checking the arguments against the metadata in @@ -162,7 +162,7 @@ static int cf_npp_send(lua_State *L) { } } -static int cf_npp_constname(lua_State *L) { +[[maybe_unused]] static int cf_npp_constname(lua_State *L) { char constName[100] = ""; const char *hint = nullptr; int message = (int)luaL_checkinteger(L, 1); @@ -257,7 +257,7 @@ static int cf_global_print(lua_State *L) { return 0; } -static bool call_function(lua_State *L, int nargs, bool ignoreFunctionReturnValue=false) { +[[maybe_unused]] static bool call_function(lua_State *L, int nargs, bool ignoreFunctionReturnValue=false) { bool handled = false; if (L) { int traceback = 0; diff --git a/src/NotepadNext/ScintillaNext.h b/src/NotepadNext/ScintillaNext.h index 376a81242..d938cc9ba 100644 --- a/src/NotepadNext/ScintillaNext.h +++ b/src/NotepadNext/ScintillaNext.h @@ -27,10 +27,6 @@ #include -static bool isRangeValid(const Sci_CharacterRange &range) -{ - return range.cpMin != INVALID_POSITION && range.cpMax != INVALID_POSITION; -} class ScintillaNext : public ScintillaEdit @@ -38,6 +34,11 @@ class ScintillaNext : public ScintillaEdit Q_OBJECT public: + static bool isRangeValid(const Sci_CharacterRange &range) + { + return range.cpMin != INVALID_POSITION && range.cpMax != INVALID_POSITION; + } + explicit ScintillaNext(QString name, QWidget *parent = Q_NULLPTR); virtual ~ScintillaNext(); diff --git a/src/NotepadNext/dialogs/FindReplaceDialog.cpp b/src/NotepadNext/dialogs/FindReplaceDialog.cpp index a7a9cd43e..5f2ee4c56 100644 --- a/src/NotepadNext/dialogs/FindReplaceDialog.cpp +++ b/src/NotepadNext/dialogs/FindReplaceDialog.cpp @@ -226,7 +226,7 @@ void FindReplaceDialog::find() Sci_CharacterRange range = finder->findNext(); - if (isRangeValid(range)) { + if (ScintillaNext::isRangeValid(range)) { // TODO: determine if search wrapped around and show message editor->goToRange(range); } @@ -292,13 +292,13 @@ void FindReplaceDialog::replace() Sci_CharacterRange range = finder->replaceSelectionIfMatch(replaceText); - if (isRangeValid(range)) { + if (ScintillaNext::isRangeValid(range)) { showMessage(tr("1 occurrence was replaced"), "blue"); } Sci_CharacterRange next_match = finder->findNext(); - if (isRangeValid(next_match)) { + if (ScintillaNext::isRangeValid(next_match)) { editor->goToRange(next_match); } else { diff --git a/src/NotepadNext/docks/LuaConsoleDock.cpp b/src/NotepadNext/docks/LuaConsoleDock.cpp index 53ded2949..722b7fa17 100644 --- a/src/NotepadNext/docks/LuaConsoleDock.cpp +++ b/src/NotepadNext/docks/LuaConsoleDock.cpp @@ -191,6 +191,7 @@ LuaConsoleDock::LuaConsoleDock(LuaState *l, QWidget *parent) : input->installEventFilter(this); connect(input, &ScintillaNext::updateUi, [=](Scintilla::Update flags) { + Q_UNUSED(flags); int curPos = input->currentPos(); int bracePos = INVALID_POSITION; From 1aa4045d7b8e7bc06df5c775a3738cd46bc3fa45 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Fri, 11 Nov 2022 11:29:27 -0500 Subject: [PATCH 55/78] Disable Scintilla symbols being exported from EXE --- src/scintilla.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scintilla.pri b/src/scintilla.pri index 9133b93ab..fd505c736 100644 --- a/src/scintilla.pri +++ b/src/scintilla.pri @@ -67,7 +67,7 @@ INCLUDEPATH += \ $$PWD/scintilla/include \ $$PWD/scintilla/src -DEFINES += SCINTILLA_QT=1 MAKING_LIBRARY=1 SCI_LEXER=1 _CRT_SECURE_NO_DEPRECATE=1 +DEFINES += SCINTILLA_QT=1 MAKING_LIBRARY=1 SCI_LEXER=1 _CRT_SECURE_NO_DEPRECATE=1 EXPORT_IMPORT_API= CONFIG(release, debug|release) { DEFINES += NDEBUG=1 } From 082c7d65cb29e56dd8f3e1d0b059aa9684471af8 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Fri, 11 Nov 2022 15:47:48 -0500 Subject: [PATCH 56/78] Add codespell workflow to check for spelling errors (#266) --- .github/workflows/codespell.yml | 21 +++++++++++++++++++ src/NotepadNext/FileDialogHelpers.cpp | 2 +- src/NotepadNext/LuaExtension.cpp | 2 +- src/NotepadNext/NotepadNextApplication.cpp | 2 +- src/NotepadNext/NppImporter.cpp | 2 +- src/NotepadNext/ScintillaNext.cpp | 6 +++--- src/NotepadNext/SelectionTracker.cpp | 2 +- .../decorators/HighlightedScrollBar.cpp | 2 +- .../decorators/SmartHighlighter.cpp | 2 +- src/NotepadNext/dialogs/FindReplaceDialog.cpp | 2 +- src/NotepadNext/dialogs/MainWindow.cpp | 2 +- src/NotepadNext/dialogs/MainWindow.h | 2 +- .../docks/LanguageInspectorDock.cpp | 2 +- src/NotepadNext/docks/SearchResultsDock.cpp | 2 +- src/NotepadNext/widgets/StatusLabel.h | 2 +- 15 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 000000000..7251c8b7f --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,21 @@ +name: Codespell + +on: + push: + branches: + - master + pull_request: + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: codespell-project/actions-codespell@master + with: + check_filenames: true + path: ./src/NotepadNext + skip: "*.lua,*.ui" + ignore_words_list: "doubleclick,msdos" diff --git a/src/NotepadNext/FileDialogHelpers.cpp b/src/NotepadNext/FileDialogHelpers.cpp index be605ab70..961f7950f 100644 --- a/src/NotepadNext/FileDialogHelpers.cpp +++ b/src/NotepadNext/FileDialogHelpers.cpp @@ -22,7 +22,7 @@ /* * NOTE: This code is nearly identical to the QFileDialog implementation of several static methods. - * Since the QDir filter options were not exposed, there was no way to specify QDir::Hiden. + * Since the QDir filter options were not exposed, there was no way to specify QDir::Hidden. */ diff --git a/src/NotepadNext/LuaExtension.cpp b/src/NotepadNext/LuaExtension.cpp index 1a43bf874..dfd4a66d0 100644 --- a/src/NotepadNext/LuaExtension.cpp +++ b/src/NotepadNext/LuaExtension.cpp @@ -210,7 +210,7 @@ static NppExtensionAPIPane check_pane_object(lua_State *L, int index) { pPane = static_cast(luaL_testudata(L, index, "Nn_MT_Application")); // NOTE: I'm not sure what the above comment about the "back reference" means. This may or - // may not apply in thise case. So that if statement may need pasted/modified in this case + // may not apply in this case. So that if statement may need pasted/modified in this case if (pPane) { return *pPane; diff --git a/src/NotepadNext/NotepadNextApplication.cpp b/src/NotepadNext/NotepadNextApplication.cpp index d3817db05..4b2a3efe1 100644 --- a/src/NotepadNext/NotepadNextApplication.cpp +++ b/src/NotepadNext/NotepadNextApplication.cpp @@ -212,7 +212,7 @@ bool NotepadNextApplication::init() if (state == Qt::ApplicationActive) { // Make sure it is active... - // The applicaiton can be active without the main window being show e.g. if there is a + // The application can be active without the main window being show e.g. if there is a // message box that pops up before the main window if (windows.first()->isActiveWindow()) { windows.first()->focusIn(); diff --git a/src/NotepadNext/NppImporter.cpp b/src/NotepadNext/NppImporter.cpp index cd79f83be..129ade77c 100644 --- a/src/NotepadNext/NppImporter.cpp +++ b/src/NotepadNext/NppImporter.cpp @@ -175,7 +175,7 @@ NppImporter::NppImporter(const QString &configPath, ScintillaEdit *_editor) : languages["cpp"].lexer.styles[16].keywordClass = LANG_INDEX_INSTR2; - // Build a temporarly list of the key/value pairs + // Build a temporary list of the key/value pairs QList> sortedLanguages; for (const QString &key : languages.keys()) { sortedLanguages.append(qMakePair(key, &languages[key])); diff --git a/src/NotepadNext/ScintillaNext.cpp b/src/NotepadNext/ScintillaNext.cpp index 4792870ac..a36569fac 100644 --- a/src/NotepadNext/ScintillaNext.cpp +++ b/src/NotepadNext/ScintillaNext.cpp @@ -371,7 +371,7 @@ bool ScintillaNext::readFromDisk(QFile &file) } if (!file.open(QIODevice::ReadOnly)) { - qWarning("Something bad happend when opening \"%s\": (%d) %s", qUtf8Printable(file.fileName()), file.error(), qUtf8Printable(file.errorString())); + qWarning("Something bad happened when opening \"%s\": (%d) %s", qUtf8Printable(file.fileName()), file.error(), qUtf8Printable(file.errorString())); return false; } @@ -454,12 +454,12 @@ bool ScintillaNext::readFromDisk(QFile &file) // modEventMask(SC_MODEVENTMASKALL)? if (status() != SC_STATUS_OK) { - qWarning("something bad happend in document->add_data() %ld", status()); + qWarning("something bad happened in document->add_data() %ld", status()); return false; } if (bytesRead == -1) { - qWarning("Something bad happend when reading disk %d %s", file.error(), qUtf8Printable(file.errorString())); + qWarning("Something bad happened when reading disk %d %s", file.error(), qUtf8Printable(file.errorString())); return false; } diff --git a/src/NotepadNext/SelectionTracker.cpp b/src/NotepadNext/SelectionTracker.cpp index ebc1db2e9..7ffb2e656 100644 --- a/src/NotepadNext/SelectionTracker.cpp +++ b/src/NotepadNext/SelectionTracker.cpp @@ -54,7 +54,7 @@ void SelectionTracker::trackInsertion(int pos, int length) void SelectionTracker::trackDeletion(int pos, int length) { - // Adjust the caret and anchor. Use the min incase they are within the range being deleted + // Adjust the caret and anchor. Use the min in case they are within the range being deleted if (caret > pos) { caret -= qMin(static_cast(caret - pos), length); } diff --git a/src/NotepadNext/decorators/HighlightedScrollBar.cpp b/src/NotepadNext/decorators/HighlightedScrollBar.cpp index 3d5d8c0b7..21270f6f1 100644 --- a/src/NotepadNext/decorators/HighlightedScrollBar.cpp +++ b/src/NotepadNext/decorators/HighlightedScrollBar.cpp @@ -130,7 +130,7 @@ int HighlightedScrollBar::lineToScrollBarY(int line) const int HighlightedScrollBar::scrollbarArrowHeight() const { - // NOTE: There is no offical way to get the height of the scrollbar arrow buttons, however for now we can + // NOTE: There is no official way to get the height of the scrollbar arrow buttons, however for now we can // assume that the buttons are square, meaning the height of them will be the same as the width of // the scroll bar. return rect().width(); diff --git a/src/NotepadNext/decorators/SmartHighlighter.cpp b/src/NotepadNext/decorators/SmartHighlighter.cpp index 26a6c32f8..d5b5615db 100644 --- a/src/NotepadNext/decorators/SmartHighlighter.cpp +++ b/src/NotepadNext/decorators/SmartHighlighter.cpp @@ -72,7 +72,7 @@ void SmartHighlighter::highlightCurrentView() // TODO: Handle large files. By default Notepad++ only monitors the text on screen. However, // that will not work when using a highlighted scroll bar. Testing with small files seems to - // have minimal impact. For large files, Qt can have a timer set to 0 to do heavier procesing. + // have minimal impact. For large files, Qt can have a timer set to 0 to do heavier processing. // Using threads seems to be a bit overkill and too burdensome to do it properly. //const int startLine = editor->firstVisibleLine(); diff --git a/src/NotepadNext/dialogs/FindReplaceDialog.cpp b/src/NotepadNext/dialogs/FindReplaceDialog.cpp index 5f2ee4c56..df81cd372 100644 --- a/src/NotepadNext/dialogs/FindReplaceDialog.cpp +++ b/src/NotepadNext/dialogs/FindReplaceDialog.cpp @@ -412,7 +412,7 @@ void FindReplaceDialog::changeTab(int index) if (index == 0) { ui->labelReplaceWith->setMaximumHeight(0); ui->comboReplace->setMaximumHeight(0); - // The combo box isn't actually "hidden", so adjust the focus policy so it doesnt get tabbed to + // The combo box isn't actually "hidden", so adjust the focus policy so it does not get tabbed to ui->comboReplace->setFocusPolicy(Qt::NoFocus); ui->buttonReplace->hide(); diff --git a/src/NotepadNext/dialogs/MainWindow.cpp b/src/NotepadNext/dialogs/MainWindow.cpp index 651603b32..4eb4ad172 100644 --- a/src/NotepadNext/dialogs/MainWindow.cpp +++ b/src/NotepadNext/dialogs/MainWindow.cpp @@ -84,7 +84,7 @@ MainWindow::MainWindow(NotepadNextApplication *app) : connect(this, &MainWindow::aboutToClose, this, &MainWindow::saveSettings); - // Createa and set up the connections to the docked editor + // Create and set up the connections to the docked editor dockedEditor = new DockedEditor(this); connect(dockedEditor, &DockedEditor::editorCloseRequested, this, [=](ScintillaNext *editor) { closeFile(editor); }); connect(dockedEditor, &DockedEditor::editorActivated, this, &MainWindow::activateEditor); diff --git a/src/NotepadNext/dialogs/MainWindow.h b/src/NotepadNext/dialogs/MainWindow.h index a09247b70..d6faaabdf 100644 --- a/src/NotepadNext/dialogs/MainWindow.h +++ b/src/NotepadNext/dialogs/MainWindow.h @@ -150,7 +150,7 @@ private slots: //NppImporter *npp; - // Persistant dialogs + // Persistent dialogs QMap dialogs; QuickFindWidget *quickFind = Q_NULLPTR; diff --git a/src/NotepadNext/docks/LanguageInspectorDock.cpp b/src/NotepadNext/docks/LanguageInspectorDock.cpp index df32781a5..fe9e521aa 100644 --- a/src/NotepadNext/docks/LanguageInspectorDock.cpp +++ b/src/NotepadNext/docks/LanguageInspectorDock.cpp @@ -134,7 +134,7 @@ void LanguageInspectorDock::updatePositionInfo(Scintilla::Update updated) if (FlagSet(updated, Scintilla::Update::Content) || FlagSet(updated, Scintilla::Update::Selection)) { ScintillaNext *editor = qobject_cast(sender()); - ui->lblInfo->setText(tr("Postion %1 Style %2").arg(editor->currentPos()).arg(editor->styleAt(editor->currentPos()))); + ui->lblInfo->setText(tr("Position %1 Style %2").arg(editor->currentPos()).arg(editor->styleAt(editor->currentPos()))); } } diff --git a/src/NotepadNext/docks/SearchResultsDock.cpp b/src/NotepadNext/docks/SearchResultsDock.cpp index 09544176a..164a5fdf7 100644 --- a/src/NotepadNext/docks/SearchResultsDock.cpp +++ b/src/NotepadNext/docks/SearchResultsDock.cpp @@ -86,7 +86,7 @@ void SearchResultsDock::newSearch(const QString searchTerm) void SearchResultsDock::newFileEntry(ScintillaNext *editor) { - // Store a QPointer since there is no guarentee this editor will be around later + // Store a QPointer since there is no guarantee this editor will be around later QPointer editor_pointer = editor; totalFileHitCount = 0; diff --git a/src/NotepadNext/widgets/StatusLabel.h b/src/NotepadNext/widgets/StatusLabel.h index 2c08cb8f7..17dcfa34b 100644 --- a/src/NotepadNext/widgets/StatusLabel.h +++ b/src/NotepadNext/widgets/StatusLabel.h @@ -47,7 +47,7 @@ class StatusLabel : public ClickableLabel public: explicit StatusLabel(int size = 200, QWidget *parent = 0) : ClickableLabel(parent), preferredSize(size) { - // Since these get set alot and plain text is always used go ahead and set the format + // Since these get set a lot and plain text is always used go ahead and set the format setTextFormat(Qt::PlainText); } From 6933aa288261347477232b4d8f8d8400d7efbcc1 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Sat, 12 Nov 2022 11:56:06 -0500 Subject: [PATCH 57/78] Adjust logic to force window to foreground on Windows Closes #254 --- src/NotepadNext/dialogs/MainWindow.cpp | 45 ++++++++++++++++---------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/src/NotepadNext/dialogs/MainWindow.cpp b/src/NotepadNext/dialogs/MainWindow.cpp index 4eb4ad172..745ec3381 100644 --- a/src/NotepadNext/dialogs/MainWindow.cpp +++ b/src/NotepadNext/dialogs/MainWindow.cpp @@ -1310,32 +1310,43 @@ void MainWindow::bringWindowToForeground() { qInfo(Q_FUNC_INFO); - //setWindowState(windowState() & ~Qt::WindowMinimized); - //raise(); - //activateWindow(); - - // Make sure the window isn't minimized - // TODO: this always puts it in the "normal" state but it might have been maximized - // before minimized...so either a flag needs stored or find a Qt call to do it appropriately - if (isMinimized()) - showNormal(); + // There doesn't seem to be a cross platform way to force the window to the foreground #ifdef Q_OS_WIN - // TODO: there doesn't seem to be a cross platform way to force the window - // to the foreground. So this will need moved to a platform specific file - HWND hWnd = reinterpret_cast(effectiveWinId()); + if (hWnd) { - // I have no idea what this does but it works mostly - // https://www.codeproject.com/Articles/1724/Some-handy-dialog-box-tricks-tips-and-workarounds + // I have no idea what this does, but it seems to work on Windows + // References: + // https://stackoverflow.com/questions/916259/win32-bring-a-window-to-top + // https://github.com/notepad-plus-plus/notepad-plus-plus/blob/ebe7648ee1a5a560d4fc65297cbdcf08055e56e3/PowerEditor/src/winmain.cpp#L596 + + HWND hCurWnd = GetForegroundWindow(); + DWORD threadId = GetCurrentThreadId(); + DWORD procId = GetWindowThreadProcessId(hCurWnd, NULL); + + int sw = 0; + if (IsZoomed(hWnd)) { + sw = SW_MAXIMIZE; + } else if (IsIconic(hWnd)) { + sw = SW_RESTORE; + } - AttachThreadInput(GetWindowThreadProcessId(GetForegroundWindow(), nullptr), GetCurrentThreadId(), TRUE); + if (sw != 0) { + ShowWindow(hWnd, sw); + } + AttachThreadInput(procId, threadId, TRUE); SetForegroundWindow(hWnd); SetFocus(hWnd); - - AttachThreadInput(GetWindowThreadProcessId(GetForegroundWindow(), nullptr), GetCurrentThreadId(), FALSE); + AttachThreadInput(procId, threadId, FALSE); } +#else + // Make sure the window isn't minimized + // TODO: this always puts it in the "normal" state but it might have been maximized + // before minimized...so either a flag needs stored or find a Qt call to do it appropriately + if (isMinimized()) + showNormal(); #endif } From 5f225b081b5750365982b011df115c97fc69ca72 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 19 Nov 2022 13:23:18 +0200 Subject: [PATCH 58/78] Compile decorators/URLFinder.cpp I was missing URLFinder.cpp in the list of files to be compiled. I took the time also to sort this list inside the CMakeLists.txt --- src/NotepadNext/CMakeLists.txt | 47 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 85eacec0b..2427a5a5e 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -85,44 +85,47 @@ add_executable(NotepadNext ZoomEventWatcher.cpp decorators/ApplicationDecorator.cpp - decorators/AutoCompletion.cpp - decorators/AutoIndentation.cpp - decorators/BetterMultiSelection.cpp - decorators/EditorConfigAppDecorator.cpp - decorators/SurroundSelection.cpp - decorators/BraceMatch.cpp - decorators/EditorDecorator.cpp - decorators/HighlightedScrollBar.cpp - decorators/LineNumbers.cpp - decorators/SmartHighlighter.cpp decorators/ApplicationDecorator.h decorators/AutoCompletion.h decorators/AutoIndentation.h + decorators/AutoCompletion.cpp + decorators/AutoIndentation.cpp decorators/BetterMultiSelection.h - decorators/EditorConfigAppDecorator.h - decorators/SurroundSelection.h + decorators/BetterMultiSelection.cpp decorators/BraceMatch.h + decorators/BraceMatch.cpp + decorators/EditorConfigAppDecorator.cpp + decorators/EditorConfigAppDecorator.h + decorators/EditorDecorator.cpp decorators/EditorDecorator.h - decorators/HighlightedScrollBar.h decorators/LineNumbers.h + decorators/LineNumbers.cpp + decorators/HighlightedScrollBar.cpp + decorators/HighlightedScrollBar.h decorators/SmartHighlighter.h + decorators/SurroundSelection.h + decorators/SurroundSelection.cpp + decorators/SmartHighlighter.cpp + decorators/URLFinder.cpp + decorators/URLFinder.h dialogs/FindReplaceDialog.cpp + dialogs/FindReplaceDialog.h + dialogs/FindReplaceDialog.ui dialogs/MacroEditorDialog.cpp + dialogs/MacroEditorDialog.h + dialogs/MacroEditorDialog.ui dialogs/MacroRunDialog.cpp - dialogs/MacroSaveDialog.cpp - dialogs/MainWindow.cpp - dialogs/PreferencesDialog.cpp - dialogs/FindReplaceDialog.h dialogs/MacroRunDialog.h + dialogs/MacroRunDialog.ui + dialogs/MacroSaveDialog.cpp dialogs/MacroSaveDialog.h + dialogs/MacroSaveDialog.ui + dialogs/MainWindow.cpp dialogs/MainWindow.h - dialogs/PreferencesDialog.h dialogs/MainWindow.ui - dialogs/FindReplaceDialog.ui - dialogs/MacroEditorDialog.ui - dialogs/MacroRunDialog.ui - dialogs/MacroSaveDialog.ui + dialogs/PreferencesDialog.cpp + dialogs/PreferencesDialog.h dialogs/PreferencesDialog.ui docks/DebugLogDock.cpp From 9bcd559bc0f79f2b782278c748bf9810ce58e173 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 19 Nov 2022 14:09:48 +0200 Subject: [PATCH 59/78] Update versions.. .for almost everything No breaks, simply compiles. NICE! --- CMakeLists.txt | 11 +++++++---- lexilla.cmake | 5 ++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cff7b63fa..33279937e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,11 +20,11 @@ set(BUILD_SHARED_LIBS OFF) # uchardet is hosted at gitlab, but CPMAddPackage needs credentials (?) -CPMAddPackage("gh:freedesktop/uchardet#23a664560b79715c04cbf73a7e2771e26086b210") +CPMAddPackage("gh:freedesktop/uchardet#143b3fe513bad2cc85903ee564fe55ccbe96d86b") CPMAddPackage("gh:vinniefalco/LuaBridge#9092ace9615d14e3f5926f2e8a3b612ddc6c8efa") -CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#22f609cfa67edbda2f40a1a87cd38ac4ab289be7") +CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#8d30fc9c3c36ac66bf3d027aaad7adff973f628f") CPMAddPackage("gh:itay-grudev/SingleApplication#f1e15081dc57a9c03f7f4f165677f18802e1437a") -CPMAddPackage("gh:editorconfig/editorconfig-core-qt#af4906ab22dc66c48e8d282708ae434de6928e55") +CPMAddPackage("gh:editorconfig/editorconfig-core-qt#b87e96f0e1ca38cdb49fe5a7771df746808bf156") # the following libraries have no upstream cmake support, # so we do own own locally (internally they clone the upstream repo) @@ -35,6 +35,9 @@ include(lexilla.cmake) # This is scintilla - which upstream uses mercurial, and as part of the build # they need python. This fork uses github, and has auto-generated files as # part of the repo. -CPMAddPackage("gh:elcuco/scintilla-code#acea5cf96cf139c05f03c752a19bb76810715f9b") +# +# rel-5.3.1- this is more or less like upstream 5-3-1... but later on on master, +# b6ab9e51106f7262e77b31c3eb5ca8a4d95c2fc7 - fixes rectangular selection on unix +CPMAddPackage("gh:elcuco/scintilla-code#b6ab9e51106f7262e77b31c3eb5ca8a4d95c2fc7") add_subdirectory(src/NotepadNext) diff --git a/lexilla.cmake b/lexilla.cmake index 0890c2b0b..d6d405442 100644 --- a/lexilla.cmake +++ b/lexilla.cmake @@ -1,6 +1,5 @@ -#CPMAddPackage("gh:elcuco/lexilla#270fb410dd7518736141c9c9c84880b938d957a7") - -CPMAddPackage("gh:ScintillaOrg/lexilla#3dbbff6fe2fa53b8d7a3907440e6f8294f8b1eb4") +# Master is currently: 537dfaa591e83473678d782e394766e7bac6d59e +CPMAddPackage("gh:ScintillaOrg/lexilla#rel-5-2-0") if (lexilla_ADDED) add_library(lexilla From 311bbc071053fc1ad7e95744f31b9cfe54772748 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 19 Nov 2022 20:57:33 +0200 Subject: [PATCH 60/78] Update scintilla-code to a version that compiles on Windows --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33279937e..4cc1518f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ set(BUILD_BINARY OFF) set(BUILD_STATICCACHE OFF) set(BUILD_SHARED_LIBS OFF) - # uchardet is hosted at gitlab, but CPMAddPackage needs credentials (?) CPMAddPackage("gh:freedesktop/uchardet#143b3fe513bad2cc85903ee564fe55ccbe96d86b") CPMAddPackage("gh:vinniefalco/LuaBridge#9092ace9615d14e3f5926f2e8a3b612ddc6c8efa") @@ -36,8 +35,9 @@ include(lexilla.cmake) # they need python. This fork uses github, and has auto-generated files as # part of the repo. # -# rel-5.3.1- this is more or less like upstream 5-3-1... but later on on master, -# b6ab9e51106f7262e77b31c3eb5ca8a4d95c2fc7 - fixes rectangular selection on unix -CPMAddPackage("gh:elcuco/scintilla-code#b6ab9e51106f7262e77b31c3eb5ca8a4d95c2fc7") +# 710a1c87106352f421febe67ec6b47f009e8b123 - +# fixes rectangular selection on unix, and static builds on Windows, slightly +# later than rel-5-3-1-cmake +CPMAddPackage("gh:elcuco/scintilla-code#710a1c87106352f421febe67ec6b47f009e8b123") add_subdirectory(src/NotepadNext) From 16245911675afd1bd9f3b82fbdf954385b75c73d Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Wed, 30 Nov 2022 22:26:30 +0200 Subject: [PATCH 61/78] Update cmake to display version 0.5.6. as main --- src/NotepadNext/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 2427a5a5e..075595c25 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -169,7 +169,7 @@ if (Qt6_FOUND) endif() target_include_directories(NotepadNext PRIVATE decorators dialogs docks widgets src) -target_compile_definitions(NotepadNext PRIVATE APP_VERSION="0.5.5") +target_compile_definitions(NotepadNext PRIVATE APP_VERSION="0.5.6") target_compile_definitions(NotepadNext PRIVATE APP_COPYRIGHT="Copyright 2019-2022 Justin Dailey") target_compile_definitions(NotepadNext PRIVATE CMAKE_EXPERIMENTAL) From 0c40bd3f31e17b89bedc554b3f1df30ace70c393 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 5 Dec 2022 22:36:06 +0200 Subject: [PATCH 62/78] Fix buildings - point to a newer Scintilla-Code - add to the CMakeLists.txt newer files from main. --- CMakeLists.txt | 2 +- src/NotepadNext/CMakeLists.txt | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cc1518f4..44be089d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,6 @@ include(lexilla.cmake) # 710a1c87106352f421febe67ec6b47f009e8b123 - # fixes rectangular selection on unix, and static builds on Windows, slightly # later than rel-5-3-1-cmake -CPMAddPackage("gh:elcuco/scintilla-code#710a1c87106352f421febe67ec6b47f009e8b123") +CPMAddPackage("gh:elcuco/scintilla-code#cf2e442e12f41eebc95c5750ed608cc5ec0be796") add_subdirectory(src/NotepadNext) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 075595c25..af37c9c48 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -16,8 +16,10 @@ add_executable(NotepadNext ColorPickerDelegate.h ComboBoxDelegate.cpp ComboBoxDelegate.h - DockedEditor.h + Converter.cpp + Converter.h DockedEditor.cpp + DockedEditor.h DebugManager.cpp DockedEditorTitleBar.h EditorHexViewerTableModel.cpp @@ -30,6 +32,8 @@ add_executable(NotepadNext FileDialogHelpers.cpp FileDialogHelpers.h FocusWatcher.h + HtmlConverter.cpp + HtmlConverter.h IFaceTable.cpp IFaceTable.h IFaceTableMixer.cpp @@ -65,6 +69,8 @@ add_executable(NotepadNext RecentFilesListManager.h RecentFilesListMenuBuilder.cpp RecentFilesListMenuBuilder.h + RtfConverter.cpp + RtfConverter.h resources.qrc SciIFaceTable.cpp ScintillaNext.cpp @@ -109,6 +115,9 @@ add_executable(NotepadNext decorators/URLFinder.cpp decorators/URLFinder.h + dialogs/ColumnEditorDialog.h + dialogs/ColumnEditorDialog.ui + dialogs/ColumnEditorDialog.cpp dialogs/FindReplaceDialog.cpp dialogs/FindReplaceDialog.h dialogs/FindReplaceDialog.ui @@ -129,9 +138,12 @@ add_executable(NotepadNext dialogs/PreferencesDialog.ui docks/DebugLogDock.cpp - docks/EditorInspectorDock.h docks/EditorInspectorDock.cpp + docks/EditorInspectorDock.h docks/EditorInspectorDock.ui + docks/FileListDock.cpp + docks/FileListDock.h + docks/FileListDock.ui docks/FolderAsWorkspaceDock.cpp docks/FolderAsWorkspaceDock.h docks/FolderAsWorkspaceDock.ui From ac632bbb41ac22ba4d48f9ba955e2bd666432114 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Mon, 5 Dec 2022 22:47:40 +0200 Subject: [PATCH 63/78] Use Qt 6.4.1 for builds, as QMake/master does --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56b2f29a5..a955553fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,15 +16,15 @@ jobs: matrix: config: - - qt_version: "6.3.2" + qt_version: "6.4.1" modules: "qt5compat" os: ubuntu-20.04 - - qt_version: "6.3.2" + qt_version: "6.4.1" modules: "qt5compat" os: windows-latest - - qt_version: "6.3.1" + qt_version: "6.4.1" modules: "qt5compat" os: macos-latest From 6f3b8c87abc60b667a9e76e4401aea818492f5c4 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Wed, 7 Dec 2022 18:42:55 +0200 Subject: [PATCH 64/78] Fix Lexilla build - using upstream version 5.2.1 --- CMakeLists.txt | 8 +++----- lexilla.cmake | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44be089d5..8ee280641 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,15 +29,13 @@ CPMAddPackage("gh:editorconfig/editorconfig-core-qt#b87e96f0e1ca38cdb49fe5a7771d # so we do own own locally (internally they clone the upstream repo) include(lua.cmake) include(qsimpleupdater.cmake) -include(lexilla.cmake) # This is scintilla - which upstream uses mercurial, and as part of the build # they need python. This fork uses github, and has auto-generated files as # part of the repo. # -# 710a1c87106352f421febe67ec6b47f009e8b123 - -# fixes rectangular selection on unix, and static builds on Windows, slightly -# later than rel-5-3-1-cmake -CPMAddPackage("gh:elcuco/scintilla-code#cf2e442e12f41eebc95c5750ed608cc5ec0be796") +CPMAddPackage("gh:elcuco/scintilla-code#rel-5-3-2-cmake") +#CPMAddPackage("gh:elcuco/lexilla#rel-5-2-1-cmake") +include(lexilla.cmake) add_subdirectory(src/NotepadNext) diff --git a/lexilla.cmake b/lexilla.cmake index d6d405442..1f5726096 100644 --- a/lexilla.cmake +++ b/lexilla.cmake @@ -1,5 +1,4 @@ -# Master is currently: 537dfaa591e83473678d782e394766e7bac6d59e -CPMAddPackage("gh:ScintillaOrg/lexilla#rel-5-2-0") +CPMAddPackage("gh:ScintillaOrg/lexilla#rel-5-2-1") if (lexilla_ADDED) add_library(lexilla @@ -164,6 +163,6 @@ if (lexilla_ADDED) ${lexilla_SOURCE_DIR}/lexlib/ ${lexilla_SOURCE_DIR}/include/ ) - set_property(TARGET lexilla PROPERTY VERSION "5.15") + set_property(TARGET lexilla PROPERTY VERSION "5.21") set_property(TARGET lexilla PROPERTY SOVERSION 5 ) endif() From c1c4dfd3556336958a5beadd2f5e00f878714193 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Fri, 10 Feb 2023 18:10:27 +0200 Subject: [PATCH 65/78] Added new files to the CMake build New files added upstream (the master branch...) and I need to update the CMakeLists.txt file - everything works. --- src/NotepadNext/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index af37c9c48..225f60c4a 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -65,6 +65,8 @@ add_executable(NotepadNext QuickFindWidget.h QuickFindWidget.cpp QuickFindWidget.ui + RangeAllocator.h + RangeAllocator.cpp RecentFilesListManager.cpp RecentFilesListManager.h RecentFilesListMenuBuilder.cpp @@ -81,6 +83,8 @@ add_executable(NotepadNext SelectionTracker.h Settings.cpp Settings.h + SessionManager.h + SessionManager.cpp SelectionTracker.cpp SpinBoxDelegate.h SpinBoxDelegate.cpp @@ -98,6 +102,8 @@ add_executable(NotepadNext decorators/AutoIndentation.cpp decorators/BetterMultiSelection.h decorators/BetterMultiSelection.cpp + decorators/BookMarkDecorator.h + decorators/BookMarkDecorator.cpp decorators/BraceMatch.h decorators/BraceMatch.cpp decorators/EditorConfigAppDecorator.cpp From 0254f14fb792cc11a4e4d9762d789fff45d18893 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Fri, 10 Feb 2023 18:31:12 +0200 Subject: [PATCH 66/78] Version updates scintilla-code - rel-5-3-2-cmake -> rel-5-3-3-cmake loexilla - rel-5-2-1 -> rel-5-2-2 uchardet - 143b3fe513bad2cc85903ee564fe55ccbe96d86b -> 2f5c24006ebc7f005040358f58f22a61a3c92522 - effectively v0.0.8 LuaBridge - 9092ace9615d14e3f5926f2e8a3b612ddc6c8efa -> 6580b18755a0fdbf87820aa16a3bc63d24b5bf31 Qt-Advanced-Docking-System - 8d30fc9c3c36ac66bf3d027aaad7adff973f628f -> 54c2bd0c304505f9c5abffdd9eaa29ecfd691054 --- CMakeLists.txt | 11 ++++++----- lexilla.cmake | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ee280641..019948866 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,10 +18,11 @@ set(BUILD_BINARY OFF) set(BUILD_STATICCACHE OFF) set(BUILD_SHARED_LIBS OFF) -# uchardet is hosted at gitlab, but CPMAddPackage needs credentials (?) -CPMAddPackage("gh:freedesktop/uchardet#143b3fe513bad2cc85903ee564fe55ccbe96d86b") -CPMAddPackage("gh:vinniefalco/LuaBridge#9092ace9615d14e3f5926f2e8a3b612ddc6c8efa") -CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#8d30fc9c3c36ac66bf3d027aaad7adff973f628f") + +# an commit after v0.0.8 +CPMAddPackage("gh:freedesktop/uchardet#2f5c24006ebc7f005040358f58f22a61a3c92522") +CPMAddPackage("gh:vinniefalco/LuaBridge#6580b18755a0fdbf87820aa16a3bc63d24b5bf31") +CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#54c2bd0c304505f9c5abffdd9eaa29ecfd691054") CPMAddPackage("gh:itay-grudev/SingleApplication#f1e15081dc57a9c03f7f4f165677f18802e1437a") CPMAddPackage("gh:editorconfig/editorconfig-core-qt#b87e96f0e1ca38cdb49fe5a7771df746808bf156") @@ -34,7 +35,7 @@ include(qsimpleupdater.cmake) # they need python. This fork uses github, and has auto-generated files as # part of the repo. # -CPMAddPackage("gh:elcuco/scintilla-code#rel-5-3-2-cmake") +CPMAddPackage("gh:elcuco/scintilla-code#rel-5-3-3-cmake") #CPMAddPackage("gh:elcuco/lexilla#rel-5-2-1-cmake") include(lexilla.cmake) diff --git a/lexilla.cmake b/lexilla.cmake index 1f5726096..a5ce31042 100644 --- a/lexilla.cmake +++ b/lexilla.cmake @@ -1,4 +1,4 @@ -CPMAddPackage("gh:ScintillaOrg/lexilla#rel-5-2-1") +CPMAddPackage("gh:ScintillaOrg/lexilla#rel-5-2-2") if (lexilla_ADDED) add_library(lexilla @@ -163,6 +163,6 @@ if (lexilla_ADDED) ${lexilla_SOURCE_DIR}/lexlib/ ${lexilla_SOURCE_DIR}/include/ ) - set_property(TARGET lexilla PROPERTY VERSION "5.21") + set_property(TARGET lexilla PROPERTY VERSION "5.22") set_property(TARGET lexilla PROPERTY SOVERSION 5 ) endif() From e7dd220c5ef297ac7b20d1f3085162b28bed9b5d Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Fri, 10 Feb 2023 18:58:29 +0200 Subject: [PATCH 67/78] Update building documentation for Qt6 --- doc/Building.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/Building.md b/doc/Building.md index 1dc788223..e18598d61 100644 --- a/doc/Building.md +++ b/doc/Building.md @@ -40,8 +40,12 @@ This section specifically describes how to build Notepad Next using Microsoft's Using a fresh Ubuntu 21.10 setup, the following script will install the needed dependencies and build the executable: +Note - that while Qt5 can be built, we are not longer effectively supporting it, +nor recommending it. Please build using Qt6 only. Qt5 is not effectively removed +but it is not used, so code base might rot - and not work/compile. + ``` -sudo apt install qtbase5-dev qt5-qmake qtbase5-dev-tools qttools5-dev-tools qtbase5-private-dev libqt5x11extras5-dev build-essential git +sudo apt install qtbase6-dev qt6-qmake qtbase6-dev-tools qtbase6-private-dev qt6-5compat-dev build-essential git git clone --recurse-submodules https://github.com/dail8859/NotepadNext.git cd NotepadNext mkdir build From c59c7eb44726ea3d0965a1b4419c7d9002176aa7 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Fri, 17 Mar 2023 08:32:05 +0200 Subject: [PATCH 68/78] New search functionality from master --- src/NotepadNext/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 225f60c4a..5d0bad1e4 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -38,6 +38,7 @@ add_executable(NotepadNext IFaceTable.h IFaceTableMixer.cpp IFaceTableMixer.h + ISearchResultsHandler.h LanguageKeywordsModel.h LanguageKeywordsModel.cpp LanguagePropertiesModel.cpp @@ -75,6 +76,8 @@ add_executable(NotepadNext RtfConverter.h resources.qrc SciIFaceTable.cpp + SearchResultsCollector.h + SearchResultsCollector.cpp ScintillaNext.cpp ScintillaNext.h SciIFaceTable.h From 4e763217026dfdc0c52a2827639dc451014018bc Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Fri, 17 Mar 2023 09:42:02 +0200 Subject: [PATCH 69/78] Update Qt versions, and on linux - build on newer ubuntu --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b17c229c3..61515bd2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,15 +16,15 @@ jobs: matrix: config: - - qt_version: "6.4.1" + qt_version: "6.4.2" modules: "qt5compat" - os: ubuntu-20.04 + os: ubuntu-22.04 - - qt_version: "6.4.1" + qt_version: "6.4.2" modules: "qt5compat" os: windows-latest - - qt_version: "6.4.1" + qt_version: "6.4.2" modules: "qt5compat" os: macos-latest From 27cdd3ea50f257eb4e4cc23e0a63fbcfc243662d Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 18 Mar 2023 07:38:43 +0200 Subject: [PATCH 70/78] Use Ubuntu 20.04, and install fuse, this should fix build --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61515bd2a..2a2904fb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - qt_version: "6.4.2" modules: "qt5compat" - os: ubuntu-22.04 + os: ubuntu-20.04 - qt_version: "6.4.2" modules: "qt5compat" @@ -47,7 +47,7 @@ jobs: - name: Setup (Linux) if: startsWith (matrix.config.os, 'ubuntu') - run: sudo apt-get install libxkbcommon-dev + run: sudo apt-get install libxkbcommon-dev fuse - name: Setup VS tools (Windows) if: startsWith (matrix.config.os, 'windows') From 78ff74a9cdc04653d539c8959b1f54628d78937e Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 18 Mar 2023 08:06:56 +0200 Subject: [PATCH 71/78] This should fix build on ubuntu --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a2904fb7..d1479c224 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: - name: Setup (Linux) if: startsWith (matrix.config.os, 'ubuntu') - run: sudo apt-get install libxkbcommon-dev fuse + run: sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse - name: Setup VS tools (Windows) if: startsWith (matrix.config.os, 'windows') From ca88456ba005556f37391268ff032be1abd14b5e Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 18 Mar 2023 08:18:46 +0200 Subject: [PATCH 72/78] Reduce warnings on build (checkout) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1479c224..3f009d462 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: runs-on: ${{ matrix.config.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true From 2d5825ea5a6c64be9e8250d2eb4a576038b0959e Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Sat, 18 Mar 2023 08:19:14 +0200 Subject: [PATCH 73/78] Reduce warnings on build (upload-artifact) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f009d462..2aeb13320 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: - name: Upload AppImage if: startsWith (matrix.config.os, 'ubuntu') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }}-cmake-AppImage path: ${{ github.workspace }}/cbuild/NotepadNext-x86_64.AppImage From d34fe4dc208068a0a060aca47de9a39fb58ce279 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 28 Nov 2023 16:21:02 +0200 Subject: [PATCH 74/78] Fix compilation against main 1) updated CPM to v0.36.0 2) uchardet: the github mirror is no longer active. Instead use the official freedesktop gitlab mirror. 3) Updated sha1/versions of libraries 4) ADS is now at v4.1.1 5) LanguagePropertiesModel and frieds are removed from code --- CMakeLists.txt | 12 +++++++----- CPM.cmake | 23 +++++++++++++---------- src/NotepadNext/CMakeLists.txt | 6 +----- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 019948866..9698fde1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,11 +20,13 @@ set(BUILD_SHARED_LIBS OFF) # an commit after v0.0.8 -CPMAddPackage("gh:freedesktop/uchardet#2f5c24006ebc7f005040358f58f22a61a3c92522") -CPMAddPackage("gh:vinniefalco/LuaBridge#6580b18755a0fdbf87820aa16a3bc63d24b5bf31") -CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#54c2bd0c304505f9c5abffdd9eaa29ecfd691054") -CPMAddPackage("gh:itay-grudev/SingleApplication#f1e15081dc57a9c03f7f4f165677f18802e1437a") -CPMAddPackage("gh:editorconfig/editorconfig-core-qt#b87e96f0e1ca38cdb49fe5a7771df746808bf156") +CPMAddPackage(NAME uchardet + GIT_REPOSITORY https://gitlab.freedesktop.org/uchardet/uchardet + GIT_TAG 2f5c24006ebc7f005040358f58f22a61a3c92522) +CPMAddPackage("gh:vinniefalco/LuaBridge#5d21e35633a1f87ed08af115b07d3386096f792b") +CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#4.1.1") +CPMAddPackage("gh:itay-grudev/SingleApplication#v3.5.1") +CPMAddPackage("gh:editorconfig/editorconfig-core-qt#bf86460fe29b53731bba650d2a59d4c47eb25de9") # the following libraries have no upstream cmake support, # so we do own own locally (internally they clone the upstream repo) diff --git a/CPM.cmake b/CPM.cmake index e51b761e5..ad6b74a8b 100644 --- a/CPM.cmake +++ b/CPM.cmake @@ -1,8 +1,11 @@ -set(CPM_DOWNLOAD_VERSION 0.36.0) +# SPDX-License-Identifier: MIT +# +# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors + +set(CPM_DOWNLOAD_VERSION 0.38.6) +set(CPM_HASH_SUM "11c3fa5f1ba14f15d31c2fb63dbc8628ee133d81c8d764caad9a8db9e0bacb07") if(CPM_SOURCE_CACHE) - # Expand relative path. This is important if the provided path contains a tilde (~) - get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") elseif(DEFINED ENV{CPM_SOURCE_CACHE}) set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") @@ -10,12 +13,12 @@ else() set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") endif() -if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) - message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") - file(DOWNLOAD - https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake - ${CPM_DOWNLOAD_LOCATION} - ) -endif() +# Expand relative path. This is important if the provided path contains a tilde (~) +get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) + +file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} +) include(${CPM_DOWNLOAD_LOCATION}) diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index 5d0bad1e4..d7b61b496 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -39,10 +39,6 @@ add_executable(NotepadNext IFaceTableMixer.cpp IFaceTableMixer.h ISearchResultsHandler.h - LanguageKeywordsModel.h - LanguageKeywordsModel.cpp - LanguagePropertiesModel.cpp - LanguagePropertiesModel.h LanguageStylesModel.cpp LanguageStylesModel.h LuaExtension.cpp @@ -177,7 +173,7 @@ target_link_libraries(NotepadNext Qt::Widgets Qt::PrintSupport libuchardet lua LuaBridge - qtadvanceddocking + qt6advanceddocking SingleApplication QSimpleUpdater editorconfig-core-qt From 80e51519b613ce53e0e88fee709f355c211b1356 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 28 Nov 2023 17:05:48 +0200 Subject: [PATCH 75/78] Updated Qt version, minor tweaks to app image building --- .github/workflows/build.yml | 11 ++++++----- src/NotepadNext/CMakeLists.txt | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c590fcf2b..bd64c1f54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,15 +18,15 @@ jobs: matrix: config: - - qt_version: "6.4.2" + qt_version: "6.6.1" modules: "qt5compat" os: ubuntu-20.04 - - qt_version: "6.4.2" + qt_version: "6.6.1" modules: "qt5compat" os: windows-latest - - qt_version: "6.4.2" + qt_version: "6.6.1" modules: "qt5compat" os: macos-latest @@ -43,13 +43,14 @@ jobs: version: ${{ matrix.config.qt_version }} modules: ${{ matrix.config.modules }} - # disable meanwhile, until I understand how to fix the install prefix with ninja - name: Install Ninja uses: seanmiddleditch/gha-setup-ninja@master - name: Setup (Linux) if: startsWith (matrix.config.os, 'ubuntu') - run: sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse + run: | + echo "DISTRIBUTION=AppImage" >> "$GITHUB_ENV" + sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse libxcb-cursor-dev - name: Setup VS tools (Windows) if: startsWith (matrix.config.os, 'windows') diff --git a/src/NotepadNext/CMakeLists.txt b/src/NotepadNext/CMakeLists.txt index d7b61b496..fde0887fd 100644 --- a/src/NotepadNext/CMakeLists.txt +++ b/src/NotepadNext/CMakeLists.txt @@ -222,4 +222,5 @@ install(FILES ${CMAKE_SOURCE_DIR}/deploy/linux/NotepadNext.desktop DESTINATION share/applications) install(FILES ${CMAKE_SOURCE_DIR}/icon/NotepadNext.svg DESTINATION share/icons/hicolor/scalable/mimetypes) - +install(FILES ${CMAKE_SOURCE_DIR}/icon/NotepadNext.svg + DESTINATION share/icons/hicolor/scalable/apps/) From 66b5a35a0e305e369a01683995ebaa91c38cf979 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 28 Nov 2023 17:38:46 +0200 Subject: [PATCH 76/78] compile using qt65 on osx, maybe this fixes compilation errors? --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd64c1f54..73815cea6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: modules: "qt5compat" os: windows-latest - - qt_version: "6.6.1" + qt_version: "6.5" modules: "qt5compat" os: macos-latest From bc794b0b8af22dfc62054703ae3c9cbb7c2ad9ec Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 28 Nov 2023 17:48:15 +0200 Subject: [PATCH 77/78] compile using qt6.6.1 - change target deployment on osx --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73815cea6..b008ff34b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: modules: "qt5compat" os: windows-latest - - qt_version: "6.5" + qt_version: "6.6.1" modules: "qt5compat" os: macos-latest @@ -60,7 +60,7 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_STATIC=ON + cmake -S . -B cbuild -G Ninja -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_STATIC=ON cmake --build cbuild - name: Create App Image From b6401251eb5a8c6e855016a93f067a93e9d55a13 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 28 Nov 2023 18:06:12 +0200 Subject: [PATCH 78/78] fixing osx compilation problem? --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b008ff34b..a97b089d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: - name: Compile run: | - cmake -S . -B cbuild -G Ninja -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_STATIC=ON + cmake -S . -B cbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON cmake --build cbuild - name: Create App Image