mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-01 03:12:51 +00:00
sqlx-cli: install shell completions
This commit is contained in:
parent
dbf6c32388
commit
9adfaee104
@ -2,14 +2,15 @@
|
|||||||
, lib
|
, lib
|
||||||
, rustPlatform
|
, rustPlatform
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, installShellFiles
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, openssl
|
, openssl
|
||||||
, SystemConfiguration
|
|
||||||
, CoreFoundation
|
|
||||||
, Security
|
|
||||||
, libiconv
|
, libiconv
|
||||||
, testers
|
, testers
|
||||||
, sqlx-cli
|
, sqlx-cli
|
||||||
|
, CoreFoundation
|
||||||
|
, Security
|
||||||
|
, SystemConfiguration
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
@ -28,9 +29,26 @@ rustPlatform.buildRustPackage rec {
|
|||||||
doCheck = false;
|
doCheck = false;
|
||||||
cargoBuildFlags = [ "-p sqlx-cli" ];
|
cargoBuildFlags = [ "-p sqlx-cli" ];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
nativeBuildInputs = [
|
||||||
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
|
installShellFiles
|
||||||
++ lib.optionals stdenv.isDarwin [ SystemConfiguration CoreFoundation Security libiconv ];
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs =
|
||||||
|
lib.optionals stdenv.isLinux [ openssl ]
|
||||||
|
++ lib.optionals stdenv.isDarwin [
|
||||||
|
CoreFoundation
|
||||||
|
Security
|
||||||
|
SystemConfiguration
|
||||||
|
libiconv
|
||||||
|
];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
for shell in bash fish zsh; do
|
||||||
|
$out/bin/sqlx completions $shell > sqlx.$shell
|
||||||
|
installShellCompletion sqlx.$shell
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
passthru.tests.version = testers.testVersion {
|
passthru.tests.version = testers.testVersion {
|
||||||
package = sqlx-cli;
|
package = sqlx-cli;
|
||||||
|
Loading…
Reference in New Issue
Block a user