Skip to content

Instantly share code, notes, and snippets.

@binarycraft007
Last active March 30, 2026 13:13
Show Gist options
  • Select an option

  • Save binarycraft007/a6353ada054c492b67c0a04ddd4c214a to your computer and use it in GitHub Desktop.

Select an option

Save binarycraft007/a6353ada054c492b67c0a04ddd4c214a to your computer and use it in GitHub Desktop.
PKGBUILD for renode
# Maintainer: Elliot <elliot@example.com>
pkgname=renode
pkgver=1.16.1
pkgrel=1
pkgdesc="The Renode Framework"
arch=('x86_64' 'aarch64')
url="https://renode.io"
license=('MIT')
options=(!strip !debug)
depends=('dotnet-runtime-8.0' 'python' 'python-pip' 'screen' 'gcc')
makedepends=('dotnet-sdk-8.0' 'cmake' 'git' 'python')
#source=("$pkgname-$pkgver::git+https://github.com/renode/renode#tag=v${pkgver}")
source=("$pkgname-$pkgver::git+https://github.com/renode/renode#commit=293fabb776e346d4e775925e35f74f8a3345c9d7")
sha256sums=('SKIP')
prepare() {
cd "$pkgname-$pkgver"
git submodule update --init --recursive
}
build() {
cd "$pkgname-$pkgver"
# 1. Build using build.sh to handle external libraries and submodules
./build.sh --no-gui
# 2. Publish the dotnet part
# We use the same flags as build.sh would use.
# TFM is net8.0 as per build.sh default for --net
dotnet publish -maxcpucount:1 -f net8.0 -p:Configuration=Release -p:NET=true Renode_NET.sln
}
package() {
cd "$pkgname-$pkgver"
local _installdir="/opt/renode"
local _target="Release"
# Prepare directories
install -d "$pkgdir/$_installdir/bin"
install -d "$pkgdir/usr/bin"
# 1. Copy publish results
cp -r output/bin/$_target/publish/* "$pkgdir/$_installdir/bin/"
# 2. Copy libllvm-disas if it wasn't picked up by publish
if [ -f "output/bin/$_target/libllvm-disas.so" ]; then
cp "output/bin/$_target/libllvm-disas.so" "$pkgdir/$_installdir/bin/"
fi
# 3. Copy tests, scripts, platforms, tools
cp -r tests "$pkgdir/$_installdir/"
cp -r scripts "$pkgdir/$_installdir/"
cp -r platforms "$pkgdir/$_installdir/"
cp -r tools "$pkgdir/$_installdir/"
cp .renode-root "$pkgdir/$_installdir/"
# 4. Create renode and renode-test scripts
# Renode script
cat <<EOF > "$pkgdir/usr/bin/renode"
#!/usr/bin/env bash
dotnet /opt/renode/bin/Renode.dll --console "\$@"
EOF
chmod +x "$pkgdir/usr/bin/renode"
# Renode-test script
# We adapt the existing renode-test script similar to how make_linux_package.sh does
install -m755 renode-test "$pkgdir/usr/bin/renode-test"
sed -i 's#tools/##' "$pkgdir/usr/bin/renode-test"
sed -i 's#tests/run_tests.py#run_tests.py#' "$pkgdir/usr/bin/renode-test"
sed -i 's#--properties-file.*#--robot-framework-remote-server-full-directory='"$_installdir"'/bin --css-file='"$_installdir"'/tests/robot.css -r $(pwd) --runner=dotnet "$@"#' "$pkgdir/usr/bin/renode-test"
sed -i "s#^ROOT_PATH=\".*#ROOT_PATH=\"$_installdir/tests\"#g" "$pkgdir/usr/bin/renode-test"
sed -i '/TESTS_FILE/d' "$pkgdir/usr/bin/renode-test"
sed -i '/TESTS_RESULTS/d' "$pkgdir/usr/bin/renode-test"
# 5. Licenses
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment