2022-06-07 23:18:43 +00:00
|
|
|
$dist = $args[0]
|
|
|
|
$cmake_opts = $args[1]
|
|
|
|
$python = Split-Path((Get-Command python.exe).Path)
|
|
|
|
|
|
|
|
if (-not (Test-Path -Path 'rz_libyara' -PathType Container)) {
|
2024-04-22 07:22:09 +00:00
|
|
|
git clone https://github.com/rizinorg/rz-libyara.git --depth 1 --branch main rz_libyara
|
2022-06-07 23:18:43 +00:00
|
|
|
git -C rz_libyara submodule init
|
|
|
|
git -C rz_libyara submodule update
|
|
|
|
}
|
|
|
|
cd rz_libyara
|
2023-06-20 08:40:57 +00:00
|
|
|
& meson.exe --buildtype=release --prefix=$dist -Duse_sys_yara=disabled -Denable_openssl=false build
|
2022-06-07 23:18:43 +00:00
|
|
|
ninja -C build install
|
2023-06-20 08:40:57 +00:00
|
|
|
$pathdll = "$dist\lib\rizin\plugins\rz_yara.dll"
|
2022-06-07 23:18:43 +00:00
|
|
|
if(![System.IO.File]::Exists($pathdll)) {
|
|
|
|
type build/meson-logs/meson-log.txt
|
2023-06-20 08:40:57 +00:00
|
|
|
ls "$dist\lib\rizin\plugins\"
|
2022-06-07 23:18:43 +00:00
|
|
|
throw (New-Object System.IO.FileNotFoundException("File not found: $pathdll", $pathdll))
|
|
|
|
}
|
2023-06-20 08:40:57 +00:00
|
|
|
Remove-Item -Recurse -Force "$dist\lib\rizin\plugins\rz_yara.lib"
|
2022-06-07 23:18:43 +00:00
|
|
|
|
|
|
|
cd cutter-plugin
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DRIZIN_INSTALL_PLUGDIR="../build" -DCMAKE_INSTALL_PREFIX="$dist" $cmake_opts ..
|
|
|
|
ninja
|
|
|
|
ninja install
|