bscpkgs/pkgs/nosv/default.nix

55 lines
1013 B
Nix
Raw Permalink Normal View History

2021-11-30 16:18:06 +01:00
{
stdenv
, lib
, autoreconfHook
2023-05-30 15:31:12 +02:00
, fetchFromGitHub
, pkg-config
2021-11-30 16:18:06 +01:00
, numactl
, hwloc
, ovni ? null
2023-05-30 15:31:12 +02:00
, useGit ? false
2023-07-14 16:44:24 +02:00
, gitUrl ? "git@gitlab-internal.bsc.es:nos-v/nos-v.git"
2021-11-30 16:18:06 +01:00
, gitBranch ? "master"
, gitCommit ? "f696951f62cac018bd9fd15e2fb9f34e96b185b5"
2021-11-30 16:18:06 +01:00
}:
with lib;
2023-05-30 15:31:12 +02:00
let
release = rec {
version = "2.1.1";
2023-05-30 15:31:12 +02:00
src = fetchFromGitHub {
owner = "bsc-pm";
repo = "nos-v";
rev = "${version}";
hash = "sha256-G80vaHep72iovnlIgqqjaQOYYtn83UJG7XrXnI/WO70=";
2023-05-30 15:31:12 +02:00
};
};
2021-11-30 16:18:06 +01:00
2023-05-30 15:31:12 +02:00
git = rec {
version = src.shortRev;
src = builtins.fetchGit {
url = gitUrl;
2021-11-30 16:18:06 +01:00
ref = gitBranch;
2023-05-30 15:31:12 +02:00
rev = gitCommit;
};
};
2021-11-30 16:18:06 +01:00
2023-05-30 15:31:12 +02:00
source = if (useGit) then git else release;
in
stdenv.mkDerivation rec {
pname = "nosv";
inherit (source) src version;
hardeningDisable = [ "all" ];
dontStrip = true;
separateDebugInfo = true;
2023-05-30 15:31:12 +02:00
configureFlags = [ "--with-ovni=${ovni}" ];
buildInputs = [
autoreconfHook
pkg-config
2023-05-30 15:31:12 +02:00
numactl
hwloc
ovni
];
}