2023-05-05 17:51:54 +00:00
|
|
|
{ lib
|
|
|
|
, buildNpmPackage
|
2023-09-19 17:46:15 +00:00
|
|
|
, fetchFromGitHub
|
2023-05-05 17:51:54 +00:00
|
|
|
, installShellFiles
|
|
|
|
, testers
|
|
|
|
, node-manta
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildNpmPackage rec {
|
|
|
|
pname = "manta";
|
2023-09-19 17:46:15 +00:00
|
|
|
version = "5.4.1";
|
2023-05-05 17:51:54 +00:00
|
|
|
|
2023-09-19 17:46:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TritonDataCenter";
|
|
|
|
repo = "node-manta";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-C6O5yTCBABMsz2scot8v3IwPbdYvJyZbcPOLfeDXCoo=";
|
2023-05-05 17:51:54 +00:00
|
|
|
};
|
|
|
|
|
2023-09-19 17:46:15 +00:00
|
|
|
npmDepsHash = "sha256-4Zz9sSUXE2dXdkIka2z5bQ2pNmCXXCBS2Sr0JHQOBQw=";
|
2023-05-05 17:51:54 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
2023-09-19 17:46:15 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2023-05-05 17:51:54 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -s ./lib/node_modules/manta/bin $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2023-09-19 17:46:15 +00:00
|
|
|
# create completions, following upstream procedure https://github.com/joyent/node-manta/blob/v5.4.1/Makefile#L85-L91
|
2023-05-05 17:51:54 +00:00
|
|
|
cmds=$(find ./bin/ -type f -printf "%f\n")
|
|
|
|
|
|
|
|
node $out/lib/node_modules/manta/lib/create_client.js
|
|
|
|
|
|
|
|
for cmd in $cmds; do
|
|
|
|
installShellCompletion --cmd $cmd --bash <($out/bin/$cmd --completion)
|
|
|
|
|
|
|
|
# Strip timestamp from generated bash completion
|
|
|
|
sed -i '/Bash completion generated.*/d' $out/share/bash-completion/completions/$cmd.bash
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = node-manta;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Manta Object-Storage Client CLIs and Node.js SDK";
|
|
|
|
homepage = "https://github.com/TritonDataCenter/node-manta";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ teutat3s ];
|
|
|
|
mainProgram = "mls";
|
|
|
|
};
|
|
|
|
}
|