--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/reproducible-build.patch 2020-02-08 14:38:25.778464385 +0000 @@ -0,0 +1,28 @@ +Description: Make the build reproducible +Author: Chris Lamb +Last-Update: 2020-02-08 + +--- pynwb-1.2.1.orig/src/pynwb/file.py ++++ pynwb-1.2.1/src/pynwb/file.py +@@ -1,5 +1,6 @@ ++import os + from datetime import datetime +-from dateutil.tz import tzlocal ++from dateutil.tz import tzlocal, UTC + from collections.abc import Iterable + from warnings import warn + import copy as _copy +@@ -306,7 +307,12 @@ class NWBFile(MultiContainerInterface): + + self.fields['file_create_date'] = getargs('file_create_date', kwargs) + if self.fields['file_create_date'] is None: +- self.fields['file_create_date'] = datetime.now(tzlocal()) ++ try: ++ file_create_date = datetime.utcfromtimestamp(int(os.environ['SOURCE_DATE_EPOCH'])) ++ file_create_date = file_create_date.replace(tzinfo=UTC) ++ except KeyError: ++ file_create_date = datetime.now(tzlocal()) ++ self.fields['file_create_date'] = file_create_date + if isinstance(self.fields['file_create_date'], datetime): + self.fields['file_create_date'] = [self.fields['file_create_date']] + self.fields['file_create_date'] = list(map(_add_missing_timezone, self.fields['file_create_date'])) --- a/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/series 2020-02-08 14:33:13.040208521 +0000 @@ -0,0 +1 @@ +reproducible-build.patch