Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
5b1d320
Add renode-cli
MementoRC Jan 26, 2025
fca5890
(fix) remove selectors. fix typos
MementoRC Jan 27, 2025
b29216e
(fix) add tests requirements
MementoRC Jan 27, 2025
9e65189
(fix) separate arch/noarch
MementoRC Jan 28, 2025
bded9e6
(fix) update renode-cores for non-unix
MementoRC Jan 28, 2025
ab99f31
(fix) update renode-cores for non-unix
MementoRC Jan 28, 2025
c8a4e1b
(fix) use .bat for non-unix
MementoRC Jan 28, 2025
37d1d27
(wip) damn working with win is like pulling teeth
MementoRC Jan 28, 2025
3388248
(fix) use PS1
MementoRC Jan 28, 2025
e66d7d7
(ref) clean unix
MementoRC Jan 29, 2025
309d872
(fix) call 'cleaned-out' function
MementoRC Jan 29, 2025
35e9924
(fix) unix script args. permissions on non-unix
MementoRC Jan 29, 2025
4606fb7
(fix) unix typos. ppc64 not on win?
MementoRC Jan 29, 2025
51bc4e6
(wip) built non-unix till tests
MementoRC Jan 29, 2025
37927b8
(ref) clean non-unix
MementoRC Jan 29, 2025
413f1f9
(fix) tests fail?
MementoRC Jan 29, 2025
4339a60
(fix) test script: hardcode pkg_name
MementoRC Jan 30, 2025
f206438
(fix) dynamic libraries loader?
MementoRC Jan 30, 2025
cab5f38
(fix) arm64 asm code
MementoRC Jan 31, 2025
020a069
(ref) remove build.sh patch
MementoRC Jan 31, 2025
0d3e416
(dev) remove patches, switch to arch renode-cli
MementoRC Jan 31, 2025
a663b6e
(wip) solved ppc64 non-unix. Odd 'do' fail
MementoRC Jan 31, 2025
4d819f2
(wip) closing in on that wraith of an OS
MementoRC Feb 1, 2025
dc9010d
(dev) sed error?
MementoRC Feb 1, 2025
9094271
(fix) win: .so not copied to cli. arm64: clobbered
MementoRC Feb 2, 2025
b306356
(fix) win build update
MementoRC Feb 5, 2025
5a7e35c
(ref) cleanup
MementoRC Mar 11, 2025
7348f94
(fix) corect OS for licenses
MementoRC Mar 12, 2025
8f4ad8c
(wip) remove build_prefix deps
MementoRC Mar 12, 2025
055d176
(fix) update licenses copy for windows
MementoRC Mar 12, 2025
b5d391b
(ref) skip win
MementoRC Mar 13, 2025
8230d8d
(ref) odd CR ussue with patch
MementoRC Mar 13, 2025
06d557a
(fix) typo
MementoRC Mar 13, 2025
9b35d0b
(fix) link the cores?
MementoRC Mar 13, 2025
a5702cf
(fix) os mismatch
MementoRC Mar 13, 2025
5ec33b3
Update recipes/renode-cli/variants.yaml
MementoRC Mar 14, 2025
066057b
Update recipes/renode-cli/build.sh
MementoRC Mar 14, 2025
ff48eb4
Update recipes/renode-cores/variants.yaml
MementoRC Mar 14, 2025
e4af681
Update recipes/renode-cli/build.sh
MementoRC Mar 14, 2025
37ca761
(fix) removed win build to simplify review. WIP
MementoRC Mar 14, 2025
f3c635e
(fix) no win for cli
MementoRC Mar 15, 2025
a7e1892
(fix) share, not opt
MementoRC Mar 15, 2025
34ffa68
(fix) Do we need to install the tests?
MementoRC Mar 15, 2025
c2d515e
(fix) Simplify win cores to single ps1
MementoRC Mar 15, 2025
77049f7
(fix) ninja. core one build.sh
MementoRC Mar 15, 2025
f6ec8e9
(fix) missing folder
MementoRC Mar 15, 2025
ba81074
(fix) single cli build.sh
MementoRC Mar 15, 2025
9a423f1
(fix) create bin dir
MementoRC Mar 15, 2025
5c24d18
(fix) missing logic in refactor
MementoRC Mar 16, 2025
58b5444
(fix) typo
MementoRC Mar 16, 2025
253120d
(fix) ill-placed ""
MementoRC Mar 16, 2025
3a54b45
(fix) several ill-placed ""
MementoRC Mar 16, 2025
3f7b5be
(fix) consolidate build.sh. adding win scaffold
MementoRC Mar 16, 2025
17f0b53
(wip) updated windows recipe
MementoRC Mar 16, 2025
8678248
(ref) fullpath to license-files
MementoRC Mar 17, 2025
b108e6e
(ref) use _NET properties
MementoRC Mar 17, 2025
62d7e52
(wip) updated windows recipe
MementoRC Mar 18, 2025
c2494cd
(fix) sign. correct location Renode.dll
MementoRC Mar 18, 2025
4c30885
(fix) simplified build (linux passes locally)
MementoRC Mar 19, 2025
4ae7e8d
(fix) remove function
MementoRC Mar 19, 2025
1e10379
(fix) various typos
MementoRC Mar 19, 2025
8ec21af
(wip) updated windows recipe
MementoRC Mar 19, 2025
1e38438
(ref) Clean-up
MementoRC Mar 20, 2025
54146e5
(ref) consolidate patches in script
MementoRC Mar 20, 2025
d979d92
(ref) ofc
MementoRC Mar 20, 2025
b2b63e4
(ref) url/sha. python_min. CXXFLAGS.
MementoRC Mar 21, 2025
7d9b970
(ref) remove -Wno-error
MementoRC Mar 21, 2025
15fc1aa
(ref) reqs. clean-up
MementoRC Mar 22, 2025
467252d
(ref) add unclassified resources
MementoRC Mar 22, 2025
8a90f2b
(ref) tlib_helper in > 1.15.3. add renode-python-tools
MementoRC Mar 22, 2025
94c29d6
(ref) noarch can't skip (ironic?)
MementoRC Mar 22, 2025
f4ab462
(ref) non-unix install dir
MementoRC Mar 22, 2025
4f6527a
(ref) typos
MementoRC Mar 22, 2025
8dab7ee
(ref) typos
MementoRC Mar 22, 2025
20ee5ef
(ref) noarch: not installing on non-linux
MementoRC Mar 22, 2025
0fd7d79
(ref) noarch: not installing on non-linux
MementoRC Mar 22, 2025
89f1337
(ref) noarch: not installing on non-linux
MementoRC Mar 22, 2025
3852969
(ref) remove extra package
MementoRC Mar 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/renode-cli/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy Bypass -File "%RECIPE_DIR%\helpers\renode_build_with_dotnet.ps1"
if %errorlevel% neq 0 exit /b %errorlevel%
91 changes: 91 additions & 0 deletions recipes/renode-cli/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env bash

