From fec4ddf6abf63e1928366d9e5d3363093a1eb3f3 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 29 Nov 2023 16:59:19 +0100 Subject: [PATCH] Merge TAMPI release and git in the same file In order to reduce duplicate information we just place the two sources in the same file. Reviewed-by: Aleix Roca Nonell --- pkgs/tampi/default.nix | 46 ++++++++++++++++++++++++++++++++---------- pkgs/tampi/git.nix | 26 ------------------------ 2 files changed, 35 insertions(+), 37 deletions(-) delete mode 100644 pkgs/tampi/git.nix diff --git a/pkgs/tampi/default.nix b/pkgs/tampi/default.nix index a5c22bc..1c25b6c 100644 --- a/pkgs/tampi/default.nix +++ b/pkgs/tampi/default.nix @@ -9,22 +9,46 @@ , mpi , gcc , autoreconfHook +, useGit ? false +, gitUrl ? "ssh://git@bscpm03.bsc.es/interoperability/tampi.git" +, gitBranch ? "master" +, gitCommit ? "16f92094ca6da25e2f561c000f5fbc2901944f7b" }: -stdenv.mkDerivation rec { - version = "3.0"; +let + release = rec { + version = "3.0"; + src = fetchFromGitHub { + owner = "bsc-pm"; + repo = "tampi"; + rev = "v${version}"; + hash = "sha256-qdWBxPsXKM428F2ojt2B6/0ZsQyGzEiojNaqbhDmrks="; + }; + }; + 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 { pname = "tampi"; + inherit (source) src version; enableParallelBuilding = true; separateDebugInfo = true; - buildInputs = [ autoreconfHook automake autoconf libtool gnumake boost mpi gcc ]; + buildInputs = [ + autoreconfHook + automake + autoconf + libtool + gnumake + boost + mpi + gcc + ]; dontDisableStatic = true; - - src = fetchFromGitHub { - owner = "bsc-pm"; - repo = "tampi"; - rev = "v${version}"; - hash = "sha256-qdWBxPsXKM428F2ojt2B6/0ZsQyGzEiojNaqbhDmrks="; - }; - hardeningDisable = [ "all" ]; } diff --git a/pkgs/tampi/git.nix b/pkgs/tampi/git.nix deleted file mode 100644 index cb1378e..0000000 --- a/pkgs/tampi/git.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - stdenv -, fetchurl -, automake -, autoconf -, libtool -, gnumake -, boost -, mpi -, gcc -, autoreconfHook -}: - -stdenv.mkDerivation rec { - pname = "tampi"; - version = "${src.shortRev}"; - enableParallelBuilding = true; - buildInputs = [ autoreconfHook automake autoconf libtool gnumake boost mpi gcc ]; - dontDisableStatic = true; - makeFlags = [ "V=1" ]; - src = builtins.fetchGit { - url = "ssh://git@bscpm03.bsc.es/interoperability/tampi"; - ref = "master"; - }; - hardeningDisable = [ "all" ]; -}