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