Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | SUMMARY = "Modern, powerful open source cross-platform C++ class libraries" |
| 2 | DESCRIPTION = "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." |
| 3 | HOMEPAGE = "http://pocoproject.org/" |
| 4 | SECTION = "libs" |
| 5 | LICENSE = "BSL-1.0" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc" |
| 7 | |
| 8 | # These dependencies are required by Foundation |
| 9 | DEPENDS = "libpcre2 zlib" |
| 10 | |
| 11 | SRC_URI = "git://github.com/pocoproject/poco.git;branch=master;protocol=https \ |
Patrick Williams | b9af875 | 2023-01-30 13:28:01 -0600 | [diff] [blame] | 12 | file://0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch \ |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 13 | file://0001-cppignore.lnx-Ignore-PKCS12-and-testLaunch-test.patch \ |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 14 | file://0001-Fix-data-race-when-create-POSIX-thread.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 15 | file://run-ptest \ |
| 16 | " |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 17 | SRCREV = "1211613642269b7d53bea58b02de7fcd25ece3b9" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 18 | |
| 19 | UPSTREAM_CHECK_GITTAGREGEX = "poco-(?P<pver>\d+(\.\d+)+)" |
| 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | inherit 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 Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 28 | PACKAGECONFIG ??= "XML JSON PDF Util Net NetSSL Crypto JWT Data DataSQLite Zip Encodings Redis Prometheus" |
| 29 | # MongoDB does not build for all architectures yet keep in sync with COMPATIBLE_HOST list in mongodb recipe |
| 30 | # and mongodb needs meta-python enabled as well |
| 31 | PACKAGECONFIG:remove:riscv32 = "MongoDB" |
| 32 | PACKAGECONFIG:remove:riscv64 = "MongoDB" |
| 33 | PACKAGECONFIG:remove:mipsarch = "MongoDB" |
| 34 | PACKAGECONFIG:remove:powerpc = "MongoDB" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 35 | |
| 36 | PACKAGECONFIG[XML] = "-DENABLE_XML=ON,-DENABLE_XML=OFF,expat" |
| 37 | PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF" |
| 38 | PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF" |
| 39 | PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib" |
| 40 | PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF" |
| 41 | PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF" |
| 42 | PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON,-DENABLE_NETSSL=OFF,openssl" |
| 43 | PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl" |
| 44 | PACKAGECONFIG[JWT] = "-DENABLE_JWT=ON,-DENABLE_JWT=OFF,openssl" |
| 45 | PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF" |
| 46 | PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3" |
| 47 | PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF" |
| 48 | PACKAGECONFIG[Encodings] = "-DENABLE_ENCODINGS=ON,-DENABLE_ENCODINGS=OFF" |
| 49 | PACKAGECONFIG[Redis] = "-DENABLE_REDIS=ON,-DENABLE_REDIS=OFF" |
| 50 | PACKAGECONFIG[Prometheus] = "-DENABLE_PROMETHEUS=ON,-DENABLE_PROMETHEUS=OFF" |
| 51 | |
| 52 | # Additional components not build by default, |
| 53 | # they might have dependencies not included in oe-core |
| 54 | # or they don't work on all architectures |
| 55 | PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2" |
| 56 | PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF" |
| 57 | PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb" |
| 58 | PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc" |
| 59 | PACKAGECONFIG[ActiveRecord] = "-DENABLE_ACTIVERECORD=ON,-DENABLE_ACTIVERECORD=OFF" |
| 60 | PACKAGECONFIG[ActiveRecordCompiler] = "-DENABLE_ACTIVERECORD_COMPILER=ON,-DENABLE_ACTIVERECORD_COMPILER=OFF" |
| 61 | PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF" |
| 62 | PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF" |
| 63 | PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF" |
| 64 | |
| 65 | EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \ |
| 66 | -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ |
| 67 | ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}" |
| 68 | |
| 69 | # For the native build we want to use the bundled version |
| 70 | EXTRA_OECMAKE:append:class-native = " -DPOCO_UNBUNDLED=OFF" |
| 71 | |
| 72 | # do not use rpath |
| 73 | EXTRA_OECMAKE:append = " -DCMAKE_SKIP_RPATH=ON" |
| 74 | |
| 75 | LDFLAGS:append:riscv32 = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}" |
| 76 | LDFLAGS:append:mips = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 77 | LDFLAGS:append:powerpc = "${@bb.utils.contains('PACKAGECONFIG', 'Prometheus', ' -Wl,--no-as-needed -latomic -Wl,--as-needed', '', d)}" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 78 | |
| 79 | python populate_packages:prepend () { |
| 80 | poco_libdir = d.expand('${libdir}') |
| 81 | pn = d.getVar("PN") |
| 82 | packages = [] |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 83 | |
| 84 | def hook(f, pkg, file_regex, output_pattern, modulename): |
| 85 | packages.append(pkg) |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 86 | |
| 87 | do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$', |
| 88 | 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook) |
| 89 | |
| 90 | d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages)) |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | do_install_ptest () { |
| 94 | cp -rf ${B}/bin/ ${D}${PTEST_PATH} |
| 95 | cp -f ${B}/lib/libCppUnit.so* ${D}${libdir} |
| 96 | cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/ |
| 97 | find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \; |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 98 | rm -f ${D}${PTEST_PATH}/testrunners |
| 99 | for f in ${D}${PTEST_PATH}/bin/*-testrunner; do |
| 100 | echo `basename $f` >> ${D}${PTEST_PATH}/testrunners |
| 101 | done |
| 102 | install -Dm 0644 ${S}/cppignore.lnx ${D}${PTEST_PATH}/cppignore.lnx |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | PACKAGES_DYNAMIC = "poco-.*" |
| 106 | |
| 107 | # "poco" is a metapackage which pulls in all Poco components |
| 108 | ALLOW_EMPTY:${PN} = "1" |
| 109 | |
| 110 | # cppunit is only built if tests are enabled |
| 111 | PACKAGES =+ "${PN}-cppunit" |
| 112 | FILES:${PN}-cppunit += "${libdir}/libCppUnit.so*" |
| 113 | ALLOW_EMPTY:${PN}-cppunit = "1" |
| 114 | |
| 115 | RDEPENDS:${PN}-ptest += "${PN}-cppunit" |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 116 | RDEPENDS:${PN}-ptest += "${@bb.utils.contains('PACKAGECONFIG', 'MongoDB', 'mongodb', '', d)}" |
| 117 | RDEPENDS:${PN}-ptest += "${@bb.utils.contains('PACKAGECONFIG', 'Redis', 'redis', '', d)}" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 118 | |
| 119 | BBCLASSEXTEND = "native" |