Adjust r2 paths (#2338)

This commit is contained in:
karliss 2020-08-08 18:43:43 +03:00 committed by GitHub
parent 32adf0b5ba
commit 724d3f26b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 24 deletions

View File

@ -40,9 +40,10 @@ install:
- cmd: set "PATH=%CD%;%PYTHON%;%PATH%"
- cmd: call "%VSVARSALLPATH%" %ARCH%
- cmd: if "%USE_APPVEYOR_QT%" == "false" ( set "QTPATH=%APPVEYOR_BUILD_FOLDER%\%QTPATH%" )
- cmd: set "PATH=%QTPATH%\bin;%PATH%"
- cmd: set "PATH=%QTPATH%\bin;%PYTHON%\Scripts\;%PATH%"
- cmd: echo %PATH%
- cmd: python -m pip install meson==0.52
- cmd: where meson.exe
- cmd: powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget %NINJA_URL% -OutFile ninja.zip; Expand-Archive .\ninja.zip -DestinationPath ."
# Artifacts
- cmd: set "ARTIFACT_NAME=Cutter-v1.11.0-%ARCH%.Windows"
@ -56,11 +57,11 @@ before_build:
build_script:
- cmd: if defined QMAKE ( call prepare_r2.bat )
- cmd: if defined QMAKE ( C:\msys64\usr\bin\bash -lc "export PATH=\"/c/msys64/usr/bin:$PATH\" && cd \"$APPVEYOR_BUILD_FOLDER\" && scripts/appveyor_r2ghidra.sh" )
- cmd: if defined QMAKE ( call build.bat CUTTER_APPVEYOR_R2DEC=true CUTTER_R2GHIDRA_STATIC=true R2GHIDRA_SOURCE="%APPVEYOR_BUILD_FOLDER%/r2ghidra-dec" R2GHIDRA_INSTALL_PATH="%APPVEYOR_BUILD_FOLDER%/r2_dist_%ARCH%/radare2/lib/plugins" CUTTER_ENABLE_CRASH_REPORTS=true CUTTER_ENABLE_PYTHON=true CUTTER_ENABLE_PYTHON_BINDINGS=true CUTTER_DEPS_DIR="%CUTTER_DEPS_DIR%" )
- cmd: if defined QMAKE ( call build.bat CUTTER_APPVEYOR_R2DEC=true CUTTER_R2GHIDRA_STATIC=true R2GHIDRA_SOURCE="%APPVEYOR_BUILD_FOLDER%/r2ghidra-dec" R2GHIDRA_INSTALL_PATH="%APPVEYOR_BUILD_FOLDER%/r2_dist/lib/plugins" CUTTER_ENABLE_CRASH_REPORTS=true CUTTER_ENABLE_PYTHON=true CUTTER_ENABLE_PYTHON_BINDINGS=true CUTTER_DEPS_DIR="%CUTTER_DEPS_DIR%" )
- cmd: if defined MESON ( python meson.py --release --dist=%ARTIFACT_PATH% --backend=%BACKEND% --python )
after_build:
- cmd: if defined QMAKE ( set "PATH=%CD%\r2_dist_%ARCH%\bin;%PATH%" && powershell scripts\bundle_r2dec.ps1 "%CD%\%ARTIFACT_PATH%" )
- cmd: if defined QMAKE ( set "PATH=%CD%\r2_dist\bin;%PATH%" && powershell scripts\bundle_r2dec.ps1 "%CD%\%ARTIFACT_PATH%" )
#- cmd: if defined QMAKE ( C:\msys64\usr\bin\bash -lc "export PATH=\"/c/msys64/usr/bin:$PATH\" && cd \"$APPVEYOR_BUILD_FOLDER\" && scripts/appveyor_r2ghidra.sh" )
#- cmd: powershell scripts\bundle_openssl.ps1 %ARCH% "%CD%\%ARTIFACT_PATH%"
- cmd: powershell scripts\bundle_python.ps1 %ARCH% "%CD%\%ARTIFACT_PATH%"

View File

@ -10,7 +10,7 @@ IF !ERRORLEVEL! NEQ 0 (
EXIT /B 1
)
SET "R2DIST=r2_dist_%PLATFORM%"
SET "R2DIST=r2_dist"
SET "BUILDDIR=build_%PLATFORM%"
SET "BREAKPAD_SOURCE_DIR=%CD%\src\breakpad\src\src"
@ -36,8 +36,9 @@ IF !ERRORLEVEL! NEQ 0 EXIT /B 1
ECHO Deploying cutter
MKDIR cutter
COPY release\cutter.exe cutter\cutter.exe
XCOPY /S /I ..\%R2DIST%\radare2 cutter\radare2
DEL cutter\radare2\lib\*.lib
XCOPY /S /I ..\%R2DIST%\share cutter\share
XCOPY /S /I ..\%R2DIST%\lib cutter\lib
DEL cutter\lib\*.lib
COPY ..\%R2DIST%\bin\*.dll cutter\
windeployqt cutter\cutter.exe
FOR %%i in (..\src\translations\*.qm) DO MOVE "%%~fi" cutter\translations

View File

@ -10,11 +10,13 @@ IF !ERRORLEVEL! NEQ 0 (
)
SET "PATH=%CD%;%PATH%"
SET "R2DIST=r2_dist_%PLATFORM%"
SET "R2DIST=r2_dist"
ECHO Building radare2 (%PLATFORM%)
CD radare2
git clean -xfd
RMDIR /S /Q ..\%R2DIST%
python sys\meson.py --release --shared --install=..\%R2DIST% --options "r2_datdir=radare2/share" "r2_libdir=radare2/lib" "c_args=-D_UNICODE -DUNICODE"
rem python sys\meson.py --release --shared --install=..\%R2DIST% --options "r2_datdir=radare2/share" "r2_libdir=radare2/lib" #"c_args=-D_UNICODE -DUNICODE"
meson.exe r2_builddir --buildtype=release --prefix=%CD%\..\%R2DIST% || EXIT /B 1
ninja -C r2_builddir install || EXIT /B 1
IF !ERRORLEVEL! NEQ 0 EXIT /B 1

View File

@ -3,6 +3,6 @@
scripts/r2ghidra.sh \
-DCMAKE_C_COMPILER=cl \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH;$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH/radare2;$QT64PATH" \
-DCMAKE_INSTALL_PREFIX="$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH/radare2" \
-DRADARE2_INSTALL_PLUGDIR="$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH/radare2/lib/plugins"
-DCMAKE_PREFIX_PATH="$APPVEYOR_BUILD_FOLDER/r2_dist;$APPVEYOR_BUILD_FOLDER/r2_dist/include/libr;$QT64PATH" \
-DCMAKE_INSTALL_PREFIX="$APPVEYOR_BUILD_FOLDER/r2_dist" \
-DRADARE2_INSTALL_PLUGDIR="$APPVEYOR_BUILD_FOLDER/r2_dist/lib/plugins"

View File

@ -3,6 +3,6 @@ $python = Split-Path((Get-Command python.exe).Path)
git clone https://github.com/wargio/r2dec-js.git
cd r2dec-js
& $python\Scripts\meson.exe --buildtype=release -Dc_args=-DDUK_USE_DATE_NOW_WINDOWS --prefix=$dist\radare2 --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
Remove-Item -Recurse -Force $dist\radare2\lib\plugins\core_pdd.lib
Remove-Item -Recurse -Force $dist\lib\plugins\core_pdd.lib

View File

@ -144,9 +144,6 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
mainWindow->openNewFile(clOptions.fileOpenOptions, askOptions);
}
#ifdef CUTTER_APPVEYOR_R2DEC
qputenv("R2DEC_HOME", "radare2\\lib\\plugins\\r2dec-js");
#endif
#ifdef APPIMAGE
{
@ -179,10 +176,13 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
}
#endif
#ifdef CUTTER_APPVEYOR_R2DEC
qputenv("R2DEC_HOME", "lib\\plugins\\r2dec-js");
#endif
#ifdef Q_OS_WIN
{
auto sleighHome = QDir(QCoreApplication::applicationDirPath());
sleighHome.cd("radare2/lib/plugins/r2ghidra_sleigh");
sleighHome.cd("lib/plugins/r2ghidra_sleigh");
Core()->setConfig("r2ghidra.sleighhome", sleighHome.absolutePath());
}
#endif

View File

@ -1,13 +1,8 @@
win32 {
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
DEFINES += _CRT_SECURE_NO_WARNINGS
!contains(QT_ARCH, x86_64) {
LIBS += -L"$$PWD/../r2_dist_x86/radare2/lib"
R2_INCLUDEPATH += "$$PWD/../r2_dist_x86/include"
} else {
LIBS += -L"$$PWD/../r2_dist_x64/radare2/lib"
R2_INCLUDEPATH += "$$PWD/../r2_dist_x64/include"
}
LIBS += -L"$$PWD/../r2_dist/lib"
R2_INCLUDEPATH += "$$PWD/../r2_dist/include/libr"
INCLUDEPATH += $$R2_INCLUDEPATH
LIBS += \