nixpkgs/pkgs/by-name/re/renode/package.nix
Otavio Salvador 50612fec98 renode: use standard nix-update-script
We can now use standard nix-update-script but the renode-unstable still
requires the custom update script so we moved it to the specific .nix
file.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2024-03-27 13:21:32 -03:00

81 lines
1.9 KiB
Nix

{ stdenv
, lib
, fetchurl
, autoPatchelfHook
, makeWrapper
, nix-update-script
, glibcLocales
, python3Packages
, gtk-sharp-2_0
, gtk2-x11
, screen
}:
let
pythonLibs = with python3Packages; makePythonPath [
construct
psutil
pyyaml
requests
robotframework
];
in
stdenv.mkDerivation (finalAttrs: {
pname = "renode";
version = "1.15.0";
src = fetchurl {
url = "https://github.com/renode/renode/releases/download/v${finalAttrs.version}/renode-${finalAttrs.version}.linux-portable.tar.gz";
hash = "sha256-w3HKYctW1LmiAse/27Y1Gmz9hDprQ1CK7+TXIexCrkg=";
};
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
];
propagatedBuildInputs = [
gtk2-x11
gtk-sharp-2_0
screen
];
strictDeps = true;
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,libexec/renode}
mv * $out/libexec/renode
mv .renode-root $out/libexec/renode
chmod +x $out/libexec/renode/*.so
makeWrapper "$out/libexec/renode/renode" "$out/bin/renode" \
--prefix PATH : "$out/libexec/renode" \
--suffix LD_LIBRARY_PATH : "${gtk2-x11}/lib" \
--set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive"
makeWrapper "$out/libexec/renode/renode-test" "$out/bin/renode-test" \
--prefix PATH : "$out/libexec/renode" \
--prefix PYTHONPATH : "${pythonLibs}" \
--suffix LD_LIBRARY_PATH : "${gtk2-x11}/lib" \
--set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive"
substituteInPlace "$out/libexec/renode/renode-test" \
--replace '$PYTHON_RUNNER' '${python3Packages.python}/bin/python3'
runHook postInstall
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Virtual development framework for complex embedded systems";
homepage = "https://renode.io";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ otavio ];
platforms = [ "x86_64-linux" ];
};
})