set -o xtrace -o nounset -o pipefail -o errexit

export PATH="${DOTNET_ROOT}/dotnet:${PATH}"

dotnet_version=$(dotnet --version)
framework_version=${dotnet_version%.*}

# Patch project files
find lib src tests -name "*.csproj" -exec sed -i -E "s/([>;])net6.0([<;])/\1net${framework_version}\2/g" {} \;

# Remove obj and bin directories
find . -name "obj" -o -name "bin" -type d -exec rm -rf {} +

# Fix typo in Renode_NET.sln
if [[ "${PKG_VERSION}" == "1.15.3" ]]; then
sed -i -E 's/ReleaseHeadless\|Any (.+) = Debug/ReleaseHeadless\|Any \1 = Release/' Renode_NET.sln
sed -i -E 's/GetBytes\(registers.Read\(offset\)\);/GetBytes((ushort)registers.Read(offset));/' src/Infrastructure/src/Emulator/Peripherals/Peripherals/Sensors/PAC1934.cs
sed -i -E 's/"System.Drawing.Common" Version="5.0.2"/"System.Drawing.Common" Version="5.0.3"/' lib/termsharp/TermSharp_NET.csproj lib/termsharp/xwt/Xwt.Gtk/Xwt.Gtk3_NET.csproj
else
echo "Remove these patches from the script after 1.15.3"
exit 1
fi

# Renode computes its version based upon `git rev-parse --short=8 HEAD`
sed -i -E "s/\`git rev-parse --short=8 HEAD\`/0/" ${SRC_DIR}/tools/building/createAssemblyInfo.sh

