bscpkgs/pkgs/nosv/default.nix

57 lines
1.0 KiB
Nix
Raw 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 ? "cfd361bd1dd30c96da405e6bbaa7e78f5f93dfda"
2021-11-30 16:18:06 +01:00
}:
with lib;
2023-05-30 15:31:12 +02:00
let
release = rec {
version = "3.1.0";
2023-05-30 15:31:12 +02:00
src = fetchFromGitHub {
owner = "bsc-pm";
repo = "nos-v";
rev = "${version}";
hash = "sha256-Pkre+ZZsREDxJLCoIoPN1HQDuUa2H1IQyKB3omg6qaU=";
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}" ];
nativeBuildInputs = [
2023-05-30 15:31:12 +02:00
autoreconfHook
pkg-config
];
buildInputs = [
2023-05-30 15:31:12 +02:00
numactl
hwloc
ovni
];
}