From 342dabb28d51986e8bae52fd93b17df2874ac84b Mon Sep 17 00:00:00 2001 From: Li-Wen Hsu Date: Sat, 3 Oct 2026 03:52:10 +0800 Subject: [PATCH] gbuild: Use date -r for the BSDs as on macOS When building with `--with-java`, `jar --date=` gets an empty value on the BSDs due to "date: illegal option -- d" and causes build failure. All the BSDs use `date -r EPOCH` and the `date` in macOS is derived from BSD's. `date -d @EPOCH` is GNU coreutils syntax. Claude Code (Opus 5.5) was used to analyze the issue and to draft the first fix. Change-Id: I5c28c58985f0fdf2a44a608000b9d14ebd33a6ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211765 Reviewed-by: Ilmari Lauhakangas Tested-by: Jenkins --- solenv/gbuild/Jar.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk index d69e784dbe36..be63820c21ea 100644 --- a/solenv/gbuild/Jar.mk +++ b/solenv/gbuild/Jar.mk @@ -19,7 +19,7 @@ # Jar class -gb_Jar_JARCOMMAND := jar $(if $(SOURCE_DATE_EPOCH),--date="$(shell date $(if $(filter $(OS),MACOSX),-r ,-d @)$(SOURCE_DATE_EPOCH) -u +'%FT%T+00:00')") +gb_Jar_JARCOMMAND := jar $(if $(SOURCE_DATE_EPOCH),--date="$(shell date $(if $(filter $(OS),DRAGONFLY FREEBSD MACOSX NETBSD OPENBSD),-r ,-d @)$(SOURCE_DATE_EPOCH) -u +'%FT%T+00:00')") gb_Jar_LAYER_DIRS := \ URE:$(INSTROOT)/$(LIBO_URE_SHARE_JAVA_FOLDER) \