mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
Merge pull request #289765 from linsui/yazi-wrapper
yazi: use wrapper to avoid rebuild
This commit is contained in:
commit
3f3d631ae2
@ -1,81 +0,0 @@
|
||||
{ rustPlatform
|
||||
, fetchFromGitHub
|
||||
, lib
|
||||
|
||||
, makeWrapper
|
||||
, installShellFiles
|
||||
, stdenv
|
||||
, Foundation
|
||||
|
||||
, withFile ? true
|
||||
, file
|
||||
, withJq ? true
|
||||
, jq
|
||||
, withPoppler ? true
|
||||
, poppler_utils
|
||||
, withUnar ? true
|
||||
, unar
|
||||
, withFfmpegthumbnailer ? true
|
||||
, ffmpegthumbnailer
|
||||
, withFd ? true
|
||||
, fd
|
||||
, withRipgrep ? true
|
||||
, ripgrep
|
||||
, withFzf ? true
|
||||
, fzf
|
||||
, withZoxide ? true
|
||||
, zoxide
|
||||
|
||||
, nix-update-script
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "yazi";
|
||||
version = "0.2.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sxyazi";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-2AiaJs6xY8hsB1DBxpPwdZtc8IZvsoCGWBOFVMf4dvk=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-fRUmXv27sHYz8z0cc795JCPLHDQGgTV4wAWAtQ/pbg4=";
|
||||
|
||||
env.YAZI_GEN_COMPLETIONS = true;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ Foundation ];
|
||||
|
||||
postInstall = with lib;
|
||||
let
|
||||
runtimePaths = [ ]
|
||||
++ optional withFile file
|
||||
++ optional withJq jq
|
||||
++ optional withPoppler poppler_utils
|
||||
++ optional withUnar unar
|
||||
++ optional withFfmpegthumbnailer ffmpegthumbnailer
|
||||
++ optional withFd fd
|
||||
++ optional withRipgrep ripgrep
|
||||
++ optional withFzf fzf
|
||||
++ optional withZoxide zoxide;
|
||||
in
|
||||
''
|
||||
wrapProgram $out/bin/yazi \
|
||||
--prefix PATH : "${makeBinPath runtimePaths}"
|
||||
installShellCompletion --cmd yazi \
|
||||
--bash ./yazi-config/completions/yazi.bash \
|
||||
--fish ./yazi-config/completions/yazi.fish \
|
||||
--zsh ./yazi-config/completions/_yazi
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Blazing fast terminal file manager written in Rust, based on async I/O";
|
||||
homepage = "https://github.com/sxyazi/yazi";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ xyenon matthiasbeyer ];
|
||||
mainProgram = "yazi";
|
||||
};
|
||||
}
|
46
pkgs/by-name/ya/yazi-unwrapped/package.nix
Normal file
46
pkgs/by-name/ya/yazi-unwrapped/package.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{ rustPlatform
|
||||
, fetchFromGitHub
|
||||
, lib
|
||||
|
||||
, installShellFiles
|
||||
, stdenv
|
||||
, Foundation
|
||||
|
||||
, nix-update-script
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "yazi";
|
||||
version = "0.2.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sxyazi";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-2AiaJs6xY8hsB1DBxpPwdZtc8IZvsoCGWBOFVMf4dvk=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-fRUmXv27sHYz8z0cc795JCPLHDQGgTV4wAWAtQ/pbg4=";
|
||||
|
||||
env.YAZI_GEN_COMPLETIONS = true;
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ Foundation ];
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd yazi \
|
||||
--bash ./yazi-config/completions/yazi.bash \
|
||||
--fish ./yazi-config/completions/yazi.fish \
|
||||
--zsh ./yazi-config/completions/_yazi
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Blazing fast terminal file manager written in Rust, based on async I/O";
|
||||
homepage = "https://github.com/sxyazi/yazi";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ xyenon matthiasbeyer ];
|
||||
mainProgram = "yazi";
|
||||
};
|
||||
}
|
48
pkgs/by-name/ya/yazi/package.nix
Normal file
48
pkgs/by-name/ya/yazi/package.nix
Normal file
@ -0,0 +1,48 @@
|
||||
{ lib
|
||||
, runCommand
|
||||
, makeWrapper
|
||||
, yazi-unwrapped
|
||||
|
||||
, withFile ? true
|
||||
, file
|
||||
, withJq ? true
|
||||
, jq
|
||||
, withPoppler ? true
|
||||
, poppler_utils
|
||||
, withUnar ? true
|
||||
, unar
|
||||
, withFfmpegthumbnailer ? true
|
||||
, ffmpegthumbnailer
|
||||
, withFd ? true
|
||||
, fd
|
||||
, withRipgrep ? true
|
||||
, ripgrep
|
||||
, withFzf ? true
|
||||
, fzf
|
||||
, withZoxide ? true
|
||||
, zoxide
|
||||
}:
|
||||
|
||||
let
|
||||
runtimePaths = with lib; [ ]
|
||||
++ optional withFile file
|
||||
++ optional withJq jq
|
||||
++ optional withPoppler poppler_utils
|
||||
++ optional withUnar unar
|
||||
++ optional withFfmpegthumbnailer ffmpegthumbnailer
|
||||
++ optional withFd fd
|
||||
++ optional withRipgrep ripgrep
|
||||
++ optional withFzf fzf
|
||||
++ optional withZoxide zoxide;
|
||||
in
|
||||
runCommand yazi-unwrapped.name
|
||||
{
|
||||
inherit (yazi-unwrapped) pname version meta;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
} ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${yazi-unwrapped}/share $out/share
|
||||
makeWrapper ${yazi-unwrapped}/bin/yazi $out/bin/yazi \
|
||||
--prefix PATH : "${lib.makeBinPath runtimePaths}"
|
||||
''
|
@ -41891,7 +41891,7 @@ with pkgs;
|
||||
|
||||
weggli = callPackage ../tools/security/weggli { };
|
||||
|
||||
yazi = callPackage ../applications/file-managers/yazi { inherit (darwin.apple_sdk.frameworks) Foundation; };
|
||||
yazi-unwrapped = callPackage ../by-name/ya/yazi-unwrapped/package.nix { inherit (darwin.apple_sdk.frameworks) Foundation; };
|
||||
|
||||
ssl-proxy = callPackage ../tools/networking/ssl-proxy { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user