2021-05-01 19:09:53 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3, docker, autoreconfHook, coreutils, makeWrapper, gnused, gnutar, gzip, findutils, sudo, nixosTests }:
|
2019-04-03 14:41:45 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2021-04-22 08:23:39 +01:00
|
|
|
version = "0.23";
|
2019-04-03 14:41:45 +01:00
|
|
|
pname = "charliecloud";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hpc";
|
|
|
|
repo = "charliecloud";
|
|
|
|
rev = "v${version}";
|
2021-04-22 08:23:39 +01:00
|
|
|
sha256 = "sha256-JQNidKqJROFVm+O1exTDon1fwU91zONqgKJIpe9gspY=";
|
2019-04-03 14:41:45 +01:00
|
|
|
};
|
|
|
|
|
2020-08-25 08:44:27 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [
|
|
|
|
docker
|
|
|
|
(python3.withPackages (ps: [ ps.lark-parser ps.requests ]))
|
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = let
|
|
|
|
pythonEnv = python3.withPackages (ps: [ ps.lark-parser ps.requests ]);
|
|
|
|
in [
|
|
|
|
"--with-python=${pythonEnv}/bin/python3"
|
|
|
|
];
|
2019-04-03 14:41:45 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs test/
|
2020-08-25 08:44:27 +01:00
|
|
|
substituteInPlace configure.ac --replace "/usr/bin/env" "${coreutils}/bin/env"
|
2019-04-03 14:41:45 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LIBEXEC_DIR=lib/charliecloud"
|
|
|
|
];
|
|
|
|
|
2020-08-25 08:44:27 +01:00
|
|
|
# Charliecloud calls some external system tools.
|
|
|
|
# Here we wrap those deps so they are resolved inside nixpkgs.
|
|
|
|
postInstall = ''
|
|
|
|
for file in $out/bin/* ; do \
|
2021-01-15 05:42:41 +00:00
|
|
|
wrapProgram $file --prefix PATH : ${lib.makeBinPath [ coreutils docker gnused gnutar gzip findutils sudo ]}
|
2020-08-25 08:44:27 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.charliecloud = nixosTests.charliecloud;
|
|
|
|
|
2019-04-03 14:41:45 +01:00
|
|
|
meta = {
|
|
|
|
description = "User-defined software stacks (UDSS) for high-performance computing (HPC) centers";
|
|
|
|
longDescription = ''
|
|
|
|
Charliecloud uses Linux user namespaces to run containers with no
|
|
|
|
privileged operations or daemons and minimal configuration changes on
|
|
|
|
center resources. This simple approach avoids most security risks
|
|
|
|
while maintaining access to the performance and functionality already
|
|
|
|
on offer.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://hpc.github.io/charliecloud";
|
2021-01-15 05:42:41 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = [ lib.maintainers.bzizou ];
|
|
|
|
platforms = lib.platforms.linux;
|
2019-04-03 14:41:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|