2024-05-05 12:58:35 +08:00
|
|
|
{
|
2024-05-23 13:39:27 +08:00
|
|
|
stdenv, cmake, pkg-config, standalone ? false, version ? null, makeWrapper, lib,
|
2024-07-03 16:59:55 +08:00
|
|
|
sqlite-orm, nlohmann_json, range-v3, openssh, sqlite, date, httplib, openssl, openxlsx, termcolor, duc, biu
|
2024-05-05 12:58:35 +08:00
|
|
|
}: stdenv.mkDerivation
|
|
|
|
{
|
|
|
|
name = "hpcstat";
|
|
|
|
src = ./.;
|
2024-05-05 22:29:06 +08:00
|
|
|
buildInputs =
|
2024-07-03 16:59:55 +08:00
|
|
|
[ sqlite-orm nlohmann_json range-v3 sqlite date httplib termcolor openssl biu openxlsx ];
|
2024-05-05 12:58:35 +08:00
|
|
|
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
|
2024-05-23 13:39:27 +08:00
|
|
|
cmakeFlags = lib.optionals (version != null) [ "-DHPCSTAT_VERSION=${version}" ];
|
2024-05-05 12:58:35 +08:00
|
|
|
postInstall =
|
2024-06-06 18:31:08 +08:00
|
|
|
if standalone then "cp ${openssh}/bin/{ssh-add,ssh-keygen} ${duc}/bin/duc $out/bin"
|
2024-05-05 12:58:35 +08:00
|
|
|
else
|
|
|
|
''
|
|
|
|
wrapProgram $out/bin/hpcstat --set HPCSTAT_SHAREDIR $out/share/hpcstat \
|
2024-06-06 18:31:08 +08:00
|
|
|
--set HPCSTAT_DATADIR /var/lib/hpcstat --set HPCSTAT_SSH_BINDIR ${openssh}/bin \
|
|
|
|
--set HPCSTAT_DUC_BINDIR ${duc}/bin
|
2024-05-05 12:58:35 +08:00
|
|
|
'';
|
2024-08-24 17:05:41 +08:00
|
|
|
doCheck = true;
|
2024-05-05 12:58:35 +08:00
|
|
|
}
|