summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKokaKiwi2021-09-23 22:31:02 +0200
committerKokaKiwi2021-09-23 22:31:02 +0200
commit54205d98f9b1d368668ffd0e1c8d0e1ad32fa445 (patch)
treed018a0f913f190efbc6ebf192fb79c8faec29c07
parente645f1370bc35c33f201630e95a68ec012cca1db (diff)
downloadaur-54205d98f9b1d368668ffd0e1c8d0e1ad32fa445.tar.gz
Use more system libraries
-rw-r--r--.SRCINFO19
-rw-r--r--0001-Set-correct-library-names.patch38
-rw-r--r--0001-build-Fix-system-libraries-usage.patch100
-rw-r--r--PKGBUILD37
4 files changed, 143 insertions, 51 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f43a0c7acc28..6ffe6510fe13 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = imhex
pkgdesc = A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM
pkgver = 1.10.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/WerWolv/ImHex
arch = x86_64
license = GPL2
@@ -21,17 +21,26 @@ pkgbase = imhex
depends = gtk3
depends = hicolor-icon-theme
depends = yara
+ depends = fmt
source = imhex::git+https://github.com/WerWolv/ImHex.git#tag=v1.10.0
- source = 0001-Set-correct-library-names.patch
+ source = nativefiledialog::git+https://github.com/btzy/nativefiledialog-extended.git
+ source = git+https://git.sr.ht/~danyspin97/xdgpp
+ source = 0001-build-Fix-system-libraries-usage.patch
source = imhex.desktop
cksums = SKIP
- cksums = 3656399322
+ cksums = SKIP
+ cksums = SKIP
+ cksums = 2019546358
cksums = 4178124713
sha256sums = SKIP
- sha256sums = a8f936c6685979f888a2008d9b407a556bd581d4655df1a88664cd35f7416d16
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = 25f2b3fe49d0c75207ad561995a3ad24b45581cad878c04922402d3d60e98ef1
sha256sums = 72525512a241589cecd6141f32ad36cbe1b5b6f2629dd8ead0e37812321bdde6
b2sums = SKIP
- b2sums = 6e68b4674888b1888f1e2a9afb9b894f180e6823c3bc0579ca6ddbe99cc23ba167761d9122ed411e421e50a951276c4a5f34b13cfbb04081fca217b895603284
+ b2sums = SKIP
+ b2sums = SKIP
+ b2sums = 00982d536e4623a47acdc648d53a97fe4eb64e1a19f807b7a1a5aa66cda5056100cc9bc968a2c914f64e924c0beb47d5443dcb013c858d30af8a24c16e0a82bf
b2sums = 7b2d029de385fdc2536f57a4364add9752b9a5dc31df501e07bff1fd69fdd1de2afa19a5ac5a4c87fbf21c5d87cc96d3fe30d58825c050f5a7d25f6d85d08efc
pkgname = imhex
diff --git a/0001-Set-correct-library-names.patch b/0001-Set-correct-library-names.patch
deleted file mode 100644
index 261fa0b82c98..000000000000
--- a/0001-Set-correct-library-names.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 8735d30e13067146ba6e1968b491b4654fdb19f7 Mon Sep 17 00:00:00 2001
-From: KokaKiwi <kokakiwi+git@kokakiwi.net>
-Date: Sun, 19 Sep 2021 15:10:13 +0200
-Subject: [PATCH] Set correct library names
-
----
- CMakeLists.txt | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 4aab3a3..5178b35 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -34,6 +34,7 @@ else()
- endif()
- if (NOT USE_SYSTEM_YARA)
- add_subdirectory(external/yara)
-+ set(YARA_LIBRARIES libyara)
- else()
- find_package(PkgConfig REQUIRED)
- pkg_check_modules(YARA REQUIRED IMPORTED_TARGET yara)
-@@ -103,9 +104,11 @@ set_target_properties(imhex PROPERTIES CXX_VISIBILITY_PRESET hidden)
- target_link_directories(imhex PRIVATE ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS})
-
- if (WIN32)
-- target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32 libyara Dwmapi.lib dl)
-+ target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32
-+ ${YARA_LIBRARIES} Dwmapi.lib dl)
- else ()
-- target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread libyara)
-+ target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread
-+ ${YARA_LIBRARIES})
- endif ()
-
- createPackage()
---
-2.33.0
-
diff --git a/0001-build-Fix-system-libraries-usage.patch b/0001-build-Fix-system-libraries-usage.patch
new file mode 100644
index 000000000000..0b8d6a3c88a5
--- /dev/null
+++ b/0001-build-Fix-system-libraries-usage.patch
@@ -0,0 +1,100 @@
+From 22b42fbdc12f86e9a36d5514306f91cdc0a8298a Mon Sep 17 00:00:00 2001
+From: KokaKiwi <kokakiwi+git@kokakiwi.net>
+Date: Thu, 23 Sep 2021 20:22:30 +0200
+Subject: [PATCH] build: Fix system libraries usage
+
+Signed-off-by: KokaKiwi <kokakiwi+git@kokakiwi.net>
+---
+ CMakeLists.txt | 8 ++++++--
+ plugins/libimhex/CMakeLists.txt | 24 +++++++++---------------
+ 2 files changed, 15 insertions(+), 17 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6f48f92..a460126 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -27,8 +27,10 @@ if (NOT USE_SYSTEM_LLVM)
+ else()
+ find_package(LLVM REQUIRED Demangle)
+ endif()
++
+ if (NOT USE_SYSTEM_YARA)
+ add_subdirectory(external/yara)
++ set(YARA_LIBRARIES libyara)
+ else()
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(YARA REQUIRED IMPORTED_TARGET yara)
+@@ -98,9 +100,11 @@ set_target_properties(imhex PROPERTIES CXX_VISIBILITY_PRESET hidden)
+ target_link_directories(imhex PRIVATE ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS})
+
+ if (WIN32)
+- target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32 libyara Dwmapi.lib dl)
++ target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32
++ ${YARA_LIBRARIES} Dwmapi.lib dl)
+ else ()
+- target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread libyara)
++ target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread
++ ${YARA_LIBRARIES})
+ endif ()
+
+ createPackage()
+diff --git a/plugins/libimhex/CMakeLists.txt b/plugins/libimhex/CMakeLists.txt
+index 2e40784..568dc9f 100644
+--- a/plugins/libimhex/CMakeLists.txt
++++ b/plugins/libimhex/CMakeLists.txt
+@@ -8,15 +8,19 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/ImGui ${CMAKE_CURREN
+
+ if(NOT USE_SYSTEM_NLOHMANN_JSON)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/nlohmann_json ${CMAKE_CURRENT_BINARY_DIR}/external/nlohmann_json)
++ set(NLOHMANN_JSON_LIBRARIES nlohmann_json)
+ else()
+ find_package(nlohmann_json 3.10.2 REQUIRED)
++ set(NLOHMANN_JSON_LIBRARIES nlohmann_json::nlohmann_json)
+ endif()
+
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/nativefiledialog ${CMAKE_CURRENT_BINARY_DIR}/external/nativefiledialog EXCLUDE_FROM_ALL)
+ if(NOT USE_SYSTEM_FMT)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/fmt ${CMAKE_CURRENT_BINARY_DIR}/external/fmt)
++ set(FMT_LIBRARIES fmt-header-only)
+ else()
+ find_package(fmt 8.0.0 REQUIRED)
++ set(FMT_LIBRARIES fmt::fmt)
+ endif()
+
+ set(XDGPP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../../external/xdgpp")
+@@ -27,6 +31,7 @@ set(FPHSA_NAME_MISMATCHED ON CACHE BOOL "")
+ if(NOT USE_SYSTEM_CURL)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/curl ${CMAKE_CURRENT_BINARY_DIR}/external/curl EXCLUDE_FROM_ALL)
+ set_target_properties(libcurl PROPERTIES POSITION_INDEPENDENT_CODE ON)
++ set(LIBCURL_LIBRARIES libcurl)
+ else()
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(LIBCURL REQUIRED IMPORTED_TARGET libcurl>=7.78.0)
+@@ -96,20 +101,9 @@ target_link_directories(libimhex PUBLIC ${MBEDTLS_LIBRARY_DIR})
+
+ if (APPLE)
+ find_library(FOUNDATION NAMES Foundation)
+- target_link_libraries(libimhex PUBLIC imgui nlohmann_json mbedcrypto ${FOUNDATION} nfd fmt-header-only libcurl magic)
++ target_link_libraries(libimhex PUBLIC imgui ${NLOHMANN_JSON_LIBRARIES} ${MBEDTLS_LIBRARIES} ${FOUNDATION} nfd
++ ${FMT_LIBRARIES} ${LIBCURL_LIBRARIES} magic)
+ else ()
+- target_link_libraries(libimhex PUBLIC imgui nlohmann_json mbedcrypto nfd magic)
+-
+- if (NOT USE_SYSTEM_FMT)
+- target_link_libraries(libimhex PUBLIC fmt-header-only)
+- else()
+- target_link_libraries(libimhex PUBLIC fmt)
+- endif()
+-
+- if (NOT USE_SYSTEM_CURL)
+- target_link_libraries(libimhex PUBLIC libcurl)
+- else()
+- target_link_libraries(libimhex PUBLIC curl)
+- endif()
+-
++ target_link_libraries(libimhex PUBLIC imgui ${NLOHMANN_JSON_LIBRARIES} ${MBEDTLS_LIBRARIES} nfd magic
++ ${FMT_LIBRARIES} ${LIBCURL_LIBRARIES})
+ endif ()
+--
+2.33.0
+
diff --git a/PKGBUILD b/PKGBUILD
index bf655b8395e5..1cc19b6cb132 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,33 +4,48 @@
_pkgname=ImHex
pkgname=${_pkgname,,}
pkgver=1.10.0
-pkgrel=1
+pkgrel=2
pkgdesc='A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM'
url='https://github.com/WerWolv/ImHex'
license=('GPL2')
arch=('x86_64')
depends=('glfw' 'capstone' 'mbedtls' 'libssh2'
'python' 'freetype2' 'file' 'gtk3' 'hicolor-icon-theme'
- 'yara')
+ 'yara' 'fmt')
makedepends=('git' 'cmake' 'glm' 'llvm' 'nlohmann-json' 'librsvg')
source=("${pkgname}::git+https://github.com/WerWolv/ImHex.git#tag=v${pkgver}"
- 0001-Set-correct-library-names.patch
+ "nativefiledialog::git+https://github.com/btzy/nativefiledialog-extended.git"
+ "git+https://git.sr.ht/~danyspin97/xdgpp"
+ 0001-build-Fix-system-libraries-usage.patch
imhex.desktop)
cksums=('SKIP'
- '3656399322'
+ 'SKIP'
+ 'SKIP'
+ '2019546358'
'4178124713')
sha256sums=('SKIP'
- 'a8f936c6685979f888a2008d9b407a556bd581d4655df1a88664cd35f7416d16'
+ 'SKIP'
+ 'SKIP'
+ '25f2b3fe49d0c75207ad561995a3ad24b45581cad878c04922402d3d60e98ef1'
'72525512a241589cecd6141f32ad36cbe1b5b6f2629dd8ead0e37812321bdde6')
b2sums=('SKIP'
- '6e68b4674888b1888f1e2a9afb9b894f180e6823c3bc0579ca6ddbe99cc23ba167761d9122ed411e421e50a951276c4a5f34b13cfbb04081fca217b895603284'
+ 'SKIP'
+ 'SKIP'
+ '00982d536e4623a47acdc648d53a97fe4eb64e1a19f807b7a1a5aa66cda5056100cc9bc968a2c914f64e924c0beb47d5443dcb013c858d30af8a24c16e0a82bf'
'7b2d029de385fdc2536f57a4364add9752b9a5dc31df501e07bff1fd69fdd1de2afa19a5ac5a4c87fbf21c5d87cc96d3fe30d58825c050f5a7d25f6d85d08efc')
prepare() {
- git -C "$pkgname" submodule update --init --recursive
+ git -C "$pkgname" submodule init
+ for name in nativefiledialog xdgpp; do
+ git -C "$pkgname" config submodule.external/$name.url "$srcdir/$name"
+ done
+ for name in yara/yara fmt curl; do
+ git -C "$pkgname" config --remove-section submodule.external/$name
+ done
+ git -C "$pkgname" submodule update
git -C "$pkgname" apply -v \
- "$srcdir/0001-Set-correct-library-names.patch"
+ "$srcdir/0001-build-Fix-system-libraries-usage.patch"
}
build() {
@@ -38,8 +53,14 @@ build() {
-Wno-dev \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_INSTALL_PREFIX=/usr \
+ -D CMAKE_SKIP_RPATH=ON \
+ -D CMAKE_C_COMPILER="gcc" \
+ -D CMAKE_CXX_COMPILER="g++" \
-D USE_SYSTEM_LLVM=ON \
-D USE_SYSTEM_YARA=ON \
+ -D USE_SYSTEM_FMT=ON \
+ -D USE_SYSTEM_CURL=ON \
+ -D USE_SYSTEM_NLOHMANN_JSON=ON \
-D PROJECT_VERSION="$pkgver"
cmake --build build
}