Skip to content

Commit

Permalink
lang/zig: update to 0.8.0 and add docs
Browse files Browse the repository at this point in the history
Reviewed by:	jbeich
Reviewed by:	Daniel Engberg <daniel.engberg.lists@pyret.net>
Differential Revision: https://reviews.freebsd.org/D30742
Sponsored by:	SkunkWerks, GmbH
  • Loading branch information
dch committed Jun 22, 2021
1 parent c849ff5 commit cdea3af
Show file tree
Hide file tree
Showing 7 changed files with 3,978 additions and 267 deletions.
44 changes: 37 additions & 7 deletions lang/zig/Makefile
@@ -1,28 +1,58 @@
PORTNAME= zig
DISTVERSION= 0.7.1
PORTREVISION= 2
DISTVERSION= 0.8.0
CATEGORIES= lang
MASTER_SITES= https://ziglang.org/download/${DISTVERSION}/ \
https://ziglang.org/builds/
MASTER_SITES= https://ziglang.org/download/${DISTVERSION}/

MAINTAINER= dch@FreeBSD.org
COMMENT= Language designed for robustness, optimality, and maintainability

LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

BROKEN_i386= static_assert failed "static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), "")"
IGNORE_FreeBSD_11= expects getrandom(2) which is unavailable on FreeBSD < 12.0
ONLY_FOR_ARCHS= aarch64 amd64
ONLY_FOR_ARCHS_REASON= not yet supported

_LLVM_VER= 11
BUILD_DEPENDS= llvm${_LLVM_VER}>=0:devel/llvm${_LLVM_VER}

USES= cmake compiler:c++11-lang tar:xz
USES= cmake compiler:c++11-lang localbase:ldflags tar:xz

OPTIONS_DEFINE= STATIC
OPTIONS_DEFAULT= STATIC

STATIC_DESC= sets ZIG_STATIC to avoid 800MiB LLVM dependencies

STATIC_RUN_DEPENDS_OFF= llvm${_LLVM_VER}>=0:devel/llvm${_LLVM_VER}
STATIC_CMAKE_BOOL= CMAKE_SKIP_INSTALL_RPATH ZIG_STATIC
STATIC_LDFLAGS= -lz -llzma -lm -lxml2 -lmd

_LLVM_VER= 12
_ZIG_BIN= ${STAGEDIR}${PREFIX}/bin/zig

post-configure-STATIC-on:
@${REINPLACE_CMD} 's/-Wl,-Bdynamic//' ${BUILD_WRKSRC}/build.ninja

post-build:
# Produce the experimental std lib documentation.
${MKDIR} ${WRKDIR}/cache ${WRKDIR}/doc
${WRKDIR}/.build/zig test ${WRKSRC}/lib/std/std.zig \
--cache-dir ${WRKDIR}/cache \
--global-cache-dir ${WRKDIR}/cache \
--override-lib-dir ${WRKSRC}/lib \
-femit-docs=${WRKDIR}/doc \
-fno-emit-bin
${RM} ${WRKSRC}/lib/zig/std/zig-cache

post-install:
${MKDIR} ${STAGEDIR}${DOCSDIR}/std
# langref cannot be generated until after install target has run
(cd ${WRKSRC} && ${_ZIG_BIN} run \
./doc/docgen.zig -- ${_ZIG_BIN} \
./doc/langref.html.in ${STAGEDIR}${DOCSDIR}/langref.html \
&& ${RM} ${STAGEDIR}/lib/zig/std/zig-cache)
${REINPLACE_CMD} -i '' -e 's|${STAGEDIR}||' ${STAGEDIR}${DOCSDIR}/langref.html
.for f in data.js main.js index.html
${INSTALL_MAN} ${WRKDIR}/doc/${f} ${STAGEDIR}${DOCSDIR}/std/
.endfor

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions lang/zig/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1607988527
SHA256 (zig-0.7.1.tar.xz) = 2db3b944ab368d955b48743d9f7c963b8f96de1a441ba5a35e197237cc6dae44
SIZE (zig-0.7.1.tar.xz) = 10711824
TIMESTAMP = 1623448037
SHA256 (zig-0.8.0.tar.xz) = 03a828d00c06b2e3bb8b7ff706997fd76bf32503b08d759756155b6e8c981e77
SIZE (zig-0.8.0.tar.xz) = 12614896
13 changes: 13 additions & 0 deletions lang/zig/files/patch-doc_langref.html.in
@@ -0,0 +1,13 @@
--- doc/langref.html.in.orig 2021-06-14 12:00:33 UTC
+++ doc/langref.html.in
@@ -221,7 +221,9 @@
</p>
<p>
If you search for something specific in this documentation and do not find it,
- please <a href="https://github.com/ziglang/www.ziglang.org/issues/new?title=I%20searched%20for%20___%20in%20the%20docs%20and%20didn%27t%20find%20it">file an issue</a> or <a href="https://webchat.freenode.net/?channels=%23zig">say something on IRC</a>.
+ please <a
+ href="https://github.com/ziglang/www.ziglang.org/issues/new?title=I%20searched%20for%20___%20in%20the%20docs%20and%20didn%27t%20find%20it">file
+ an issue</a> or <a href="https://web.libera.chat/#zig">say something on IRC</a>.
</p>
<p>
The code samples in this document are compiled and tested as part of the main test suite of Zig.
23 changes: 0 additions & 23 deletions lang/zig/files/patch-lib_std_c.zig

This file was deleted.

25 changes: 0 additions & 25 deletions lang/zig/files/patch-lib_std_os_bits.zig

This file was deleted.

24 changes: 0 additions & 24 deletions lang/zig/files/patch-lib_std_os_bits_freebsd.zig

This file was deleted.

0 comments on commit cdea3af

Please sign in to comment.