Skip to contentSkip to conversation

nspr, nss: use ${includedir}/nspr like e.g. ubuntu does

PATCH In review Martin Jansa 2 participants 3 messages Jan 27, 2020 – Jan 28, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nspr, nss: use ${includedir}/nspr like e.g. ubuntu does

* instead of installing all 51 nspr header files directly in ${includedir}

* ubuntu uses /usr/include/nspr as well as shown in:
https://packages.ubuntu.com/xenial/amd64/libnspr4-dev/filelist
and some components assume the same path

* update nss configure to find them, similar change might be needed in mozjs and ecryptfs-utils

---
 meta/recipes-support/nspr/nspr/nspr.pc.in | 2 +-
 meta/recipes-support/nspr/nspr_4.24.bb    | 4 ++++
 meta/recipes-support/nss/nss/nss.pc.in    | 2 +-
 meta/recipes-support/nss/nss_3.49.1.bb    | 4 +++-
 4 files changed, 9 insertions(+), 3 deletions(-)
meta/recipes-support/nspr/nspr/nspr.pc.in +1 -1
index d74caabe4c..1f15d19cfa 100644
@@ -8,4 +8,4 @@ Name: NSPR
 Description: The Netscape Portable Runtime
 Version: NSPRVERSION
 Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-Cflags:
+Cflags: -I${includedir}/nspr
meta/recipes-support/nspr/nspr_4.24.bb +4 -0
index 5f823f8941..e98fe83ed3 100644
@@ -156,6 +156,10 @@ MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/nspr-config"
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
+# Do not install nspr in usr/include, but in usr/include/nspr, the
+# preferred path upstream.
+EXTRA_OECONF += "--includedir=${includedir}/nspr"
+
 do_compile_prepend() {
 	oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
 }
meta/recipes-support/nss/nss/nss.pc.in +1 -1
index 200f635c65..402b4ecb33 100644
@@ -7,5 +7,5 @@ Name: NSS
 Description: Network Security Services
 Version: %NSS_VERSION%
 Requires: nspr >= %NSPR_VERSION%
-Libs: -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
+Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
 Cflags: -IOEINCDIR
meta/recipes-support/nss/nss_3.49.1.bb +3 -1
index 94f4b88fa5..b16ade9f62 100644
@@ -52,7 +52,7 @@ do_configure_prepend_libc-musl () {
 }
 
 do_compile_prepend_class-native() {
-    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}/nspr
     export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
     export NSS_ENABLE_WERROR=0
 }
@@ -67,6 +67,8 @@ do_compile_prepend_class-native() {
 }
 
 do_compile() {
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR}/nspr
+
     export CROSS_COMPILE=1
     export NATIVE_CC="${BUILD_CC}"
     # Additional defines needed on Centos 7
Signature · 1 line
2.20.1
#1 lore raw
Quoted 9 lines · Martin Jansa

* instead of installing all 51 nspr header files directly in ${includedir}

* ubuntu uses /usr/include/nspr as well as shown in:
https://packages.ubuntu.com/xenial/amd64/libnspr4-dev/filelist
and some components assume the same path

* update nss configure to find them, similar change might be needed in mozjs and ecryptfs-utils

It does come with some userspace fallouts

https://errors.yoctoproject.org/Errors/Details/308323/
https://errors.yoctoproject.org/Errors/Details/308321/
https://errors.yoctoproject.org/Errors/Details/308320/

Quoted 75 lines
---
 meta/recipes-support/nspr/nspr/nspr.pc.in | 2 +-
 meta/recipes-support/nspr/nspr_4.24.bb    | 4 ++++
 meta/recipes-support/nss/nss/nss.pc.in    | 2 +-
 meta/recipes-support/nss/nss_3.49.1.bb    | 4 +++-
 4 files changed, 9 insertions(+), 3 deletions(-)
meta/recipes-support/nspr/nspr/nspr.pc.in +1 -1
index d74caabe4c..1f15d19cfa 100644
@@ -8,4 +8,4 @@ Name: NSPR
 Description: The Netscape Portable Runtime
 Version: NSPRVERSION
 Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-Cflags:
+Cflags: -I${includedir}/nspr
meta/recipes-support/nspr/nspr_4.24.bb +4 -0
index 5f823f8941..e98fe83ed3 100644
@@ -156,6 +156,10 @@ MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/nspr-config"
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
+# Do not install nspr in usr/include, but in usr/include/nspr, the
+# preferred path upstream.
+EXTRA_OECONF += "--includedir=${includedir}/nspr"
+
 do_compile_prepend() {
        oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
 }
