Unverified Commit 2e7b2517 authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #312471 from natsukium/textlint/repackage

textlint: repackage with buildNpmPackage
parents b45ff4af 5f58c6a8
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  buildNpmPackage,
  textlint,
  textlint-plugin-latex2e,
  textlint-rule-max-comma,
}:

buildNpmPackage rec {
  pname = "textlint-plugin-latex2e";
  version = "1.2.1-unstable-2024-02-05";

  src = fetchFromGitHub {
    owner = "textlint";
    repo = "textlint-plugin-latex2e";
    rev = "d3ba1be14543aaaf8e52f87d103fafb3ebb7c4b0";
    hash = "sha256-sCDpyhnznMAkIPWK0BawWZwuR9UO/ipIG2o5hyBkJQ0=";
  };

  npmDepsHash = "sha256-u2cMZC3s4iGCWG6iVMDYfb6XbxfjCdwpzl7opkwtrU8=";

  passthru.tests = textlint.testPackages {
    inherit (textlint-plugin-latex2e) pname;
    rule = textlint-rule-max-comma;
    plugin = textlint-plugin-latex2e;
    testFile = ./test.tex;
  };

  meta = {
    description = "Textlint Plugin LaTeX2ε";
    homepage = "https://github.com/textlint/textlint-plugin-latex2e";
    changelog = "https://github.com/textlint/textlint-plugin-latex2e/blob/${src.rev}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ natsukium ];
  };
}
+4 −0
Original line number Diff line number Diff line
\documentclass{article}
\begin{document}
Nix, is a tool, that takes a unique approach to package management and system configuration, Learn how to make reproducible, declarative, and reliable systems.
\end{document}
+79 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchYarnDeps,
  fixup-yarn-lock,
  nodejs,
  yarn,
  textlint,
  textlint-rule-abbr-within-parentheses,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "textlint-rule-abbr-within-parentheses";
  version = "1.0.2";

  src = fetchFromGitHub {
    owner = "azu";
    repo = "textlint-rule-abbr-within-parentheses";
    rev = "refs/tags/${finalAttrs.version}";
    hash = "sha256-CBrf7WtvywDmtuSyxkDtAyjmrj7KS3TQLSsNfMxeWXw=";
  };

  offlineCache = fetchYarnDeps {
    yarnLock = "${finalAttrs.src}/yarn.lock";
    hash = "sha256-N4tnja6qTo7jtn7Dh4TwBUCUKfbIbHvdZ7aeJcE+NlU=";
  };

  nativeBuildInputs = [
    fixup-yarn-lock
    nodejs
    yarn
  ];

  configurePhase = ''
    runHook preConfigure

    export HOME=$(mktemp -d)
    yarn config --offline set yarn-offline-mirror "$offlineCache"
    fixup-yarn-lock yarn.lock
    yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
    patchShebangs node_modules

    runHook postConfigure
  '';

  buildPhase = ''
    runHook preBuild

    yarn --offline build

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    yarn --offline --production install
    rm -r test
    mkdir -p $out/lib/node_modules/textlint-rule-abbr-within-parentheses
    cp -r . $out/lib/node_modules/textlint-rule-abbr-within-parentheses/

    runHook postInstall
  '';

  passthru.tests = textlint.testPackages {
    rule = textlint-rule-abbr-within-parentheses;
    testFile = ./test.md;
  };

  meta = {
    description = "Textlint rule check if write abbreviations within parentheses";
    homepage = "https://github.com/azu/textlint-rule-abbr-within-parentheses";
    changelog = "https://github.com/azu/textlint-rule-abbr-within-parentheses/releases/tag/${finalAttrs.src.rev}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ natsukium ];
    platforms = textlint.meta.platforms;
  };
})
+1 −0
Original line number Diff line number Diff line
Passing an expression `expr` that evaluates to a store path to any built-in function which reads from the filesystem constitutes IFD(Import From Derivation).
+34 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  buildNpmPackage,
  textlint,
  textlint-rule-alex,
}:

buildNpmPackage rec {
  pname = "textlint-rule-alex";
  version = "5.0.0";

  src = fetchFromGitHub {
    owner = "textlint-rule";
    repo = "textlint-rule-alex";
    rev = "refs/tags/v${version}";
    hash = "sha256-1JoiUhiRXZWIyLAJXp5ZzFAa/NBCN79jYh5kMNbO0jI=";
  };

  npmDepsHash = "sha256-ovDDiOZ415ubyDqbLNggzoVuqUWsRlG3zlhRW6xU3SQ=";

  passthru.tests = textlint.testPackages {
    rule = textlint-rule-alex;
    testFile = ./test.md;
  };

  meta = {
    description = "Textlint rule for alex";
    homepage = "https://github.com/textlint-rule/textlint-rule-alex";
    changelog = "https://github.com/textlint-rule/textlint-rule-alex/releases/tag/${src.rev}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ natsukium ];
  };
}
Loading