at master 57 lines 1.2 kB view raw
1{ 2 lib, 3 fetchCrate, 4 rustPlatform, 5 pkg-config, 6 installShellFiles, 7 openssl, 8 dbus, 9 sqlite, 10 stdenv, 11 testers, 12 leetcode-cli, 13}: 14 15rustPlatform.buildRustPackage rec { 16 pname = "leetcode-cli"; 17 version = "0.4.7"; 18 19 src = fetchCrate { 20 inherit pname version; 21 hash = "sha256-zxaBSZS2mlGaKT+AN4oS8eJmoLdVe2/T/G41ERj3gDg="; 22 }; 23 24 cargoHash = "sha256-JsWMQp93fGXitnZ9LLGD9dZddc6Z7jRuAyx6HreV+XM="; 25 26 nativeBuildInputs = [ 27 pkg-config 28 installShellFiles 29 ]; 30 31 buildInputs = [ 32 openssl 33 dbus 34 sqlite 35 ]; 36 37 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 38 installShellCompletion --cmd leetcode \ 39 --bash <($out/bin/leetcode completions bash) \ 40 --fish <($out/bin/leetcode completions fish) \ 41 --zsh <($out/bin/leetcode completions zsh) 42 ''; 43 44 passthru.tests = testers.testVersion { 45 package = leetcode-cli; 46 command = "leetcode -V"; 47 version = "leetcode ${version}"; 48 }; 49 50 meta = with lib; { 51 description = "Leetcode CLI utility"; 52 homepage = "https://github.com/clearloop/leetcode-cli"; 53 license = licenses.mit; 54 maintainers = with maintainers; [ congee ]; 55 mainProgram = "leetcode"; 56 }; 57}