renode: init at 1.16.0
This commit is contained in:
Generated
+1192
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,199 @@
|
||||
{
|
||||
buildDotnetModule,
|
||||
cmake,
|
||||
dconf,
|
||||
dotnet-runtime_8,
|
||||
dotnet-sdk_6,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
gcc,
|
||||
glibcLocales,
|
||||
gtk3-x11,
|
||||
gtk3,
|
||||
lib,
|
||||
mono,
|
||||
nix-update-script,
|
||||
python3Packages,
|
||||
}:
|
||||
|
||||
let
|
||||
resources = fetchFromGitHub {
|
||||
owner = "renode";
|
||||
repo = "renode-resources";
|
||||
rev = "d3d69f8f17ed164ee23e46f0c06844a69bf4c004";
|
||||
hash = "sha256-wR3heL58NOQLENwCzL4lPM4KuvT/ON7dlc/KUqrlRjg=";
|
||||
};
|
||||
assemblyVersion =
|
||||
s:
|
||||
let
|
||||
part = lib.strings.splitString "-" s;
|
||||
result = builtins.head part;
|
||||
in
|
||||
result;
|
||||
|
||||
pythonLibs =
|
||||
with python3Packages;
|
||||
makePythonPath [
|
||||
construct
|
||||
psutil
|
||||
pyyaml
|
||||
requests
|
||||
tkinter
|
||||
|
||||
# from tools/csv2resd/requirements.txt
|
||||
construct
|
||||
|
||||
# from tools/execution_tracer/requirements.txt
|
||||
pyelftools
|
||||
|
||||
(robotframework.overrideDerivation (oldAttrs: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "robotframework";
|
||||
repo = "robotframework";
|
||||
rev = "v6.1";
|
||||
hash = "sha256-l1VupBKi52UWqJMisT2CVnXph3fGxB63mBVvYdM1NWE=";
|
||||
};
|
||||
patches = (oldAttrs.patches or [ ]) ++ [
|
||||
(fetchpatch {
|
||||
# utest: Improve filtering of output sugar for Python 3.13+
|
||||
name = "python3.13-support.patch";
|
||||
url = "https://github.com/robotframework/robotframework/commit/921e352556dc8538b72de1e693e2a244d420a26d.patch";
|
||||
hash = "sha256-aSaror26x4kVkLVetPEbrJG4H1zstHsNWqmwqOys3zo=";
|
||||
})
|
||||
];
|
||||
}))
|
||||
];
|
||||
|
||||
in
|
||||
buildDotnetModule rec {
|
||||
pname = "renode";
|
||||
version = "1.16.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "renode";
|
||||
repo = "renode";
|
||||
rev = "20ad06d9379997829df309c5724be94ba4effedd";
|
||||
hash = "sha256-I/W3OAzHCN8rEIlDyBwI1ZDvKfHYYBDiqE9XkWHxo7o=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
projectFile = "Renode_NET.sln";
|
||||
|
||||
dotnet-runtime = dotnet-runtime_8;
|
||||
dotnet-sdk = dotnet-sdk_6;
|
||||
|
||||
nugetDeps = ./deps.json;
|
||||
|
||||
patches = [ ./renode-test.patch ];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace tools/building/createAssemblyInfo.sh \
|
||||
--replace CURRENT_INFORMATIONAL_VERSION="`git rev-parse --short=8 HEAD`" \
|
||||
CURRENT_INFORMATIONAL_VERSION="${builtins.substring 0 8 src.rev}"
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
# https://github.com/dotnet/roslyn/issues/37379#issuecomment-513371985
|
||||
cat << EOF > Directory.Build.props
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
EOF
|
||||
|
||||
patchShebangs build.sh tools/
|
||||
|
||||
# Fixes determinism build error
|
||||
sed -i 's/AssemblyVersion("%VERSION%.*")/AssemblyVersion("${assemblyVersion version}")/g' src/Renode/Properties/AssemblyInfo.template
|
||||
sed -i 's/AssemblyVersion("1.0.*")/AssemblyVersion("1.0.0.0")/g' lib/AntShell/AntShell/Properties/AssemblyInfo.cs lib/CxxDemangler/CxxDemangler/Properties/AssemblyInfo.cs
|
||||
'';
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/38991
|
||||
# bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
|
||||
env.LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive";
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
gcc
|
||||
];
|
||||
|
||||
runtimeDeps = [
|
||||
gtk3
|
||||
mono
|
||||
];
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
enableParallelBuilding = false;
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p lib/resources
|
||||
ln -s ${resources}/* lib/resources/
|
||||
|
||||
mkdir output
|
||||
mv src/Infrastructure/src/Emulator/Cores/linux-properties.csproj output/properties.csproj
|
||||
sed -i "s#/usr/bin/gcc#${gcc}/bin/gcc#g" output/properties.csproj
|
||||
sed -i "s#/usr/bin/ar#${gcc}/bin/ar#g" output/properties.csproj
|
||||
|
||||
# To fix value "" error in element <Import>
|
||||
rm -rf src/Directory.Build.targets
|
||||
|
||||
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="$(echo $core_config | cut -d '.' -f 1)"
|
||||
ENDIAN="$(echo $core_config | cut -d '.' -f 2)"
|
||||
BITS=32
|
||||
|
||||
if [[ $CORE =~ "64" ]]; then
|
||||
BITS=64
|
||||
fi
|
||||
|
||||
SOURCE="${src}/src/Infrastructure/src/Emulator/Cores"
|
||||
CMAKE_CONF_FLAGS="-DTARGET_ARCH=$CORE -DTARGET_WORD_SIZE=$BITS -DCMAKE_BUILD_TYPE=Release -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$out/lib"
|
||||
CORE_DIR=build/$CORE/$ENDIAN
|
||||
mkdir -p $CORE_DIR
|
||||
pushd $CORE_DIR
|
||||
|
||||
if [[ $ENDIAN == "be" ]]; then
|
||||
CMAKE_CONF_FLAGS+=" -DTARGET_WORDS_BIGENDIAN=1"
|
||||
fi
|
||||
|
||||
cmake $CMAKE_CONF_FLAGS -DHOST_ARCH=i386 $SOURCE
|
||||
cmake --build . -j$NIX_BUILD_CORES
|
||||
popd
|
||||
done
|
||||
|
||||
mkdir -p src/Infrastructure/src/Emulator/Cores/bin/Release/lib
|
||||
ln -s $out/lib/*.so src/Infrastructure/src/Emulator/Cores/bin/Release/lib
|
||||
'';
|
||||
|
||||
dotnetInstallFlags = [ "-p:TargetFramework=net6.0" ];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/lib/renode
|
||||
mv * .renode-root $out/lib/renode
|
||||
|
||||
makeWrapper "$out/lib/renode/renode-test" "$out/bin/renode-test" \
|
||||
--prefix PATH : "$out/lib/renode:${lib.makeBinPath [ dotnet-sdk ]}" \
|
||||
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
|
||||
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk3-x11 ]}" \
|
||||
--prefix PYTHONPATH : "${pythonLibs}" \
|
||||
--set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \
|
||||
'';
|
||||
|
||||
executables = [ "Renode" ];
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/renode/renode/blob/${version}/CHANGELOG.rst";
|
||||
description = "Virtual development framework for complex embedded systems";
|
||||
downloadPage = "https://github.com/renode/renode";
|
||||
homepage = "https://renode.io";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ otavio ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
diff --git a/renode-test b/renode-test
|
||||
index 0f8f8d0..1fdfe23 100755
|
||||
--- a/renode-test
|
||||
+++ b/renode-test
|
||||
@@ -5,22 +5,17 @@ set -u
|
||||
# this is to support running renode-test from an external directory and via a symlink
|
||||
ROOT_PATH="$(cd $(dirname $(readlink -f $0 2>/dev/null || echo $0)); echo $PWD)"
|
||||
|
||||
-TESTS_FILE="$ROOT_PATH/tests/tests.yaml"
|
||||
-TESTS_RESULTS="$ROOT_PATH/output/tests"
|
||||
|
||||
. "${ROOT_PATH}/tools/common.sh"
|
||||
|
||||
set +e
|
||||
STTY_CONFIG=`stty -g 2>/dev/null`
|
||||
-$PYTHON_RUNNER -u "`get_path "$ROOT_PATH/tests/run_tests.py"`" --exclude "skip_${DETECTED_OS}" --exclude "skip_host_${DETECTED_ARCH}" --properties-file "`get_path "$ROOT_PATH/output/properties.csproj"`" -r "`get_path "$TESTS_RESULTS"`" -t "`get_path "$TESTS_FILE"`" "$@"
|
||||
+$PYTHON_RUNNER -u "`get_path "$ROOT_PATH/tests/run_tests.py"`" --exclude "skip_${DETECTED_OS}" -r $(pwd) --runner=dotnet "$@"
|
||||
RESULT_CODE=$?
|
||||
|
||||
set -e
|
||||
if [ -n "${STTY_CONFIG:-}" ]
|
||||
then
|
||||
- # SIGTTOU might be sent when trying to change the terminal settings when "renode-test" runs in the background so trap the signal.
|
||||
- trap "" SIGTTOU
|
||||
stty "$STTY_CONFIG"
|
||||
- trap - SIGTTOU
|
||||
fi
|
||||
exit $RESULT_CODE
|
||||
Reference in New Issue
Block a user