2021-11-30 15:58:58 +01:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, lib
|
|
|
|
, cmake
|
|
|
|
, mpi
|
2023-05-30 16:44:39 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, useGit ? false
|
2021-11-30 15:58:58 +01:00
|
|
|
, gitBranch ? "master"
|
2023-09-06 16:20:59 +02:00
|
|
|
, gitUrl ? "ssh://git@bscpm03.bsc.es/rarias/ovni.git"
|
2023-05-30 16:44:39 +02:00
|
|
|
, gitCommit ? "d0a47783f20f8b177a48418966dae45454193a6a"
|
|
|
|
, enableDebug ? false
|
2021-11-30 15:58:58 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2023-05-30 16:44:39 +02:00
|
|
|
let
|
|
|
|
release = rec {
|
2023-07-26 16:00:02 +02:00
|
|
|
version = "1.2.2";
|
2023-05-30 16:44:39 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bsc-pm";
|
|
|
|
repo = "ovni";
|
|
|
|
rev = "${version}";
|
2023-07-26 16:00:02 +02:00
|
|
|
sha256 = "sha256-Hf6aeUN/uElfA9Lzzrejffb8RA6lcZQytqBdmIiBBJk=";
|
2023-05-30 16:44:39 +02:00
|
|
|
};
|
|
|
|
};
|
2021-11-30 15:58:58 +01:00
|
|
|
|
2023-05-30 16:44:39 +02:00
|
|
|
git = rec {
|
|
|
|
version = src.shortRev;
|
|
|
|
src = builtins.fetchGit {
|
|
|
|
url = gitUrl;
|
|
|
|
ref = gitBranch;
|
|
|
|
rev = gitCommit;
|
|
|
|
};
|
|
|
|
};
|
2021-11-30 15:58:58 +01:00
|
|
|
|
2023-05-30 16:44:39 +02:00
|
|
|
source = if (useGit) then git else release;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ovni";
|
|
|
|
inherit (source) src version;
|
|
|
|
buildInputs = [ cmake mpi ];
|
|
|
|
cmakeBuildType = if (enableDebug) then "Debug" else "Release";
|
|
|
|
dontStrip = true;
|
|
|
|
}
|