summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTechcable2022-08-13 20:37:19 -0700
committerTechcable2022-08-21 20:36:01 -0700
commit3b8d78cc12b99ea597c4d5d9760a3a8abd7ca5b7 (patch)
treed9d79ad2b2a780ad4cf39db04a5e6d7a7e468876
parent53bd12acccc144bd6617b7d790429da12a4d1700 (diff)
downloadaur-3b8d78cc12b99ea597c4d5d9760a3a8abd7ca5b7.tar.gz
Handle moved docs directory
The location in the nightly tarball moved.
-rw-r--r--PKGBUILD24
1 files changed, 22 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a9e7b89591c2..8044c7f54bf6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -75,7 +75,27 @@ package() {
cp -R lib "${pkgdir}/usr/lib/zig/lib"
install -D -m755 zig "${pkgdir}/usr/lib/zig/zig"
ln -s /usr/lib/zig/zig "${pkgdir}/usr/bin/zig"
- install -D -m644 docs/langref.html "${pkgdir}/usr/share/doc/zig/langref.html"
- cp -R docs/std "${pkgdir}/usr/share/doc/zig/"
+ # Old versions had a `docs` dir in the root dir
+ local langref_docs="${pkgdir}/usr/share/doc/zig/langref.html";
+ if [[ -d "docs" ]]; then
+ install -D -m644 docs/zig/langref.html "$langref_docs";
+ cp -R docs/std "${pkgdir}/usr/share/doc/zig/";
+ elif [[ -f "langref.html" ]]; then
+ # New versions have langref in the root dir,
+ # stdlib docs in lib/zig/docs
+ #
+ # The first install command implicitly creates
+ # the doc directory needed by stdlib :(
+ #
+ # NOTE: Currently missing data.js file
+ #
+ # https://ziglang.org/documentation/master/std/data.js
+ # TODO: Maybe just download it seperately from the tarball?
+ install -D -m644 langref.html "$langref_docs";
+ cp -R lib/zig/docs "${pkgdir}/usr/share/doc/zig/std";
+ else
+ echo "Unable to find docs!" >&2;
+ exit 1;
+ fi;
install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/zig/LICENSE"
}