Merge openembedded@openembedded.bkbits.net:packages
authorGerald Britton <gbritton@doomcom.org>
Thu, 22 Apr 2004 03:58:19 +0000 (03:58 +0000)
committerGerald Britton <gbritton@doomcom.org>
Thu, 22 Apr 2004 03:58:19 +0000 (03:58 +0000)
into doomcom.org:/home/gbritton/devel/OE/packages

2004/04/21 23:57:17-04:00 doomcom.org!gbritton
conditional packaging of glibc/uclibc on target

BKrev: 408742dbu8l2qiyjFGvfgdBte9yGng

glibc/glibc_2.3.2.oe
glibc/glibc_cvs.oe
uclibc/uclibc_0.9.26.oe

index 3b6ddf8..5e72341 100644 (file)
@@ -4,14 +4,39 @@ SECTION = "libs"
 PRIORITY = "required"
 MAINTAINER = "Chris Larson <kergoth@handhelds.org>"
 
-# This will ONLY build to this target
+# We want to select whether we're building a uclibc or glibc system and
+# perform provides accordingly.  We want to trigger on the original
+# TARGET_VENDOR setting, so we must do this before changing it.
+def target_is_uclibc(d):
+    import oe
+    if (oe.data.getVar('TARGET_VENDOR', d, 1) == '-uclibc'):
+        return 1
+    return 0
+def cond_provides(d):
+    import oe
+    if not target_is_uclibc(d):
+        return 'virtual/libc'
+    return ''
+def cond_packages(d):
+    import oe
+    if not target_is_uclibc(d):
+        return 'glibc glibc-dev glibc-doc glibc-i18n glibc-locale'
+    oe.data.setVar('PACKAGE_NO_LOCALE', '1', d)
+    oe.data.setVar('PACKAGE_NO_GCONV', '1', d)
+    return 'glibc-compat'
+PROVIDES := "${@cond_provides(d)}"
+PACKAGES := "${@cond_packages(d)}"
+
+# When target is not a uclibc system, do a compat-only package
+FILES_${PN}-compat = "${libdir}/lib*.so.* /lib/*.so*"
+
+# This will ONLY build to this target (we override it incase we're buliding
+# the world for a uclibc system)
 TARGET_VENDOR = ""
 TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 TARGET_PREFIX = "${TARGET_SYS}-"
 
 DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
-PROVIDES = "virtual/libc"
-PACKAGES = "glibc glibc-dev glibc-doc glibc-i18n glibc-locale"
 
 FILES_glibc_append = " ${datadir}/zoneinfo"
 FILES_glibc-dev_append = " ${libdir}/*.o"
@@ -216,7 +241,7 @@ do_install() {
        done
 }
 
