Merge pull request #215682 from candyc1oud/autocorrect

This commit is contained in:
Sandro 2023-02-27 00:49:46 +01:00 committed by GitHub
commit ee90de5543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2424 additions and 0 deletions

2369
pkgs/tools/text/autocorrect/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View 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 ];
};
}

View 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"

View File

@ -14118,6 +14118,10 @@ with pkgs;
asciigraph = callPackage ../tools/text/asciigraph { }; asciigraph = callPackage ../tools/text/asciigraph { };
autocorrect = callPackage ../tools/text/autocorrect {
inherit (darwin.apple_sdk.frameworks) Security;
};
as31 = callPackage ../development/compilers/as31 { }; as31 = callPackage ../development/compilers/as31 { };
asl = callPackage ../development/compilers/asl { asl = callPackage ../development/compilers/asl {