blob: c3b52c888556a2448be5ec1976edbecfb74459be [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
Andrew Geissler615f2f12022-07-15 14:00:58 -05009DEPENDS = "libpcre2 zlib"
Andrew Geissler9aee5002022-03-30 16:27:02 +000010
11SRC_URI = " \
12 git://github.com/pocoproject/poco.git;branch=master;protocol=https \
Andrew Geissler615f2f12022-07-15 14:00:58 -050013 file://0001-fix-unbundled-PCRE2-dependency.patch \
14 file://0002-remove-providers-unitialization.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000015 file://run-ptest \
16 "
Andrew Geissler615f2f12022-07-15 14:00:58 -050017SRCREV = "4ba8595ed83841d1fa240716b5652adc3772c36b"
Andrew Geissler9aee5002022-03-30 16:27:02 +000018
19UPSTREAM_CHECK_GITTAGREGEX = "poco-(?P<pver>\d+(\.\d+)+)"
20
21S = "${WORKDIR}/git"
22
23inherit cmake ptest
24
25# By default the most commonly used poco components are built
26# Foundation is built anyway and doesn't need to be listed explicitly
27# these don't have dependencies outside oe-core
Andrew Geissler615f2f12022-07-15 14:00:58 -050028PACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto JWT Data DataSQLite Zip Encodings Redis Prometheus"
Andrew Geissler9aee5002022-03-30 16:27:02 +000029
30PACKAGECONFIG[XML] = "-DENABLE_XML=ON,-DENABLE_XML=OFF,expat"
31PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF"
32PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF"
33PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib"
34PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF"
35PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF"
36PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON,-DENABLE_NETSSL=OFF,openssl"
37PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl"
38PACKAGECONFIG[JWT] = "-DENABLE_JWT=ON,-DENABLE_JWT=OFF,openssl"
39PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
40PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3"
41PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
42PACKAGECONFIG[Encodings] = "-DENABLE_ENCODINGS=ON,-DENABLE_ENCODINGS=OFF"
43PACKAGECONFIG[Redis] = "-DENABLE_REDIS=ON,-DENABLE_REDIS=OFF"
Andrew Geissler615f2f12022-07-15 14:00:58 -050044PACKAGECONFIG[Prometheus] = "-DENABLE_PROMETHEUS=ON,-DENABLE_PROMETHEUS=OFF"
Andrew Geissler9aee5002022-03-30 16:27:02 +000045
46# Additional components not build by default,
47# they might have dependencies not included in oe-core
48# or they don't work on all architectures
49PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
50PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
51PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb"
52PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
Andrew Geissler615f2f12022-07-15 14:00:58 -050053PACKAGECONFIG[ActiveRecord] = "-DENABLE_ACTIVERECORD=ON,-DENABLE_ACTIVERECORD=OFF"
54PACKAGECONFIG[ActiveRecordCompiler] = "-DENABLE_ACTIVERECORD_COMPILER=ON,-DENABLE_ACTIVERECORD_COMPILER=OFF"
Andrew Geissler9aee5002022-03-30 16:27:02 +000055PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
56PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
57PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
58
59EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
60 -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
61 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
62
63# For the native build we want to use the bundled version
64EXTRA_OECMAKE:append:class-native = " -DPOCO_UNBUNDLED=OFF"
65
66# do not use rpath
67EXTRA_OECMAKE:append = " -DCMAKE_SKIP_RPATH=ON"
68
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050069LDFLAGS:append:riscv32 = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
70LDFLAGS:append:mips = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}"
71
Andrew Geissler9aee5002022-03-30 16:27:02 +000072python populate_packages:prepend () {
73 poco_libdir = d.expand('${libdir}')
74 pn = d.getVar("PN")
75 packages = []
76 testrunners = []
77
78 def hook(f, pkg, file_regex, output_pattern, modulename):
79 packages.append(pkg)
80 testrunners.append(modulename)
81
82 do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$',
83 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook)
84
85 d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages))
86 d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
87}
88
89do_install_ptest () {
90 cp -rf ${B}/bin/ ${D}${PTEST_PATH}
91 cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
92 cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
93 find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
94 echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
95}
96
97PACKAGES_DYNAMIC = "poco-.*"
98
99# "poco" is a metapackage which pulls in all Poco components
100ALLOW_EMPTY:${PN} = "1"
101
102# cppunit is only built if tests are enabled
103PACKAGES =+ "${PN}-cppunit"
104FILES:${PN}-cppunit += "${libdir}/libCppUnit.so*"
105ALLOW_EMPTY:${PN}-cppunit = "1"
106
107RDEPENDS:${PN}-ptest += "${PN}-cppunit"
108
109BBCLASSEXTEND = "native"