-python populate_packages_prepend () {
+python package_do_split_gconvs () {
        import os
        def do_split(root, pattern, format, description, postinst):
                dvar = oe.data.getVar('D', d, 1)
@@ -249,6 +274,10 @@ python populate_packages_prepend () {
 
                oe.data.setVar('PACKAGES', ' '.join(packages), d)
 
+       if (oe.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'):
+               oe.note("package requested not splitting gconvs")
+               return
+
        libdir = oe.data.getVar('libdir', d, 1)
        if not libdir:
                oe.error("libdir not defined")
@@ -261,6 +290,12 @@ python populate_packages_prepend () {
        oe.data.setVar('PACKAGES', oe.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
 }
 
+# We want to do this indirection so that we can safely 'return'
+# from the called function even though we're prepending
+python populate_packages_prepend () {
+       oe.build.exec_func('package_do_split_gconvs', d)
+}
+
 python do_package () {
        if oe.data.getVar('DEBIAN_NAMES', d, 1):
                oe.data.setVar('PKG_glibc', 'libc6', d)
index 192ff5b..5afe568 100644 (file)
@@ -7,14 +7,39 @@ SECTION = "libs"
 PRIORITY = "required"
 MAINTAINER = "Phil Blundell <pb@handhelds.org>"
 
-# This will ONLY build to this target
+# We want to select whether we're building a uclibc or glibc system and
+# perform provides accordingly.  We want to trigger on the original
+# TARGET_VENDOR setting, so we must do this before changing it.
+def target_is_uclibc(d):
+    import oe
+    if (oe.data.getVar('TARGET_VENDOR', d, 1) == '-uclibc'):
+        return 1
+    return 0
+def cond_provides(d):
+    import oe
+    if not target_is_uclibc(d):
+        return 'virtual/libc'
+    return ''
+def cond_packages(d):
+    import oe
+    if not target_is_uclibc(d):
+        return 'glibc glibc-dev glibc-doc glibc-i18n glibc-locale'
+    oe.data.setVar('PACKAGE_NO_LOCALE', '1', d)
+    oe.data.setVar('PACKAGE_NO_GCONV', '1', d)
+    return 'glibc-compat'
+PROVIDES := "${@cond_provides(d)}"
+PACKAGES := "${@cond_packages(d)}"
+
+# When target is not a uclibc system, do a compat-only package
+FILES_${PN}-compat = "${libdir}/lib*.so.* /lib/*.so*"
+
+# This will ONLY build to this target (we override it incase we're buliding
+# the world for a uclibc system)
 TARGET_VENDOR = ""
 TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 TARGET_PREFIX = "${TARGET_SYS}-"
 
 DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
-PROVIDES = "virtual/libc"
-PACKAGES = "glibc glibc-dev glibc-doc glibc-i18n glibc-locale"
 
 FILES_glibc_append = " ${datadir}/zoneinfo"
 FILES_glibc-dev_append = " ${libdir}/*.o"
@@ -171,7 +196,7 @@ do_install() {
        done
 }
 
-python populate_packages_prepend () {
+python package_do_split_gconvs () {
        import os
        def do_split(root, pattern, format, description, postinst):
                dvar = oe.data.getVar('D', d, 1)
@@ -204,6 +229,10 @@ python populate_packages_prepend () {
 
                oe.data.setVar('PACKAGES', ' '.join(packages), d)
 
+       if (oe.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'):
+               oe.note("package requested not splitting gconvs")
+               return
+
        libdir = oe.data.getVar('libdir', d, 1)
        if not libdir:
                oe.error("libdir not defined")
@@ -216,6 +245,12 @@ python populate_packages_prepend () {
        oe.data.setVar('PACKAGES', oe.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
 }
 
+# We want to do this indirection so that we can safely 'return'
+# from the called function even though we're prepending
+python populate_packages_prepend () {
+       oe.build.exec_func('package_do_split_gconvs', d)
+}
+
 python do_package () {
        if oe.data.getVar('DEBIAN_NAMES', d, 1):
                oe.data.setVar('PKG_glibc', 'libc6', d)
index b8e308a..d723217 100644 (file)
@@ -4,7 +4,32 @@ SECTION = "libs"
 PRIORITY = "required"
 MAINTAINER = "Gerald Britton <gbritton@doomcom.org>"
 
-# This will ONLY build to this target
+# We want to select whether we're building a uclibc or glibc system and
+# perform provides accordingly.  We want to trigger on the original
+# TARGET_VENDOR setting, so we must do this before changing it.
+def target_is_uclibc(d):
+    import oe
+    if (oe.data.getVar('TARGET_VENDOR', d, 1) == '-uclibc'):
+        return 1
+    return 0
+def cond_provides(d):
+    import oe
+    if target_is_uclibc(d):
+        return 'virtual/libc'
+    return ''
+def cond_packages(d):
+    import oe
+    if target_is_uclibc(d):
+        return '${PN} ${PN}-doc ${PN}-dev ${PN}-locale'
+    return '${PN}-compat'
+PROVIDES := "${@cond_provides(d)}"
+PACKAGES := "${@cond_packages(d)}"
+
+# When target is not a uclibc system, do a compat-only package
+FILES_${PN}-compat = "${libdir}/lib*.so.* /lib/*.so*"
+
+# This will ONLY build to this target (we override it incase we're buliding
+# the world for a glibc system)
 TARGET_VENDOR = "-uclibc"
 TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 TARGET_PREFIX = "${TARGET_SYS}-"
@@ -12,7 +37,6 @@ TARGET_PREFIX = "${TARGET_SYS}-"
 FILESDIR = "${@os.path.dirname(oe.data.getVar('FILE',d,1))}/uclibc-${PV}"
 
 DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc-initial"
-PROVIDES = "virtual/libc"
 
 SRC_URI = "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \
            http://www.uclibc.org/downloads/toolchain/kernel-headers-2.4.21.tar.bz2"