Code Monkey home page Code Monkey logo

Comments (12)

Mailaender avatar Mailaender commented on May 14, 2024 1

The patch for @openSUSE is slightly different as we use shared libs instead:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ff9079..b92ed20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,8 +11,6 @@ pkg_search_module(CAPSTONE REQUIRED capstone)
 find_package(OpenGL REQUIRED)
 find_package(LLVM REQUIRED CONFIG)
 
-llvm_map_components_to_libnames(demangler)
-
 include_directories(include ${GLFW_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} libs/ImGui/include libs/glad/include)
 
 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -DIMGUI_IMPL_OPENGL_LOADER_GLAD")
@@ -65,10 +63,12 @@ add_executable(ImHex
         resource.rc
         )
 
+target_link_directories(ImHex PRIVATE ${LLVM_LIBRARY_DIR})
+
 if (WIN32)
-    target_link_libraries(ImHex libglfw3.a libgcc.a libstdc++.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a shlwapi.lib libcrypto.a libwinpthread.a libcapstone.a libLLVMDemangle.a)
+    target_link_libraries(ImHex libglfw3.a libgcc.a libstdc++.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a shlwapi.lib libcrypto.a libwinpthread.a libcapstone.a libLLVM.a)
 endif (WIN32)
 
 if (UNIX)
-    target_link_libraries(ImHex libglfw.so libmagic.so libcrypto.so libdl.so libcapstone.so libLLVMDemangle.so)
-endif (UNIX)
\ No newline at end of file
+    target_link_libraries(ImHex libglfw.so libmagic.so libcrypto.so libdl.so libcapstone.so libLLVM.so)
+endif (UNIX)
-- 
2.26.2

from imhex.

marysaka avatar marysaka commented on May 14, 2024 1

@Mailaender As of 9b85335, you don't need a patch anymore πŸŽ‰

from imhex.

WerWolv avatar WerWolv commented on May 14, 2024

Hi!
It's absolutely not deprecated, in fact it's still being further improved as seen here https://github.com/llvm/llvm-project/tree/master/llvm/include/llvm/Demangle.

ImHex in itself does have a lot of dependencies already. And I know not all of them can be available on absolutely every distribution. Therefore, if I start making one dependency optional, lots of other people will come asking for capstone or python or libmagic to be made optional. I feel like ImHex is going to lose lots of what it is when having different features available on different architectures because prebuilt libraries aren't available there. In my opinion you should rather try to get these libraries be available on those distros as well instead of ripping them out of projects. That will help other people too that use these libraries.

from imhex.

Sijisu avatar Sijisu commented on May 14, 2024

I have exactly the same issue as @Mailaender (I'm on openSUSE as well), can't find the dependency anywhere.

from imhex.

Mailaender avatar Mailaender commented on May 14, 2024

I understand. https://build.opensuse.org/package/show/devel:tools:compiler/llvm has it disabled somehow which seems to be the default.

Are you sure it is available for @archlinux? It isn't packaged for https://www.archlinux.org/packages/extra/x86_64/llvm-libs/ as you linked in the ReadMe and https://www.archlinux.org/packages/extra/x86_64/llvm/ only contains headers and a statically linked library.

from imhex.

Mailaender avatar Mailaender commented on May 14, 2024

We believe it is part of libLLVM itself already.

from imhex.

WerWolv avatar WerWolv commented on May 14, 2024
➜  / find /usr | grep libLLVM
...
/usr/lib/libLLVMDemangle.a

Definitely available on my Arch Linux setup.
I have llvm 11.0.0-1 and llvm-libs 11.0.0-1 installed.

from imhex.

WerWolv avatar WerWolv commented on May 14, 2024

Oh I just noticed the title, sorry. Me writing libLLVMDemangle.so in the cmake script was actually an error. It was fixed today to use the correct file. It's very much possible that that's the reason nothing came up for you. Sorry about that

from imhex.

Mailaender avatar Mailaender commented on May 14, 2024

Even with #35 applied it can't find the library.

https://build.opensuse.org/package/view_file/devel:tools:compiler/llvm11/llvm-do-not-install-static-libraries.patch is probably the culprit here so nothing on your end.

from imhex.

Mailaender avatar Mailaender commented on May 14, 2024

https://build.opensuse.org/package/show/home:Mailaender:branches:editors/imhex builds.

from imhex.

tuxuser avatar tuxuser commented on May 14, 2024

Thanks alot for this patch, gentoo is working now too :)

imhex-1.5.0.ebuild

# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

PYTHON_COMPAT=( python3_{7..9} )

inherit desktop xdg-utils python-single-r1 cmake-utils llvm

DESCRIPTION="A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM."
HOMEPAGE="https://github.com/WerWolv/ImHex"
SRC_URI="https://github.com/WerWolv/ImHex/archive/v${PV}.tar.gz"
S="${WORKDIR}/ImHex-${PV}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DEPEND="
  ${PYTHON_DEPS}
  sys-devel/llvm:=
  media-libs/glfw
  media-libs/glm
  sys-apps/file
  dev-libs/openssl
  dev-libs/capstone
  sys-devel/llvm
  dev-cpp/nlohmann_json
  dev-lang/python
"
RDEPEND="${DEPEND}"
BDEPEND="
  dev-util/cmake
"

src_install() {
	# Install executable
	exeinto /opt/${PN}
	doexe ${BUILD_DIR}/ImHex
	fperms +x /opt/${PN}/ImHex

	# Symlink executable
	dodir /opt/bin
	dosym ../${PN}/ImHex /opt/bin/ImHex

	# Install auxiliary files
	insinto /opt/${PN}
	doins ${S}/icon.ico
	doins -r ${S}/python_libs/lib/.

	make_desktop_entry /opt/bin/ImHex "ImHex" /opt/${PN}/icon.ico "Editor"

	einstalldocs
}

pkg_postinst() {
	xdg_desktop_database_update
	xdg_mimeinfo_database_update
}

pkg_postrm() {
	xdg_desktop_database_update
	xdg_mimeinfo_database_update
}

from imhex.

Sijisu avatar Sijisu commented on May 14, 2024

Yaay! That's great, thanksπŸ‘πŸ»πŸŽ‰πŸŽ‰

from imhex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.