nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 59 lines 1.5 kB view raw
1{ 2 lib, 3 buildNpmPackage, 4 fetchFromGitHub, 5 installShellFiles, 6 testers, 7 node-manta, 8}: 9 10buildNpmPackage rec { 11 pname = "manta"; 12 version = "5.4.2"; 13 14 src = fetchFromGitHub { 15 owner = "TritonDataCenter"; 16 repo = "node-manta"; 17 rev = "v${version}"; 18 hash = "sha256-Uj3fNzeERiO++sW2uyAbtfN/1Ed6uRVBBvCecncq/QY="; 19 }; 20 21 npmDepsHash = "sha256-Xk/K90K+X73ZTV6u2GJij8815GdBn6igXmpWLaCfKF4="; 22 23 dontBuild = true; 24 25 nativeBuildInputs = [ installShellFiles ]; 26 27 postInstall = '' 28 ln -s ./lib/node_modules/manta/bin $out/bin 29 ''; 30 31 postFixup = '' 32 # create completions, following upstream procedure https://github.com/joyent/node-manta/blob/v5.4.1/Makefile#L85-L91 33 cmds=$(find ./bin/ -type f -printf "%f\n") 34 35 node $out/lib/node_modules/manta/lib/create_client.js 36 37 for cmd in $cmds; do 38 installShellCompletion --cmd $cmd --bash <($out/bin/$cmd --completion) 39 40 # Strip timestamp from generated bash completion 41 sed -i '/Bash completion generated.*/d' $out/share/bash-completion/completions/$cmd.bash 42 done 43 ''; 44 45 passthru = { 46 tests.version = testers.testVersion { 47 package = node-manta; 48 }; 49 }; 50 51 meta = { 52 description = "Manta Object-Storage Client CLIs and Node.js SDK"; 53 homepage = "https://github.com/TritonDataCenter/node-manta"; 54 changelog = "https://github.com/TritonDataCenter/node-manta/blob/v${version}/CHANGES.md"; 55 license = lib.licenses.mit; 56 maintainers = with lib.maintainers; [ teutat3s ]; 57 mainProgram = "mls"; 58 }; 59}