Add JSDec packaging for macos. (#2580)

This commit is contained in:
karliss 2021-02-18 16:36:27 +02:00 committed by GitHub
parent 4501a6ba44
commit 0553d3ffdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 9 deletions

View File

@ -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="-" \
.. && \

View File

@ -55,9 +55,7 @@ target_include_directories(Rizin INTERFACE
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/librz>")
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()

12
dist/CMakeLists.txt vendored
View File

@ -81,6 +81,18 @@ if(APPLE)
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()

View File

@ -5,7 +5,7 @@
<key>CFBundleDisplayName</key>
<string>Cutter</string>
<key>CFBundleExecutable</key>
<string>Cutter</string>
<string>cutter</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<key>CFBundleShortVersionString</key>

View File

@ -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)

View File

@ -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());