blob: f66a2725246434de2edf90e62e4e75753dc4d8cc [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 Williams7784c422022-11-17 07:29:11 -060014SRCREV = "1211613642269b7d53bea58b02de7fcd25ece3b9"
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)}"
Andrew Geissler517393d2023-01-13 08:55:19 -060068LDFLAGS:append:powerpc = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
Patrick Williams92b42cb2022-09-03 06:53:57 -050069
70python populate_packages:prepend () {
71 poco_libdir = d.expand('${libdir}')
72 pn = d.getVar("PN")
73 packages = []
74 testrunners = []
75
76 def hook(f, pkg, file_regex, output_pattern, modulename):
77 packages.append(pkg)
78 testrunners.append(modulename)
79
80 do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$',
81 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook)
82
83 d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages))
84 d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
85}
86
87do_install_ptest () {
88 cp -rf ${B}/bin/ ${D}${PTEST_PATH}
89 cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
90 cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
91 find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
92 echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
93}
94
95PACKAGES_DYNAMIC = "poco-.*"
96
97# "poco" is a metapackage which pulls in all Poco components
98ALLOW_EMPTY:${PN} = "1"
99
100# cppunit is only built if tests are enabled
101PACKAGES =+ "${PN}-cppunit"
102FILES:${PN}-cppunit += "${libdir}/libCppUnit.so*"
103ALLOW_EMPTY:${PN}-cppunit = "1"
104
105RDEPENDS:${PN}-ptest += "${PN}-cppunit"
106
107BBCLASSEXTEND = "native"