# Prepare for build
mkdir -p "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/bin/Release/lib"
ln -sf ${PREFIX}/lib/renode-cores/* "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/bin/Release/lib"

rm -f "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/translate*.cproj"

# Build with dotnet
mkdir -p "${SRC_DIR}/output/bin/Release/net${framework_version}"
cp "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/${target_platform%%-*}-properties_NET.csproj" "${SRC_DIR}/output/properties.csproj"

dotnet build \
-p:GUI_DISABLED=true \
-p:Configuration=ReleaseHeadless \
-p:GenerateFullPaths=true \
-p:Platform="Any CPU" \
${SRC_DIR}/Renode_NET.sln
echo -n "dotnet" > "${SRC_DIR}/output/bin/Release/build_type"

# Copy LLVM library (simplified logic)
LLVM_LIB="libllvm-disas"
cp "lib/resources/llvm/$LLVM_LIB$SHLIB_EXT" "${SRC_DIR}/output/bin/Release/libllvm-disas$SHLIB_EXT"

# Install procedure
mkdir -p ${PREFIX}/bin ${PREFIX}/libexec/${PKG_NAME} ${PREFIX}/share/${PKG_NAME}/{scripts,platforms,tools/sel4_extensions} ${SRC_DIR}/license-files

cp -r ${SRC_DIR}/output/bin/Release/net${framework_version}/* ${PREFIX}/libexec/${PKG_NAME}/
cp -r ${SRC_DIR}/scripts/* "${PREFIX}/share/${PKG_NAME}/scripts/"
cp -r ${SRC_DIR}/platforms/* "${PREFIX}/share/${PKG_NAME}/platforms/"
cp -r ${SRC_DIR}/tools/sel4_extensions "${PREFIX}/share/${PKG_NAME}/tools/"

# Remove Mono dynamic library
find ${PREFIX}/libexec/${PKG_NAME} -name "libMonoPosixHelper.so" -exec rm -f {} +

dotnet-project-licenses --input "$SRC_DIR/src/Renode/Renode_NET.csproj" -d "$SRC_DIR/license-files"

# Create renode script (using heredoc)
cat > "${PREFIX}/bin/renode" <<EOF
#!/bin/sh
exec "\${DOTNET_ROOT}"/dotnet exec "\${CONDA_PREFIX}"/libexec/renode-cli/Renode.dll "\$@"
EOF
chmod +x "${PREFIX}/bin/renode"

# Install tests for post-install testing
TEST_PREFIX="${SRC_DIR}/test-bundle"

mkdir -p "${TEST_PREFIX}/bin"
mkdir -p "${TEST_PREFIX}/share/${PKG_NAME}/tests"
cp -r tests/* "${TEST_PREFIX}/share/${PKG_NAME}/tests/"
cp lib/resources/styles/robot.css "${TEST_PREFIX}/share/${PKG_NAME}/tests"

sed -i "s#os\.path\.join(this_path, '\.\./lib/resources/styles/robot\.css')#os.path.join(this_path,'robot.css')#g" "${TEST_PREFIX}/share/${PKG_NAME}/tests/robot_tests_provider.py"

cat > "${TEST_PREFIX}/bin/renode-test" <<EOF
#!/usr/bin/env bash
stty_config=\$(stty -g 2>/dev/null)
python3 "\${LOCAL_TEST_PREFIX:-\${CONDA_PREFIX}}"/share/"${PKG_NAME}"/tests/run_tests.py --robot-framework-remote-server-full-directory "${CONDA_PREFIX}"/libexec/renode-cli "\$@"
result_code=\$?
if [[ -n "\${stty_config+_}" ]]; then stty "\$stty_config"; fi
exit \$result_code
EOF
chmod +x "${TEST_PREFIX}/bin/renode-test"

exit 0
108 changes: 108 additions & 0 deletions recipes/renode-cli/helpers/renode_build_with_dotnet.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
$ErrorActionPreference = "Stop"

# Get logical processors count
$cpuCount = (Get-CimInstance Win32_Processor).NumberOfLogicalProcessors

# Set environment variables (using robust expansion)
$SRC_DIR = & cmd.exe /c echo %SRC_DIR%
$PREFIX = & cmd.exe /c echo %PREFIX%
$PKG_NAME = & cmd.exe /c echo %PKG_NAME%

# Check for empty environment variables
if ([string]::IsNullOrEmpty($SRC_DIR)) { throw "SRC_DIR is empty" }
if ([string]::IsNullOrEmpty($PREFIX)) { throw "PREFIX is empty" }
if ([string]::IsNullOrEmpty($PKG_NAME)) { throw "PKG_NAME is empty" }

# Set environment variables
$env:PATH = "${env:BUILD_PREFIX}/Library/mingw-w64/bin;${env:BUILD_PREFIX}/Library/bin;${env:PREFIX}/Library/bin;${env:PREFIX}/bin;${env:PATH}"

$dotnet_version = dotnet --version

$framework_version = $dotnet_version -replace "^(\d+\.\d+).*", '$1'
@"
<Project>
<PropertyGroup>
<TargetFrameworks>net$framework_version-windows</TargetFrameworks>
</PropertyGroup>
</Project>
"@ | Set-Content "$SRC_DIR\Directory.Build.targets"

Get-ChildItem -Path . -Directory -Filter "obj" -Recurse | Remove-Item -Force -Recurse
Get-ChildItem -Path . -Directory -Filter "bin" -Recurse | Remove-Item -Force -Recurse
Remove-Item -Path "$SRC_DIR/src/Infrastructure/src/Emulator/Cores/translate*.cproj" -Force

(Get-Content $SRC_DIR/src/Infrastructure/src/UI/UI_NET.csproj) -replace "(<\/PropertyGroup>)", " <UseWPF>true</UseWPF>`n`$1" | Set-Content $SRC_DIR/src/Infrastructure/src/UI/UI_NET.csproj
if ($env:PKG_VERSION -eq "1.15.3") {
(Get-Content $SRC_DIR/Renode_NET.sln) | ForEach-Object {
$_ -replace '(ReleaseHeadless\|Any CPU\.(ActiveCfg|Build\.0) = )Debug', '$1Release'
} | Set-Content "$SRC_DIR/Renode_NET.sln"
(Get-Content $SRC_DIR/src/Infrastructure/src/Emulator/Peripherals/Peripherals/Sensors/PAC1934.cs) -replace "GetBytes\(registers.Read\(offset\)\);", "GetBytes((ushort)registers.Read(offset));" | Set-Content "$SRC_DIR/src/Infrastructure/src/Emulator/Peripherals/Peripherals/Sensors/PAC1934.cs"
(Get-Content $SRC_DIR/lib/termsharp/TermSharp_NET.csproj) -replace '"System.Drawing.Common" Version="5.0.2"', '"System.Drawing.Common" Version="5.0.3"' | Set-Content "$SRC_DIR/lib/termsharp/TermSharp_NET.csproj"
(Get-Content $SRC_DIR/lib/termsharp/xwt/Xwt.Gtk/Xwt.Gtk3_NET.csproj) -replace '"System.Drawing.Common" Version="5.0.2"', '"System.Drawing.Common" Version="5.0.3"' | Set-Content "$SRC_DIR/lib/termsharp/xwt/Xwt.Gtk/Xwt.Gtk3_NET.csproj"
} else {
Write-Host "Remove these patches from the script after 1.15.3"
exit 1
}

# Renode computes its version based upon `git rev-parse --short=8 HEAD`
(Get-Content $SRC_DIR/tools/building/createAssemblyInfo.ps1) -replace 'git rev-parse --short=8 HEAD', '"0"' | Set-Content "$SRC_DIR/tools/building/createAssemblyInfo.ps1"

# Prepare, build, and install
New-Item -ItemType Directory -Path "$SRC_DIR/src/Infrastructure/src/Emulator/Cores/bin/Release/lib", "$SRC_DIR/output/bin/Release/net$framework_version", "$PREFIX/Library/bin", "$PREFIX/Library/libexec/$PKG_NAME", "$PREFIX/Library/share/$PKG_NAME/{scripts,platforms,tools/sel4_extensions}", "$SRC_DIR/license-files" -Force | Out-Null
Copy-Item -Path "$PREFIX/Library/bin/renode-cores/*" -Destination "$SRC_DIR/src/Infrastructure/src/Emulator/Cores/bin/Release/lib" -Force
Copy-Item -Path "$SRC_DIR/src/Infrastructure/src/Emulator/Cores/windows-properties_NET.csproj" -Destination "$SRC_DIR/output/properties.csproj" -Force

$OUT_BIN_DIR = "$SRC_DIR\output\bin\Release"
"dotnet" | Out-File -FilePath "$SRC_DIR/output/bin/Release/build_type" -Encoding ascii
dotnet build -p:GUI_DISABLED=true -p:Configuration=ReleaseHeadless -p:GenerateFullPaths=true -p:Platform="Any CPU" "$SRC_DIR/Renode_NET.sln"

Copy-Item "$SRC_DIR/lib/resources/llvm/libllvm-disas.dll" "$SRC_DIR/output/bin/Release/" -Force

Copy-Item -Path "$SRC_DIR/output/bin/Release/net$framework_version-windows" -Destination "$PREFIX/Library/libexec/$PKG_NAME/" -Recurse -Force
Copy-Item -Path "$SRC_DIR/scripts" -Destination "$PREFIX/Library/share/$PKG_NAME/scripts" -Recurse -Force
Copy-Item -Path "$SRC_DIR/platforms" -Destination "$PREFIX/Library/share/$PKG_NAME/platforms" -Recurse -Force
Copy-Item -Path "$SRC_DIR/tools/sel4_extensions" -Destination "$PREFIX/Library/share/$PKG_NAME/tools/sel4_extensions" -Recurse -Force

dotnet-project-licenses --input "$SRC_DIR/src/Renode/Renode_NET.csproj" -d "$SRC_DIR/license-files" -f "txt"

# Create renode.cmd
New-Item -ItemType File -Path "$PREFIX\Library\bin\renode.cmd" -Force
@"
@echo off
call %DOTNET_ROOT%\dotnet exec %CONDA_PREFIX%\Library\libexec\renode-cli\net$framework_version-windows\Renode.dll %*
"@ | Out-File -FilePath "$PREFIX\Library\bin\renode.cmd" -Encoding ascii

# Install tests for post-install testing
$TEST_PREFIX = "$SRC_DIR/test-bundle"

mkdir -p "$TEST_PREFIX/Library/bin"
mkdir -p "$TEST_PREFIX/Library/share/$PKG_NAME/tests"
Copy-Item -Path "tests/*" -Destination "$TEST_PREFIX/Library/share/$PKG_NAME/tests" -Recurse -Force
Copy-Item -Path "lib/resources/styles/robot.css" -Destination "$TEST_PREFIX/Library/share/$PKG_NAME/tests" -Force

# Use PowerShell's -replace operator
(Get-Content "$TEST_PREFIX/Library/share/$PKG_NAME/tests/robot_tests_provider.py") | ForEach-Object { $_ -replace "os\.path\.join\(this_path, '\.\./lib/resources/styles/robot\.css'\)", "os.path.join(this_path,'robot.css')" } | Set-Content "$TEST_PREFIX/Library/share/$PKG_NAME/tests/robot_tests_provider.py"

# Create renode-test script (using PowerShell heredoc)
@"
@echo off
setlocal enabledelayedexpansion
set "STTY_CONFIG=%stty -g 2^>nul%"
IF NOT DEFINED LOCAL_TEST_PREFIX (
set "LOCAL_TEST_PREFIX=%CONDA_PREFIX%"
)
python "%LOCAL_TEST_PREFIX%\Library\share\renode-cli\tests\run_tests.py" --robot-framework-remote-server-full-directory "%CONDA_PREFIX%\Library\libexec\renode-cli" %*
set "RESULT_CODE=%ERRORLEVEL%"
if not "%STTY_CONFIG%"=="" stty "%STTY_CONFIG%"
exit /b %RESULT_CODE%
"@ | Out-File -FilePath "$TEST_PREFIX\Library\bin\renode-test.cmd" -Encoding ascii

# Terminate the dotnet processes that may hang around and prevent the build environment from being removed
try {
Get-Process -Name *dotnet* | Stop-Process
}
catch {
Write-Warning "Error removing the build environment: $_"
}

exit 0
46 changes: 46 additions & 0 deletions recipes/renode-cli/patches/update-cores.template_NET.csproj.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
--- a/src/Infrastructure/src/Emulator/Cores/cores.template_NET.csproj 2024-09-17 05:29:16.000000000 -0500
+++ b/src/Infrastructure/src/Emulator/Cores/cores.template_NET.csproj 2025-01-27 21:35:32.396468884 -0600
@@ -1,4 +1,2 @@
<Project DefaultTargets="Build">
- <UsingTask AssemblyFile="$(MSBuildProjectDirectory)/../../../../../lib/cctask/CCTask/bin/Release/net6.0/CCTask.dll" TaskName="EnvironmentTask" />
-
<PropertyGroup>
@@ -17,18 +15,9 @@

- <Target Name="CompileTranslationLib" DependsOnTargets="VerifyProperties">
- <!-- Due to a bug in some versions of xbuild we set default value of $(TargetWordSize) and $(TargetInsnStartExtraWords)
- before passing it to 'translate.cproj' as it is impossible to overwrite them later. -->
- <PropertyGroup>
- <TargetWordSize Condition=" $(TargetWordSize) == '' ">32</TargetWordSize>
- <TargetInsnStartExtraWords Condition=" $(TargetInsnStartExtraWords) == '' ">0</TargetInsnStartExtraWords>
- </PropertyGroup>
- <MSBuild Projects="./translate_NET.cproj" Properties="AdditionalCompilationFlags=$(AdditionalCompilationFlags);HostArchitecture=i386;HostEndianess=le;TargetEndianess=%(Endianess.Identity);TargetArchitecture=$(Architecture);EmulatedTarget=$(EmulatedTarget);Configuration=$(Configuration);TargetWordSize=$(TargetWordSize);TargetInsnStartExtraWords=$(TargetInsnStartExtraWords);CompilerPath=$(CompilerPath);LinkerPath=$(LinkerPath);ArPath=$(ArPath);CurrentPlatform=$(CurrentPlatform)">
- <Output TaskParameter="TargetOutputs" ItemName="TranslationLibraries" />
- </MSBuild>
- </Target>
-
- <Target Name="PrepareEmbeddedResources" BeforeTargets="ResolveReferences" DependsOnTargets="CompileTranslationLib">
+ <Target Name="PrepareEmbeddedResources" BeforeTargets="ResolveReferences" >
<ItemGroup>
- <EmbeddedResource Include="@(TranslationLibraries)">
- <LogicalName>Antmicro.Renode.%(Filename)%(Extension)</LogicalName>
+ <EmbeddedResource Include="..\Cores\bin\$(Configuration)\lib\translate-$(Architecture)-le.so" Condition=" '%(Endianess.Identity)' == 'le' ">
+ <LogicalName>Antmicro.Renode.translate-$(Architecture)-le.so</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="..\Cores\bin\$(Configuration)\lib\translate-$(Architecture)-be.so" Condition=" '%(Endianess.Identity)' == 'be' ">
+ <LogicalName>Antmicro.Renode.translate-$(Architecture)-be.so</LogicalName>
</EmbeddedResource>
@@ -36,11 +25,2 @@
</Target>
-
- <Target Name="ActualClean" DependsOnTargets="_PrepareProperties">
- <MSBuild Projects="translate_NET.cproj" Targets="Clean" />
- </Target>
-
- <!-- It is intended to have 'Clean' and 'ActualClean' targets separated.
- Thanks to this multiple calling of 'Clean' from MSBuild task will not cause
- 'ActualClean' to run more than once. -->
- <Target Name="Clean" DependsOnTargets="ActualClean" />
-</Project>
+</Project>
\ No newline at end of file
78 changes: 78 additions & 0 deletions recipes/renode-cli/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
context:
name: renode-cli
version: "1.15.3"

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
- url: https://github.com/renode/renode/releases/download/v${{ version }}/renode_${{ version }}_source.tar.xz
sha256: 40c50afe8db86a9c63f4a86b93116a6babd43bf241cfaac47b2c0d2cbc2b15a8
patches:
- patches/update-cores.template_NET.csproj.patch

build:
number: 0

requirements:
build:
- dotnet
- nuget-license
- if: unix
then:
- sed
- bash
else:
- m2-bash
- m2-coreutils
- m2-findutils
- m2-sed
host:
- dotnet
- renode-cores ==${{ version }}
run:
- dotnet

tests:
- package_contents:
bin:
- renode
files:
- ${{ "Library/" if win }}share/renode-cli/scripts/monitor.py
- ${{ "Library/" if win }}share/renode-cli/platforms/cpus/cortex-a9.repl
- ${{ "Library/" if win }}share/renode-cli/tools/sel4_extensions/seL4Extensions.cs
- script:
- renode --help
- LOCAL_TEST_PREFIX=./test-bundle test-bundle/${{ "Library/" if win }}bin/renode-test test-bundle/${{ "Library/" if win }}share/renode-cli/tests/unit-tests
requirements:
run:
- robotframework >=6.1
- psutil >=5.9.3
- python
- pyyaml >=6.0
files:
source:
- test-bundle/

about:
homepage: https://github.com/renode/renode
summary: "Antmicro's open source simulation and virtual development framework for complex embedded systems"
description: |
Renode was created by Antmicro as a virtual development tool for multi-node
embedded networks (both wired and wireless) and is intended to enable a scalable
workflow for creating effective, tested and secure IoT systems.

With Renode, developing, testing, debugging and simulating unmodified software
for IoT devices is fast, cost-effective and reliable.
license: MIT
license_file:
- LICENSE
- license-files/
documentation: https://renode.io/
repository: https://github.com/renode/renode

extra:
recipe-maintainers:
- MementoRC
- danielnachun
4 changes: 4 additions & 0 deletions recipes/renode-cores/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo on
:: powershell -NoLogo -NonInteractive -ExecutionPolicy Bypass -File "%RECIPE_DIR%\helpers\renode_build_with_cmake.ps1"
powershell -NoLogo -NonInteractive -ExecutionPolicy Bypass -Command "& { try { . '%RECIPE_DIR%\helpers\renode_build_with_cmake.ps1'; exit $LASTEXITCODE } catch { Write-Error $_; exit 1 } }"
if %errorlevel% neq 0 exit /b %errorlevel%
57 changes: 57 additions & 0 deletions recipes/renode-cores/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash

set -o xtrace -o nounset -o pipefail -o errexit

# Update CMakeLists.txt and copy license files
cp "cmake-renode-infrastructure/src/Emulator/Cores/CMakeLists.txt" "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/CMakeLists.txt"

cp cmake-tlib/CMakeLists.txt "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/tlib"
cp cmake-tlib/tcg/CMakeLists.txt "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/tlib/tcg"

cp cmake-tlib/LICENSE "${RECIPE_DIR}/tlib-LICENSE"
cp "${SRC_DIR}/src/Infrastructure/src/Emulator/Cores/tlib/softfloat-3/COPYING.txt" "${RECIPE_DIR}/softfloat-3-COPYING.txt"

export CXXFLAGS="${CXXFLAGS} -Wno-unknown-warning-option"

# Check weak implementations
pushd "${SRC_DIR}/tools/building" > /dev/null
./check_weak_implementations.sh
popd > /dev/null

CORES_PATH="${SRC_DIR}/src/Infrastructure/src/Emulator/Cores"
CORES=("arm.le" "arm.be" "arm64.le" "arm-m.le" "arm-m.be" "ppc.le" "ppc.be" "ppc64.le" "ppc64.be" "i386.le" "x86_64.le" "riscv.le" "riscv64.le" "sparc.le" "sparc.be" "xtensa.le")

for core_config in "${CORES[@]}"; do
CORE="${core_config%%.*}"
ENDIAN="${core_config##*.}"
BITS=32
[[ "$CORE" == *"64"* ]] && BITS=64

CMAKE_CONF_FLAGS=(
"-GNinja"
"-DTARGET_ARCH=$CORE"
"-DTARGET_WORD_SIZE=$BITS"
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_VERBOSE_MAKEFILE=ON"
"$CORES_PATH"
)

[[ "${target_platform}" == "osx-arm64" ]] && CMAKE_CONF_FLAGS+=("-DCMAKE_OSX_ARCHITECTURES=arm64" "-DHOST_ARCH=aarch64")
[[ "$ENDIAN" == "be" ]] && CMAKE_CONF_FLAGS+=("-DTARGET_BIG_ENDIAN=1")

CORE_DIR="$CORES_PATH/obj/Release/$CORE/$ENDIAN"
mkdir -p "$CORE_DIR"
pushd "$CORE_DIR" > /dev/null
cmake "${CMAKE_CONF_FLAGS[@]}"
cmake --build .
mkdir -p "$CORES_PATH/bin/Release/lib"
cp -u -v tlib/*.so "$CORES_PATH/bin/Release/lib/"
popd > /dev/null
done

# Install to conda path
mkdir -p "${PREFIX}/lib/${PKG_NAME}"
tar -c -C "${CORES_PATH}/bin/Release/lib" . | tar -x -C "${PREFIX}/lib/${PKG_NAME}"

exit 0

Loading