Merge pull request #215682 from candyc1oud/autocorrect
This commit is contained in:
commit
ee90de5543
2369
pkgs/tools/text/autocorrect/Cargo.lock
generated
Normal file
2369
pkgs/tools/text/autocorrect/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
36
pkgs/tools/text/autocorrect/default.nix
Normal file
36
pkgs/tools/text/autocorrect/default.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{ lib, stdenv, rustPlatform, fetchFromGitHub, Security }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "autocorrect";
|
||||
version = "2.6.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "huacnlee";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-QHQQrUQCfDAlAtDcfrAkOwRhQkO+HcwnPfJ5+jb1290=";
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
cp ${./Cargo.lock} Cargo.lock
|
||||
'';
|
||||
|
||||
buildInputs = lib.optional stdenv.isDarwin Security;
|
||||
|
||||
cargoBuildFlags = [ "-p" "autocorrect-cli" ];
|
||||
cargoTestFlags = [ "-p" "autocorrect-cli" ];
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A linter and formatter for help you improve copywriting, to correct spaces, punctuations between CJK (Chinese, Japanese, Korean)";
|
||||
homepage = "https://huacnlee.github.io/autocorrect";
|
||||
changelog = "https://github.com/huacnlee/autocorrect/releases/tag/v${version}";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ candyc1oud ];
|
||||
};
|
||||
}
|
15
pkgs/tools/text/autocorrect/update.sh
Executable file
15
pkgs/tools/text/autocorrect/update.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p coreutils curl jq common-updater-scripts cargo
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
version=$(curl -s https://api.github.com/repos/huacnlee/autocorrect/releases/latest | jq -r .tag_name)
|
||||
update-source-version autocorrect "${version#v}"
|
||||
|
||||
tmp=$(mktemp -d)
|
||||
trap 'rm -rf -- "${tmp}"' EXIT
|
||||
|
||||
git clone --depth 1 --branch "${version}" https://github.com/huacnlee/autocorrect.git "${tmp}/autocorrect"
|
||||
cargo generate-lockfile --manifest-path "${tmp}/autocorrect/Cargo.toml"
|
||||
cp "${tmp}/autocorrect/Cargo.lock" "$(dirname "$0")/Cargo.lock"
|
@ -14118,6 +14118,10 @@ with pkgs;
|
||||
|
||||
asciigraph = callPackage ../tools/text/asciigraph { };
|
||||
|
||||
autocorrect = callPackage ../tools/text/autocorrect {
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
};
|
||||
|
||||
as31 = callPackage ../development/compilers/as31 { };
|
||||
|
||||
asl = callPackage ../development/compilers/asl {
|
||||
|
Loading…
Reference in New Issue
Block a user