1*4882a593SmuzhiyunSUMMARY = "Modern, powerful open source cross-platform C++ class libraries" 2*4882a593SmuzhiyunDESCRIPTION = "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*4882a593SmuzhiyunHOMEPAGE = "http://pocoproject.org/" 4*4882a593SmuzhiyunSECTION = "libs" 5*4882a593SmuzhiyunLICENSE = "BSL-1.0" 6*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc" 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun# These dependencies are required by Foundation 9*4882a593SmuzhiyunDEPENDS = "libpcre zlib" 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunSRC_URI = " \ 12*4882a593Smuzhiyun git://github.com/pocoproject/poco.git;branch=master;protocol=https \ 13*4882a593Smuzhiyun file://run-ptest \ 14*4882a593Smuzhiyun " 15*4882a593SmuzhiyunSRCREV = "9d1c428c861f2e5ccf09149bbe8d2149720c5896" 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunUPSTREAM_CHECK_GITTAGREGEX = "poco-(?P<pver>\d+(\.\d+)+)" 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunS = "${WORKDIR}/git" 20*4882a593Smuzhiyun 21*4882a593Smuzhiyuninherit cmake ptest 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun# By default the most commonly used poco components are built 24*4882a593Smuzhiyun# Foundation is built anyway and doesn't need to be listed explicitly 25*4882a593Smuzhiyun# these don't have dependencies outside oe-core 26*4882a593SmuzhiyunPACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto JWT Data DataSQLite Zip Encodings Redis" 27*4882a593Smuzhiyun 28*4882a593SmuzhiyunPACKAGECONFIG[XML] = "-DENABLE_XML=ON,-DENABLE_XML=OFF,expat" 29*4882a593SmuzhiyunPACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF" 30*4882a593SmuzhiyunPACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF" 31*4882a593SmuzhiyunPACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib" 32*4882a593SmuzhiyunPACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF" 33*4882a593SmuzhiyunPACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF" 34*4882a593SmuzhiyunPACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON,-DENABLE_NETSSL=OFF,openssl" 35*4882a593SmuzhiyunPACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl" 36*4882a593SmuzhiyunPACKAGECONFIG[JWT] = "-DENABLE_JWT=ON,-DENABLE_JWT=OFF,openssl" 37*4882a593SmuzhiyunPACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF" 38*4882a593SmuzhiyunPACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3" 39*4882a593SmuzhiyunPACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF" 40*4882a593SmuzhiyunPACKAGECONFIG[Encodings] = "-DENABLE_ENCODINGS=ON,-DENABLE_ENCODINGS=OFF" 41*4882a593SmuzhiyunPACKAGECONFIG[Redis] = "-DENABLE_REDIS=ON,-DENABLE_REDIS=OFF" 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun# Additional components not build by default, 44*4882a593Smuzhiyun# they might have dependencies not included in oe-core 45*4882a593Smuzhiyun# or they don't work on all architectures 46*4882a593SmuzhiyunPACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2" 47*4882a593SmuzhiyunPACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF" 48*4882a593SmuzhiyunPACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb" 49*4882a593SmuzhiyunPACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc" 50*4882a593SmuzhiyunPACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF" 51*4882a593SmuzhiyunPACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF" 52*4882a593SmuzhiyunPACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF" 53*4882a593Smuzhiyun 54*4882a593SmuzhiyunEXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \ 55*4882a593Smuzhiyun -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ 56*4882a593Smuzhiyun ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}" 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun# For the native build we want to use the bundled version 59*4882a593SmuzhiyunEXTRA_OECMAKE:append:class-native = " -DPOCO_UNBUNDLED=OFF" 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun# do not use rpath 62*4882a593SmuzhiyunEXTRA_OECMAKE:append = " -DCMAKE_SKIP_RPATH=ON" 63*4882a593Smuzhiyun 64*4882a593Smuzhiyunpython populate_packages:prepend () { 65*4882a593Smuzhiyun poco_libdir = d.expand('${libdir}') 66*4882a593Smuzhiyun pn = d.getVar("PN") 67*4882a593Smuzhiyun packages = [] 68*4882a593Smuzhiyun testrunners = [] 69*4882a593Smuzhiyun 70*4882a593Smuzhiyun def hook(f, pkg, file_regex, output_pattern, modulename): 71*4882a593Smuzhiyun packages.append(pkg) 72*4882a593Smuzhiyun testrunners.append(modulename) 73*4882a593Smuzhiyun 74*4882a593Smuzhiyun do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$', 75*4882a593Smuzhiyun 'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook) 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages)) 78*4882a593Smuzhiyun d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners)) 79*4882a593Smuzhiyun} 80*4882a593Smuzhiyun 81*4882a593Smuzhiyundo_install_ptest () { 82*4882a593Smuzhiyun cp -rf ${B}/bin/ ${D}${PTEST_PATH} 83*4882a593Smuzhiyun cp -f ${B}/lib/libCppUnit.so* ${D}${libdir} 84*4882a593Smuzhiyun cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/ 85*4882a593Smuzhiyun find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \; 86*4882a593Smuzhiyun echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners" 87*4882a593Smuzhiyun} 88*4882a593Smuzhiyun 89*4882a593SmuzhiyunPACKAGES_DYNAMIC = "poco-.*" 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun# "poco" is a metapackage which pulls in all Poco components 92*4882a593SmuzhiyunALLOW_EMPTY:${PN} = "1" 93*4882a593Smuzhiyun 94*4882a593Smuzhiyun# cppunit is only built if tests are enabled 95*4882a593SmuzhiyunPACKAGES =+ "${PN}-cppunit" 96*4882a593SmuzhiyunFILES:${PN}-cppunit += "${libdir}/libCppUnit.so*" 97*4882a593SmuzhiyunALLOW_EMPTY:${PN}-cppunit = "1" 98*4882a593Smuzhiyun 99*4882a593SmuzhiyunRDEPENDS:${PN}-ptest += "${PN}-cppunit" 100*4882a593Smuzhiyun 101*4882a593SmuzhiyunBBCLASSEXTEND = "native" 102