From e475e763db575e4774fdd8e1cf687a0b778592b0 Mon Sep 17 00:00:00 2001 From: Nik Date: Sat, 17 Feb 2024 21:01:57 +0100 Subject: [PATCH] build: Hopefully fix macOS x86 build issues (#1556) #1109 --- .github/workflows/build.yml | 1 - cmake/build_helpers.cmake | 2 ++ cmake/modules/PostprocessBundle.cmake | 12 ++++++++++-- dist/rpm/imhex.spec | 2 -- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd0c6d719..ffdd356fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -215,7 +215,6 @@ jobs: -DIMHEX_COMMIT_HASH_LONG="${GITHUB_SHA}" \ -DIMHEX_COMMIT_BRANCH="${GITHUB_REF##*/}" \ -DCPACK_PACKAGE_FILE_NAME="imhex-${{env.IMHEX_VERSION}}-macOS${{matrix.suffix}}-x86_64" \ - -DIMHEX_RESIGN_BUNDLE=ON \ .. - name: 🛠️ Build diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 0982c67a0..2dc65a00d 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -252,6 +252,8 @@ macro(createPackage) install(FILES ${IMHEX_ICON} DESTINATION "${IMHEX_BUNDLE_PATH}/Contents/Resources") install(TARGETS main BUNDLE DESTINATION ".") + install(FILES $ DESTINATION "${IMHEX_BUNDLE_PATH}") + install(FILES $ DESTINATION "${IMHEX_BUNDLE_PATH}") # Update library references to make the bundle portable postprocess_bundle(imhex_all main) diff --git a/cmake/modules/PostprocessBundle.cmake b/cmake/modules/PostprocessBundle.cmake index e421888ba..22a7e1c70 100644 --- a/cmake/modules/PostprocessBundle.cmake +++ b/cmake/modules/PostprocessBundle.cmake @@ -36,7 +36,6 @@ message(STATUS "Fixing up application bundle: ${BUNDLE_PATH}") # Make sure to fix up any included ImHex plugin. file(GLOB_RECURSE plugins "${BUNDLE_PATH}/Contents/MacOS/plugins/*.hexplug") -file(GLOB_RECURSE plugin_libs "${BUNDLE_PATH}/Contents/MacOS/plugins/*.hexpluglib") # BundleUtilities doesn't support DYLD_FALLBACK_LIBRARY_PATH behavior, which @@ -68,4 +67,13 @@ if (CODE_SIGN_CERTIFICATE_ID) endif() # Add a necessary rpath to the imhex binary -get_bundle_main_executable("${BUNDLE_PATH}" IMHEX_EXECUTABLE) \ No newline at end of file +get_bundle_main_executable("${BUNDLE_PATH}" IMHEX_EXECUTABLE) + +file(GLOB_RECURSE plugin_libs "${BUNDLE_PATH}/Contents/MacOS/*.hexpluglib") +foreach(plugin_lib ${plugin_libs}) + get_filename_component(plugin_lib_name ${plugin_lib} NAME) + set(plugin_lib_dest "${BUNDLE_PATH}/Contents/MacOS/plugins/${plugin_lib_name}") + + configure_file(${plugin_lib} "${plugin_lib_dest}" COPYONLY) + message(STATUS "Copying plugin library: ${plugin_lib} to ${plugin_lib_dest}") +endforeach () \ No newline at end of file diff --git a/dist/rpm/imhex.spec b/dist/rpm/imhex.spec index 1d68671f8..2a08531ff 100644 --- a/dist/rpm/imhex.spec +++ b/dist/rpm/imhex.spec @@ -40,7 +40,6 @@ Provides: bundled(capstone) = 5.0-rc2 Provides: bundled(imgui) Provides: bundled(libromfs) Provides: bundled(microtar) -Provides: bundled(libpl) Provides: bundled(xdgpp) # ftbfs on these arches. armv7hl might compile when capstone 5.x @@ -128,7 +127,6 @@ cp -a lib/third_party/xdgpp/LICENSE %{buildroot %{_datadir}/pixmaps/%{name}.png %{_datadir}/applications/%{name}.desktop %{_libdir}/libimhex.so* -%{_libdir}/libpl.so* %{_libdir}/%{name}/ %{_metainfodir}/net.werwolv.%{name}.metainfo.xml