summaryrefslogtreecommitdiff
path: root/pkgs/gem5.nix
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2025-08-24 18:55:06 -0600
committerAlejandro Soto <alejandro@34project.org>2025-08-24 18:55:06 -0600
commitd7ac88762db111a7962c4e14b5f4e37ab85ccac7 (patch)
tree0c2c8c4383bef74215e3b7c48a2f6b0117f084bc /pkgs/gem5.nix
parent504589d1035f27b766bd33040b415b2725ece4ca (diff)
tree-wide: reformat using alejandra after enabling trivionomicon
Diffstat (limited to '')
-rw-r--r--pkgs/gem5.nix101
1 files changed, 51 insertions, 50 deletions
diff --git a/pkgs/gem5.nix b/pkgs/gem5.nix
index 3174553..9795c0e 100644
--- a/pkgs/gem5.nix
+++ b/pkgs/gem5.nix
@@ -1,65 +1,66 @@
-{ boost
-, lib
-, fetchFromGitHub
-, gnum4
-, gperftools
-, hdf5-cpp
-, libpng
-, protobuf
-, python3
-, scons
-, stdenv
-, zlib
-, enableHdf5 ? true
-, enableLibpng ? true
-, enableTrace ? true
-, enableSystemC ? true
-, enableTcmalloc ? true
-, gem5ISA
-}:
-let
+{
+ boost,
+ lib,
+ fetchFromGitHub,
+ gnum4,
+ gperftools,
+ hdf5-cpp,
+ libpng,
+ protobuf,
+ python3,
+ scons,
+ stdenv,
+ zlib,
+ enableHdf5 ? true,
+ enableLibpng ? true,
+ enableTrace ? true,
+ enableSystemC ? true,
+ enableTcmalloc ? true,
+ gem5ISA,
+}: let
version = "22.1.0.0";
- isa = assert lib.assertMsg (lib.elem gem5ISA [ "arm" "null" "mips" "power" "x86" ])
- "${gem5ISA} is not a valid gem5 target ISA";
+ isa = assert lib.assertMsg (lib.elem gem5ISA ["arm" "null" "mips" "power" "x86"])
+ "${gem5ISA} is not a valid gem5 target ISA";
lib.toUpper gem5ISA;
target = "build/${isa}/gem5.opt";
in
-stdenv.mkDerivation {
- pname = "gem5";
- version = "${gem5ISA}-${version}";
+ stdenv.mkDerivation {
+ pname = "gem5";
+ version = "${gem5ISA}-${version}";
- src = fetchFromGitHub {
- repo = "gem5";
- owner = "gem5";
+ src = fetchFromGitHub {
+ repo = "gem5";
+ owner = "gem5";
- rev = "v${version}";
- sha256 = "sha256-Yxag8emR6hf7oX4GAtQi/YYcKrpXicUoQg5+rjKyjc0=";
- };
+ rev = "v${version}";
+ sha256 = "sha256-Yxag8emR6hf7oX4GAtQi/YYcKrpXicUoQg5+rjKyjc0=";
+ };
- buildInputs = [ zlib ]
- ++ lib.optional enableHdf5 hdf5-cpp
- ++ lib.optional enableLibpng libpng
- ++ lib.optional enableTrace boost
- ++ lib.optional enableSystemC protobuf
- ++ lib.optional enableTcmalloc gperftools;
+ buildInputs =
+ [zlib]
+ ++ lib.optional enableHdf5 hdf5-cpp
+ ++ lib.optional enableLibpng libpng
+ ++ lib.optional enableTrace boost
+ ++ lib.optional enableSystemC protobuf
+ ++ lib.optional enableTcmalloc gperftools;
- nativeBuildInputs = [ gnum4 scons ];
+ nativeBuildInputs = [gnum4 scons];
- sconsFlags = [ target ];
+ sconsFlags = [target];
- enableParallelBuilding = true;
+ enableParallelBuilding = true;
- # Without this we get "ValueError: invalid width 0 (must be > 0)"
- COLUMNS = 80;
+ # Without this we get "ValueError: invalid width 0 (must be > 0)"
+ COLUMNS = 80;
- postPatch = ''
- patchShebangs util/
- '';
+ postPatch = ''
+ patchShebangs util/
+ '';
- installPhase = ''
- mkdir -p $out/bin/
- cp ${target} $out/bin/
- '';
-}
+ installPhase = ''
+ mkdir -p $out/bin/
+ cp ${target} $out/bin/
+ '';
+ }