diff options
author | Sofiane HAMAM <sofiane.hamam@smile.fr> | 2025-04-04 17:56:32 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-04-04 19:18:48 -0700 |
commit | d2ebc1fdd5d1e8d8b70259cb73a14f803b781a0e (patch) | |
tree | 1227d86eb9c3d1a92cd69044073572be5b540c9d | |
parent | 9e90eac5339dc7fc3785ec688670c557a28e8037 (diff) | |
download | meta-openembedded-d2ebc1fdd5d1e8d8b70259cb73a14f803b781a0e.tar.gz |
openocd : Fix non reproducible build
This package defines PKGBLDDATE as build timestamp which makes
it non reproducible. Use SOURCE_DATE_EPOCH if it is found, otherwise
use build timestamp. Following best practices, see :
https://reproducible-builds.org/docs/source-date-epoch/
Co-developed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Sofiane HAMAM <sofiane.hamam@smile.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-devtools/openocd/openocd/0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch | 38 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/openocd/openocd_git.bb | 1 |
2 files changed, 39 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/openocd/openocd/0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch b/meta-oe/recipes-devtools/openocd/openocd/0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch new file mode 100644 index 0000000000..c0a1803a9a --- /dev/null +++ b/meta-oe/recipes-devtools/openocd/openocd/0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 65969a2b73ce93db4c80f1706677351b0e57fa72 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sofiane HAMAM <sofiane.hamam@smile.fr> | ||
3 | Date: Fri, 28 Mar 2025 12:31:17 +0100 | ||
4 | Subject: [PATCH] Makefile.am: Use SOURCE_DATE_EPOCH environment variable | ||
5 | |||
6 | This package defines PKGBLDDATE as build timestamp which makes | ||
7 | it non reproducible. Use SOURCE_DATE_EPOCH if it is found, otherwise | ||
8 | use build timestamp. Following best practices, see : | ||
9 | https://reproducible-builds.org/docs/source-date-epoch/ | ||
10 | |||
11 | The patch is BSD compatible too. | ||
12 | |||
13 | Change-Id: I26c1a00f2e8059ae31fe72a794b5962af5a84f44 | ||
14 | Co-developed-by: Yoann Congal <yoann.congal@smile.fr> | ||
15 | Signed-off-by: Yoann Congal <yoann.congal@smile.fr> | ||
16 | Signed-off-by: Sofiane HAMAM <sofiane.hamam@smile.fr> | ||
17 | |||
18 | Upstream-Status: Submitted [https://review.openocd.org/c/openocd/+/8619] | ||
19 | --- | ||
20 | src/Makefile.am | 5 ++++- | ||
21 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
24 | index 6d79cd631..9ca697407 100644 | ||
25 | --- a/src/Makefile.am | ||
26 | +++ b/src/Makefile.am | ||
27 | @@ -30,7 +30,10 @@ if RELEASE | ||
28 | else | ||
29 | %C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\" | ||
30 | %C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\" | ||
31 | -%C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`date +%F-%R`\" | ||
32 | +%C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`DATE_FMT=+%F-%R; \ | ||
33 | + SOURCE_DATE_EPOCH="$${SOURCE_DATE_EPOCH:-$$(date +%s)}"; \ | ||
34 | + date -u -d "@$$SOURCE_DATE_EPOCH" "$$DATE_FMT" 2>/dev/null || \ | ||
35 | + date -u -r "$$SOURCE_DATE_EPOCH" "$$DATE_FMT" 2>/dev/null || date -u "$$DATE_FMT"`\" | ||
36 | endif | ||
37 | |||
38 | # add default CPPFLAGS | ||
diff --git a/meta-oe/recipes-devtools/openocd/openocd_git.bb b/meta-oe/recipes-devtools/openocd/openocd_git.bb index 559fe29ff8..b1ce2ec168 100644 --- a/meta-oe/recipes-devtools/openocd/openocd_git.bb +++ b/meta-oe/recipes-devtools/openocd/openocd_git.bb | |||
@@ -9,6 +9,7 @@ SRC_URI = " \ | |||
9 | git://repo.or.cz/r/git2cl.git;protocol=http;destsuffix=tools/git2cl;name=git2cl;branch=master \ | 9 | git://repo.or.cz/r/git2cl.git;protocol=http;destsuffix=tools/git2cl;name=git2cl;branch=master \ |
10 | git://github.com/msteveb/jimtcl.git;protocol=https;destsuffix=git/jimtcl;name=jimtcl;branch=master \ | 10 | git://github.com/msteveb/jimtcl.git;protocol=https;destsuffix=git/jimtcl;name=jimtcl;branch=master \ |
11 | git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=git/src/jtag/drivers/libjaylink;name=libjaylink;branch=master \ | 11 | git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=git/src/jtag/drivers/libjaylink;name=libjaylink;branch=master \ |
12 | file://0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | SRCREV_FORMAT = "openocd" | 15 | SRCREV_FORMAT = "openocd" |