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,
|
|
|
|
boost, fmt, sqlite-orm, nlohmann_json, zpp-bits, range-v3, nameof, openssh, sqlite, date, openxlsx, httplib, openssl,
|
2024-06-06 18:31:08 +08:00
|
|
|
termcolor, duc
|
2024-05-05 12:58:35 +08:00
|
|
|
}: stdenv.mkDerivation
|
|
|
|
{
|
|
|
|
name = "hpcstat";
|
|
|
|
src = ./.;
|
2024-05-05 22:29:06 +08:00
|
|
|
buildInputs =
|
2024-06-04 20:46:10 +08:00
|
|
|
[ boost fmt sqlite-orm nlohmann_json zpp-bits range-v3 nameof sqlite date openxlsx httplib termcolor ];
|
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
|
|
|
'';
|
|
|
|
}
|