diff mbox series

icu: remove host references in nativesdk to fix reproducibility

Message ID 20240712111130.2221496-1-ohnatiuk@cisco.com
State Accepted, archived
Commit dc6306883cc2c7d4d98d595442e5bf4037a160c5
Headers show
Series icu: remove host references in nativesdk to fix reproducibility | expand

Commit Message

Fix is only done for target. Copy same code for nativesdk.

Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
Signed-off-by: Oleksandr Hnatiuk <ohnatiuk@cisco.com>
---
 meta/recipes-support/icu/icu_75-1.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Alexander Kanavin July 12, 2024, 11:13 a.m. UTC | #1
You need to put this into a function, and call it from various places,
instead of just copy-pasting code.

Alex

On Fri, 12 Jul 2024 at 13:11, Oleksandr Hnatiuk via
lists.openembedded.org <ohnatiuk=cisco.com@lists.openembedded.org>
wrote:
>
> Fix is only done for target. Copy same code for nativesdk.
>
> Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
> Signed-off-by: Oleksandr Hnatiuk <ohnatiuk@cisco.com>
> ---
>  meta/recipes-support/icu/icu_75-1.bb | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/meta/recipes-support/icu/icu_75-1.bb b/meta/recipes-support/icu/icu_75-1.bb
> index 27fe392e4d4e..4b7023fd06e1 100644
> --- a/meta/recipes-support/icu/icu_75-1.bb
> +++ b/meta/recipes-support/icu/icu_75-1.bb
> @@ -39,6 +39,15 @@ do_compile:prepend:class-target () {
>             -i ${B}/tools/toolutil/Makefile
>  }
>
> +do_compile:prepend:class-nativesdk () {
> +       # Make sure certain build host references do not end up being compiled
> +       # in the image. This only affects libicutu and icu-dbg
> +       sed  \
> +           -e 's,DU_BUILD=,DU_BUILD_unused=,g' \
> +           -e '/^CPPFLAGS.*/ s,--sysroot=${STAGING_DIR_TARGET},,g' \
> +           -i ${B}/tools/toolutil/Makefile
> +}
> +
>  PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
>  do_install:append:class-native() {
>         mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
> @@ -66,6 +75,16 @@ do_install:append:class-target() {
>             ${D}/${libdir}/${BPN}/${@icu_install_folder(d)}/pkgdata.inc
>  }
>
> +do_install:append:class-nativesdk() {
> +       # Remove build host references...
> +       sed -i  \
> +           -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
> +           -e 's|${DEBUG_PREFIX_MAP}||g' \
> +           -e 's:${HOSTTOOLS_DIR}/::g' \
> +           ${D}/${libdir}/${BPN}/${@icu_install_folder(d)}/Makefile.inc \
> +           ${D}/${libdir}/${BPN}/${@icu_install_folder(d)}/pkgdata.inc
> +}
> +
>  PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio"
>
>  FILES:${PN}-dev += "${libdir}/${BPN}/"
> --
> 2.35.6
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#201820): https://lists.openembedded.org/g/openembedded-core/message/201820
> Mute This Topic: https://lists.openembedded.org/mt/107179994/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-support/icu/icu_75-1.bb b/meta/recipes-support/icu/icu_75-1.bb
index 27fe392e4d4e..4b7023fd06e1 100644
--- a/meta/recipes-support/icu/icu_75-1.bb
+++ b/meta/recipes-support/icu/icu_75-1.bb
@@ -39,6 +39,15 @@  do_compile:prepend:class-target () {
 	    -i ${B}/tools/toolutil/Makefile
 }
 
+do_compile:prepend:class-nativesdk () {
+	# Make sure certain build host references do not end up being compiled
+	# in the image. This only affects libicutu and icu-dbg
+	sed  \
+	    -e 's,DU_BUILD=,DU_BUILD_unused=,g' \
+	    -e '/^CPPFLAGS.*/ s,--sysroot=${STAGING_DIR_TARGET},,g' \
+	    -i ${B}/tools/toolutil/Makefile
+}
+
 PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
 do_install:append:class-native() {
 	mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
@@ -66,6 +75,16 @@  do_install:append:class-target() {
 	    ${D}/${libdir}/${BPN}/${@icu_install_folder(d)}/pkgdata.inc
 }
 
+do_install:append:class-nativesdk() {
+	# Remove build host references...
+	sed -i  \
+	    -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+	    -e 's|${DEBUG_PREFIX_MAP}||g' \
+	    -e 's:${HOSTTOOLS_DIR}/::g' \
+	    ${D}/${libdir}/${BPN}/${@icu_install_folder(d)}/Makefile.inc \
+	    ${D}/${libdir}/${BPN}/${@icu_install_folder(d)}/pkgdata.inc
+}
+
 PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio"
 
 FILES:${PN}-dev += "${libdir}/${BPN}/"