Klemens Nanni <[email protected]> writes:

> On Fri, Jun 11, 2021 at 08:32:18PM +0200, Omar Polo wrote:
>> 
>> textproc/cloc' pod2man.mk fails to generate a manpage because the date
>> command fails.  Don't know why it doesn't stop the build, but the
>> following seems to fix it.
>> 
>> Index: Makefile
>> ===================================================================
>> RCS file: /home/cvs/ports/textproc/cloc/Makefile,v
>> retrieving revision 1.15
>> diff -u -p -r1.15 Makefile
>> --- Makefile 1 Jun 2020 21:24:48 -0000       1.15
>> +++ Makefile 11 Jun 2021 18:22:49 -0000
>> @@ -4,6 +4,7 @@ COMMENT=             count lines of code
>>  
>>  V=                  1.86
>>  DISTNAME=           cloc-${V}
>> +REVISION=           0
>>  
>>  CATEGORIES=         textproc devel
>>  
>> Index: patches/patch-Unix_pod2man_mk
>> ===================================================================
>> RCS file: patches/patch-Unix_pod2man_mk
>> diff -N patches/patch-Unix_pod2man_mk
>> --- /dev/null        1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-Unix_pod2man_mk    11 Jun 2021 18:23:27 -0000
>> @@ -0,0 +1,14 @@
>> +$OpenBSD$
>> +
>> +Index: Unix/pod2man.mk
>> +--- Unix/pod2man.mk.orig
>> ++++ Unix/pod2man.mk
>> +@@ -40,7 +40,7 @@ PACKAGE           ?= package
>> + # Optional variables to set
>> + MANSECT            ?= 1
>> + PODCENTER  ?= User Commands
>> +-PODDATE            ?= $$(date --utc --date="@$${SOURCE_DATE_EPOCH:-$$(date 
>> +%s)}" "+%Y-%m-%d")
>> ++PODDATE            ?= $$(date -ujf "%s" "$${SOURCE_DATE_EPOCH:-$$(date 
>> +%s)}" "+%Y-%m-%d")
>
> SOURCE_DATE_EPOCH is not set, neither by cloc WRKSRC or our Makefile,
> so the "today" default, e.g. "2021-06-11" kicks in.
>
> That means that manual page and therefore the package content changes
> every day;  wouldn't it be wiser to amend FAKE_FLAGS with this?
>
>       PODDATE=<date of release>
>
> No need for a patch fixing what's already flawed (in our build
> environment), imho.

Yep, it seems way better :)

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/textproc/cloc/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile    1 Jun 2020 21:24:48 -0000       1.15
+++ Makefile    11 Jun 2021 19:56:40 -0000
@@ -4,6 +4,7 @@ COMMENT=                count lines of code
 
 V=                     1.86
 DISTNAME=              cloc-${V}
+REVISION=              0
 
 CATEGORIES=            textproc devel
 
@@ -25,7 +26,8 @@ RUN_DEPENDS=          devel/p5-Algorithm-Diff \
 BUILD_DEPENDS+=                ${RUN_DEPENDS}
 
 FAKE_FLAGS=            prefix="${PREFIX}" \
-                       man_prefix="${PREFIX}"
+                       man_prefix="${PREFIX}" \
+                       PODDATE=2020-05-19
 
 USE_GMAKE=             Yes
 

Reply via email to