forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
antora-lunr-extension: init at 1.0.0-alpha.8
Link: NixOS#332341
- Loading branch information
Showing
2 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
antora, | ||
buildNpmPackage, | ||
fetchFromGitLab, | ||
lib, | ||
nix-update-script, | ||
}: | ||
buildNpmPackage rec { | ||
pname = "antora-lunr-extension"; | ||
version = "1.0.0-alpha.8"; | ||
|
||
src = fetchFromGitLab { | ||
hash = "sha256-GplCwhUl8jurD4FfO6/T3Vo1WFjg+rtAjWeIh35unk4="; | ||
owner = "antora"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
}; | ||
|
||
npmDepsHash = "sha256-EtjZL6U/uSGSYSqtuatCkdWP0NHxRuht13D9OaM4x00="; | ||
|
||
# Prevent tests from failing because they are fetching data at runtime. | ||
postPatch = '' | ||
substituteInPlace package.json --replace '"_mocha"' '""' | ||
''; | ||
|
||
# Pointing $out to $out/lib/node_modules/@antora/lunr-extension simplifies | ||
# Antora's extension option usage from | ||
# | ||
# --extension ${pkgs.antora-lunr-extension}/lib/node_modules/@antora/lunr-extension | ||
# | ||
# to | ||
# | ||
# --extension ${pkgs.antora-lunr-extension} | ||
postInstall = '' | ||
directory="$(mktemp --directory)" | ||
mv "$out/"{.,}* "$directory" | ||
mv "$directory/lib/node_modules/@antora/lunr-extension/"{.,}* "$out" | ||
''; | ||
|
||
passthru = { | ||
tests.run = antora.tests.run.override { | ||
antora-lunr-extension-test = true; | ||
}; | ||
|
||
updateScript = nix-update-script { }; | ||
}; | ||
|
||
meta = { | ||
description = "Antora extension adding offline, full-text search powered by Lunr"; | ||
homepage = "https://gitlab.com/antora/antora-lunr-extension"; | ||
license = lib.licenses.mpl20; | ||
|
||
longDescription = '' | ||
This Antora extension is intended to be passed to `antora`'s `--extension` | ||
flag or injected into the [`antora.extensions` | ||
key](https://docs.antora.org/antora/3.1/extend/enable-extension). | ||
''; | ||
|
||
maintainers = [ lib.maintainers.naho ]; | ||
platforms = lib.platforms.all; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters