diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 25230847..83f65175 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -184,6 +184,7 @@ jobs: -DCUTTER_PACKAGE_DEPENDENCIES=ON \ -DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \ -DCUTTER_PACKAGE_RZ_GHIDRA=ON \ + -DCUTTER_PACKAGE_JSDEC=ON \ -DCMAKE_FRAMEWORK_PATH="$BREAKPAD_FRAMEWORK_DIR" \ -DCPACK_BUNDLE_APPLE_CERT_APP="-" \ .. && \ diff --git a/cmake/BundledRizin.cmake b/cmake/BundledRizin.cmake index d3611864..97dd461b 100644 --- a/cmake/BundledRizin.cmake +++ b/cmake/BundledRizin.cmake @@ -55,9 +55,7 @@ target_include_directories(Rizin INTERFACE "$") install(TARGETS Rizin EXPORT CutterTargets) -if (APPLE) - install(DIRECTORY "${RIZIN_INSTALL_DIR}/" DESTINATION ".") -elseif (WIN32) +if (WIN32) foreach(_lib ${RZ_LIBS} ${RZ_EXTRA_LIBS}) install(FILES "${RIZIN_INSTALL_DIR}/${RZ_INSTALL_BINPATH}/${_lib}.dll" DESTINATION "${CMAKE_INSTALL_BINDIR}") endforeach() diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt index c06ad1a0..14cc31b7 100644 --- a/dist/CMakeLists.txt +++ b/dist/CMakeLists.txt @@ -80,7 +80,19 @@ if(APPLE) get_filename_component(QT_PREFIX "${MACDEPLOYQT_PATH}/../.." ABSOLUTE) list(APPEND RZ_GHIDRA_PREFIX_PATH "${QT_PREFIX}") set(RIZIN_INSTALL_PLUGDIR "share/rizin/plugins") # escaped backslash on purpose, should be evaluated later - + + if (CUTTER_PACKAGE_JSDEC AND CUTTER_ENABLE_DEPENDENCY_DOWNLOADS) + install(CODE " + execute_process(COMMAND \"${CMAKE_CURRENT_SOURCE_DIR}/../scripts/jsdec.sh\" --prefix=\${CMAKE_INSTALL_PREFIX} + \"-Drizin_incdir=\${CMAKE_INSTALL_PREFIX}/include/librz\" + \"-Drizin_libdir=\${CMAKE_INSTALL_PREFIX}/lib\" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE SCRIPT_RESULT) + if (SCRIPT_RESULT) + message(FATAL_ERROR \"Failed to package jsdec\") + endif() + ") + endif() endif() diff --git a/dist/macos/Info.plist.in b/dist/macos/Info.plist.in index 632c03db..0da08172 100644 --- a/dist/macos/Info.plist.in +++ b/dist/macos/Info.plist.in @@ -5,7 +5,7 @@ CFBundleDisplayName Cutter CFBundleExecutable - Cutter + cutter CFBundleVersion @FULL_VERSION@ CFBundleShortVersionString diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 97af55ce..d03c9490 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -515,7 +515,7 @@ if (CUTTER_APPIMAGE_BUILD) endif() if (CUTTER_PACKAGE_JSDEC) - target_compile_definitions(Cutter PRIVATE CUTTER_APPVEYOR_JSDEC) + target_compile_definitions(Cutter PRIVATE CUTTER_BUNDLE_JSDEC) endif() if(APPLE AND CUTTER_ENABLE_PACKAGING AND CUTTER_USE_BUNDLED_RIZIN) diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index a34591d9..a63a5565 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -173,18 +173,20 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc "share/rizin/plugins/rz_ghidra_sleigh"); // Contents/Resources/rz/share/rizin/plugins/rz_ghidra_sleigh Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath()); +# ifdef CUTTER_BUNDLE_JSDEC auto jsdecHome = rzprefix; jsdecHome.cd( "share/rizin/plugins/jsdec"); // Contents/Resources/rz/share/rizin/plugins/jsdec qputenv("JSDEC_HOME", jsdecHome.absolutePath().toLocal8Bit()); +# endif } #endif -#ifdef CUTTER_APPVEYOR_JSDEC - qputenv("JSDEC_HOME", "lib\\plugins\\jsdec"); -#endif #ifdef Q_OS_WIN { +# ifdef CUTTER_BUNDLE_JSDEC + qputenv("JSDEC_HOME", "lib\\plugins\\jsdec"); +# endif auto sleighHome = QDir(QCoreApplication::applicationDirPath()); sleighHome.cd("lib/plugins/rz_ghidra_sleigh"); Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath());