mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-20 11:11:43 -04:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
38 lines
1 KiB
Nix
38 lines
1 KiB
Nix
{ lib, stdenv, rustPlatform, fetchFromGitHub, Security, SystemConfiguration }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "autocorrect";
|
|
version = "2.11.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "huacnlee";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-iBwF8rMm4MbHwJSDmENDgGJKCl05psStxsi6BIliZP0=";
|
|
};
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
postPatch = ''
|
|
cp ${./Cargo.lock} Cargo.lock
|
|
'';
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ Security SystemConfiguration ];
|
|
|
|
cargoBuildFlags = [ "-p" "autocorrect-cli" ];
|
|
cargoTestFlags = [ "-p" "autocorrect-cli" ];
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = with lib; {
|
|
description = "Linter and formatter for help you improve copywriting, to correct spaces, punctuations between CJK (Chinese, Japanese, Korean)";
|
|
mainProgram = "autocorrect";
|
|
homepage = "https://huacnlee.github.io/autocorrect";
|
|
changelog = "https://github.com/huacnlee/autocorrect/releases/tag/v${version}";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
};
|
|
}
|