2020-09-25 04:45:31 +00:00
|
|
|
{ stdenv, fetchFromGitHub, python3, python3Packages, docker, autoreconfHook, coreutils, makeWrapper, gnused, gnutar, gzip, findutils, sudo, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
version = "0.20";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "charliecloud";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hpc";
|
|
|
|
repo = "charliecloud";
|
|
|
|
rev = "v${version}";
|
2020-11-03 02:18:15 +00:00
|
|
|
sha256 = "15ihffwhpjnzgz0ir5vc9la4fwkqj91vmrcsb2r58ikq7h9sk45j";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00: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"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs test/
|
2020-09-25 04:45:31 +00:00
|
|
|
substituteInPlace configure.ac --replace "/usr/bin/env" "${coreutils}/bin/env"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LIBEXEC_DIR=lib/charliecloud"
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Charliecloud calls some external system tools.
|
|
|
|
# Here we wrap those deps so they are resolved inside nixpkgs.
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
for file in $out/bin/* ; do \
|
|
|
|
wrapProgram $file --prefix PATH : ${stdenv.lib.makeBinPath [ coreutils docker gnused gnutar gzip findutils sudo ]}
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
passthru.tests.charliecloud = nixosTests.charliecloud;
|
|
|
|
|
2020-04-24 23:36:52 +00: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.
|
|
|
|
'';
|
|
|
|
homepage = "https://hpc.github.io/charliecloud";
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.bzizou ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|