summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/wireshark
diff options
context:
space:
mode:
authorOleksiy Obitotskyy <oobitots@cisco.com>2021-02-17 06:41:21 -0800
committerKhem Raj <raj.khem@gmail.com>2021-02-17 09:58:35 -0800
commitac4c2dc26d935d89fa7de498ddbb1f8dee7b3718 (patch)
tree814d1827bab77f2b54d180b519b1390ce1050781 /meta-networking/recipes-support/wireshark
parent4f0166d871caf78e15c79f372abe21d9096e6edb (diff)
downloadmeta-openembedded-ac4c2dc26d935d89fa7de498ddbb1f8dee7b3718.tar.gz
wireshark-src: improve reproducibility
What was done: - add --noline option to flex, --no-line to bison and -l to lemon generators to prevent adding #line directives with absolute path. - eliminate absolute source path in python code generator and use baseline instead. Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/wireshark')
-rw-r--r--meta-networking/recipes-support/wireshark/files/0001-wireshark-src-improve-reproducibility.patch44
-rw-r--r--meta-networking/recipes-support/wireshark/files/0002-flex-Remove-line-directives.patch46
-rw-r--r--meta-networking/recipes-support/wireshark/files/0003-bison-Remove-line-directives.patch59
-rw-r--r--meta-networking/recipes-support/wireshark/files/0004-lemon-Remove-line-directives.patch77
-rw-r--r--meta-networking/recipes-support/wireshark/wireshark_3.4.3.bb7
5 files changed, 233 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/wireshark/files/0001-wireshark-src-improve-reproducibility.patch b/meta-networking/recipes-support/wireshark/files/0001-wireshark-src-improve-reproducibility.patch
new file mode 100644
index 000000000..0b83ca4ae
--- /dev/null
+++ b/meta-networking/recipes-support/wireshark/files/0001-wireshark-src-improve-reproducibility.patch
@@ -0,0 +1,44 @@
1From 0a9ab056ce7582033a21d6bc541ece520bf2b0b6 Mon Sep 17 00:00:00 2001
2From: Oleksiy Obitotskyy <oobitots@cisco.com>
3Date: Thu, 26 Nov 2020 05:38:31 -0800
4Subject: [PATCH] wireshark-src: improve reproducibility
5
6Cut absolute path for filename in generated code
7comments.
8
9Upstream-Status: Pending
10Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
11---
12 tools/make-plugin-reg.py | 2 +-
13 tools/ncp2222.py | 2 +-
14 2 files changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/tools/make-plugin-reg.py b/tools/make-plugin-reg.py
17index 66b4656..c52b3fc 100755
18--- a/tools/make-plugin-reg.py
19+++ b/tools/make-plugin-reg.py
20@@ -28,7 +28,7 @@ preamble = """\
21 *
22 * Generated automatically from %s.
23 */
24-""" % (sys.argv[0])
25+""" % (os.path.basename(sys.argv[0]))
26
27 # Create the proper list of filenames
28 filenames = []
29diff --git a/tools/ncp2222.py b/tools/ncp2222.py
30index 1dea4ec..dc376e3 100755
31--- a/tools/ncp2222.py
32+++ b/tools/ncp2222.py
33@@ -5858,7 +5858,7 @@ def produce_code():
34
35 print("/*")
36 print(" * Do not modify this file. Changes will be overwritten.")
37- print(" * Generated automatically from %s" % (sys.argv[0]))
38+ print(" * Generated automatically from %s" % (os.path.basename(sys.argv[0])))
39 print(" */\n")
40
41 print("""
42--
432.26.2.Cisco
44
diff --git a/meta-networking/recipes-support/wireshark/files/0002-flex-Remove-line-directives.patch b/meta-networking/recipes-support/wireshark/files/0002-flex-Remove-line-directives.patch
new file mode 100644
index 000000000..069b5793d
--- /dev/null
+++ b/meta-networking/recipes-support/wireshark/files/0002-flex-Remove-line-directives.patch
@@ -0,0 +1,46 @@
1From 3e571e24c730f747d18ed02ba7451e9e00480fc7 Mon Sep 17 00:00:00 2001
2From: Oleksiy Obitotskyy <oobitots@cisco.com>
3Date: Thu, 26 Nov 2020 12:00:43 -0800
4Subject: [PATCH] flex: Remove #line directives
5
6Append --noline option to flex to not
7generate #line directives with absolute file patch.
8
9Upstream-Status: Pending
10Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
11---
12 cmake/modules/FindLEX.cmake | 18 +++++++++++++-----
13 1 file changed, 13 insertions(+), 5 deletions(-)
14
15diff --git a/cmake/modules/FindLEX.cmake b/cmake/modules/FindLEX.cmake
16index 0008bc4..ec68f84 100644
17--- a/cmake/modules/FindLEX.cmake
18+++ b/cmake/modules/FindLEX.cmake
19@@ -32,11 +32,19 @@ MACRO(ADD_LEX_FILES _source _generated)
20 SET(_outc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.c)
21 SET(_outh ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_lex.h)
22
23- ADD_CUSTOM_COMMAND(
24- OUTPUT ${_outc} ${_outh}
25- COMMAND ${LEX_EXECUTABLE} -o${_outc} --header-file=${_outh} ${_in}
26- DEPENDS ${_in}
27- )
28+ IF (DEFINED ENV{SOURCE_DATE_EPOCH})
29+ ADD_CUSTOM_COMMAND(
30+ OUTPUT ${_outc} ${_outh}
31+ COMMAND ${LEX_EXECUTABLE} --noline -o${_outc} --header-file=${_outh} ${_in}
32+ DEPENDS ${_in}
33+ )
34+ ELSE ()
35+ ADD_CUSTOM_COMMAND(
36+ OUTPUT ${_outc} ${_outh}
37+ COMMAND ${LEX_EXECUTABLE} -o${_outc} --header-file=${_outh} ${_in}
38+ DEPENDS ${_in}
39+ )
40+ ENDIF ()
41 LIST(APPEND ${_source} ${_in})
42 LIST(APPEND ${_generated} ${_outc})
43 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
44--
452.26.2.Cisco
46
diff --git a/meta-networking/recipes-support/wireshark/files/0003-bison-Remove-line-directives.patch b/meta-networking/recipes-support/wireshark/files/0003-bison-Remove-line-directives.patch
new file mode 100644
index 000000000..824761a3d
--- /dev/null
+++ b/meta-networking/recipes-support/wireshark/files/0003-bison-Remove-line-directives.patch
@@ -0,0 +1,59 @@
1From 42abf1d299fed8e00a189f6f9c55fb344e5bb775 Mon Sep 17 00:00:00 2001
2From: Oleksiy Obitotskyy <oobitots@cisco.com>
3Date: Wed, 27 Jan 2021 04:01:34 -0800
4Subject: [PATCH] bison: Remove #line directives
5
6Append --no-lines option to bison to not
7generate #line directives with absolute file path.
8
9Upstream-Status: Pending
10Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
11---
12 cmake/modules/FindYACC.cmake | 31 ++++++++++++++++++++++---------
13 1 file changed, 22 insertions(+), 9 deletions(-)
14
15diff --git a/cmake/modules/FindYACC.cmake b/cmake/modules/FindYACC.cmake
16index c96f87b..54a73cb 100644
17--- a/cmake/modules/FindYACC.cmake
18+++ b/cmake/modules/FindYACC.cmake
19@@ -29,15 +29,28 @@ MACRO(ADD_YACC_FILES _source _generated)
20
21 SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.c)
22
23- ADD_CUSTOM_COMMAND(
24- OUTPUT ${_out}
25- COMMAND ${YACC_EXECUTABLE}
26- -d
27- -p ${_basename}
28- -o${_out}
29- ${_in}
30- DEPENDS ${_in}
31- )
32+ IF (DEFINED ENV{SOURCE_DATE_EPOCH})
33+ ADD_CUSTOM_COMMAND(
34+ OUTPUT ${_out}
35+ COMMAND ${YACC_EXECUTABLE}
36+ --no-lines
37+ -d
38+ -p ${_basename}
39+ -o${_out}
40+ ${_in}
41+ DEPENDS ${_in}
42+ )
43+ ELSE ()
44+ ADD_CUSTOM_COMMAND(
45+ OUTPUT ${_out}
46+ COMMAND ${YACC_EXECUTABLE}
47+ -d
48+ -p ${_basename}
49+ -o${_out}
50+ ${_in}
51+ DEPENDS ${_in}
52+ )
53+ ENDIF ()
54 LIST(APPEND ${_source} ${_in})
55 LIST(APPEND ${_generated} ${_out})
56 ENDFOREACH (_current_FILE)
57--
582.26.2.Cisco
59
diff --git a/meta-networking/recipes-support/wireshark/files/0004-lemon-Remove-line-directives.patch b/meta-networking/recipes-support/wireshark/files/0004-lemon-Remove-line-directives.patch
new file mode 100644
index 000000000..c1a528f90
--- /dev/null
+++ b/meta-networking/recipes-support/wireshark/files/0004-lemon-Remove-line-directives.patch
@@ -0,0 +1,77 @@
1From 17f05a8d02c589e4867906f70381e63e46a67870 Mon Sep 17 00:00:00 2001
2From: Oleksiy Obitotskyy <oobitots@cisco.com>
3Date: Wed, 27 Jan 2021 06:47:13 -0800
4Subject: [PATCH] lemon: Remove #line directives
5
6In case of reproducible build remove #line
7directives with extra option '-l'.
8
9Upstream-Status: Pending
10Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
11---
12 cmake/modules/UseLemon.cmake | 49 +++++++++++++++++++++++++-----------
13 1 file changed, 34 insertions(+), 15 deletions(-)
14
15diff --git a/cmake/modules/UseLemon.cmake b/cmake/modules/UseLemon.cmake
16index 849ffc1..ca38ab7 100644
17--- a/cmake/modules/UseLemon.cmake
18+++ b/cmake/modules/UseLemon.cmake
19@@ -7,21 +7,40 @@ MACRO(ADD_LEMON_FILES _source _generated)
20
21 SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename})
22
23- ADD_CUSTOM_COMMAND(
24- OUTPUT
25- ${_out}.c
26- # These files are generated as side-effect
27- ${_out}.h
28- ${_out}.out
29- COMMAND lemon
30- -T${_lemonpardir}/lempar.c
31- -d.
32- ${_in}
33- DEPENDS
34- ${_in}
35- lemon
36- ${_lemonpardir}/lempar.c
37- )
38+ IF (DEFINED ENV{SOURCE_DATE_EPOCH})
39+ ADD_CUSTOM_COMMAND(
40+ OUTPUT
41+ ${_out}.c
42+ # These files are generated as side-effect
43+ ${_out}.h
44+ ${_out}.out
45+ COMMAND lemon
46+ -l
47+ -T${_lemonpardir}/lempar.c
48+ -d.
49+ ${_in}
50+ DEPENDS
51+ ${_in}
52+ lemon
53+ ${_lemonpardir}/lempar.c
54+ )
55+ ELSE ()
56+ ADD_CUSTOM_COMMAND(
57+ OUTPUT
58+ ${_out}.c
59+ # These files are generated as side-effect
60+ ${_out}.h
61+ ${_out}.out
62+ COMMAND lemon
63+ -T${_lemonpardir}/lempar.c
64+ -d.
65+ ${_in}
66+ DEPENDS
67+ ${_in}
68+ lemon
69+ ${_lemonpardir}/lempar.c
70+ )
71+ ENDIF ()
72
73 LIST(APPEND ${_source} ${_in})
74 LIST(APPEND ${_generated} ${_out}.c)
75--
762.26.2.Cisco
77
diff --git a/meta-networking/recipes-support/wireshark/wireshark_3.4.3.bb b/meta-networking/recipes-support/wireshark/wireshark_3.4.3.bb
index 1c470d8bc..e730b18a0 100644
--- a/meta-networking/recipes-support/wireshark/wireshark_3.4.3.bb
+++ b/meta-networking/recipes-support/wireshark/wireshark_3.4.3.bb
@@ -10,6 +10,13 @@ DEPENDS_append_class-target = " wireshark-native chrpath-replacement-native "
10 10
11SRC_URI = "https://1.eu.dl.wireshark.org/src/all-versions/wireshark-${PV}.tar.xz" 11SRC_URI = "https://1.eu.dl.wireshark.org/src/all-versions/wireshark-${PV}.tar.xz"
12 12
13SRC_URI += " \
14 file://0001-wireshark-src-improve-reproducibility.patch \
15 file://0002-flex-Remove-line-directives.patch \
16 file://0003-bison-Remove-line-directives.patch \
17 file://0004-lemon-Remove-line-directives.patch \
18"
19
13UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src" 20UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src"
14 21
15SRC_URI[sha256sum] = "f467cc77f0fc73fce0b854cdbc292f132d4879fca69d417eccad5f967fbf262b" 22SRC_URI[sha256sum] = "f467cc77f0fc73fce0b854cdbc292f132d4879fca69d417eccad5f967fbf262b"