Skip to content

Commit 4eb79ea

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

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

emulators/renode/Portfile

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