dev-libs/poco: use HTTPs
[gentoo.git] / dev-libs / poco / poco-1.9.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cmake-utils
7
8 DESCRIPTION="C++ libraries for building network-based applications"
9 HOMEPAGE="https://pocoproject.org/"
10 SRC_URI="https://github.com/pocoproject/${PN}/archive/${P}-release.tar.gz -> ${P}.tar.gz"
11 LICENSE="Boost-1.0"
12 SLOT="0"
13 KEYWORDS="~amd64 ~arm ~x86"
14 IUSE="7z apache cppparser +crypto +data examples +file2pagecompiler +json +pagecompiler iodbc libressl +mongodb mysql +net odbc pdf pocodoc sqlite +ssl test +util +xml +zip"
15 REQUIRED_USE="7z? ( xml )
16         apache? ( net util )
17         file2pagecompiler? ( pagecompiler )
18         iodbc? ( odbc )
19         mongodb? ( data )
20         mysql? ( data )
21         odbc? ( data )
22         pagecompiler? ( json net util xml )
23         pocodoc? ( cppparser util xml )
24         sqlite? ( data )
25         test? ( data? ( sqlite ) json util xml )"
26
27 RDEPEND=">=dev-libs/libpcre-8.13
28         xml? ( dev-libs/expat )
29         apache? ( dev-libs/apr
30                 dev-libs/apr-util
31                 www-servers/apache )
32         mysql? ( virtual/mysql )
33         odbc? ( iodbc? ( dev-db/libiodbc )
34                 !iodbc? ( dev-db/unixODBC ) )
35         ssl? (
36                 !libressl? ( <dev-libs/openssl-1.1.0:0 )
37                 libressl? ( dev-libs/libressl )
38         )
39         sqlite? ( dev-db/sqlite:3 )
40         zip? ( sys-libs/zlib )"
41 DEPEND="${DEPEND}
42         virtual/pkgconfig"
43
44 S="${WORKDIR}/${PN}-${P}-release"
45
46 PATCHES=( "${FILESDIR}/${PN}-1.7.2-iodbc-incdir.patch" )
47
48 src_prepare() {
49         if use test ; then
50                 # ignore missing tests on experimental library
51                 # and tests requiring running DB-servers, internet connections, etc.
52                 sed -i \
53                         -e '/testsuite/d' \
54                         {Data/{MySQL,ODBC},MongoDB,Net,NetSSL_OpenSSL,PDF}/CMakeLists.txt || die
55                 # Poco expands ~ using passwd, which does not match $HOME in the build environment
56                 sed -i \
57                         -e '/CppUnit_addTest.*testExpand/d' \
58                         Foundation/testsuite/src/PathTest.cpp || die
59                 # ignore failing Crypto test since upstream does not seem to care,
60                 # see https://github.com/pocoproject/poco/issues/1209
61                 sed -i \
62                         -e '/RSATest, testRSACipherLarge/d' \
63                         Crypto/testsuite/src/RSATest.cpp || die
64         fi
65
66         cmake-utils_src_prepare
67 }
68
69 src_configure() {
70         local mycmakeargs=(
71                 -DPOCO_UNBUNDLED=ON
72                 -DENABLE_APACHECONNECTOR="$(usex apache)"
73                 -DENABLE_CPPPARSER="$(usex cppparser)"
74                 -DENABLE_CRYPTO="$(usex ssl)"
75                 -DENABLE_DATA="$(usex data)"
76                 -DENABLE_DATA_MYSQL="$(usex mysql)"
77                 -DENABLE_DATA_ODBC="$(usex odbc)"
78                 -DENABLE_DATA_SQLITE="$(usex sqlite)"
79                 -DENABLE_JSON="$(usex util)"
80                 -DENABLE_MONGODB="$(usex mongodb)"
81                 -DENABLE_NET="$(usex net)"
82                 -DENABLE_NETSSL="$(usex ssl)"
83                 -DENABLE_NETSSL_WIN=OFF
84                 -DENABLE_PAGECOMPILER="$(usex pagecompiler)"
85                 -DENABLE_PAGECOMPILER_FILE2PAGE="$(usex file2pagecompiler)"
86                 -DENABLE_PDF="$(usex pdf)"
87                 -DENABLE_POCODOC="$(usex pocodoc)"
88                 -DENABLE_SEVENZIP="$(usex 7z)"
89                 -DENABLE_TESTS="$(usex test)"
90                 -DENABLE_UTIL="$(usex util)"
91                 -DENABLE_XML="$(usex xml)"
92                 -DENABLE_ZIP="$(usex zip)"
93         )
94
95         if ! use iodbc ; then
96                 sed -i -e 's|iodbc||' cmake/FindODBC.cmake || die
97         fi
98
99         cmake-utils_src_configure
100 }
101
102 src_install() {
103         cmake-utils_src_install
104
105         if use examples ; then
106                 for sd in */samples ; do
107                         insinto /usr/share/doc/${PF}/examples/${sd%/samples}
108                         doins -r ${sd}
109                 done
110                 find "${D}/usr/share/doc/${PF}/examples" \
111                         -iname "*.sln" -or -iname "*.vcproj" -or \
112                         -iname "*.vmsbuild" -or -iname "*.properties" \
113                         | xargs rm
114         fi
115 }