blob: 3cfd49fcdd55bc31887790f0fa900dbd07b34419 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "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=master;protocol=https \
13 file://run-ptest \
14 "
15SRCREV = "de61f0049175a941cc83c2615c3bdc5e947b89f9"
16
17UPSTREAM_CHECK_GITTAGREGEX = "poco-(?P<pver>\d+(\.\d+)+)"
18
19S = "${WORKDIR}/git"
20
21inherit cmake ptest
22
23# By default the most commonly used poco components are built
24# Foundation is built anyway and doesn't need to be listed explicitly
25# these don't have dependencies outside oe-core
26PACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto JWT Data DataSQLite Zip Encodings Redis"
27
28PACKAGECONFIG[XML] = "-DENABLE_XML=ON,-DENABLE_XML=OFF,expat"
29PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF"
30PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF"
31PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib"
32PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF"
33PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF"
34PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON,-DENABLE_NETSSL=OFF,openssl"
35PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl"
36PACKAGECONFIG[JWT] = "-DENABLE_JWT=ON,-DENABLE_JWT=OFF,openssl"
37PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
38PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3"
39PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
40PACKAGECONFIG[Encodings] = "-DENABLE_ENCODINGS=ON,-DENABLE_ENCODINGS=OFF"
41PACKAGECONFIG[Redis] = "-DENABLE_REDIS=ON,-DENABLE_REDIS=OFF"
42
43# Additional components not build by default,
44# they might have dependencies not included in oe-core
45# or they don't work on all architectures
46PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
47PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
48PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb"
49PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
50PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
51PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
52PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
53
54EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
55 -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
56 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
57
58# For the native build we want to use the bundled version
59EXTRA_OECMAKE:append:class-native = " -DPOCO_UNBUNDLED=OFF"
60
61# do not use rpath
62EXTRA_OECMAKE:append = " -DCMAKE_SKIP_RPATH=ON"
63
64python populate_packages:prepend () {
65 poco_libdir = d.expand('${libdir}')
66 pn = d.getVar("PN")
67 packages = []
68 testrunners = []
69
70 def hook(f, pkg, file_regex, output_pattern, modulename):
71 packages.append(pkg)
72 testrunners.append(modulename)
73
74 do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$',
75 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook)
76
77 d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages))
78 d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
79}
80
81do_install_ptest () {
82 cp -rf ${B}/bin/ ${D}${PTEST_PATH}
83 cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
84 cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
85 find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
86 echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
87}
88
89PACKAGES_DYNAMIC = "poco-.*"
90
91# "poco" is a metapackage which pulls in all Poco components
92ALLOW_EMPTY:${PN} = "1"
93
94# cppunit is only built if tests are enabled
95PACKAGES =+ "${PN}-cppunit"
96FILES:${PN}-cppunit += "${libdir}/libCppUnit.so*"
97ALLOW_EMPTY:${PN}-cppunit = "1"
98
99RDEPENDS:${PN}-ptest += "${PN}-cppunit"
100
101BBCLASSEXTEND = "native"