Add nos-v release by default

This commit is contained in:
Rodrigo Arias 2023-05-30 15:31:12 +02:00
parent 0e176cb2a9
commit d8c19eb4b4

View File

@ -2,39 +2,53 @@
stdenv stdenv
, lib , lib
, autoreconfHook , autoreconfHook
, fetchFromGitHub
, pkgconfig , pkgconfig
, numactl , numactl
, hwloc , hwloc
, ovni ? null , ovni ? null
, enableOvni ? false , useGit ? false
, gitURL ? "git@gitlab-internal.bsc.es:nos-v/nos-v.git" , gitURL ? "git@gitlab-internal.bsc.es:nos-v/nos-v.git"
, gitBranch ? "master" , gitBranch ? "master"
, gitCommit ? null , gitCommit ? "0edc81d065f20d3d2f8acf94df1d2640dc430d5e"
}: }:
with lib; with lib;
let
release = rec {
version = "1.0.0";
src = fetchFromGitHub {
owner = "bsc-pm";
repo = "nos-v";
rev = "${version}";
sha256 = "sha256-1Dsxd7OQYxnPvFnpGgCTlG9wbxV8vQpzvSy+cdPD8ro=";
};
};
git = rec {
version = src.shortRev;
src = builtins.fetchGit {
url = gitUrl;
ref = gitBranch;
rev = gitCommit;
};
};
source = if (useGit) then git else release;
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "nosv"; pname = "nosv";
version = "${src.shortRev}"; inherit (source) src version;
inherit gitURL gitCommit gitBranch; inherit gitURL gitCommit gitBranch;
src = builtins.fetchGit ({
url = gitURL;
ref = gitBranch;
} // (optionalAttrs (gitCommit != null) { rev = gitCommit; })
);
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
dontStrip = true; dontStrip = true;
configureFlags = [ "--with-ovni=${ovni}" ];
configureFlags = optional (enableOvni) "--with-ovni=${ovni}";
buildInputs = [ buildInputs = [
autoreconfHook autoreconfHook
pkgconfig pkgconfig
numactl numactl
hwloc hwloc
] ++ (optional (enableOvni) ovni); ovni
];
} }