mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-24 04:33:24 +00:00
lang/zig: update to 0.8.0 and add docs
Reviewed by: jbeich Reviewed by: Daniel Engberg <daniel.engberg.lists@pyret.net> Differential Revision: https://reviews.freebsd.org/D30742 Sponsored by: SkunkWerks, GmbH
This commit is contained in:
parent
c849ff5db5
commit
cdea3af060
@ -1,9 +1,7 @@
|
||||
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
|
||||
@ -11,18 +9,50 @@ 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>
|
||||
|
@ -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
lang/zig/files/patch-doc_langref.html.in
Normal file
13
lang/zig/files/patch-doc_langref.html.in
Normal file
@ -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.
|
@ -1,23 +0,0 @@
|
||||
--- lib/std/c.zig.orig 2020-12-13 19:14:58 UTC
|
||||
+++ lib/std/c.zig
|
||||
@@ -346,3 +346,20 @@ pub extern "c" fn prctl(option: c_int, ...) c_int;
|
||||
|
||||
pub extern "c" fn getrlimit(resource: rlimit_resource, rlim: *rlimit) c_int;
|
||||
pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_int;
|
||||
+
|
||||
+pub extern "c" fn fmemopen(noalias buf: ?*c_void, size: usize, noalias mode: [*:0]const u8) ?*FILE;
|
||||
+
|
||||
+pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void;
|
||||
+pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void;
|
||||
+pub extern "c" fn closelog() void;
|
||||
+pub extern "c" fn setlogmask(maskpri: c_int) c_int;
|
||||
+
|
||||
+pub const max_align_t = if (std.Target.current.abi == .msvc)
|
||||
+ f64
|
||||
+else if (std.Target.current.isDarwin())
|
||||
+ c_longdouble
|
||||
+else
|
||||
+ extern struct {
|
||||
+ a: c_longlong,
|
||||
+ b: c_longdouble,
|
||||
+ };
|
@ -1,25 +0,0 @@
|
||||
--- lib/std/os/bits.zig.orig 2020-12-13 19:14:58 UTC
|
||||
+++ lib/std/os/bits.zig
|
||||
@@ -34,3 +34,22 @@ pub const iovec_const = extern struct {
|
||||
iov_base: [*]const u8,
|
||||
iov_len: usize,
|
||||
};
|
||||
+
|
||||
+// syslog
|
||||
+
|
||||
+/// system is unusable
|
||||
+pub const LOG_EMERG = 0;
|
||||
+/// action must be taken immediately
|
||||
+pub const LOG_ALERT = 1;
|
||||
+/// critical conditions
|
||||
+pub const LOG_CRIT = 2;
|
||||
+/// error conditions
|
||||
+pub const LOG_ERR = 3;
|
||||
+/// warning conditions
|
||||
+pub const LOG_WARNING = 4;
|
||||
+/// normal but significant condition
|
||||
+pub const LOG_NOTICE = 5;
|
||||
+/// informational
|
||||
+pub const LOG_INFO = 6;
|
||||
+/// debug-level messages
|
||||
+pub const LOG_DEBUG = 7;
|
@ -1,24 +0,0 @@
|
||||
--- lib/std/os/bits/freebsd.zig.orig 2020-12-13 19:14:58 UTC
|
||||
+++ lib/std/os/bits/freebsd.zig
|
||||
@@ -15,6 +15,7 @@ pub const gid_t = u32;
|
||||
pub const mode_t = c_uint;
|
||||
|
||||
pub const socklen_t = u32;
|
||||
+pub const suseconds_t = c_long;
|
||||
|
||||
/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
|
||||
pub const Kevent = extern struct {
|
||||
@@ -159,6 +160,13 @@ pub const libc_stat = extern struct {
|
||||
pub const timespec = extern struct {
|
||||
tv_sec: isize,
|
||||
tv_nsec: isize,
|
||||
+};
|
||||
+
|
||||
+pub const timeval = extern struct {
|
||||
+ /// seconds
|
||||
+ tv_sec: time_t,
|
||||
+ /// microseconds
|
||||
+ tv_usec: suseconds_t,
|
||||
};
|
||||
|
||||
pub const dirent = extern struct {
|
4110
lang/zig/pkg-plist
4110
lang/zig/pkg-plist
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user