blob: 51bd5611fb82b4917789d19500a021265a5b8d63 [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 \
Patrick Williamsb9af8752023-01-30 13:28:01 -060012 file://0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050013 file://run-ptest \
14 "
Patrick Williams7784c422022-11-17 07:29:11 -060015SRCREV = "1211613642269b7d53bea58b02de7fcd25ece3b9"
Patrick Williams92b42cb2022-09-03 06:53:57 -050016
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 Prometheus"
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"
42PACKAGECONFIG[Prometheus] = "-DENABLE_PROMETHEUS=ON,-DENABLE_PROMETHEUS=OFF"
43
44# Additional components not build by default,
45# they might have dependencies not included in oe-core
46# or they don't work on all architectures
47PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
48PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
49PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb"
50PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
51PACKAGECONFIG[ActiveRecord] = "-DENABLE_ACTIVERECORD=ON,-DENABLE_ACTIVERECORD=OFF"
52PACKAGECONFIG[ActiveRecordCompiler] = "-DENABLE_ACTIVERECORD_COMPILER=ON,-DENABLE_ACTIVERECORD_COMPILER=OFF"
53PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
54PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
55PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
56
57EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
58 -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
59 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
60
61# For the native build we want to use the bundled version
62EXTRA_OECMAKE:append:class-native = " -DPOCO_UNBUNDLED=OFF"
63
64# do not use rpath
65EXTRA_OECMAKE:append = " -DCMAKE_SKIP_RPATH=ON"
66
67LDFLAGS:append:riscv32 = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
68LDFLAGS:append:mips = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
Andrew Geissler517393d2023-01-13 08:55:19 -060069LDFLAGS:append:powerpc = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
Patrick Williams92b42cb2022-09-03 06:53:57 -050070
71python populate_packages:prepend () {
72 poco_libdir = d.expand('${libdir}')
73 pn = d.getVar("PN")
74 packages = []
75 testrunners = []
76
77 def hook(f, pkg, file_regex, output_pattern, modulename):
78 packages.append(pkg)
79 testrunners.append(modulename)
80
81 do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$',
82 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook)
83
84 d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages))
85 d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
86}
87
88do_install_ptest () {
89 cp -rf ${B}/bin/ ${D}${PTEST_PATH}
90 cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
91 cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
92 find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
93 echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
94}
95
96PACKAGES_DYNAMIC = "poco-.*"
97
98# "poco" is a metapackage which pulls in all Poco components
99ALLOW_EMPTY:${PN} = "1"
100
101# cppunit is only built if tests are enabled
102PACKAGES =+ "${PN}-cppunit"
103FILES:${PN}-cppunit += "${libdir}/libCppUnit.so*"
104ALLOW_EMPTY:${PN}-cppunit = "1"
105
106RDEPENDS:${PN}-ptest += "${PN}-cppunit"
107
108BBCLASSEXTEND = "native"