blob: 32c57ce9788ff93d22e030d7e8594e60303596ac [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "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 = "libpcre2 zlib"
10
11SRC_URI = "git://github.com/pocoproject/poco.git;branch=master;protocol=https \
12 file://run-ptest \
13 "
Patrick Williams2390b1b2022-11-03 13:47:49 -050014SRCREV = "f1aefe34a46891b09230422bbc37465bc6d0a0d1"
Patrick Williams92b42cb2022-09-03 06:53:57 -050015
16UPSTREAM_CHECK_GITTAGREGEX = "poco-(?P<pver>\d+(\.\d+)+)"
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 JWT Data DataSQLite Zip Encodings Redis Prometheus"
26
27PACKAGECONFIG[XML] = "-DENABLE_XML=ON,-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,-DENABLE_NETSSL=OFF,openssl"
34PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl"
35PACKAGECONFIG[JWT] = "-DENABLE_JWT=ON,-DENABLE_JWT=OFF,openssl"
36PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
37PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3"
38PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
39PACKAGECONFIG[Encodings] = "-DENABLE_ENCODINGS=ON,-DENABLE_ENCODINGS=OFF"
40PACKAGECONFIG[Redis] = "-DENABLE_REDIS=ON,-DENABLE_REDIS=OFF"
41PACKAGECONFIG[Prometheus] = "-DENABLE_PROMETHEUS=ON,-DENABLE_PROMETHEUS=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[ActiveRecord] = "-DENABLE_ACTIVERECORD=ON,-DENABLE_ACTIVERECORD=OFF"
51PACKAGECONFIG[ActiveRecordCompiler] = "-DENABLE_ACTIVERECORD_COMPILER=ON,-DENABLE_ACTIVERECORD_COMPILER=OFF"
52PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
53PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
54PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
55
56EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
57 -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
58 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
59
60# For the native build we want to use the bundled version
61EXTRA_OECMAKE:append:class-native = " -DPOCO_UNBUNDLED=OFF"
62
63# do not use rpath
64EXTRA_OECMAKE:append = " -DCMAKE_SKIP_RPATH=ON"
65
66LDFLAGS:append:riscv32 = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
67LDFLAGS:append:mips = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
68
69python populate_packages:prepend () {
70 poco_libdir = d.expand('${libdir}')
71 pn = d.getVar("PN")
72 packages = []
73 testrunners = []
74
75 def hook(f, pkg, file_regex, output_pattern, modulename):
76 packages.append(pkg)
77 testrunners.append(modulename)
78
79 do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$',
80 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook)
81
82 d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages))
83 d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
84}
85
86do_install_ptest () {
87 cp -rf ${B}/bin/ ${D}${PTEST_PATH}
88 cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
89 cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
90 find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
91 echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
92}
93
94PACKAGES_DYNAMIC = "poco-.*"
95
96# "poco" is a metapackage which pulls in all Poco components
97ALLOW_EMPTY:${PN} = "1"
98
99# cppunit is only built if tests are enabled
100PACKAGES =+ "${PN}-cppunit"
101FILES:${PN}-cppunit += "${libdir}/libCppUnit.so*"
102ALLOW_EMPTY:${PN}-cppunit = "1"
103
104RDEPENDS:${PN}-ptest += "${PN}-cppunit"
105
106BBCLASSEXTEND = "native"