Skip to content

Commit 2f7ed2d

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

File tree

3 files changed

+118
-0
lines changed

3 files changed

+118
-0
lines changed

emulators/renode/Portfile

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
name renode
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+
use_configure no
44+
45+
build.env-append "PATH=${prefix}/libexec/gnubin:$env(PATH)" \
46+
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
47+
PLATFORM= \
48+
CC=${configure.cc} \
49+
CXX=${configure.cxx} \
50+
"CFLAGS=${configure.cflags}" \
51+
"CXXFLAGS=${configure.cxxflags}" \
52+
"LDFLAGS=${configure.ldflags}"
53+
54+
build.cmd ./build.sh
55+
build.target
56+
build.args
57+
58+
destroot {
59+
set renode_dir ${prefix}/libexec/${name}
60+
61+
# Create directory structure
62+
xinstall -d ${destroot}${renode_dir}
63+
xinstall -d ${destroot}${renode_dir}/output
64+
65+
# Install build output
66+
copy ${worksrcpath}/output/bin ${destroot}${renode_dir}/output/bin
67+
68+
# Install tools (needed by the launcher scripts)
69+
copy ${worksrcpath}/tools ${destroot}${renode_dir}/tools
70+
71+
# Install scripts, platforms, tests
72+
copy ${worksrcpath}/scripts ${destroot}${renode_dir}/scripts
73+
copy ${worksrcpath}/platforms ${destroot}${renode_dir}/platforms
74+
copy ${worksrcpath}/tests ${destroot}${renode_dir}/tests
75+
76+
# Install lib resources (e.g. robot.css used by renode-test)
77+
copy ${worksrcpath}/lib ${destroot}${renode_dir}/lib
78+
79+
# Install the root marker file used by TryGetRootDirectory to locate built-in platforms
80+
xinstall -m 0644 ${worksrcpath}/.renode-root ${destroot}${renode_dir}/.renode-root
81+
82+
# Install the original launcher scripts
83+
xinstall -m 0755 ${worksrcpath}/renode \
84+
${destroot}${renode_dir}/renode
85+
xinstall -m 0755 ${worksrcpath}/renode-test \
86+
${destroot}${renode_dir}/renode-test
87+
88+
# The upstream renode-test hardcodes the test results directory below
89+
# ${renode_dir}/output, which is read-only once installed. Default to /tmp
90+
reinplace "s|TESTS_RESULTS=\"\$ROOT_PATH/output/tests\"|TESTS_RESULTS=\"/tmp/renode/output/tests\"|" \
91+
${destroot}${renode_dir}/renode-test
92+
93+
# Create CLI wrapper for renode
94+
xinstall -m 0755 ${filespath}/renode.sh \
95+
${destroot}${prefix}/bin/renode
96+
reinplace "s|@RENODE_DIR@|${renode_dir}|g" \
97+
${destroot}${prefix}/bin/renode
98+
99+
# Create CLI wrapper for renode-test
100+
xinstall -m 0755 ${filespath}/renode-test.sh \
101+
${destroot}${prefix}/bin/renode-test
102+
reinplace "s|@RENODE_DIR@|${renode_dir}|g" \
103+
${destroot}${prefix}/bin/renode-test
104+
}
105+
106+
notes "
107+
Renode has been installed as a CLI tool.
108+
109+
Usage:
110+
renode # launch with Monitor in the terminal
111+
renode --disable-gui # headless mode
112+
renode script.resc # run a Renode script
113+
renode-test test.robot # run Robot Framework tests
114+
"
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)