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.
The Antora default UI bundle is intended to be passed to antora's --ui-bundle-url flag or injected into the ui.bundle.url key to avoid irreproducible [1] references. This UI bundle allows writing reproducible Antora tests. [1]: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable Link: NixOS#332341
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 deletions.
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,78 @@ | ||
{ | ||
fetchFromGitLab, | ||
lib, | ||
stdenvNoCC, | ||
}: | ||
let | ||
srcFetchFromGitLab = { | ||
hash = "sha256-q2FwkwzjanxTIxjMpCyMpzPt782uYZiWVdZ7Eev79oM="; | ||
owner = "trueNAHO"; | ||
repo = "antora-ui-default"; | ||
rev = "83bf9bf5f22a6dee397f8b089eb0315c14a278b5"; | ||
}; | ||
in | ||
stdenvNoCC.mkDerivation { | ||
pname = "antora-ui-default"; | ||
version = "0"; | ||
|
||
# The UI bundle is fetched from lib.maintainers.naho's antora-ui-default fork | ||
# for the following reasons: | ||
# | ||
# > The UI bundle is currently unpackaged [1] [2], and only accessible by | ||
# > fetching the latest GitLab artifact or building from source. Neither | ||
# > method is reliably reproducible, as artifacts are deleted over time and | ||
# > building from source requires insecure Node 10. | ||
# > | ||
# > The solution is to version control the UI bundle. | ||
# > | ||
# > [...] | ||
# > | ||
# > [1]: https://gitlab.com/antora/antora-ui-default/-/issues/135 | ||
# > [2]: https://gitlab.com/antora/antora-ui-default/-/issues/211 | ||
# > | ||
# > -- [3] | ||
# | ||
# To avoid bloating the repository archive size, the UI bundle is not stored | ||
# in Nixpkgs. | ||
# | ||
# For reference, the UI bundle from [3] is 300K large. | ||
# | ||
# [3]: https://gitlab.com/trueNAHO/antora-ui-default/-/commit/83bf9bf5f22a6dee397f8b089eb0315c14a278b5 | ||
src = fetchFromGitLab srcFetchFromGitLab; | ||
|
||
phases = [ "installPhase" ]; | ||
|
||
# Install '$src/ui-bundle.zip' to '$out/ui-bundle.zip' instead of '$out' to | ||
# prevent the ZIP from being misidentified as a binary [1]. | ||
# | ||
# [1]: https://github.com/NixOS/nixpkgs/blob/8885a1e21ad43f8031c738a08029cd1d4dcbc2f7/pkgs/stdenv/generic/setup.sh#L792-L795 | ||
installPhase = '' | ||
install --mode 755 -D "$src/ui-bundle.zip" "$out/ui-bundle.zip" | ||
''; | ||
|
||
meta = { | ||
description = "Antora default UI bundle"; | ||
homepage = "https://gitlab.com/antora/antora-ui-default"; | ||
license = lib.licenses.mpl20; | ||
|
||
longDescription = '' | ||
> A UI bundle is a [ZIP | ||
> archive](https://en.wikipedia.org/wiki/Zip_(file_format)) or directory | ||
> that contains one or more UIs for a site. | ||
> | ||
> -- Antora | ||
> https://docs.antora.org/antora/3.1/playbook/ui-bundle-url | ||
This UI bundle is available under `$out/ui-bundle.zip` and intended to be | ||
passed to `antora`'s `--ui-bundle-url` flag or injected into the | ||
[`ui.bundle.url` | ||
key](https://docs.antora.org/antora/3.1/playbook/ui-bundle-url/#url-key) | ||
to avoid irreproducible | ||
[`https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable`](https://gitlab.com/${srcFetchFromGitLab.owner}/${srcFetchFromGitLab.repo}/-/blob/${srcFetchFromGitLab.rev}/README.adoc#user-content-use-the-default-ui) | ||
references. | ||
''; | ||
|
||
maintainers = [ lib.maintainers.naho ]; | ||
platforms = lib.platforms.all; | ||
}; | ||
} |