antora-lunr-extension: init at 1.0.0-alpha.8

Link: https://github.com/NixOS/nixpkgs/pull/332341

NAHO 6248c46b d5443c91

+67 -1
+63
pkgs/by-name/an/antora-lunr-extension/package.nix
···
··· 1 + { 2 + antora, 3 + buildNpmPackage, 4 + fetchFromGitLab, 5 + lib, 6 + nix-update-script, 7 + }: 8 + buildNpmPackage rec { 9 + pname = "antora-lunr-extension"; 10 + version = "1.0.0-alpha.8"; 11 + 12 + src = fetchFromGitLab { 13 + hash = "sha256-GplCwhUl8jurD4FfO6/T3Vo1WFjg+rtAjWeIh35unk4="; 14 + owner = "antora"; 15 + repo = pname; 16 + rev = "v${version}"; 17 + }; 18 + 19 + npmDepsHash = "sha256-EtjZL6U/uSGSYSqtuatCkdWP0NHxRuht13D9OaM4x00="; 20 + 21 + # Prevent tests from failing because they are fetching data at runtime. 22 + postPatch = '' 23 + substituteInPlace package.json --replace '"_mocha"' '""' 24 + ''; 25 + 26 + # Pointing $out to $out/lib/node_modules/@antora/lunr-extension simplifies 27 + # Antora's extension option usage from 28 + # 29 + # --extension ${pkgs.antora-lunr-extension}/lib/node_modules/@antora/lunr-extension 30 + # 31 + # to 32 + # 33 + # --extension ${pkgs.antora-lunr-extension} 34 + postInstall = '' 35 + directory="$(mktemp --directory)" 36 + 37 + mv "$out/"{.,}* "$directory" 38 + mv "$directory/lib/node_modules/@antora/lunr-extension/"{.,}* "$out" 39 + ''; 40 + 41 + passthru = { 42 + tests.run = antora.tests.run.override { 43 + antora-lunr-extension-test = true; 44 + }; 45 + 46 + updateScript = nix-update-script { }; 47 + }; 48 + 49 + meta = { 50 + description = "Antora extension adding offline, full-text search powered by Lunr"; 51 + homepage = "https://gitlab.com/antora/antora-lunr-extension"; 52 + license = lib.licenses.mpl20; 53 + 54 + longDescription = '' 55 + This Antora extension is intended to be passed to `antora`'s `--extension` 56 + flag or injected into the [`antora.extensions` 57 + key](https://docs.antora.org/antora/3.1/extend/enable-extension). 58 + ''; 59 + 60 + maintainers = [ lib.maintainers.naho ]; 61 + platforms = lib.platforms.all; 62 + }; 63 + }
+4 -1
pkgs/by-name/an/antora/test/default.nix
··· 1 { 2 antora, 3 antora-ui-default, 4 gitMinimal, 5 lib, 6 stdenvNoCC, 7 }: 8 stdenvNoCC.mkDerivation { 9 - name = "${antora.pname}-test"; 10 src = ./minimal_working_example; 11 12 postPatch = ··· 43 antora ${ 44 lib.cli.toGNUCommandLineShell { } { 45 cache-dir = "$(mktemp --directory)"; 46 to-dir = placeholder "out"; 47 ui-bundle-url = "${antora-ui-default}/ui-bundle.zip"; 48 }
··· 1 { 2 antora, 3 + antora-lunr-extension, 4 + antora-lunr-extension-test ? false, 5 antora-ui-default, 6 gitMinimal, 7 lib, 8 stdenvNoCC, 9 }: 10 stdenvNoCC.mkDerivation { 11 + name = "${antora.pname}${lib.optionalString antora-lunr-extension-test "-${antora-lunr-extension.pname}"}-test"; 12 src = ./minimal_working_example; 13 14 postPatch = ··· 45 antora ${ 46 lib.cli.toGNUCommandLineShell { } { 47 cache-dir = "$(mktemp --directory)"; 48 + extension = if antora-lunr-extension-test then antora-lunr-extension else false; 49 to-dir = placeholder "out"; 50 ui-bundle-url = "${antora-ui-default}/ui-bundle.zip"; 51 }