blob: 135d2aa6c00e64ebe20ccfc8898ad8542fb706ae [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -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."
3SECTION = "libs"
4HOMEPAGE = "http://pocoproject.org/"
5LICENSE = "BSL-1.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc"
7
8# These dependencies are required by Foundation
9DEPENDS = "libpcre zlib"
10
11inherit cmake ptest
12
13BBCLASSEXTEND = "native"
14
15SRC_URI = " \
16 https://github.com/pocoproject/poco/archive/poco-${PV}-release.tar.gz \
17 file://run-ptest \
18 "
19
20SRC_URI[md5sum] = "a4b755d47303b20a0e2586f281d05a36"
21SRC_URI[sha256sum] = "6dbbc2018912ad9af6af96f605933ed91354a1e7423e5dbd04d8e9a2b2d15c05"
22
23S = "${WORKDIR}/poco-poco-${PV}-release"
24
25EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
26 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
27
28# For the native build we want to use the bundled version
29EXTRA_OECMAKE_append_class-native = " -DPOCO_UNBUNDLED=OFF"
30
31# do not use rpath
32EXTRA_OECMAKE_append = " -DCMAKE_SKIP_RPATH=ON"
33
34# By default the most commonly used poco components are built
35# Foundation is built anyway and doesn't need to be listed explicitly
36# these don't have dependencies outside oe-core
37PACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto Data DataSQLite Zip"
38
39PACKAGECONFIG[XML] = "-DENABLE_XML=ON,-DENABLE_XML=OFF,expat"
40PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF"
41PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF"
42PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib"
43PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF"
44PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF"
45PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON,-DENABLE_NETSSL=OFF,openssl"
46PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl"
47PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
48PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON,-DENABLE_DATA_SQLITE=OFF,sqlite3"
49PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
50
51# Additional components not build by default,
52# they might have dependencies not included in oe-core
53# or they don't work on all architectures
54PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
55PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
56PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON,-DENABLE_DATA_MYSQL=OFF,mariadb"
57PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
58PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
59PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
60PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
61
62# Make a package for each library
63PACKAGES = "${PN}-dbg ${POCO_PACKAGES}"
64python __anonymous () {
65 packages = []
66 testrunners = []
67 components = d.getVar("PACKAGECONFIG", True).split()
68 components.append("Foundation")
69 for lib in components:
70 pkg = ("poco-%s" % lib.lower()).replace("_","")
71 packages.append(pkg)
72 if not d.getVar("FILES_%s" % pkg, True):
73 d.setVar("FILES_%s" % pkg, "${libdir}/libPoco%s.so.*" % lib)
74 testrunners.append("%s" % lib)
75
76 d.setVar("POCO_PACKAGES", " ".join(packages))
77 d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
78}
79
80# "poco" is a metapackage which pulls in all Poco components
81PACKAGES += "${PN}"
82RRECOMMENDS_${PN} += "${POCO_PACKAGES}"
83RRECOMMENDS_${PN}_class-native = ""
84ALLOW_EMPTY_${PN} = "1"
85
86# -dev last to pick up the remaining stuff
87PACKAGES += "${PN}-dev ${PN}-staticdev"
88FILES_${PN}-dev = "${includedir} ${libdir}/libPoco*.so ${libdir}/cmake"
89FILES_${PN}-staticdev = "${libdir}/libPoco*.a"
90
91# ptest support
92FILES_${PN}-dbg += "${PTEST_PATH}/bin/.debug"
93
94# cppunit is only built if tests are enabled
95PACKAGES += "${PN}-cppunit"
96FILES_${PN}-cppunit += "${libdir}/libCppUnit.so*"
97ALLOW_EMPTY_${PN}-cppunit = "1"
98
99RDEPENDS_${PN}-ptest += "${PN}-cppunit"
100
101do_install_ptest () {
102 cp -rf ${B}/bin/ ${D}${PTEST_PATH}
103 cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
104 cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
105 find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
106 echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
107}