mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
devenv: fix locale warnings, install shell completions, and more (#367567)
This commit is contained in:
commit
1636ec1b8f
1 changed files with 33 additions and 12 deletions
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
makeWrapper,
|
||||
makeBinaryWrapper,
|
||||
installShellFiles,
|
||||
rustPlatform,
|
||||
testers,
|
||||
cachix,
|
||||
darwin,
|
||||
sqlx-cli,
|
||||
nixVersions,
|
||||
openssl,
|
||||
pkg-config,
|
||||
glibcLocalesUtf8,
|
||||
devenv, # required to run version test
|
||||
}:
|
||||
|
||||
|
@ -55,20 +55,41 @@ rustPlatform.buildRustPackage {
|
|||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
installShellFiles
|
||||
makeBinaryWrapper
|
||||
pkg-config
|
||||
sqlx-cli
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[ openssl ]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
darwin.apple_sdk.frameworks.SystemConfiguration
|
||||
];
|
||||
buildInputs = [ openssl ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/devenv --set DEVENV_NIX ${devenv_nix} --prefix PATH ":" "$out/bin:${cachix}/bin"
|
||||
'';
|
||||
postInstall =
|
||||
let
|
||||
setDefaultLocaleArchive = lib.optionalString (glibcLocalesUtf8 != null) ''
|
||||
--set-default LOCALE_ARCHIVE ${glibcLocalesUtf8}/lib/locale/locale-archive
|
||||
'';
|
||||
in
|
||||
''
|
||||
wrapProgram $out/bin/devenv \
|
||||
--prefix PATH ":" "$out/bin:${cachix}/bin" \
|
||||
--set DEVENV_NIX ${devenv_nix} \
|
||||
${setDefaultLocaleArchive}
|
||||
|
||||
# Generate manpages
|
||||
cargo xtask generate-manpages --out-dir man
|
||||
installManPage man/*
|
||||
|
||||
# Generate shell completions
|
||||
compdir=./completions
|
||||
for shell in bash fish zsh; do
|
||||
cargo xtask generate-shell-completion $shell --out-dir $compdir
|
||||
done
|
||||
|
||||
installShellCompletion --cmd devenv \
|
||||
--bash $compdir/devenv.bash \
|
||||
--fish $compdir/devenv.fish \
|
||||
--zsh $compdir/_devenv
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
version = testers.testVersion {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue