SHA256
1
0
forked from pool/snobol4

Accepting request 1089591 from home:bmwiedemann:branches:devel:languages:misc

Add reproducible.patch to drop build date (boo#1047218)

OBS-URL: https://build.opensuse.org/request/show/1089591
OBS-URL: https://build.opensuse.org/package/show/devel:languages:misc/snobol4?expand=0&rev=4
This commit is contained in:
Dominique Leuenberger 2023-06-12 10:37:13 +00:00 committed by Git OBS Bridge
parent a74a8787e9
commit fe851a5c6b
3 changed files with 59 additions and 0 deletions

53
reproducible.patch Normal file
View File

@ -0,0 +1,53 @@
Author: Bernhard M. Wiedemann <bwiedemann suse de>
To: Phil Budne <phil@regressive.org>
CC: <fred_weigel@hotmail.com>
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

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon May 29 14:29:04 UTC 2023 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add reproducible.patch to drop build date (boo#1047218)
-------------------------------------------------------------------
Tue Apr 4 08:29:44 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -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