void-packages/srcpkgs/vdrift/patches/0001-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch
Đoàn Trần Công Danh 76acfa2dd2 srcpkgs/v*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

38 lines
1.1 KiB
Diff

From 5345e8b57d300b14c36b8519e18f67096e4b8d78 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Thu, 11 Jul 2019 10:33:52 +0200
Subject: [PATCH 1/3] Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Also use UTC/gmtime to be independent of timezone.
---
SConstruct | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git SConstruct SConstruct
index 950a5289..763f2e36 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,5 +1,4 @@
-import os, sys, errno, SCons
-from time import gmtime, strftime
+import os, sys, time, errno, SCons
#---------------#
# Build Options #
@@ -395,7 +394,7 @@ else:
#------------------------#
# Version, debug/release #
#------------------------#
-version = strftime("%Y-%m-%d")
+version = time.strftime("%Y-%m-%d", time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
build_dir = 'build'
if env['release']:
# release build, debugging off, optimizations on
--
2.29.0.rc1