Hi,
I ran into software doing the following:
set( TARFLAGS cfz )
if( DEFINED ENV{SOURCE_DATE_EPOCH} )
set( TARFLAGS --sort=name --mtime=@$ENV{SOURCE_DATE_EPOCH}
--clamp-mtime --owner=0 --group=0 --numeric-owner
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime
-czf )
endif()
Basically: if SOURCE_DATE_EPOCH is defined, run
tar --sort=name --mtime=...
which fails on macOS because --sort, --mtime etc. are all GNU extensions.
What's the best way to handle this?
1.) Can the code be rewritten in such a way that it will work with
native tar, and yet result in reproducible builds?
2.) If that is not possible, I guess that using gnu tar as build
dependency is the best bet?
3.) Can SOURCE_DATE_EPOCH be easily unset during configure/build step?
Thank you,
Mojca