diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..d496efc --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,53 @@ +Author: Bernhard M. Wiedemann +To: Phil Budne +CC: +Subject: [Patch] PoC reproducible builds + +Allow for bit-identical binaries to be created +See https://reproducible-builds.org/ for why. + +This patch was done while working on reproducible builds for openSUSE. + +Index: snobol4-2.3.1/snolib/setuputil.sno +=================================================================== +--- snobol4-2.3.1.orig/snolib/setuputil.sno ++++ snobol4-2.3.1/snolib/setuputil.sno +@@ -194,7 +194,7 @@ setup.makeinclude + + ou = IO_FINDUNIT() + of = setup.sno(t) + OUTPUT(.out, ou,, of) :f(freturn) +- out = "* Generated by setuputil.sno setup.makeinclude() " DATE() ++ out = "* Generated by setuputil.sno setup.makeinclude() " + modname = REPLACE(t['module'], &LCASE, &UCASE) '_DL' + out = setup.t modname ' = "' t['module'] '"' + iu = IO_FINDUNIT() +Index: snobol4-2.3.1/configure +=================================================================== +--- snobol4-2.3.1.orig/configure ++++ snobol4-2.3.1/configure +@@ -45,6 +45,10 @@ DATE=`date` + + # run hostname from subshell to redirect shell "not found message" + HOST=`(hostname) 2>/dev/null || uname -n` ++if [ -n "$SOURCE_DATE_EPOCH" ] ; then ++ DATE='reproducible' ++ HOST='reproducible' ++fi + + VERSION_H=version.h.tmp + CONFIG_H=config.h.tmp +Index: snobol4-2.3.1/Makefile2.m4 +=================================================================== +--- snobol4-2.3.1.orig/Makefile2.m4 ++++ snobol4-2.3.1/Makefile2.m4 +@@ -260,8 +260,8 @@ build.o: always + echo '/* MACHINE GENERATED. EDITING IS FUTILE */' > build.c + echo '#include "h.h"' >> build.c + echo 'const char build_files[] = "'$(SRCS)'";' >> build.c +- echo 'const char build_date[] = "'`date`'";' >> build.c +- echo 'const char build_dir[] = "'`pwd`'";' >> build.c ++ echo 'const char build_date[] = "'nodate'";' >> build.c ++ echo 'const char build_dir[] = "'reproducible'";' >> build.c + $(CC) $(CFLAGS) -c build.c + changequote([,])dnl + diff --git a/snobol4.changes b/snobol4.changes index ab60832..30e383a 100644 --- a/snobol4.changes +++ b/snobol4.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 29 14:29:04 UTC 2023 - Bernhard Wiedemann + +- Add reproducible.patch to drop build date (boo#1047218) + ------------------------------------------------------------------- Tue Apr 4 08:29:44 UTC 2023 - Dominique Leuenberger diff --git a/snobol4.spec b/snobol4.spec index 3bab4ba..33f2a57 100644 --- a/snobol4.spec +++ b/snobol4.spec @@ -27,6 +27,7 @@ URL: https://www.regressive.org/snobol4/csnobol4/curr/ Source0: https://ftp.regressive.org/snobol4/%{name}-%{version}.tar.gz # Do not hardcode -O3. Patch1: snobol4-2.3.1-configure-no-opt.patch +Patch2: reproducible.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gdbm-devel