Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, python3, docker, autoreconfHook, coreutils, makeWrapper, gnused, gnutar, gzip, findutils, sudo, nixosTests }: 2 3stdenv.mkDerivation rec { 4 5 version = "0.24"; 6 pname = "charliecloud"; 7 8 src = fetchFromGitHub { 9 owner = "hpc"; 10 repo = "charliecloud"; 11 rev = "v${version}"; 12 sha256 = "sha256-kdaVlwE3vdCxsmJTOUwx8J+9UcBuXbKDwS2MHX2ZPPM="; 13 }; 14 15 nativeBuildInputs = [ autoreconfHook makeWrapper ]; 16 buildInputs = [ 17 docker 18 (python3.withPackages (ps: [ ps.lark ps.requests ])) 19 ]; 20 21 configureFlags = let 22 pythonEnv = python3.withPackages (ps: [ ps.lark ps.requests ]); 23 in [ 24 "--with-python=${pythonEnv}/bin/python3" 25 ]; 26 27 preConfigure = '' 28 patchShebangs test/ 29 substituteInPlace configure.ac --replace "/usr/bin/env" "${coreutils}/bin/env" 30 ''; 31 32 makeFlags = [ 33 "PREFIX=$(out)" 34 "LIBEXEC_DIR=lib/charliecloud" 35 ]; 36 37 # Charliecloud calls some external system tools. 38 # Here we wrap those deps so they are resolved inside nixpkgs. 39 postInstall = '' 40 for file in $out/bin/* ; do \ 41 wrapProgram $file --prefix PATH : ${lib.makeBinPath [ coreutils docker gnused gnutar gzip findutils sudo ]} 42 done 43 ''; 44 45 passthru.tests.charliecloud = nixosTests.charliecloud; 46 47 meta = { 48 description = "User-defined software stacks (UDSS) for high-performance computing (HPC) centers"; 49 longDescription = '' 50 Charliecloud uses Linux user namespaces to run containers with no 51 privileged operations or daemons and minimal configuration changes on 52 center resources. This simple approach avoids most security risks 53 while maintaining access to the performance and functionality already 54 on offer. 55 ''; 56 homepage = "https://hpc.github.io/charliecloud"; 57 license = lib.licenses.asl20; 58 maintainers = [ lib.maintainers.bzizou ]; 59 platforms = lib.platforms.linux; 60 }; 61 62}