From aa458a136ebd4abc55d502984b5c90ddab458288 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 23 Feb 2016 12:22:19 +0100 Subject: add libtalloc and its dependency waf-samba.bbclass This also adds libtalloc-dev to the SDK, which is a first step to upgrading libosmocore to a 'post external talloc' version. --- classes/waf-samba.bbclass | 54 ++++++++++++++++++++++ .../packagegroup/packagegroup-sdk-osmo.inc | 1 + .../libtalloc/avoid-attr-unless-wanted.patch | 20 ++++++++ recipes-support/libtalloc/libtalloc_2.1.3.bb | 41 ++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 classes/waf-samba.bbclass create mode 100644 recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch create mode 100644 recipes-support/libtalloc/libtalloc_2.1.3.bb diff --git a/classes/waf-samba.bbclass b/classes/waf-samba.bbclass new file mode 100644 index 0000000..4b6e3c9 --- /dev/null +++ b/classes/waf-samba.bbclass @@ -0,0 +1,54 @@ +# waf is a build system which is used by samba related project. +# Obtain details from https://wiki.samba.org/index.php/Waf +# +inherit qemu pythonnative + +DEPENDS += "qemu-native python" + +CONFIGUREOPTS = " --prefix=${prefix} \ + --bindir=${bindir} \ + --sbindir=${sbindir} \ + --libexecdir=${libexecdir} \ + --datadir=${datadir} \ + --sysconfdir=${sysconfdir} \ + --sharedstatedir=${sharedstatedir} \ + --localstatedir=${localstatedir} \ + --libdir=${libdir} \ + --includedir=${includedir} \ + --oldincludedir=${oldincludedir} \ + --infodir=${infodir} \ + --mandir=${mandir} \ + " + +do_configure() { + qemu_binary="${@qemu_target_binary(d)}" + if [ "${qemu_binary}" = "qemu-allarch" ]; then + qemu_binary="qemuwrapper" + fi + + libdir_qemu="${STAGING_DIR_HOST}/${libdir}" + base_libdir_qemu="${STAGING_DIR_HOST}/${base_libdir}" + + CROSS_EXEC="${qemu_binary} \ + ${QEMU_OPTIONS} \ + -L ${STAGING_DIR_HOST} \ + -E LD_LIBRARY_PATH=${libdir_qemu}:${base_libdir_qemu}" + + export BUILD_SYS=${BUILD_SYS} + export HOST_SYS=${HOST_SYS} + export BUILD_ARCH=${BUILD_ARCH} + export HOST_ARCH=${HOST_ARCH} + export STAGING_LIBDIR=${STAGING_LIBDIR} + export STAGING_INCDIR=${STAGING_INCDIR} + export PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} + + ./configure ${CONFIGUREOPTS} ${EXTRA_OECONF} --cross-compile --cross-execute="${CROSS_EXEC}" +} + +do_compile () { + python ./buildtools/bin/waf ${PARALLEL_MAKE} +} + +do_install() { + oe_runmake install DESTDIR=${D} +} diff --git a/recipes-osmocom/packagegroup/packagegroup-sdk-osmo.inc b/recipes-osmocom/packagegroup/packagegroup-sdk-osmo.inc index 29f3ad9..8a52016 100644 --- a/recipes-osmocom/packagegroup/packagegroup-sdk-osmo.inc +++ b/recipes-osmocom/packagegroup/packagegroup-sdk-osmo.inc @@ -1,4 +1,5 @@ SDK-OSMO = " \ + libtalloc-dev \ libosmocore-dev \ libosmo-sccp-staticdev \ libosmo-abis-dev \ diff --git a/recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch b/recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch new file mode 100644 index 0000000..a3ee9cc --- /dev/null +++ b/recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch @@ -0,0 +1,20 @@ +--- a/lib/replace/wscript 2015-11-13 16:04:04.000000000 +0100 ++++ b/lib/replace/wscript 2015-11-13 16:23:20.000000000 +0100 +@@ -636,8 +636,6 @@ + if not bld.CONFIG_SET('HAVE_INET_ATON'): REPLACE_SOURCE += ' inet_aton.c' + if not bld.CONFIG_SET('HAVE_INET_NTOP'): REPLACE_SOURCE += ' inet_ntop.c' + if not bld.CONFIG_SET('HAVE_INET_PTON'): REPLACE_SOURCE += ' inet_pton.c' +- if not bld.CONFIG_SET('HAVE_GETXATTR') or bld.CONFIG_SET('XATTR_ADDITIONAL_OPTIONS'): +- REPLACE_SOURCE += ' xattr.c' + + bld.SAMBA_LIBRARY('replace', + source=REPLACE_SOURCE, +@@ -648,7 +646,7 @@ + # at the moment: + # hide_symbols=bld.BUILTIN_LIBRARY('replace'), + private_library=True, +- deps='crypt dl nsl socket rt attr' + extra_libs) ++ deps='crypt dl nsl socket rt ' + extra_libs) + + bld.SAMBA_SUBSYSTEM('replace-test', + source='''test/testsuite.c test/strptime.c diff --git a/recipes-support/libtalloc/libtalloc_2.1.3.bb b/recipes-support/libtalloc/libtalloc_2.1.3.bb new file mode 100644 index 0000000..8209264 --- /dev/null +++ b/recipes-support/libtalloc/libtalloc_2.1.3.bb @@ -0,0 +1,41 @@ +SUMMARY = "Hierarchical, reference counted memory pool system with destructors" +HOMEPAGE = "http://talloc.samba.org" +SECTION = "libs" +LICENSE = "LGPL-3.0+ & GPL-3.0+" + +DEPENDS += "libbsd" + +SRC_URI = "http://samba.org/ftp/talloc/talloc-${PV}.tar.gz" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \ + file://${COREBASE}/meta/files/common-licenses/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891" + +SRC_URI[md5sum] = "3e285de2228ae67ff0a0f5cec658f627" +SRC_URI[sha256sum] = "7aa5f75b22d4ef9c737b25515f2a2837ddc13014ff4ac6e58dd9e311f41f2cb0" + +inherit waf-samba + +PACKAGECONFIG[attr] = ",,attr" + +SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}" + +S = "${WORKDIR}/talloc-${PV}" + +EXTRA_OECONF += "--disable-rpath \ + --disable-rpath-install \ + --bundled-libraries=NONE \ + --builtin-libraries=replace \ + --disable-silent-rules \ + --with-libiconv=${STAGING_DIR_HOST}${prefix}\ + " +DISABLE_STATIC = "" + +PACKAGES += "pytalloc pytalloc-dbg pytalloc-dev" + +FILES_pytalloc = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \ + ${libdir}/libpytalloc-util.so.2 \ + ${libdir}/libpytalloc-util.so.2.1.1 \ + " +FILES_pytalloc-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \ + ${libdir}/.debug/libpytalloc-util.so.2.1.1" +FILES_pytalloc-dev = "${libdir}/libpytalloc-util.so" +RDEPENDS_pytalloc = "python" -- cgit v1.2.3