From 8b4aa0c34273b517bfbfba49457e7f7203613b8c Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sat, 1 Nov 2014 02:13:36 +0200 Subject: [PATCH] zlib: update to 1.2.8 --- .../zlib/zlib-1.2.8/Makefile-runtests.patch | 38 ++++++++++++++ recipes/zlib/zlib-1.2.8/ldflags-tests.patch | 45 ++++++++++++++++ recipes/zlib/zlib-1.2.8/libz.la | 41 +++++++++++++++ .../zlib-1.2.8/remove.ldconfig.call.patch | 20 ++++++++ recipes/zlib/zlib-1.2.8/run-ptest | 2 + recipes/zlib/zlib_1.2.8.bb | 51 +++++++++++++++++++ 6 files changed, 197 insertions(+) create mode 100644 recipes/zlib/zlib-1.2.8/Makefile-runtests.patch create mode 100644 recipes/zlib/zlib-1.2.8/ldflags-tests.patch create mode 100755 recipes/zlib/zlib-1.2.8/libz.la create mode 100644 recipes/zlib/zlib-1.2.8/remove.ldconfig.call.patch create mode 100644 recipes/zlib/zlib-1.2.8/run-ptest create mode 100644 recipes/zlib/zlib_1.2.8.bb diff --git a/recipes/zlib/zlib-1.2.8/Makefile-runtests.patch b/recipes/zlib/zlib-1.2.8/Makefile-runtests.patch new file mode 100644 index 0000000000..61eea8238a --- /dev/null +++ b/recipes/zlib/zlib-1.2.8/Makefile-runtests.patch @@ -0,0 +1,38 @@ +Add 'ptest' target to Makefile, to run tests without checking dependencies. + +Signed-off-by: Anders Roxell +Upstream-Status: Pending +--- +diff -uNr a/Makefile.in b/Makefile.in +--- a/Makefile.in 2013-06-10 13:48:14.321959162 +0200 ++++ b/Makefile.in 2013-06-10 13:49:36.686476448 +0200 +@@ -83,6 +83,9 @@ + test: all teststatic testshared + + teststatic: static ++ @make runteststatic ++ ++runteststatic: + @TMPST=tmpst_$$; \ + if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \ + echo ' *** zlib test OK ***'; \ +@@ -92,6 +95,9 @@ + rm -f $$TMPST + + testshared: shared ++ @make runtestshared ++ ++runtestshared: + @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ + LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \ + DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \ +@@ -105,6 +111,9 @@ + rm -f $$TMPSH + + test64: all64 ++ @make runtestall64 ++ ++runtestall64: + @TMP64=tmp64_$$; \ + if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \ + echo ' *** zlib 64-bit test OK ***'; \ diff --git a/recipes/zlib/zlib-1.2.8/ldflags-tests.patch b/recipes/zlib/zlib-1.2.8/ldflags-tests.patch new file mode 100644 index 0000000000..650794f504 --- /dev/null +++ b/recipes/zlib/zlib-1.2.8/ldflags-tests.patch @@ -0,0 +1,45 @@ +Obey LDFLAGS for tests + +Signed-off-by: Christopher Larson +Upstream-status: Pending + +--- zlib-1.2.8.orig/Makefile.in ++++ zlib-1.2.8/Makefile.in +@@ -26,7 +26,7 @@ CFLAGS=-O + + SFLAGS=-O + LDFLAGS= +-TEST_LDFLAGS=-L. libz.a ++TEST_LDFLAGS=-L. $(LDFLAGS) + LDSHARED=$(CC) + CPP=$(CC) -E + +@@ -176,22 +176,22 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz. + -@rmdir objs + + example$(EXE): example.o $(STATICLIB) +- $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) ++ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(STATICLIB) + + minigzip$(EXE): minigzip.o $(STATICLIB) +- $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) ++ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(STATICLIB) + + examplesh$(EXE): example.o $(SHAREDLIBV) +- $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) ++ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(SHAREDLIBV) + + minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) +- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) ++ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(SHAREDLIBV) + + example64$(EXE): example64.o $(STATICLIB) +- $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) ++ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(STATICLIB) + + minigzip64$(EXE): minigzip64.o $(STATICLIB) +- $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) ++ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) $(STATICLIB) + + install-libs: $(LIBS) + -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi diff --git a/recipes/zlib/zlib-1.2.8/libz.la b/recipes/zlib/zlib-1.2.8/libz.la new file mode 100755 index 0000000000..fc02000ebd --- /dev/null +++ b/recipes/zlib/zlib-1.2.8/libz.la @@ -0,0 +1,41 @@ +# libz.la - a libtool library file +# Generated by ltmain.sh (GNU libtool) 2.2.6b +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='libz.so.1' + +# Names of this library. +library_names='libz.so.1.2.8 libz.so.1 libz.so' + +# The name of the static archive. +old_library='libz.a' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -L/usr/lib' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libz. +current=8 +age=8 +revision=2 + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/lib' diff --git a/recipes/zlib/zlib-1.2.8/remove.ldconfig.call.patch b/recipes/zlib/zlib-1.2.8/remove.ldconfig.call.patch new file mode 100644 index 0000000000..403b4825c9 --- /dev/null +++ b/recipes/zlib/zlib-1.2.8/remove.ldconfig.call.patch @@ -0,0 +1,20 @@ + +When /etc/ld.so.cache is writeable by user running bitbake then it creates invalid cache +(in my case libstdc++.so cannot be found after building zlib(-native) and I have to call +touch */libstdc++.so && /sbin/ldconfig to fix it. + +So remove ldconfig call from make install-libs + +Upstream-Status: Inappropriate [disable feature] + +diff -uNr zlib-1.2.6.orig/Makefile.in zlib-1.2.6/Makefile.in +--- zlib-1.2.6.orig/Makefile.in 2012-01-28 23:48:50.000000000 +0100 ++++ zlib-1.2.6/Makefile.in 2012-02-13 15:38:20.577700723 +0100 +@@ -199,7 +199,6 @@ + rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ +- ($(LDCONFIG) || true) >/dev/null 2>&1; \ + fi + cp zlib.3 $(DESTDIR)$(man3dir) + chmod 644 $(DESTDIR)$(man3dir)/zlib.3 diff --git a/recipes/zlib/zlib-1.2.8/run-ptest b/recipes/zlib/zlib-1.2.8/run-ptest new file mode 100644 index 0000000000..884d9dc699 --- /dev/null +++ b/recipes/zlib/zlib-1.2.8/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +make -k runteststatic runtestshared | sed -r -e 's/^(\s+\*+ (.+?) test OK \*+)/\1\nPASS: \2/' -e 's/^(\s+\*+ (.+?) test FAILED \*+)/\1\nFAIL: \2/' diff --git a/recipes/zlib/zlib_1.2.8.bb b/recipes/zlib/zlib_1.2.8.bb new file mode 100644 index 0000000000..9d34054ab8 --- /dev/null +++ b/recipes/zlib/zlib_1.2.8.bb @@ -0,0 +1,51 @@ +SUMMARY = "Zlib Compression Library" +DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \ +library which is used by many different programs." +HOMEPAGE = "http://zlib.net/" +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;patch=1 \ +# file://Makefile-runtests.patch;patch=1 \ + file://ldflags-tests.patch;patch=1 \ +# file://run-ptest \ + file://libz.la \ + " + +SRC_URI[md5sum] = "28f1205d8dd2001f26fec1e8c2cebe37" +SRC_URI[sha256sum] = "831df043236df8e9a7667b9e3bb37e1fcb1220a0f163b6de2626774b9590d057" + +#RDEPENDS_${PN}-ptest += "make" + +#inherit ptest + +do_configure (){ + ./configure --prefix=${prefix} --shared --libdir=${libdir} +} + +do_compile (){ + oe_runmake +} + +do_install() { + oe_runmake DESTDIR=${D} install + install -m 0755 ${WORKDIR}/libz.la ${D}${libdir} +} + +# We move zlib shared libraries for target builds to avoid +# qa warnings. +# +do_install_append_class-target() { + if [ ${base_libdir} != ${libdir} ] + then + 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 + fi +} + +BBCLASSEXTEND = "native nativesdk" -- 2.39.5