Skip to content

Commit

Permalink
Always build rizin from sources on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio committed Mar 19, 2024
1 parent 8be5271 commit 11c5890
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 23 deletions.
11 changes: 0 additions & 11 deletions .ci-scripts/ci-build-win.bat

This file was deleted.

9 changes: 9 additions & 0 deletions .ci-scripts/ci-build-win.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.ci-scripts\vsdevenv.ps1 64

$env:PATH = "$env:PATH;C:$env:HOMEPATH\AppData\Local\Programs\rizin\bin"
$env:PKG_CONFIG_PATH = "C:$env:HOMEPATH\AppData\Local\Programs\rizin\lib\pkgconfig"

meson --buildtype=release --prefix="%CD%\..\rizin" build || exit /b 666
ninja -C build install || exit /b 666
rizin.exe -e log.level=2 -Qc "Lc" || exit /b 0
rizin.exe -Qc "af ; pdd" "C:\Windows\System32\calc.exe" || exit /b 0
3 changes: 1 addition & 2 deletions .ci-scripts/ci-rizin-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
with urllib.request.urlopen('https://api.github.com/repos/rizinorg/rizin/tags?per_page=1') as f:
tags = json.load(f)
latest = tags[0]['name']
url = f"https://github.com/rizinorg/rizin/releases/download/{latest}/{file_name}"
url = url.format(version=latest)
url = f"https://github.com/rizinorg/rizin/releases/download/{latest}/rizin-src-{latest}"
else:
# dev branch always build against latest commit of rizin
url = "https://github.com/rizinorg/rizin/archive/refs/heads/dev.zip"
Expand Down
13 changes: 8 additions & 5 deletions .ci-scripts/vsdevenv.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
$bits = $args[0]
$installationPath = vswhere.exe -latest -property installationPath
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo && set" | foreach-object {
$name, $value = $_ -split '=', 2
set-content env:\"$name" $value
if (-not $installationPath -or -not (test-path "$installationPath\VC\Auxiliary\Build\vcvars$bits.bat")) {
throw "vcvars$bits.bat file not found"
}
& "${env:COMSPEC}" /s /c "`"$installationPath\VC\Auxiliary\Build\vcvars$bits.bat`" > nul 2>&1 && set" | . { process {
if ($_ -match '^([^=]+)=(.*)') {
[System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
}
}
}}
20 changes: 15 additions & 5 deletions .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,29 @@ jobs:
- name: Install dependencies
shell: bash
run: |
pip install ninja meson
pip install ninja meson PyYAML
choco install pkgconfiglite
choco install zip
- name: Install rizin
- name: Fetch rizin source
shell: bash
run: |
WORKDIR="$PWD"
cd ..
python "$WORKDIR/.ci-scripts/ci-rizin-dl.py" 'rizin-${{ matrix.release }}-{version}.zip' '${{ github.event.pull_request.base.ref || github.ref_name }}'
unzip -q rizin.zip
rm *.zip
mv rizin* rizin
mv rizin* rizin-build
cp .ci-scripts/ci-build-rizin.ps1 rizin-build/ci-build-rizin.ps1
cd "$WORKDIR"
- name: Build rizin
shell: pwsh
run: |
cd rizin-build
.\dist\windows\build_windows_installer.ps1 'vs2019_static' '64' '--default-library=static -Db_vscrt=static_from_buildtype -Dportable=true'
ls .\dist\windows\Output\
- name: Install rizin.exe
shell: pwsh
run: Start-Process -Wait -FilePath .\dist\windows\Output\rizin.exe -ArgumentList "/SP- /SILENT /CURRENTUSER" -PassThru
- name: Build & run the plugin
shell: cmd
run: .ci-scripts/ci-build-win.bat x64
shell: pwsh
run: .ci-scripts\ci-build-win.ps1 64

0 comments on commit 11c5890

Please sign in to comment.