Skip to contentSkip to conversation

openssl: remove dependency on relative_symlinks class

PATCH New Andre McCurdy 1 participant 1 message Aug 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssl: remove dependency on relative_symlinks class

Although the relative_symlinks class converts any absolute symlinks in ${D} into relative symlinks automatically, it's a little clearer to create relative symlinks directly where possible.

---
 meta/recipes-connectivity/openssl/openssl_1.0.2p.bb | 11 +++++++----
 meta/recipes-connectivity/openssl/openssl_1.1.0i.bb | 11 +++++++----
 2 files changed, 14 insertions(+), 8 deletions(-)
meta/recipes-connectivity/openssl/openssl_1.0.2p.bb +7 -4
index 1abf894..dbcb000 100644
@@ -58,7 +58,7 @@ SRC_URI[sha256sum] = "50a98e07b1a89eb8f6a99477f262df71c6fa7bef77df4dc83025a2845c
 
 UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar"
 
-inherit pkgconfig siteinfo multilib_header ptest relative_symlinks manpages
+inherit pkgconfig siteinfo multilib_header ptest manpages
 
 PACKAGECONFIG ?= "cryptodev-linux"
 PACKAGECONFIG_class-native = ""
@@ -242,9 +242,12 @@ do_install () {
 	   ${D}${libdir}/ssl/private \
 	   ${D}${libdir}/ssl/openssl.cnf \
 	   ${D}${sysconfdir}/ssl/
-	ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
-	ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
-	ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
+
+	# Although absolute symlinks would be OK for the target, they become
+	# invalid if native or nativesdk are relocated from sstate.
+	ln -sf ${@oe.path.relative('${libdir}/ssl', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl/certs
+	ln -sf ${@oe.path.relative('${libdir}/ssl', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl/private
+	ln -sf ${@oe.path.relative('${libdir}/ssl', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl/openssl.cnf
 
 	# Rename man pages to prefix openssl10-*
 	for f in `find ${D}${mandir} -type f`; do
meta/recipes-connectivity/openssl/openssl_1.1.0i.bb +7 -4
index d2f2624..a03f6ff 100644
@@ -24,7 +24,7 @@ SRC_URI_append_class-nativesdk = " \
 SRC_URI[md5sum] = "9495126aafd2659d357ea66a969c3fe1"
 SRC_URI[sha256sum] = "ebbfc844a8c8cc0ea5dc10b86c9ce97f401837f3fa08c17b2cdadc118253cf99"
 
-inherit lib_package multilib_header ptest relative_symlinks
+inherit lib_package multilib_header ptest
 
 #| ./libcrypto.so: undefined reference to `getcontext'
 #| ./libcrypto.so: undefined reference to `setcontext'
@@ -114,9 +114,12 @@ do_install () {
 	   ${D}${libdir}/ssl-1.1/private \
 	   ${D}${libdir}/ssl-1.1/openssl.cnf \
 	   ${D}${sysconfdir}/ssl/
-	ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl-1.1/certs
-	ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl-1.1/private
-	ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl-1.1/openssl.cnf
+
+	# Although absolute symlinks would be OK for the target, they become
+	# invalid if native or nativesdk are relocated from sstate.
+	ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs
+	ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private
+	ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf
 }
 
 do_install_append_class-native () {
Signature · 1 line
1.9.1