-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-firmware: move all mediatek WLAN/BT drivers to -network subpkg
based on https://github.com/chimera-linux/cports/blob/339c0eef5be61397707170c6789e09fa4c3b5810/main/firmware-linux/template.py#L83-L86 this shouldn't break anything because `linux-firmware` depends on `linux-firmware-network` already fixes #43515
- Loading branch information
1 parent
3e11c20
commit a1be2bf
Showing
3 changed files
with
107 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,113 @@ | ||
running the internal update checker is pointless when updates are managed by xbps | ||
From 4b37a0b3cec38d5fee99795ad6a4d2e789827c5e Mon Sep 17 00:00:00 2001 | ||
From: classabbyamp <dev@placeviolette.net> | ||
Date: Tue, 18 Apr 2023 05:27:07 -0400 | ||
Subject: [PATCH] build: Add option to disable update checking | ||
|
||
--- a/plugins/builtin/source/content/welcome_screen.cpp | ||
+++ b/plugins/builtin/source/content/welcome_screen.cpp | ||
@@ -517,20 +517,6 @@ | ||
loadDefaultLayout(); | ||
}); | ||
|
||
- EventManager::subscribe<EventWindowInitialized>([] { | ||
- // documentation of the value above the setting definition | ||
- int showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2); | ||
- if (showCheckForUpdates == 2) { | ||
- ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 0); | ||
- View::showYesNoQuestionPopup("hex.builtin.welcome.check_for_updates_text"_lang, | ||
- [] { // yes | ||
- ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 1); | ||
- ImGui::CloseCurrentPopup(); | ||
- }, [] { // no | ||
- ImGui::CloseCurrentPopup(); | ||
- }); | ||
- } | ||
- }); | ||
|
||
ContentRegistry::Interface::addMenuItem("hex.builtin.menu.file", 1075, [&] { | ||
if (ImGui::BeginMenu("hex.builtin.menu.file.open_recent"_lang, !s_recentProvidersUpdating && !s_recentProviders.empty())) { | ||
--- a/plugins/builtin/source/content/settings_entries.cpp | ||
+++ b/plugins/builtin/source/content/settings_entries.cpp | ||
@@ -35,21 +35,6 @@ | ||
|
||
/* General */ | ||
This is aimed at use by linux distros, where package updates come from | ||
a central location, and users shouldn't need to worry about updating | ||
ImHex on their own. This disables parts of the ImHex UI that would not | ||
be useful in that case. | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index fc5c0e73..d2fbfab5 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -10,6 +10,7 @@ option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of t | ||
option(IMHEX_IGNORE_BAD_COMPILER "Allow compiling with an unsupported compiler" OFF) | ||
option(IMHEX_USE_GTK_FILE_PICKER "Use GTK file picker instead of xdg-desktop-portals" OFF) | ||
option(IMHEX_DISABLE_STACKTRACE "Disables support for printing stack traces" OFF) | ||
+option(IMHEX_DISABLE_UPDATE_CHECK "Disables built-in update check" OFF) | ||
|
||
- /* Values of this setting : | ||
- 0 - do not check for updates on startup | ||
- 1 - check for updates on startup | ||
- 2 - default value - ask the user if he wants to check for updates. This value should only be encountered on the first startup. | ||
- */ | ||
- ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2, [](auto name, nlohmann::json &setting) { | ||
- static bool enabled = static_cast<int>(setting) == 1; | ||
- | ||
- if (ImGui::Checkbox(name.data(), &enabled)) { | ||
- setting = static_cast<int>(enabled); | ||
- return true; | ||
- } | ||
- | ||
- return false; | ||
- }); | ||
# Basic compiler and cmake configurations | ||
set(CMAKE_CXX_STANDARD 23) | ||
@@ -46,6 +47,10 @@ configurePackingResources() | ||
setUninstallTarget() | ||
addBundledLibraries() | ||
|
||
ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.show_tips", 1, [](auto name, nlohmann::json &setting) { | ||
static bool enabled = static_cast<int>(setting); | ||
+if (NOT IMHEX_DISABLE_UPDATE_CHECK) | ||
+ add_compile_definitions(HEX_UPDATE_CHECK) | ||
+endif() | ||
+ | ||
# Add ImHex sources | ||
add_subdirectory(lib/libimhex) | ||
add_subdirectory(main) | ||
diff --git a/main/source/init/tasks.cpp b/main/source/init/tasks.cpp | ||
index 4e83b079..2d993f00 100644 | ||
--- a/main/source/init/tasks.cpp | ||
+++ b/main/source/init/tasks.cpp | ||
@@ -29,46 +29,6 @@ | ||
@@ -29,6 +29,7 @@ namespace hex::init { | ||
|
||
using namespace std::literals::string_literals; | ||
|
||
- static bool checkForUpdates() { | ||
- int showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2); | ||
- | ||
- // Check if we should check for updates | ||
- if (showCheckForUpdates == 1){ | ||
- HttpRequest request("GET", GitHubApiURL + "/releases/latest"s); | ||
- request.setTimeout(2000); | ||
- | ||
- // Query the GitHub API for the latest release version | ||
- auto response = request.execute().get(); | ||
- if (response.getStatusCode() != 200) | ||
- return false; | ||
- | ||
- nlohmann::json releases; | ||
- try { | ||
- releases = nlohmann::json::parse(response.getData()); | ||
- } catch (std::exception &e) { | ||
- return false; | ||
- } | ||
- | ||
- // Check if the response is valid | ||
- if (!releases.contains("tag_name") || !releases["tag_name"].is_string()) | ||
- return false; | ||
- | ||
- // Convert the current version string to a format that can be compared to the latest release | ||
- auto versionString = std::string(IMHEX_VERSION); | ||
- size_t versionLength = std::min(versionString.find_first_of('-'), versionString.length()); | ||
- auto currVersion = "v" + versionString.substr(0, versionLength); | ||
- | ||
- // Get the latest release version string | ||
- auto latestVersion = releases["tag_name"].get<std::string_view>(); | ||
- | ||
- // Check if the latest release is different from the current version | ||
- if (latestVersion != currVersion) | ||
- ImHexApi::System::impl::addInitArgument("update-available", latestVersion.data()); | ||
- | ||
- } | ||
- return true; | ||
- } | ||
- | ||
+#ifdef HEX_UPDATE_CHECK | ||
static bool checkForUpdates() { | ||
int showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2); | ||
|
||
@@ -68,6 +69,7 @@ namespace hex::init { | ||
} | ||
return true; | ||
} | ||
+#endif | ||
|
||
bool setupEnvironment() { | ||
hex::log::debug("Using romfs: '{}'", romfs::name()); | ||
|
||
@@ -479,7 +439,6 @@ | ||
@@ -474,7 +476,9 @@ namespace hex::init { | ||
#endif | ||
{ "Loading settings", loadSettings, false }, | ||
{ "Loading plugins", loadPlugins, false }, | ||
- { "Checking for updates", checkForUpdates, true }, | ||
+#if HEX_UPDATE_CHECK | ||
{ "Checking for updates", checkForUpdates, true }, | ||
+#endif | ||
{ "Loading fonts", loadFonts, true }, | ||
}; | ||
} | ||
@@ -487,4 +491,4 @@ namespace hex::init { | ||
}; | ||
} | ||
|
||
-} | ||
\ No newline at end of file | ||
+} | ||
diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp | ||
index 60530d59..b462327e 100644 | ||
--- a/plugins/builtin/source/content/settings_entries.cpp | ||
+++ b/plugins/builtin/source/content/settings_entries.cpp | ||
@@ -45,6 +45,7 @@ namespace hex::plugin::builtin { | ||
1 - check for updates on startup | ||
2 - default value - ask the user if he wants to check for updates. This value should only be encountered on the first startup. | ||
*/ | ||
+#ifdef HEX_UPDATE_CHECK | ||
ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2, [](auto name, nlohmann::json &setting) { | ||
static bool enabled = static_cast<int>(setting) == 1; | ||
|
||
@@ -55,6 +56,7 @@ namespace hex::plugin::builtin { | ||
|
||
return false; | ||
}); | ||
+#endif | ||
|
||
ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.show_tips", 1, [](auto name, nlohmann::json &setting) { | ||
static bool enabled = static_cast<int>(setting); | ||
diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp | ||
index 5d54c7bd..993efecb 100644 | ||
--- a/plugins/builtin/source/content/welcome_screen.cpp | ||
+++ b/plugins/builtin/source/content/welcome_screen.cpp | ||
@@ -511,6 +511,7 @@ namespace hex::plugin::builtin { | ||
loadDefaultLayout(); | ||
}); | ||
|
||
+#ifdef HEX_UPDATE_CHECK | ||
EventManager::subscribe<EventWindowInitialized>([] { | ||
// documentation of the value above the setting definition | ||
auto showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2); | ||
@@ -526,6 +527,7 @@ namespace hex::plugin::builtin { | ||
); | ||
} | ||
}); | ||
+#endif | ||
|
||
// Clear project context if we go back to the welcome screen | ||
EventManager::subscribe<EventProviderChanged>([](hex::prv::Provider *oldProvider, hex::prv::Provider *newProvider) { | ||
-- | ||
2.40.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters