Build specinvoke from source

The one contained in the CPU SPEC ISO is built for x86, and there is no
binary for RISC-V.
This commit is contained in:
Rodrigo Arias 2024-10-08 10:13:27 +02:00
parent a9e149a125
commit ce70726bf6
3 changed files with 33 additions and 2 deletions

View File

@ -14,6 +14,7 @@ final: prev:
spec-cpu-tools = final.callPackage ./pkgs/spec-cpu/tools.nix { }; spec-cpu-tools = final.callPackage ./pkgs/spec-cpu/tools.nix { };
spec-cpu = final.callPackage ./pkgs/spec-cpu/default.nix { }; spec-cpu = final.callPackage ./pkgs/spec-cpu/default.nix { };
spec-cpu-mini = final.callPackage ./pkgs/spec-cpu/mini.nix { }; spec-cpu-mini = final.callPackage ./pkgs/spec-cpu/mini.nix { };
specinvoke = final.callPackage ./pkgs/spec-cpu/specinvoke.nix { };
spec-cpu-clang = final.callPackage ./pkgs/spec-cpu/default.nix { stdenv = final.stdenvClangEpi; }; spec-cpu-clang = final.callPackage ./pkgs/spec-cpu/default.nix { stdenv = final.stdenvClangEpi; };
blis = ((prev.blis.override { blis = ((prev.blis.override {

View File

@ -2,6 +2,7 @@
stdenv stdenv
, spec-cpu , spec-cpu
, spec-cpu-tools , spec-cpu-tools
, specinvoke
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -49,9 +50,8 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin mkdir -p $out/bin
echo -e "#!$SHELL\necho $out" > $out/bin/spec-cpu-mini echo -e "#!$SHELL\necho $out" > $out/bin/spec-cpu-mini
chmod +x $out/bin/spec-cpu-mini chmod +x $out/bin/spec-cpu-mini
cp $(command -v specinvoke) $out/bin cp ${specinvoke}/bin/specinvoke $out/bin
''; '';
nativeBuildInputs = [ spec-cpu-tools ];
enableParallelBuilding = false; enableParallelBuilding = false;
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
dontStrip = true; dontStrip = true;

View File

@ -0,0 +1,30 @@
{
stdenv
, libarchive
, spec-cpu-tools
, runCommandNoCC
}:
let
version = spec-cpu-tools.version;
tar = runCommandNoCC "specinvoke-${version}.tar" {
src = spec-cpu-tools.src;
nativeBuildInputs = [ libarchive ];
} ''
mkdir iso
bsdtar -C iso -xf $src
cp iso/install_archives/tools-src.tar $out
'';
in stdenv.mkDerivation {
pname = "specinvoke";
version = version;
src = tar;
sourceRoot = "tools/src/specinvoke/";
# Almost no bugs
preInstall = ''
mkdir -p $out/bin
'';
enableParallelBuilding = false;
hardeningDisable = [ "all" ];
dontStrip = true;
}