Line
Link Here
|
0 |
-- a/net-libs/polarssl/polarssl-1.3.0.ebuild |
0 |
++ b/net-libs/polarssl/polarssl-1.3.4.ebuild |
Lines 4-10
Link Here
|
4 |
|
4 |
|
5 |
EAPI=5 |
5 |
EAPI=5 |
6 |
|
6 |
|
7 |
inherit eutils multilib toolchain-funcs |
7 |
inherit eutils multilib toolchain-funcs cmake-utils multilib-minimal |
8 |
|
8 |
|
9 |
DESCRIPTION="Cryptographic library for embedded systems" |
9 |
DESCRIPTION="Cryptographic library for embedded systems" |
10 |
HOMEPAGE="http://polarssl.org/" |
10 |
HOMEPAGE="http://polarssl.org/" |
Lines 12-71
Link Here
|
12 |
|
12 |
|
13 |
LICENSE="GPL-2" |
13 |
LICENSE="GPL-2" |
14 |
SLOT="0" |
14 |
SLOT="0" |
15 |
KEYWORDS="amd64 arm hppa ~mips ppc ppc64 ~s390 sparc x86 ~amd64-fbsd ~x86-fbsd" |
15 |
KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" |
16 |
IUSE="examples havege sse2 static-libs zlib" |
16 |
IUSE="examples havege sse2 static-libs zlib" |
17 |
|
17 |
|
18 |
RDEPEND="zlib? ( sys-libs/zlib )" |
18 |
RDEPEND=" |
|
|
19 |
examples? ( |
20 |
dev-libs/openssl:0 |
21 |
amd64? ( abi_x86_32? ( |
22 |
|| ( |
23 |
dev-libs/openssl:0[abi_x86_32] |
24 |
app-emulation/emul-linux-x86-baselibs |
25 |
) |
26 |
) ) |
27 |
) |
28 |
zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )" |
19 |
DEPEND="${RDEPEND}" |
29 |
DEPEND="${RDEPEND}" |
20 |
|
30 |
|
21 |
enable_polarssl_option() { |
31 |
enable_polarssl_option() { |
22 |
local myopt="$@" |
32 |
local myopt="$@" |
23 |
# check that config.h syntax is the same at version bump |
33 |
# check that config.h syntax is the same at version bump |
24 |
sed -i \ |
34 |
sed -i \ |
25 |
-e "/define ${myopt}/{n; s/$/\n#define ${myopt}/}" \ |
35 |
-e "s://#define ${myopt}:#define ${myopt}:" \ |
26 |
include/polarssl/config.h || die |
36 |
include/polarssl/config.h || die |
27 |
} |
37 |
} |
28 |
|
38 |
|
29 |
src_prepare() { |
39 |
src_prepare() { |
30 |
sed -i '/.SILENT:/d' Makefile */Makefile || die |
40 |
if use !examples ; then |
31 |
epatch "${FILESDIR}"/${PN}-cflags.patch |
41 |
>programs/CMakeLists.txt |
|
|
42 |
fi |
43 |
epatch "${FILESDIR}"/${P}-static.patch \ |
44 |
"${FILESDIR}"/${P}-zlib.patch \ |
45 |
"${FILESDIR}"/${P}-cflags.patch \ |
46 |
"${FILESDIR}"/${P}-out-of-source.patch |
32 |
|
47 |
|
33 |
use sse2 && enable_polarssl_option POLARSSL_HAVE_SSE2 |
48 |
use sse2 && enable_polarssl_option POLARSSL_HAVE_SSE2 |
34 |
use zlib && enable_polarssl_option POLARSSL_ZLIB_SUPPORT |
49 |
use zlib && enable_polarssl_option POLARSSL_ZLIB_SUPPORT |
35 |
use havege && enable_polarssl_option POLARSSL_HAVEGE_C |
50 |
use havege && enable_polarssl_option POLARSSL_HAVEGE_C |
36 |
} |
51 |
} |
37 |
|
52 |
|
38 |
src_compile() { |
53 |
multilib_src_configure() { |
39 |
tc-export CC AR |
54 |
local mycmakeargs=( |
40 |
emake -C library OFLAGS="-fPIC" libpolarssl.so |
55 |
$(cmake-utils_use_enable zlib ZLIB_SUPPORT) |
|
|
56 |
$(cmake-utils_use_use static-libs STATIC_POLARSSL_LIBRARY) |
57 |
-DUSE_SHARED_POLARSSL_LIBRARY=ON |
58 |
-DINSTALL_POLARSSL_HEADERS=ON |
59 |
-DLIB_INSTALL_DIR="/usr/$(get_libdir)" |
60 |
) |
41 |
|
61 |
|
42 |
if use examples ; then |
62 |
cmake-utils_src_configure |
43 |
emake -C programs OFLAGS="" $(usex zlib "ZLIB=1" "") all |
|
|
44 |
fi |
45 |
ln -s libpolarssl.so library/libpolarssl.so.0 || die |
46 |
} |
63 |
} |
47 |
|
64 |
|
48 |
src_test() { |
65 |
multilib_src_compile() { |
49 |
cd programs || die |
66 |
cmake-utils_src_compile |
50 |
emake test/selftest $(usex zlib "ZLIB=1" "") || die "emake selftest failed" |
|
|
51 |
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:../library" ./test/selftest || die "selftest failed" |
52 |
cd "${S}" || die |
53 |
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:../library" emake check $(usex zlib "ZLIB=1" "") |
54 |
} |
67 |
} |
55 |
|
68 |
|
56 |
src_install() { |
69 |
multilib_src_test() { |
57 |
insinto /usr/include/polarssl |
70 |
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BUILD_DIR}/library" cmake-utils_src_test |
58 |
doins include/polarssl/*.h |
71 |
} |
59 |
dolib.so library/libpolarssl.so |
|
|
60 |
ln -s libpolarssl.so "${D%/}"/usr/$(get_libdir)/libpolarssl.so.0 || die |
61 |
use static-libs && dolib.a library/libpolarssl.a |
62 |
|
72 |
|
63 |
local p e |
73 |
multilib_src_install() { |
|
|
74 |
cmake-utils_src_install |
75 |
} |
76 |
|
77 |
multilib_src_install_all() { |
64 |
if use examples ; then |
78 |
if use examples ; then |
65 |
for p in programs/*/* ; do |
79 |
# avoid file collisions with sys-apps/coreutils |
|
|
80 |
local p e |
81 |
for p in "${ED%/}"/usr/bin/* ; do |
66 |
if [[ -x "${p}" && ! -d "${p}" ]] ; then |
82 |
if [[ -x "${p}" && ! -d "${p}" ]] ; then |
67 |
f=polarssl_`basename "${p}"` |
83 |
mv "${p}" "${ED%/}"/usr/bin/polarssl_`basename "${p}"` || die |
68 |
newbin "${p}" "${f}" |
|
|
69 |
fi |
84 |
fi |
70 |
done |
85 |
done |
71 |
for e in aes hash pkey ssl test ; do |
86 |
for e in aes hash pkey ssl test ; do |