| @@ -1,47 +1,49 @@ | | | @@ -1,47 +1,49 @@ |
1 | # $NetBSD: Makefile,v 1.34 2024/04/25 10:05:24 nikita Exp $ | | 1 | # $NetBSD: Makefile,v 1.35 2024/04/26 09:57:34 nikita Exp $ |
2 | | | 2 | |
3 | DISTNAME= zig-0.12.0 | | 3 | DISTNAME= zig-0.12.0 |
4 | CATEGORIES= lang | | 4 | CATEGORIES= lang |
5 | MASTER_SITES= https://ziglang.org/download/${PKGVERSION_NOREV}/ | | 5 | MASTER_SITES= https://ziglang.org/download/${PKGVERSION_NOREV}/ |
6 | EXTRACT_SUFX= .tar.xz | | 6 | EXTRACT_SUFX= .tar.xz |
7 | | | 7 | |
8 | MAINTAINER= pkgsrc-users@NetBSD.org | | 8 | MAINTAINER= pkgsrc-users@NetBSD.org |
9 | HOMEPAGE= https://ziglang.org/ | | 9 | HOMEPAGE= https://ziglang.org/ |
10 | COMMENT= Programming language designed for robustness and clarity | | 10 | COMMENT= Programming language designed for robustness and clarity |
11 | LICENSE= mit | | 11 | LICENSE= mit |
12 | | | 12 | |
13 | # Broken at least on *BSD, needs a new release, 0.11.0 does not build | | 13 | # Broken at least on *BSD, needs a new release, 0.11.0 does not build |
14 | # stage 3 of the build process (fixed upstream). | | 14 | # stage 3 of the build process (fixed upstream). |
15 | USE_CXX_FEATURES+= c++14 | | 15 | USE_CXX_FEATURES+= c++14 |
16 | USE_LANGUAGES= c c++ | | 16 | USE_LANGUAGES= c c++ |
17 | USE_TOOLS+= bash:run | | 17 | USE_TOOLS+= bash:run |
18 | | | 18 | |
19 | CMAKE_CONFIGURE_ARGS+= -DCMAKE_BUILD_TYPE=Release | | 19 | CMAKE_CONFIGURE_ARGS+= -DCMAKE_BUILD_TYPE=Release |
20 | CMAKE_CONFIGURE_ARGS+= -DZIG_SHARED_LLVM=ON | | 20 | CMAKE_CONFIGURE_ARGS+= -DZIG_SHARED_LLVM=ON |
21 | CMAKE_CONFIGURE_ARGS+= -DCMAKE_INSTALL_PREFIX=${DESTDIR}${PREFIX} | | 21 | CMAKE_CONFIGURE_ARGS+= -DCMAKE_INSTALL_PREFIX=${DESTDIR}${PREFIX} |
22 | # avoid full-cu-features available to build host, | | 22 | # avoid full-cu-features available to build host, |
23 | # in other words ensure that we run everywhere | | 23 | # in other words ensure that we run everywhere |
24 | CMAKE_CONFIGURE_ARGS+= -DZIG_TARGET_MCPU=baseline | | 24 | CMAKE_CONFIGURE_ARGS+= -DZIG_TARGET_MCPU=baseline |
| | | 25 | CMAKE_CONFIGURE_ARGS+= -DZIG_PIE=ON |
25 | | | 26 | |
26 | CHECK_PORTABILITY_SKIP+= ci/azure/macos_script | | 27 | CHECK_PORTABILITY_SKIP+= ci/azure/macos_script |
27 | BUILDLINK_TRANSFORM+= rm:-Werror | | 28 | BUILDLINK_TRANSFORM+= rm:-Werror |
28 | | | 29 | |
29 | UNLIMIT_RESOURCES= stacksize | | 30 | UNLIMIT_RESOURCES= stacksize |
30 | | | 31 | |
31 | # \todo: There is currently an issue building this as a PIE | | 32 | # \todo: There is currently an issue building this as a PIE |
32 | MKPIE_SUPPORTED= no | | 33 | #MKPIE_SUPPORTED= no |
33 | # RELRO checks fail for this package at the moment | | 34 | # RELRO checks fail for this package at the moment |
34 | RELRO_SUPPORTED= no | | 35 | #RELRO_SUPPORTED= no |
| | | 36 | # TODO: /usr/bin/env + /bin/env in lib/std/zig/system.zig |
35 | | | 37 | |
36 | # after install, because the zig binary ends up in paths like | | 38 | # after install, because the zig binary ends up in paths like |
37 | # ./zig-0.10.1/zig-cache/o/e6445b80597d6bc8fe865e7254800ac9/zig | | 39 | # ./zig-0.10.1/zig-cache/o/e6445b80597d6bc8fe865e7254800ac9/zig |
38 | # unless we want to run find for the executable here? | | 40 | # unless we want to run find for the executable here? |
39 | do-test: | | 41 | do-test: |
40 | mkdir ${WRKDIR}/cache | | 42 | mkdir ${WRKDIR}/cache |
41 | cd ${WRKSRC} && \ | | 43 | cd ${WRKSRC} && \ |
42 | ${DESTDIR}${PREFIX}/bin/zig build test-behavior \ | | 44 | ${DESTDIR}${PREFIX}/bin/zig build test-behavior \ |
43 | --cache-dir ${WRKDIR}/cache --global-cache-dir ${WRKDIR}/cache \ | | 45 | --cache-dir ${WRKDIR}/cache --global-cache-dir ${WRKDIR}/cache \ |
44 | --zig-lib-dir ${WRKSRC}/lib | | 46 | --zig-lib-dir ${WRKSRC}/lib |
45 | | | 47 | |
46 | .include "../../devel/cmake/build.mk" | | 48 | .include "../../devel/cmake/build.mk" |
47 | .include "../../devel/lld/buildlink3.mk" | | 49 | .include "../../devel/lld/buildlink3.mk" |