Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Embeddable SQL database engine" |
| 2 | HOMEPAGE = "http://www.sqlite.org" |
| 3 | SECTION = "libs" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 4 | |
| 5 | PE = "3" |
| 6 | |
| 7 | def sqlite_download_version(d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 8 | pvsplit = d.getVar('PV').split('.') |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 9 | if len(pvsplit) < 4: |
| 10 | pvsplit.append('0') |
| 11 | return pvsplit[0] + ''.join([part.rjust(2,'0') for part in pvsplit[1:]]) |
| 12 | |
| 13 | SQLITE_PV = "${@sqlite_download_version(d)}" |
| 14 | |
| 15 | S = "${WORKDIR}/sqlite-autoconf-${SQLITE_PV}" |
| 16 | |
| 17 | UPSTREAM_CHECK_URI = "http://www.sqlite.org/" |
| 18 | UPSTREAM_CHECK_REGEX = "releaselog/(?P<pver>(\d+[\.\-_]*)+)\.html" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 20 | CVE_PRODUCT = "sqlite" |
| 21 | |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 22 | inherit autotools pkgconfig siteinfo |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 24 | # enable those which are enabled by default in configure |
| 25 | PACKAGECONFIG ?= "fts4 fts5 json1 rtree dyn_ext" |
| 26 | PACKAGECONFIG_class-native ?= "fts4 fts5 json1 rtree dyn_ext" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | |
| 28 | PACKAGECONFIG[editline] = "--enable-editline,--disable-editline,libedit" |
| 29 | PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline ncurses" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 30 | PACKAGECONFIG[fts3] = "--enable-fts3,--disable-fts3" |
| 31 | PACKAGECONFIG[fts4] = "--enable-fts4,--disable-fts4" |
| 32 | PACKAGECONFIG[fts5] = "--enable-fts5,--disable-fts5" |
| 33 | PACKAGECONFIG[json1] = "--enable-json1,--disable-json1" |
| 34 | PACKAGECONFIG[rtree] = "--enable-rtree,--disable-rtree" |
| 35 | PACKAGECONFIG[session] = "--enable-session,--disable-session" |
| 36 | PACKAGECONFIG[dyn_ext] = "--enable-dynamic-extensions,--disable-dynamic-extensions" |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 37 | PACKAGECONFIG[zlib] = ",,zlib" |
| 38 | |
| 39 | CACHED_CONFIGUREVARS += "${@bb.utils.contains('PACKAGECONFIG', 'zlib', '', 'ac_cv_search_deflate=no',d)}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 40 | |
| 41 | EXTRA_OECONF = " \ |
| 42 | --enable-shared \ |
| 43 | --enable-threadsafe \ |
| 44 | --disable-static-shell \ |
| 45 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | |
| 47 | # pread() is in POSIX.1-2001 so any reasonable system must surely support it |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 48 | CFLAGS_append = " -DUSE_PREAD" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 50 | # Provide column meta-data API |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 51 | CFLAGS_append = " -DSQLITE_ENABLE_COLUMN_METADATA" |
| 52 | |
| 53 | # Unless SQLITE_BYTEORDER is predefined, the code falls back to build time |
| 54 | # huristics, which are not always correct |
| 55 | CFLAGS_append = " ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DSQLITE_BYTEORDER=1234', '-DSQLITE_BYTEORDER=4321', d)}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 56 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | PACKAGES = "lib${BPN} lib${BPN}-dev lib${BPN}-doc ${PN}-dbg lib${BPN}-staticdev ${PN}" |
| 58 | |
| 59 | FILES_${PN} = "${bindir}/*" |
| 60 | FILES_lib${BPN} = "${libdir}/*.so.*" |
| 61 | FILES_lib${BPN}-dev = "${libdir}/*.la ${libdir}/*.so \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 62 | ${libdir}/pkgconfig ${includedir}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | FILES_lib${BPN}-doc = "${docdir} ${mandir} ${infodir}" |
| 64 | FILES_lib${BPN}-staticdev = "${libdir}/lib*.a" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 65 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | AUTO_LIBNAME_PKGS = "${MLPREFIX}lib${BPN}" |
| 67 | |
| 68 | BBCLASSEXTEND = "native nativesdk" |