The -d argument to the date command is not portable, and there's no portable alternative.
This results in an error in BSD systems, and consequently always the current date in BUILD_DATE even if SOURCE_DATE_EPOCH is defined.
On BSD systems one must use -j and -f to produce an equivalent effect to the GNU -d (BSD doesn't guess the format).