blob: 258cc4994fd5ef494e3ad81046f639e173a6790c [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "Modern, powerful open source cross-platform C++ class libraries"
2DESCRIPTION = "Modern, powerful open source C++ class libraries and frameworks for building network- and internet-based applications that run on desktop, server, mobile and embedded systems."
3HOMEPAGE = "http://pocoproject.org/"
4SECTION = "libs"
5LICENSE = "BSL-1.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc"
7
8# These dependencies are required by Foundation
9DEPENDS = "libpcre zlib"
10
11SRC_URI = " \
12 git://github.com/pocoproject/poco.git;branch=poco-${PV} \
13 file://0001-Don-t-try-to-install-non-existing-Encodings-testsuit.patch \
14 file://run-ptest \
15 "
16SRCREV = "daf00da73ab917e4d4581e3aa00c0ee61e0cc58b"
17
18S = "${WORKDIR}/git"
19
20inherit cmake ptest
21
22# By default the most commonly used poco components are built
23# Foundation is built anyway and doesn't need to be listed explicitly
24# these don't have dependencies outside oe-core
25PACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto Data DataSQLite Zip Encodings Redis"
26
27PACKAGECONFIG[XML] = "-DENABLE_XML=ON -DEXPAT_LIBRARY:STRING=expat,-DENABLE_XML=OFF,expat"
28PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF"
29PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF"
30PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib"
31PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF"
32PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF"
33PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON -DOPENSSL_SSL_LIBRARY:STRING=ssl -DOPENSSL_CRYPTO_LIBRARY:STRING=crypto,-DENABLE_NETSSL=OFF,openssl"
34PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON -DOPENSSL_SSL_LIBRARY:STRING=ssl -DOPENSSL_CRYPTO_LIBRARY:STRING=crypto,-DENABLE_CRYPTO=OFF,openssl"
35PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
36PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3"
37PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
38PACKAGECONFIG[Encodings] = "-DENABLE_ENCODINGS=ON,-DENABLE_ENCODINGS=OFF"
39PACKAGECONFIG[Redis] = "-DENABLE_REDIS=ON,-DENABLE_REDIS=OFF"
40
41# Additional components not build by default,
42# they might have dependencies not included in oe-core
43# or they don't work on all architectures
44PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
45PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
46PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb"
47PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
48PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
49PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
50PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
51
52EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
53 -DZLIB_LIBRARY_RELEASE:STRING=z -DPCRE_LIBRARY:STRING=pcre \
54 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
55
56# For the native build we want to use the bundled version
57EXTRA_OECMAKE_append_class-native = " -DPOCO_UNBUNDLED=OFF"
58
59# do not use rpath
60EXTRA_OECMAKE_append = " -DCMAKE_SKIP_RPATH=ON"
61
62python populate_packages_prepend () {
63 poco_libdir = d.expand('${libdir}')
64 pn = d.getVar("PN")
65 packages = []
66 testrunners = []
67
68 def hook(f, pkg, file_regex, output_pattern, modulename):
69 packages.append(pkg)
70 testrunners.append(modulename)
71
72 do_split_packages(d, poco_libdir, '^libPoco(.*)\.so\..*$',
73 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook)
74
75 d.setVar("RRECOMMENDS_%s" % pn, " ".join(packages))
76 d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
77}
78
79do_install_ptest () {
80 cp -rf ${B}/bin/ ${D}${PTEST_PATH}
81 cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
82 cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
83 find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
84 echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
85}
86
87PACKAGES_DYNAMIC = "poco-.*"
88
89# "poco" is a metapackage which pulls in all Poco components
90ALLOW_EMPTY_${PN} = "1"
91
92# cppunit is only built if tests are enabled
93PACKAGES =+ "${PN}-cppunit"
94FILES_${PN}-cppunit += "${libdir}/libCppUnit.so*"
95ALLOW_EMPTY_${PN}-cppunit = "1"
96
97RDEPENDS_${PN}-ptest += "${PN}-cppunit"
98
99BBCLASSEXTEND = "native"