Skip to contentSkip to conversation

zlib: minor symbolic link issue

PATCH In review Matthieu Crapet 2 participants 5 messages May 5, 2015 – May 21, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zlib: minor symbolic link issue

libz.so symbolic link created in ${libdir} is ../..//lib/libz.so.1.2.8 Make it cleaner and generic (idea comes from libcgroup recipe).

---
 meta/recipes-core/zlib/zlib_1.2.8.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/zlib/zlib_1.2.8.bb +2 -2
index ca0ba3f..5e11f23 100644
@@ -6,7 +6,6 @@ SECTION = "libs"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd"
 
-
 SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.xz \
            file://remove.ldconfig.call.patch \
            file://Makefile-runtests.patch \
@@ -54,7 +53,8 @@ do_install_append_class-target() {
 		mkdir -p ${D}/${base_libdir}
 		mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
 		tmp=`readlink ${D}/${libdir}/libz.so`
-		ln -sf ../../${base_libdir}/$tmp ${D}/${libdir}/libz.so
+		rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
+		ln -sf ${rel_lib_prefix}${base_libdir}/$tmp ${D}/${libdir}/libz.so
 	fi
 }
 
Signature · 1 line
1.9.1
#1 lore raw

Hello,

Just tell me if something is wrong, I can provide a v2 patch.

Regards,
Matthieu

-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De la part de Matthieu Crapet Envoyé : mardi 5 mai 2015 10:14
À : [email protected]
Objet : [OE-core] [PATCH] zlib: minor symbolic link issue

libz.so symbolic link created in ${libdir} is ../..//lib/libz.so.1.2.8 Make it cleaner and generic (idea comes from libcgroup recipe).

---
 meta/recipes-core/zlib/zlib_1.2.8.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/zlib/zlib_1.2.8.bb +0 -1
index ca0ba3f..5e11f23 100644
@@ -6,7 +6,6 @@ SECTION = "libs"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd"
 
-
 SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.xz \
            file://remove.ldconfig.call.patch \
            file://Makefile-runtests.patch \ @@ -54,7 +53,8 @@ do_install_append_class-target() {

mkdir -p ${D}/${base_libdir}
mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir} tmp=readlink ${D}/${libdir}/libz.so
- ln -sf ../../${base_libdir}/$tmp ${D}/${libdir}/libz.so
+ rel_lib_prefix=echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'
+ ln -sf ${rel_lib_prefix}${base_libdir}/$tmp ${D}/${libdir}/libz.so
fi
}

--
1.9.1

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

#2 lore raw
Quoted 2 lines · Matthieu CRAPET

Just tell me if something is wrong, I can provide a v2 patch.

No, it just slipped through the cracks.

That regex looked a bit obscure, and there's a Python function we provide that uses the Python standard library to do the same thing, so I ended up with this locally:

# Move zlib shared libraries for target builds to $base_libdir so the library

# can be used in early boot before $prefix is mounted.
do_install_append_class-target() {
if [ ${base_libdir} != ${libdir} ]
then
mkdir -p ${D}/${base_libdir}
mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
libname=`readlink ${D}/${libdir}/libz.so`
ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname
${D}${libdir}/libz.so
fi
}

Do you have any objections to this form instead? I'm also thinking we should rationalise the duplicated logic into a single implementation in meta/classes/utils.bbclass...

Ross

#3 lore raw

Hi Ross,

I didn’t know such a function was existing. You can use it of course, it’s much better. I found the (obscure) regexp in libcgroup recipe, it could be updated too.

Is it worth it I send a v2 patch ?

Matthieu

De : Burton, Ross [mailto:[email protected]] Envoyé : mercredi 20 mai 2015 16:42
À : Matthieu CRAPET
Cc : [email protected]
Objet : Re: [OE-core] [PATCH] zlib: minor symbolic link issue

On 20 May 2015 at 10:47, Matthieu CRAPET <[email protected]<mailto:[email protected]>> wrote:
Just tell me if something is wrong, I can provide a v2 patch.

No, it just slipped through the cracks.

That regex looked a bit obscure, and there's a Python function we provide that uses the Python standard library to do the same thing, so I ended up with this locally:

# Move zlib shared libraries for target builds to $base_libdir so the library

# can be used in early boot before $prefix is mounted.
do_install_append_class-target() {
            if [ ${base_libdir} != ${libdir} ]
            then
                        mkdir -p ${D}/${base_libdir}
                        mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
                        libname=`readlink ${D}/${libdir}/libz.so`
                        ln -sf ${@oe.path.relative("${libdir}<mailto:$%[email protected](%22$%7blibdir%7d>", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
            fi
}

Do you have any objections to this form instead? I'm also thinking we should rationalise the duplicated logic into a single implementation in meta/classes/utils.bbclass...

Ross

#4 lore raw
Quoted 9 lines · Matthieu CRAPET

I didn’t know such a function was existing. You can use it of course, it’s much better.

I found the (obscure) regexp in libcgroup recipe, it could be updated too.

Is it worth it I send a v2 patch ?

I already sent it, but thanks for the offer!

Ross