Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # Version 5 of the Berkeley DB from Sleepycat |
| 2 | # |
| 3 | # At present this package only installs the DB code |
| 4 | # itself (shared libraries, .a in the dev package), |
| 5 | # documentation and headers. |
| 6 | # |
| 7 | # The headers have the same names as those as v3 |
| 8 | # of the DB, only one version can be used *for dev* |
| 9 | # at once - DB3 and DB5 can both be installed on the |
| 10 | # same system at the same time if really necessary. |
| 11 | SECTION = "libs" |
| 12 | SUMMARY = "Berkeley Database v5" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 13 | HOMEPAGE = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | LICENSE = "Sleepycat" |
| 15 | VIRTUAL_NAME ?= "virtual/db" |
| 16 | RCONFLICTS_${PN} = "db3" |
| 17 | |
| 18 | SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz" |
| 19 | SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \ |
| 20 | file://fix-parallel-build.patch \ |
| 21 | " |
| 22 | |
| 23 | SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24" |
| 24 | SRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628" |
| 25 | |
| 26 | LIC_FILES_CHKSUM = "file://../LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955" |
| 27 | |
| 28 | inherit autotools |
| 29 | |
| 30 | # Put virtual/db in any appropriate provider of a |
| 31 | # relational database, use it as a dependency in |
| 32 | # place of a specific db and use: |
| 33 | # |
| 34 | # PREFERRED_PROVIDER_virtual/db |
| 35 | # |
| 36 | # to select the correct db in the build (distro) .conf |
| 37 | PROVIDES += "${VIRTUAL_NAME}" |
| 38 | |
| 39 | # bitbake isn't quite clever enough to deal with sleepycat, |
| 40 | # the distribution sits in the expected directory, but all |
| 41 | # the builds must occur from a sub-directory. The following |
| 42 | # persuades bitbake to go to the right place |
| 43 | S = "${WORKDIR}/db-${PV}/dist" |
| 44 | B = "${WORKDIR}/db-${PV}/build_unix" |
| 45 | SPDX_S = "${WORKDIR}/db-${PV}" |
| 46 | |
| 47 | # The executables go in a separate package - typically there |
| 48 | # is no need to install these unless doing real database |
| 49 | # management on the system. |
| 50 | inherit lib_package |
| 51 | |
| 52 | PACKAGES =+ "${PN}-cxx" |
| 53 | FILES_${PN}-cxx = "${libdir}/*cxx*so" |
| 54 | |
| 55 | |
| 56 | # The dev package has the .so link (as in db3) and the .a's - |
| 57 | # it is therefore incompatible (cannot be installed at the |
| 58 | # same time) as the db3 package |
| 59 | # sort out the .so since they do version prior to the .so |
| 60 | SOLIBS = "-5*.so" |
| 61 | FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so" |
| 62 | |
| 63 | #configuration - set in local.conf to override |
| 64 | # All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix) |
| 65 | DB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql" |
| 66 | |
| 67 | EXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot" |
| 68 | |
| 69 | # Override the MUTEX setting here, the POSIX library is |
| 70 | # the default - "POSIX/pthreads/library". |
| 71 | # Don't ignore the nice SWP instruction on the ARM: |
| 72 | # These enable the ARM assembler mutex code, this won't |
| 73 | # work with thumb compilation... |
| 74 | ARM_MUTEX = "--with-mutex=ARM/gcc-assembly" |
| 75 | MUTEX = "" |
| 76 | MUTEX_arm = "${ARM_MUTEX}" |
| 77 | MUTEX_armeb = "${ARM_MUTEX}" |
| 78 | EXTRA_OECONF += "${MUTEX}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 79 | EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | |
| 81 | # Cancel the site stuff - it's set for db3 and destroys the |
| 82 | # configure. |
| 83 | CONFIG_SITE = "" |
| 84 | do_configure() { |
| 85 | gnu-configize --force ${S} |
| 86 | export STRIP="true" |
| 87 | oe_runconf |
| 88 | } |
| 89 | |
| 90 | do_compile_prepend() { |
| 91 | sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' \ |
| 92 | ${B}/libtool |
| 93 | } |
| 94 | |
| 95 | do_install_append() { |
| 96 | mkdir -p ${D}/${includedir}/db51 |
| 97 | mv ${D}/${includedir}/db.h ${D}/${includedir}/db51/. |
| 98 | mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db51/. |
| 99 | ln -s db51/db.h ${D}/${includedir}/db.h |
| 100 | ln -s db51/db_cxx.h ${D}/${includedir}/db_cxx.h |
| 101 | |
| 102 | # The docs end up in /usr/docs - not right. |
| 103 | if test -d "${D}/${prefix}/docs" |
| 104 | then |
| 105 | mkdir -p "${D}/${datadir}" |
| 106 | test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}" |
| 107 | mv "${D}/${prefix}/docs" "${D}/${docdir}" |
| 108 | fi |
| 109 | |
| 110 | chown -R root:root ${D} |
| 111 | } |
| 112 | |
| 113 | INSANE_SKIP_${PN} = "dev-so" |
| 114 | INSANE_SKIP_${PN}-cxx = "dev-so" |
| 115 | |
| 116 | BBCLASSEXTEND = "native nativesdk" |
| 117 | |