From 321d881bfe2f7cc77ac64fc843484d5e9f170c43 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Mon, 6 May 2024 17:03:17 +0200 Subject: [PATCH] Release plugins alpha (#5288) --- .github/workflows/build.yml | 6 +++--- BUILDING_ON_FREEBSD.md | 2 +- BUILDING_ON_LINUX.md | 2 +- BUILDING_ON_MAC.md | 2 +- BUILDING_ON_WINDOWS.md | 1 + BUILDING_ON_WINDOWS_WITH_VCPKG.md | 1 + CHANGELOG.md | 1 + CMakeLists.txt | 2 +- src/widgets/settingspages/PluginsPage.cpp | 15 +++++++++++++++ 9 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e42b5dd6..5a4d07717 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,21 +115,21 @@ jobs: - os: macos-13 qt-version: 5.15.2 force-lto: false - plugins: false + plugins: true skip-artifact: false skip-crashpad: false # Windows - os: windows-latest qt-version: 6.5.0 force-lto: false - plugins: false + plugins: true skip-artifact: false skip-crashpad: false # Windows 7/8 - os: windows-latest qt-version: 5.15.2 force-lto: false - plugins: false + plugins: true skip-artifact: false skip-crashpad: true diff --git a/BUILDING_ON_FREEBSD.md b/BUILDING_ON_FREEBSD.md index 8a1deeeba..26e751c93 100644 --- a/BUILDING_ON_FREEBSD.md +++ b/BUILDING_ON_FREEBSD.md @@ -15,7 +15,7 @@ FreeBSD 13.0-CURRENT. mkdir build cd build ``` -1. Generate build files +1. Generate build files. To enable Lua plugins in your build add `-DCHATTERINO_PLUGINS=ON` to this command. ```sh cmake .. ``` diff --git a/BUILDING_ON_LINUX.md b/BUILDING_ON_LINUX.md index b901e8e6d..3aa2df4a8 100644 --- a/BUILDING_ON_LINUX.md +++ b/BUILDING_ON_LINUX.md @@ -51,7 +51,7 @@ nix-shell -p openssl boost qt6.full pkg-config cmake mkdir build cd build ``` -1. Generate build files +1. Generate build files. To enable Lua plugins in your build add `-DCHATTERINO_PLUGINS=ON` to this command. ```sh cmake -DBUILD_WITH_QT6=ON -DBUILD_WITH_QTKEYCHAIN=OFF .. ``` diff --git a/BUILDING_ON_MAC.md b/BUILDING_ON_MAC.md index 78f94c7e9..1c8fc38a1 100644 --- a/BUILDING_ON_MAC.md +++ b/BUILDING_ON_MAC.md @@ -20,7 +20,7 @@ Local dev machines for testing are available on Apple Silicon on macOS 13. 1. Go to the project directory where you cloned Chatterino2 & its submodules 1. Create a build directory and go into it: `mkdir build && cd build` -1. Run CMake: +1. Run CMake. To enable Lua plugins in your build add `-DCHATTERINO_PLUGINS=ON` to this command. `cmake -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt@5 -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@1.1 ..` 1. Build: `make` diff --git a/BUILDING_ON_WINDOWS.md b/BUILDING_ON_WINDOWS.md index dc66d65c4..42d71cc51 100644 --- a/BUILDING_ON_WINDOWS.md +++ b/BUILDING_ON_WINDOWS.md @@ -118,6 +118,7 @@ nmake ``` To build a debug build, you'll also need to add the `-s compiler.runtime_type=Debug` flag to the `conan install` invocation. See [this StackOverflow post](https://stackoverflow.com/questions/59828611/windeployqt-doesnt-deploy-qwindowsd-dll-for-a-debug-application/75607313#75607313) +To build with plugins add `-DCHATTERINO_PLUGINS=ON` to `cmake` command. #### Deploying Qt libraries diff --git a/BUILDING_ON_WINDOWS_WITH_VCPKG.md b/BUILDING_ON_WINDOWS_WITH_VCPKG.md index b99809431..ec9615724 100644 --- a/BUILDING_ON_WINDOWS_WITH_VCPKG.md +++ b/BUILDING_ON_WINDOWS_WITH_VCPKG.md @@ -50,4 +50,5 @@ This will require more than 30GB of free space on your hard drive. cmake --build . --parallel --config Release ``` When using CMD, use `-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake` to specify the toolchain. + To build with plugins add `-DCHATTERINO_PLUGINS=ON` to `cmake -B build` command. 1. Run `.\bin\chatterino2.exe` diff --git a/CHANGELOG.md b/CHANGELOG.md index eae3d6f30..4bd5f9a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unversioned +- Major: Release plugins alpha. (#5288) - Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378) - Dev: Add doxygen build target. (#5377) - Dev: Make printing of strings in tests easier. (#5379) diff --git a/CMakeLists.txt b/CMakeLists.txt index eec6b7e1c..6fb323286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ option(CHATTERINO_GENERATE_COVERAGE "Generate coverage files" OFF) option(BUILD_TRANSLATIONS "" OFF) option(BUILD_SHARED_LIBS "" OFF) option(CHATTERINO_LTO "Enable LTO for all targets" OFF) -option(CHATTERINO_PLUGINS "Enable EXPERIMENTAL plugin support in Chatterino" OFF) +option(CHATTERINO_PLUGINS "Enable ALPHA plugin support in Chatterino" OFF) option(CHATTERINO_UPDATER "Enable update checks" ON) mark_as_advanced(CHATTERINO_UPDATER) diff --git a/src/widgets/settingspages/PluginsPage.cpp b/src/widgets/settingspages/PluginsPage.cpp index aad35f751..05c80a37c 100644 --- a/src/widgets/settingspages/PluginsPage.cpp +++ b/src/widgets/settingspages/PluginsPage.cpp @@ -37,6 +37,21 @@ PluginsPage::PluginsPage() auto group = layout.emplace("General plugin settings"); this->generalGroup = group.getElement(); auto groupLayout = group.setLayoutType(); + auto *scaryLabel = new QLabel( + "Plugins can expand functionality of " + "Chatterino. They can be made in Lua. This functionality is " + "still in public alpha stage. Use ONLY the plugins you trust. " + "The permission system is best effort, always " + "assume plugins can bypass permissions and can execute " + "arbitrary code. To see how to create plugins " + + formatRichNamedLink("https://github.com/Chatterino/chatterino2/" + "blob/master/docs/wip-plugins.md", + "look at the manual") + + "."); + scaryLabel->setWordWrap(true); + scaryLabel->setOpenExternalLinks(true); + groupLayout->addRow(scaryLabel); + auto *description = new QLabel("You can load plugins by putting them into " + formatRichNamedLink(