pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/zig



Module Name:    pkgsrc
Committed By:   nikita
Date:           Tue Feb 28 20:56:27 UTC 2023

Modified Files:
        pkgsrc/lang/zig: application.mk

Log Message:
zig: changes and todo notes for application.mk, build with baseline cpu


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/zig/application.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/zig/application.mk
diff -u pkgsrc/lang/zig/application.mk:1.4 pkgsrc/lang/zig/application.mk:1.5
--- pkgsrc/lang/zig/application.mk:1.4  Sun Jan 22 19:50:50 2023
+++ pkgsrc/lang/zig/application.mk      Tue Feb 28 20:56:27 2023
@@ -1,10 +1,13 @@
-# $NetBSD: application.mk,v 1.4 2023/01/22 19:50:50 nikita Exp $
+# $NetBSD: application.mk,v 1.5 2023/02/28 20:56:27 nikita Exp $
 #
 # Common logic to handle zig packages
 # This is only usable if they include a 'build.zig' file
 #
 .include "../../mk/bsd.fast.prefs.mk"
 
+# https://github.com/ziglang/zig/issues/3382
+# For now, Zig doesn't support CFLAGS/LDFLAGS/etc.
+
 # Debug build (default):
 # Fast compilation speed, Safety checks enabled, Slow runtime performance
 # Large binary size, No reproducible build requirement
@@ -17,18 +20,30 @@
 # ReleaseSmall (-Drelease-small=true)
 # Medium runtime performance, Safety checks disabled, Slow compilation speed
 # Small binary size
-ZIGBUILDMODE?=         -Drelease-fast=true
+ZIGBUILDMODE?=         -Drelease-safe=true
+ZIGCPUMODE?=           -Dcpu=baseline
 ZIGBUILDARGS?=
 ZIGTESTARGS?=
 
 BUILD_DEPENDS+=                zig-[0-9]*:../../lang/zig
 USE_LANGUAGES=         c
 
+#MAKE_ENV+=            ZIG_GLOBAL_CACHE_DIR=${WRKSRC}/tmp
+# \todo: There is currently an issue building zig packages as RELRO.
+#RELRO_SUPPORTED=      no
+
+# figure out how to do this for all zig packages:
+#ZIGBUILDARGS+=                -Dpie=true
+#.if ${MKDEBUG:Uyes:M[yY][eE][sS]} && ${INSTALL_UNSTRIPPED:Uyes:tl} == yes
+#ZIGBUILDARGS+=                -Dstrip=true
+#.endif
+
 do-build:
-       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} zig build ${ZIGBUILDMODE} ${ZIGBUILDARGS} --prefix ${DESTDIR}${PREFIX}
+       mkdir ${WRKSRC}/tmp
+       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} zig build ${ZIGBUILDMODE} ${ZIGCPUMODE} ${ZIGBUILDARGS} --prefix ${DESTDIR}${PREFIX}
 
 do-install:
-       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} zig build install ${ZIGBUILDMODE} ${ZIGBUILDARGS} --prefix ${DESTDIR}${PREFIX}
+       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} zig build install ${ZIGBUILDMODE} ${ZIGCPUMODE} ${ZIGBUILDARGS} --prefix ${DESTDIR}${PREFIX}
 
 do-test:
-       cd ${WRKSRC} && ${SETENV} ${TEST_ENV} zig build ${ZIGBUILDMODE} ${ZIGBUILDARGS} ${ZIGTESTARGS} test
+       cd ${WRKSRC} && ${SETENV} ${TEST_ENV} zig build ${ZIGBUILDMODE} ${ZIGBUILDARGS} ${ZIGCPUMODE} ${ZIGTESTARGS} test



Home | Main Index | Thread Index | Old Index