meta/recipes-support/nss/nss/nss.pc.in +1 -1
index 200f635c65..402b4ecb33 100644
@@ -7,5 +7,5 @@ Name: NSS
 Description: Network Security Services
 Version: %NSS_VERSION%
 Requires: nspr >= %NSPR_VERSION%
-Libs: -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
+Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
 Cflags: -IOEINCDIR
meta/recipes-support/nss/nss_3.49.1.bb +3 -2
index 94f4b88fa5..b16ade9f62 100644
@@ -52,7 +52,7 @@ do_configure_prepend_libc-musl () {
 }
 
 do_compile_prepend_class-native() {
-    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}/nspr
     export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
     export NSS_ENABLE_WERROR=0
 }
@@ -67,6 +67,8 @@ do_compile_prepend_class-native() {
 }
 
 do_compile() {
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR}/nspr
+
     export CROSS_COMPILE=1
     export NATIVE_CC="${BUILD_CC}"
     # Additional defines needed on Centos 7
--

2.20.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw

Fixes for all 3 sent to oe-devel ML, thanks for review and test with world.

Quoted 101 lines · Khem Raj
Quoted 2 lines · Martin Jansa

* instead of installing all 51 nspr header files directly in

${includedir}

Quoted 7 lines

* ubuntu uses /usr/include/nspr as well as shown in:
https://packages.ubuntu.com/xenial/amd64/libnspr4-dev/filelist
and some components assume the same path

* update nss configure to find them, similar change might be needed in mozjs and ecryptfs-utils

It does come with some userspace fallouts

https://errors.yoctoproject.org/Errors/Details/308323/
https://errors.yoctoproject.org/Errors/Details/308321/
https://errors.yoctoproject.org/Errors/Details/308320/

Review

Quoted 10 lines
---
 meta/recipes-support/nspr/nspr/nspr.pc.in | 2 +-
 meta/recipes-support/nspr/nspr_4.24.bb    | 4 ++++
 meta/recipes-support/nss/nss/nss.pc.in    | 2 +-
 meta/recipes-support/nss/nss_3.49.1.bb    | 4 +++-
 4 files changed, 9 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/meta/recipes-support/nspr/nspr/nspr.pc.in

Review

Quoted 10 lines

index d74caabe4c..1f15d19cfa 100644

meta/recipes-support/nspr/nspr/nspr.pc.in +1 -1
@@ -8,4 +8,4 @@ Name: NSPR
 Description: The Netscape Portable Runtime
 Version: NSPRVERSION
 Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-Cflags:
+Cflags: -I${includedir}/nspr
(quoted diff) +0 -0

b/meta/recipes-support/nspr/nspr_4.24.bb

meta/recipes-support/nspr/nspr_4.24.bb MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/nspr-config" · line 164

Quoted 13 lines

index 5f823f8941..e98fe83ed3 100644

meta/recipes-support/nspr/nspr_4.24.bb +4 -0
@@ -156,6 +156,10 @@ MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/nspr-config"
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
+# Do not install nspr in usr/include, but in usr/include/nspr, the
+# preferred path upstream.
+EXTRA_OECONF += "--includedir=${includedir}/nspr"
+
 do_compile_prepend() {
        oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}"

LDFLAGS="" CC="${BUILD_CC}" -C config export

Review

Quoted 2 lines
meta/recipes-support/nspr/nspr_4.24.bb +0 -0
 }
(quoted diff) +0 -0

b/meta/recipes-support/nss/nss/nss.pc.in

Review

Quoted 11 lines

index 200f635c65..402b4ecb33 100644

meta/recipes-support/nss/nss/nss.pc.in +1 -1
@@ -7,5 +7,5 @@ Name: NSS
 Description: Network Security Services
 Version: %NSS_VERSION%
 Requires: nspr >= %NSPR_VERSION%
-Libs: -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
+Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
 Cflags: -IOEINCDIR
(quoted diff) +0 -0

b/meta/recipes-support/nss/nss_3.49.1.bb

Quoted 29 lines

index 94f4b88fa5..b16ade9f62 100644

meta/recipes-support/nss/nss_3.49.1.bb +3 -2
@@ -52,7 +52,7 @@ do_configure_prepend_libc-musl () {
 }
 
 do_compile_prepend_class-native() {
-    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}/nspr
     export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
     export NSS_ENABLE_WERROR=0
 }
@@ -67,6 +67,8 @@ do_compile_prepend_class-native() {
 }
 
 do_compile() {
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR}/nspr
+
     export CROSS_COMPILE=1
     export NATIVE_CC="${BUILD_CC}"
     # Additional defines needed on Centos 7
--

2.20.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core