From f5dcaf831b03b14477bcff31a5c8440466e97d45 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 30 May 2023 16:44:39 +0200 Subject: [PATCH] Update ovni to release and add useGit option --- bsc/ovni/default.nix | 48 ++++++++++++++++++++++++++++---------------- overlay.nix | 4 ---- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/bsc/ovni/default.nix b/bsc/ovni/default.nix index 1f1654b..49fc847 100644 --- a/bsc/ovni/default.nix +++ b/bsc/ovni/default.nix @@ -3,28 +3,42 @@ , lib , cmake , mpi +, fetchFromGitHub +, useGit ? false , gitBranch ? "master" , gitURL ? "ssh://git@bscpm03.bsc.es/rarias/ovni.git" -, gitCommit ? null -# By default use debug -, enableDebug ? true +, gitCommit ? "d0a47783f20f8b177a48418966dae45454193a6a" +, enableDebug ? false }: with lib; -stdenv.mkDerivation rec { - pname = "ovni"; - version = "${src.shortRev}"; +let + release = rec { + version = "1.2.0"; + src = fetchFromGitHub { + owner = "bsc-pm"; + repo = "ovni"; + rev = "${version}"; + sha256 = "sha256-J6eC62RT/0CHN7IXJuIw1c9GBkjvVEyh0HjIF7uG0FM="; + }; + }; - buildInputs = [ cmake mpi ]; + git = rec { + version = src.shortRev; + src = builtins.fetchGit { + url = gitUrl; + ref = gitBranch; + rev = gitCommit; + }; + }; - cmakeBuildType = if (enableDebug) then "Debug" else "Release"; - dontStrip = true; - - src = builtins.fetchGit ({ - url = gitURL; - ref = gitBranch; - } // optionalAttrs (gitCommit != null) ({ - rev = gitCommit; - })); -} + 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; + } diff --git a/overlay.nix b/overlay.nix index 241d7f1..0f948c2 100644 --- a/overlay.nix +++ b/overlay.nix @@ -260,10 +260,6 @@ let cn6 = callPackage ./bsc/cn6/default.nix { }; ovni = callPackage ./bsc/ovni/default.nix { }; - ovniKernel = callPackage ./bsc/ovni/default.nix { - gitBranch = "kernel-context-switch"; - gitCommit = null; - }; # ================================================================= # MN4 specific