feat(plugins): add a plugin shop fed by a JSON catalogue
Installing a plugin meant compiling a shared library and dropping it in a directory by hand. The shop reads a catalogue (plugins/catalog.json, one entry per plugin with its description and download URL), lists what can be installed next to what already is, and installs an entry into ~/.local/share/PacManager/plugins — the directory the registry already scans — so a plugin becomes usable without root rights and without a restart. Installing runs third-party code in this process, so the shop only fetches what the user picked, checks the announced sha256 before writing anything, and a removal deletes only the files the shop wrote itself. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
1 parent
b26e907221
commit
5033c4e940
9 files changed
+872
-6
No files matched your search
+16
-2
@@ -32,8 +32,10 @@ set(SOURCES
|
||||
src/package-model.cpp
|
||||
src/update-manager.cpp
|
||||
src/app-logging.cpp
|
||||
# Logic layer: background workers and the controller the screens delegate to.
|
||||
# Logic layer: background workers, the plugin shop and the controller the
|
||||
# screens delegate to.
|
||||
src/workers.cpp
|
||||
src/plugin-shop.cpp
|
||||
src/app-core.cpp
|
||||
# Interface: one file per screen under pages/, on top of the logic layer.
|
||||
pages/page.cpp
|
||||
@@ -59,6 +61,7 @@ set(HEADERS
|
||||
include/app-logging.h
|
||||
include/workers.h
|
||||
include/progress-tracker.h
|
||||
include/plugin-shop.h
|
||||
include/app-core.h
|
||||
pages/page.h
|
||||
pages/ui-kit.h
|
||||
@@ -156,6 +159,15 @@ add_executable(progress-tracker-test tests/progress-tracker.test.cpp)
|
||||
target_include_directories(progress-tracker-test PRIVATE include)
|
||||
add_test(NAME progress-tracker-test COMMAND progress-tracker-test)
|
||||
|
||||
# PluginShop: catalogue parsing and the install/uninstall bookkeeping. The
|
||||
# network half is exercised through the catalogue parser; the file half runs in
|
||||
# a temporary directory, and the settings go to a temporary INI too.
|
||||
add_executable(plugin-shop-test tests/plugin-shop.test.cpp
|
||||
src/plugin-shop.cpp src/app-logging.cpp include/plugin-shop.h)
|
||||
target_include_directories(plugin-shop-test PRIVATE include)
|
||||
target_link_libraries(plugin-shop-test PRIVATE Qt6::Core Qt6::Network)
|
||||
add_test(NAME plugin-shop-test COMMAND plugin-shop-test)
|
||||
|
||||
add_executable(aur-manager-test tests/aur-manager.test.cpp
|
||||
plugins/aur-provider/aur-manager.cpp)
|
||||
target_include_directories(aur-manager-test PRIVATE include plugins/aur-provider)
|
||||
@@ -170,8 +182,10 @@ add_test(NAME aur-manager-test COMMAND aur-manager-test)
|
||||
add_executable(app-core-test tests/app-core.test.cpp
|
||||
src/app-core.cpp src/workers.cpp src/pacman-manager.cpp
|
||||
src/plugin-manager.cpp src/history-manager.cpp src/update-manager.cpp
|
||||
src/plugin-shop.cpp
|
||||
src/app-logging.cpp
|
||||
include/app-core.h include/workers.h include/update-manager.h)
|
||||
include/app-core.h include/workers.h include/update-manager.h
|
||||
include/plugin-shop.h)
|
||||
target_include_directories(app-core-test PRIVATE include)
|
||||
target_link_libraries(app-core-test PRIVATE Qt6::Core Qt6::Network)
|
||||
target_compile_definitions(app-core-test PRIVATE
|
||||
|
||||
Reference in new issue
Block a user