mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
Add cmake script for packaging r2dec on windows. (#2425)
This commit is contained in:
parent
38b317e619
commit
c49cbc9f01
1
.github/workflows/ccpp.yml
vendored
1
.github/workflows/ccpp.yml
vendored
@ -124,6 +124,7 @@ jobs:
|
|||||||
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON ^
|
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON ^
|
||||||
-DCUTTER_PACKAGE_DEPENDENCIES=ON ^
|
-DCUTTER_PACKAGE_DEPENDENCIES=ON ^
|
||||||
-DCUTTER_PACKAGE_R2GHIDRA=ON ^
|
-DCUTTER_PACKAGE_R2GHIDRA=ON ^
|
||||||
|
-DCUTTER_PACKAGE_R2DEC=ON ^
|
||||||
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
|
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
|
||||||
-DCUTTER_ENABLE_CRASH_REPORTS=ON ^
|
-DCUTTER_ENABLE_CRASH_REPORTS=ON ^
|
||||||
-DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^
|
-DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
$dist = $args[0]
|
$dist = $args[0]
|
||||||
$python = Split-Path((Get-Command python.exe).Path)
|
$python = Split-Path((Get-Command python.exe).Path)
|
||||||
|
|
||||||
git clone https://github.com/radareorg/r2dec-js.git
|
if (-not (Test-Path -Path 'r2dec-js' -PathType Container)) {
|
||||||
|
git clone https://github.com/radareorg/r2dec-js.git --branch master --depth 1
|
||||||
|
}
|
||||||
cd r2dec-js
|
cd r2dec-js
|
||||||
git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
|
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
|
||||||
& meson.exe --buildtype=release -Dc_args=-DDUK_USE_DATE_NOW_WINDOWS --prefix=$dist --libdir=lib\plugins --datadir=lib\plugins p build
|
& meson.exe --buildtype=release -Dc_args=-DDUK_USE_DATE_NOW_WINDOWS --prefix=$dist --libdir=lib\plugins --datadir=lib\plugins p build
|
||||||
ninja -C build install
|
ninja -C build install
|
||||||
Remove-Item -Recurse -Force $dist\lib\plugins\core_pdd.lib
|
Remove-Item -Recurse -Force $dist\lib\plugins\core_pdd.lib
|
||||||
|
@ -7,10 +7,10 @@ SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
|
|||||||
cd "$SCRIPTPATH/.."
|
cd "$SCRIPTPATH/.."
|
||||||
|
|
||||||
if [[ ! -d r2dec-js ]]; then
|
if [[ ! -d r2dec-js ]]; then
|
||||||
git clone https://github.com/wargio/r2dec-js.git
|
git clone https://github.com/radareorg/r2dec-js.git --depth 1 --branch master
|
||||||
cd r2dec-js
|
#cd r2dec-js
|
||||||
git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
|
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
|
||||||
cd ..
|
#cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd r2dec-js
|
cd r2dec-js
|
||||||
|
@ -24,6 +24,7 @@ set(CUTTER_EXTRA_PLUGIN_DIRS "" CACHE STRING "List of addition plugin locations"
|
|||||||
option(CUTTER_ENABLE_DEPENDENCY_DOWNLOADS "Enable downloading of dependencies. Setting to OFF doesn't affect any downloads done by r2 build." OFF)
|
option(CUTTER_ENABLE_DEPENDENCY_DOWNLOADS "Enable downloading of dependencies. Setting to OFF doesn't affect any downloads done by r2 build." OFF)
|
||||||
option(CUTTER_PACKAGE_DEPENDENCIES "During install step include the third party dependencies." OFF)
|
option(CUTTER_PACKAGE_DEPENDENCIES "During install step include the third party dependencies." OFF)
|
||||||
option(CUTTER_PACKAGE_R2GHIDRA "Compile and install r2ghidra during install step." OFF)
|
option(CUTTER_PACKAGE_R2GHIDRA "Compile and install r2ghidra during install step." OFF)
|
||||||
|
option(CUTTER_PACKAGE_R2DEC "Compile and install r2dec during install step." OFF)
|
||||||
|
|
||||||
if(NOT CUTTER_ENABLE_PYTHON)
|
if(NOT CUTTER_ENABLE_PYTHON)
|
||||||
set(CUTTER_ENABLE_PYTHON_BINDINGS OFF)
|
set(CUTTER_ENABLE_PYTHON_BINDINGS OFF)
|
||||||
@ -263,6 +264,10 @@ if (CUTTER_APPIMAGE_BUILD)
|
|||||||
target_compile_definitions(Cutter PRIVATE APPIMAGE)
|
target_compile_definitions(Cutter PRIVATE APPIMAGE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (CUTTER_PACKAGE_R2DEC)
|
||||||
|
target_compile_definitions(Cutter PRIVATE CUTTER_APPVEYOR_R2DEC)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(Translations)
|
include(Translations)
|
||||||
|
|
||||||
# Install files
|
# Install files
|
||||||
|
@ -12,7 +12,7 @@ if(WIN32)
|
|||||||
install(FILES ${CUTTER_DEPS}/pyside/bin/shiboken2.abi3.dll ${CUTTER_DEPS}/pyside/bin/pyside2.abi3.dll DESTINATION .)
|
install(FILES ${CUTTER_DEPS}/pyside/bin/shiboken2.abi3.dll ${CUTTER_DEPS}/pyside/bin/pyside2.abi3.dll DESTINATION .)
|
||||||
endif()
|
endif()
|
||||||
install(SCRIPT cmake/WindowsBundleQt.cmake)
|
install(SCRIPT cmake/WindowsBundleQt.cmake)
|
||||||
|
endif()
|
||||||
if (CUTTER_PACKAGE_R2GHIDRA)
|
if (CUTTER_PACKAGE_R2GHIDRA)
|
||||||
if (CUTTER_ENABLE_DEPENDENCY_DOWNLOADS)
|
if (CUTTER_ENABLE_DEPENDENCY_DOWNLOADS)
|
||||||
# Currently using external project only for downloading source
|
# Currently using external project only for downloading source
|
||||||
@ -53,6 +53,17 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
|
if (CUTTER_PACKAGE_R2DEC AND CUTTER_ENABLE_DEPENDENCY_DOWNLOADS)
|
||||||
|
install(CODE "
|
||||||
|
set(ENV{R_ALT_SRC_DIR} 1)
|
||||||
|
set(ENV{PATH} \"\${CMAKE_INSTALL_PREFIX};\$ENV{PATH}\")
|
||||||
|
execute_process(COMMAND powershell ../scripts/bundle_r2dec.ps1 \"\${CMAKE_INSTALL_PREFIX}\"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
RESULT_VARIABLE SCRIPT_RESULT)
|
||||||
|
if (SCRIPT_RESULT)
|
||||||
|
message(FATAL_ERROR \"Failed to package r2dec\")
|
||||||
|
endif()
|
||||||
|
")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
Loading…
Reference in New Issue
Block a user