Skip to content

Commit 86871e4

Browse files
committed
renode: new port (1.16.1)
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 1502a69 commit 86871e4

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed

emulators/renode/Portfile

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2+
3+
PortSystem 1.0
4+
PortGroup github 1.0
5+
PortGroup makefile 1.0
6+
7+
github.setup renode renode 1.16.1 v
8+
github.tarball_from releases
9+
10+
revision 0
11+
categories emulators devel
12+
license MIT
13+
maintainers {pguyot @pguyot} openmaintainer
14+
15+
description Virtual development framework for embedded systems
16+
17+
long_description Renode is an open source virtual development framework \
18+
for complex embedded systems. It simulates SoCs, sensors, \
19+
and other hardware, letting you run unmodified firmware \
20+
binaries on your workstation. Supports ARM, RISC-V, \
21+
SPARC, x86, Xtensa, POWER and more.
22+
23+
homepage https://renode.io
24+
25+
distname renode_${version}_source
26+
use_xz yes
27+
28+
checksums rmd160 1162c3be17e823c83a1460a3963b8703f76b683e \
29+
sha256 fefe9a495cb54af09f13a93a863b6cad027f7ddc8854921efa6e42d9fbcd9888 \
30+
size 240071476
31+
32+
platforms {darwin >= 21}
33+
supported_archs x86_64 arm64
34+
35+
depends_build-append \
36+
port:dotnet-sdk-8 \
37+
path:bin/cmake:cmake \
38+
port:coreutils
39+
40+
depends_run-append port:dotnet-cli \
41+
port:dotnet-runtime-8
42+
43+
makefile.override {}
44+
makefile.has_destdir no
45+
46+
build.env-append "PATH=${prefix}/libexec/gnubin:$env(PATH)" \
47+
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
48+
PLATFORM=
49+
50+
build.cmd ./build.sh
51+
build.target
52+
build.args
53+
54+
destroot {
55+
set renode_dir ${prefix}/libexec/${name}
56+
57+
# Create directory structure
58+
xinstall -d ${destroot}${renode_dir}
59+
xinstall -d ${destroot}${renode_dir}/output
60+
61+
# Install build output
62+
copy ${worksrcpath}/output/bin ${destroot}${renode_dir}/output/bin
63+
64+
# Install tools (needed by the launcher scripts)
65+
copy ${worksrcpath}/tools ${destroot}${renode_dir}/tools
66+
67+
# Install scripts, platforms, tests
68+
copy ${worksrcpath}/scripts ${destroot}${renode_dir}/scripts
69+
copy ${worksrcpath}/platforms ${destroot}${renode_dir}/platforms
70+
copy ${worksrcpath}/tests ${destroot}${renode_dir}/tests
71+
72+
# Install lib resources (e.g. robot.css used by renode-test)
73+
copy ${worksrcpath}/lib ${destroot}${renode_dir}/lib
74+
75+
# Install the root marker file used by TryGetRootDirectory to locate built-in platforms
76+
xinstall -m 0644 ${worksrcpath}/.renode-root ${destroot}${renode_dir}/.renode-root
77+
78+
# Install the original launcher scripts
79+
xinstall -m 0755 ${worksrcpath}/renode \
80+
${destroot}${renode_dir}/renode
81+
xinstall -m 0755 ${worksrcpath}/renode-test \
82+
${destroot}${renode_dir}/renode-test
83+
84+
# The upstream renode-test hardcodes the test results directory below
85+
# ${renode_dir}/output, which is read-only once installed. Default to /tmp
86+
reinplace "s|TESTS_RESULTS=\"\$ROOT_PATH/output/tests\"|TESTS_RESULTS=\"/tmp/renode/output/tests\"|" \
87+
${destroot}${renode_dir}/renode-test
88+
89+
# Create CLI wrapper for renode
90+
xinstall -m 0755 ${filespath}/renode.sh \
91+
${destroot}${prefix}/bin/renode
92+
reinplace "s|@RENODE_DIR@|${renode_dir}|g" \
93+
${destroot}${prefix}/bin/renode
94+
95+
# Create CLI wrapper for renode-test
96+
xinstall -m 0755 ${filespath}/renode-test.sh \
97+
${destroot}${prefix}/bin/renode-test
98+
reinplace "s|@RENODE_DIR@|${renode_dir}|g" \
99+
${destroot}${prefix}/bin/renode-test
100+
}
101+
102+
notes "
103+
Renode has been installed as a CLI tool.
104+
105+
Usage:
106+
renode # launch with Monitor in the terminal
107+
renode --disable-gui # headless mode
108+
renode script.resc # run a Renode script
109+
renode-test test.robot # run Robot Framework tests
110+
"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec "@RENODE_DIR@/renode-test" "$@"

emulators/renode/files/renode.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec "@RENODE_DIR@/renode" "$@"

0 commit comments

Comments
 (0)