53 lines
1.6 KiB
Nix
53 lines
1.6 KiB
Nix
{ lib
|
||
, rustPlatform
|
||
, fetchFromGitHub
|
||
, bash
|
||
, bash-completion
|
||
, glibc
|
||
, gcc
|
||
, findutils
|
||
}:
|
||
|
||
rustPlatform.buildRustPackage rec {
|
||
pname = "bash-pinyin-completion-rs";
|
||
version = "1.0.0-beta";
|
||
|
||
src = fetchFromGitHub {
|
||
owner = "AOSC-Dev";
|
||
repo = pname;
|
||
rev = "v${version}";
|
||
sha256 = "sha256-VXIIG+ZGb4fS3LSIkGW744ui4AKTdQCjrNlObH/YZVY=";
|
||
};
|
||
|
||
#cargoHash = "sha256-VXIIG+ZGb4fS3LSIkGW744ui4AKTdQCjrNlObH/YZVY=";
|
||
cargoHash = "sha256-IEtGulY6EqJ74ok1xLY64K1yKSZcmb/wyObtcaHYMRk=";
|
||
|
||
nativeBuildInputs = [ ];
|
||
buildInputs = [ bash bash-completion glibc gcc findutils ];
|
||
|
||
# Tests are enabled by default; equivalent to Arch’s `check()`
|
||
doCheck = true;
|
||
|
||
installPhase = ''
|
||
runHook preInstall
|
||
BIN_PATH=$(${findutils}/bin/find target -type f -executable -name bash-pinyin-completion-rs)
|
||
install -Dm755 -t $out/bin/ "$BIN_PATH"
|
||
install -Dm644 -t "$out/share/${pname}" scripts/bash_pinyin_completion
|
||
runHook postInstall
|
||
'';
|
||
|
||
meta = with lib; {
|
||
description = "Simple completion script for pinyin, written in Rust.";
|
||
longDescription = ''
|
||
Simple completion script for pinyin, written in Rust.
|
||
==> Remember to enable bash-pinyin-completion-rs in your .bashrc
|
||
==> (add the following line):
|
||
source /run/current-system/sw/share/bash-pinyin-completion-rs/bash_pinyin_completion
|
||
==> Or if installed via nix profile:
|
||
source ~/.nix-profile/share/bash-pinyin-completion-rs/bash_pinyin_completion
|
||
'';
|
||
homepage = "https://github.com/AOSC-Dev/bash-pinyin-completion-rs";
|
||
license = licenses.gpl3Only;
|
||
platforms = platforms.linux;
|
||
};
|
||
}
|