diff --git a/.appveyor.yml b/.appveyor.yml index ef808a75..e008c1ff 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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%" diff --git a/build.bat b/build.bat index 039d9819..7cba2a14 100644 --- a/build.bat +++ b/build.bat @@ -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 diff --git a/prepare_r2.bat b/prepare_r2.bat index 85b8e0fe..4d3db8c3 100644 --- a/prepare_r2.bat +++ b/prepare_r2.bat @@ -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 diff --git a/scripts/appveyor_r2ghidra.sh b/scripts/appveyor_r2ghidra.sh index 5b479604..b54fab1d 100755 --- a/scripts/appveyor_r2ghidra.sh +++ b/scripts/appveyor_r2ghidra.sh @@ -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" \ No newline at end of file + -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" \ No newline at end of file diff --git a/scripts/bundle_r2dec.ps1 b/scripts/bundle_r2dec.ps1 index bba02940..2e3ded1b 100644 --- a/scripts/bundle_r2dec.ps1 +++ b/scripts/bundle_r2dec.ps1 @@ -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 diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index ec1c5f95..299e7191 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -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 diff --git a/src/lib_radare2.pri b/src/lib_radare2.pri index 7af051fc..8b61d2c2 100644 --- a/src/lib_radare2.pri +++ b/src/lib_radare2.pri @@ -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 += \