app-editors/imhex/files: tree clean patches

Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui
2022-09-08 12:13:53 +08:00
parent 5168f8765c
commit cfebd16246
6 changed files with 0 additions and 205 deletions

View File

@@ -1,26 +0,0 @@
From 63d0b8a6e2abe14f4d1947cc9ef9b2905f117801 Mon Sep 17 00:00:00 2001
From: KokaKiwi <kokakiwi+git@kokakiwi.net>
Date: Sun, 14 Aug 2022 23:59:30 +0200
Subject: [PATCH 2/3] makepkg: Fix build with clang
clang does not support some C++20 features
---
lib/libimhex/include/hex/data_processor/node.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libimhex/include/hex/data_processor/node.hpp b/lib/libimhex/include/hex/data_processor/node.hpp
index c5fcde80..1a5d9fde 100644
--- a/lib/libimhex/include/hex/data_processor/node.hpp
+++ b/lib/libimhex/include/hex/data_processor/node.hpp
@@ -90,7 +90,7 @@ namespace hex::dp {
protected:
[[noreturn]] void throwNodeError(const std::string &message) {
- throw NodeError(this, message);
+ throw NodeError { this, message };
}
std::vector<u8> getBufferOnInput(u32 index);
--
2.37.2

View File

@@ -1,44 +0,0 @@
From c5e69f9670f8b6e5d6f223c312807f2ecd204493 Mon Sep 17 00:00:00 2001
From: KokaKiwi <kokakiwi+git@kokakiwi.net>
Date: Sun, 14 Aug 2022 23:01:45 +0200
Subject: [PATCH 1/3] makepkg: Fix compiler check
---
cmake/build_helpers.cmake | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake
index e46ffa5e..c7aa712c 100644
--- a/cmake/build_helpers.cmake
+++ b/cmake/build_helpers.cmake
@@ -344,7 +344,7 @@ function(verifyCompiler)
message(FATAL_ERROR "ImHex requires GCC 12.0.0 or newer. Please use the latest GCC version.")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0.0")
message(FATAL_ERROR "ImHex requires Clang 14.0.0 or newer. Please use the latest Clang version.")
- elseif (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ elseif (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
message(FATAL_ERROR "ImHex can only be compiled with GCC or Clang. ${CMAKE_CXX_COMPILER_ID} is not supported.")
endif()
endfunction()
@@ -384,10 +384,14 @@ function(downloadImHexPatternsFiles dest)
endfunction()
macro(setupCompilerWarnings target)
- set(IMHEX_COMMON_FLAGS "-Wall -Wextra -Werror")
- set(IMHEX_C_FLAGS "${IMHEX_COMMON_FLAGS} -Wno-restrict -Wno-stringop-overread")
+ set(IMHEX_COMMON_FLAGS "")
+ set(IMHEX_C_FLAGS "${IMHEX_COMMON_FLAGS}")
+
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set(IMHEX_C_FLAGS "${IMHEX_C_FLAGS} -Wno-restrict -Wno-stringop-overread")
+ endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_C_FLAGS}")
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${IMHEX_COMMON_FLAGS}")
-endmacro()
\ No newline at end of file
+endmacro()
--
2.37.2

View File

@@ -1,25 +0,0 @@
From 90241ef46d52fb00f3941b526a9b4d20d9170ef0 Mon Sep 17 00:00:00 2001
From: WerWolv <werwolv98@gmail.com>
Date: Thu, 18 Aug 2022 00:23:31 +0200
Subject: [PATCH 1/2] fix: Copy elision not applying
---
lib/source/pl/core/evaluator.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/source/pl/core/evaluator.cpp b/lib/source/pl/core/evaluator.cpp
index 37e7168..0bc9133 100644
--- a/lib/external/pattern_language/lib/source/pl/core/evaluator.cpp
+++ b/lib/external/pattern_language/lib/source/pl/core/evaluator.cpp
@@ -59,7 +59,7 @@ namespace pl::core {
pattern->setVariableName(name);
- variables.push_back(std::move(std::unique_ptr<ptrn::Pattern>(pattern)));
+ variables.push_back(std::unique_ptr<ptrn::Pattern>(pattern));
}
void Evaluator::createVariable(const std::string &name, ast::ASTNode *type, const std::optional<Token::Literal> &value, bool outVariable) {
--
2.37.2

View File

@@ -1,64 +0,0 @@
From 013aed0e9131461157c199edfd9565a82657f293 Mon Sep 17 00:00:00 2001
From: KokaKiwi <kokakiwi+git@kokakiwi.net>
Date: Sat, 11 Jun 2022 23:08:31 +0200
Subject: [PATCH 3/3] fix: Deduplicate resources directories
It seems to actually happens despite xdgpp already doing that...
---
lib/libimhex/include/hex/helpers/utils.hpp | 11 +++++++++++
lib/libimhex/source/helpers/fs.cpp | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/lib/libimhex/include/hex/helpers/utils.hpp b/lib/libimhex/include/hex/helpers/utils.hpp
index f5666254..5d86768a 100644
--- a/lib/libimhex/include/hex/helpers/utils.hpp
+++ b/lib/libimhex/include/hex/helpers/utils.hpp
@@ -189,6 +189,17 @@ namespace hex {
return result;
}
+ template<typename T>
+ void deduplicateVector(std::vector<T> &items) {
+ auto end = items.end();
+
+ for (auto it = items.begin(); it != end; ++it) {
+ end = std::remove(it + 1, end, *it);
+ }
+
+ items.erase(end, items.end());
+ }
+
std::vector<std::string> splitString(const std::string &string, const std::string &delimiter);
std::string combineStrings(const std::vector<std::string> &strings, const std::string &delimiter = "");
diff --git a/lib/libimhex/source/helpers/fs.cpp b/lib/libimhex/source/helpers/fs.cpp
index dc58ced3..5c346ec8 100644
--- a/lib/libimhex/source/helpers/fs.cpp
+++ b/lib/libimhex/source/helpers/fs.cpp
@@ -1,4 +1,5 @@
#include <hex/helpers/fs.hpp>
+#include <hex/helpers/utils.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/helpers/fs_macos.hpp>
@@ -156,6 +157,8 @@ namespace hex::fs {
auto additionalDirs = ImHexApi::System::getAdditionalFolderPaths();
std::copy(additionalDirs.begin(), additionalDirs.end(), std::back_inserter(paths));
+ hex::deduplicateVector(paths);
+
return paths;
}
@@ -175,6 +178,8 @@ namespace hex::fs {
for (auto &path : paths)
path = path / "imhex";
+ hex::deduplicateVector(paths);
+
return paths;
#endif
}
--
2.37.2

View File

@@ -1,20 +0,0 @@
Date: Thu, 19 Aug 2022 17:57:02 +0800
Subject: [PATCH 1/1] Remove LLVMDemangle
---
lib/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/builtin/CMakeLists.txt b/plugins/builtin/CMakeLists.txt
index 1822efa..1141abf 100644
--- a/plugins/builtin/CMakeLists.txt 2022-08-19 17:02:46.348471178 +0800
+++ b/plugins/builtin/CMakeLists.txt 2022-08-19 17:03:24.748001036 +0800
@@ -69,7 +69,7 @@
target_include_directories(${PROJECT_NAME} PRIVATE include)
# Add additional libraries here #
-target_link_libraries(${PROJECT_NAME} PRIVATE libimhex LLVMDemangle)
+target_link_libraries(${PROJECT_NAME} PRIVATE libimhex)
# ---- No need to change anything from here downwards unless you know what you're doing ---- #

View File

@@ -1,26 +0,0 @@
From 5a5a97b49ff7fb6dc3786917f59322df67e42816 Mon Sep 17 00:00:00 2001
From: KokaKiwi <kokakiwi+git@kokakiwi.net>
Date: Thu, 18 Aug 2022 00:57:02 +0200
Subject: [PATCH 2/2] Use C++23 standard
---
lib/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 5822e0a..11511ba 100644
--- a/lib/external/pattern_language/lib/CMakeLists.txt
+++ b/lib/external/pattern_language/lib/CMakeLists.txt
@@ -1,7 +1,7 @@
-cmake_minimum_required(VERSION 3.16)
+cmake_minimum_required(VERSION 3.20)
project(libpl)
-set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD 23)
if (LIBPL_SHARED_LIBRARY)
set(LIBRARY_TYPE SHARED)
--
2.37.2