Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 562122
Collapse All | Expand All

(-)a/dev-libs/Ice/Ice-3.5.1-r1.ebuild (+287 lines)
Line 0 Link Here
1
# Copyright 1999-2015 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
4
5
EAPI=5
6
7
PYTHON_COMPAT=( python2_7 pypy )
8
RUBY_OPTIONAL="yes"
9
USE_RUBY="ruby19"
10
11
inherit eutils toolchain-funcs versionator python-r1 mono-env ruby-ng db-use
12
13
DESCRIPTION="ICE middleware C++ library and generator tools"
14
HOMEPAGE="http://www.zeroc.com/"
15
SRC_URI="http://www.zeroc.com/download/Ice/$(get_version_component_range 1-2)/${P}.tar.gz
16
	doc? ( http://www.zeroc.com/download/Ice/$(get_version_component_range 1-2)/${P}.pdf )"
17
LICENSE="GPL-2"
18
SLOT="0"
19
KEYWORDS="~amd64 ~arm ~ia64 ~x86 ~x86-linux ~x64-macos"
20
IUSE="doc examples libressl +ncurses mono python ruby test debug"
21
22
RDEPEND=">=dev-libs/expat-2.0.1
23
	>=app-arch/bzip2-1.0.5
24
	!libressl? ( >=dev-libs/openssl-0.9.8o:0 )
25
	libressl? ( dev-libs/libressl )
26
	|| (
27
		sys-libs/db:5.3[cxx]
28
		sys-libs/db:5.1[cxx]
29
		sys-libs/db:4.8[cxx]
30
	)
31
	~dev-cpp/libmcpp-2.7.2
32
	python? ( ${PYTHON_DEPS} )
33
	ruby? ( $(ruby_implementation_depend ruby19) )
34
	mono? ( dev-lang/mono )
35
	!dev-python/IcePy
36
	!dev-ruby/IceRuby"
37
DEPEND="${RDEPEND}
38
	ncurses? ( sys-libs/ncurses sys-libs/readline )
39
	test? ( ${PYTHON_DEPS} )"
40
41
# Maintainer notes:
42
# - yes, we have to do the trickery with the move for the python functions
43
#   since the build and test frameworks deduce various settings from the path
44
#   and they can't be tricked by a symlink. And we also need
45
#   SUPPORT_PYTHON_ABIS=1 otherwise we can't get pyc/pyo anymore the sane way.
46
# TODO: php bindings
47
# TODO: java bindings
48
49
#overwrite ruby-ng.eclass default
50
S="${WORKDIR}/${P}"
51
52
pkg_setup() {
53
	# prevent ruby-ng.eclass from messing with src_unpack
54
	:;
55
}
56
57
src_unpack() {
58
	# prevent ruby-ng.eclass from messing with src_unpack
59
	default
60
}
61
62
src_prepare() {
63
	epatch "${FILESDIR}"/${P}-libressl.patch
64
65
	sed -i \
66
		-e 's|\(install_docdir[[:space:]]*\):=|\1?=|' \
67
		-e 's|\(install_configdir[[:space:]]*\):=|\1?=|' \
68
		cpp/config/Make.rules || die "sed failed"
69
70
	sed -i \
71
		-e 's|\(install_pythondir[[:space:]]*\):=|\1?=|' \
72
		-e 's|\(install_rubydir[[:space:]]*\):=|\1?=|' \
73
		-e 's|\(install_libdir[[:space:]]*\):=|\1?=|' \
74
		{py,rb}/config/Make.rules || die "sed failed"
75
76
	sed -i \
77
		-e 's|-O2 ||g' \
78
		-e 's|-Werror ||g' \
79
		cpp/config/Make.rules.Linux || die "sed failed"
80
81
	sed -i \
82
		-e 's|install-common||' \
83
		-e 's|demo||' \
84
		{cpp,cs,php,py,rb}/Makefile || die "sed failed"
85
86
	sed -i \
87
		-e 's|-f -root|-f -gacdir $(GAC_DIR) -root|' \
88
		cs/config/Make.rules.cs || die "sed failed"
89
90
	# skip mono tests, bug #498484
91
	sed -i \
92
		-e 's|^\(SUBDIRS.*\)test|\1|' \
93
		cs/Makefile || die "sed failed"
94
95
	if ! use test ; then
96
		sed -i \
97
			-e 's|^\(SUBDIRS.*\)test|\1|' \
98
			{cpp,php,py,rb}/Makefile || die "sed failed"
99
	fi
100
}
101
102
suitable_db_version() {
103
	local tested_slots="5.3 5.1 4.8"
104
	for ver in ${tested_slots}; do
105
		if [[ -n $(db_findver sys-libs/db:${ver}) ]]; then
106
			echo ${ver}
107
			return 0
108
		fi
109
	done
110
	die "No suitable BerkDB versions found, aborting"
111
}
112
113
src_configure() {
114
	MAKE_RULES="prefix=\"${ED}/usr\"
115
		install_docdir=\"${ED}/usr/share/doc/${PF}\"
116
		install_configdir=\"${ED}/usr/share/Ice-${PV}/config\"
117
		install_mandir=\"${ED}/usr/share/man\"
118
		embedded_runpath_prefix=\"${EPREFIX}/usr\"
119
		LP64=yes"
120
121
	use ncurses && OPTIONS="${MAKE_RULES} USE_READLINE=yes" || MAKE_RULES="${MAKE_RULES} USE_READLINE=no"
122
	use debug && OPTIONS"${MAKE_RULES} OPTIMIZE=no" || MAKE_RULES="${MAKE_RULES} OPTIMIZE=yes"
123
124
	local BERKDB_VERSION="$(suitable_db_version)"
125
	MAKE_RULES="${MAKE_RULES} DB_FLAGS=-I$(db_includedir ${BERKDB_VERSION})"
126
	sed -i \
127
		-e "s|g++|$(tc-getCXX)|" \
128
		-e "s|\(CFLAGS[[:space:]]*=\)|\1 ${CFLAGS}|" \
129
		-e "s|\(CXXFLAGS[[:space:]]*=\)|\1 ${CXXFLAGS}|" \
130
		-e "s|\(LDFLAGS[[:space:]]*=\)|\1 ${LDFLAGS}|" \
131
		-e "s|\(DB_LIBS[[:space:]]*=\) \-ldb_cxx|\1 -ldb_cxx-$(db_findver sys-libs/db:${BERKDB_VERSION})|" \
132
		cpp/config/Make.rules{,.Linux} py/config/Make.rules || die "sed failed"
133
134
	if use python ; then
135
		S=${S}/py python_copy_sources
136
137
		# make a place for the symlink
138
		rm -r py/python || die
139
	fi
140
141
	if use ruby ; then
142
		SITERUBY="$(ruby19 -r rbconfig -e 'print Config::CONFIG["sitedir"]')"
143
		MAKE_RULES_RB="install_rubydir=\"${ED}/${SITERUBY}\"
144
			install_libdir=\"${ED}/${SITERUBY}\""
145
146
		# make it use ruby19 only
147
		sed -i \
148
			-e 's|RUBY = ruby|\019|' \
149
			rb/config/Make.rules || die "sed failed"
150
	fi
151
152
	MAKE_RULES_CS="GACINSTALL=yes GAC_ROOT=\"${ED}/usr/$(get_libdir)\" GAC_DIR=${EPREFIX}/usr/$(get_libdir)"
153
154
	use test && python_export_best
155
}
156
157
src_compile() {
158
	# Do not remove this export or build will break!
159
	tc-export CXX
160
161
	emake -C cpp ${MAKE_RULES} || die "emake failed"
162
163
	if use doc ; then
164
		emake -C cpp/doc || die "building docs failed"
165
	fi
166
167
	if use python ; then
168
		building() {
169
			emake -C "${BUILD_DIR}" ${MAKE_RULES} || die "emake py-${EPYTHON} failed"
170
		}
171
		BUILD_DIR=py python_foreach_impl building
172
	fi
173
174
	if use ruby ; then
175
		emake -C rb ${MAKE_RULES} ${MAKE_RULES_RB} || die "emake rb failed"
176
	fi
177
178
	if use mono ; then
179
		emake -C cs ${MAKE_RULES} ${MAKE_RULES_CS} || die "emake cs failed"
180
	fi
181
}
182
183
src_install() {
184
	dodoc CHANGES README
185
186
	insinto /usr/share/${P}
187
	doins -r slice
188
189
	emake -C cpp ${MAKE_RULES} install || die "emake install failed"
190
191
	docinto cpp
192
	dodoc CHANGES README
193
194
	if use examples ; then
195
		insinto /usr/share/doc/${PF}/examples-cpp
196
		doins cpp/config/*.cfg
197
		doins -r cpp/demo/*
198
	fi
199
200
	if use doc ; then
201
		dohtml -r cpp/doc/reference/*
202
		dodoc "${DISTDIR}/${P}.pdf"
203
	fi
204
205
	if use python ; then
206
		installation() {
207
			mkdir -p "${D}/$(python_get_sitedir)" || die
208
209
			emake -C "${BUILD_DIR}" ${MAKE_RULES} \
210
				install_pythondir="\"${D}/$(python_get_sitedir)\"" \
211
				install_libdir="\"${D}/$(python_get_sitedir)\"" \
212
				install || die "emake py-${EPYTHON} install failed"
213
		}
214
		BUILD_DIR=py python_foreach_impl installation
215
216
		docinto py
217
		dodoc py/CHANGES py/README
218
219
		if use examples ; then
220
			insinto /usr/share/doc/${PF}/examples-py
221
			doins -r py/demo/*
222
		fi
223
	fi
224
225
	if use ruby ; then
226
		dodir "${SITERUBY}"
227
		emake -C rb ${MAKE_RULES} ${MAKE_RULES_RB} install || die "emake rb install failed"
228
229
		docinto rb
230
		dodoc rb/CHANGES rb/README
231
232
		if use examples ; then
233
			insinto /usr/share/doc/${PF}/examples-rb
234
			doins -r rb/demo/*
235
		fi
236
	fi
237
238
	if use mono ; then
239
		emake -C cs ${MAKE_RULES} ${MAKE_RULES_CS} install || die "emake cs install failed"
240
241
		# TODO: anyone has an idea what those are for?
242
		rm "${ED}"/usr/bin/*.xml
243
244
		docinto cs
245
		dodoc cs/CHANGES cs/README
246
247
		if use examples ; then
248
			insinto /usr/share/doc/${PF}/examples-cs
249
			doins -r cs/demo/*
250
		fi
251
	fi
252
}
253
254
run_tests() {
255
	# Run tests through the script interface since Python test runner
256
	# fails to exit with non-zero code for some reason.
257
258
	pushd "${1}" >/dev/null || die
259
	./allTests.py --script | sh
260
	ret=${?}
261
	popd >/dev/null || die
262
263
	return ${ret}
264
}
265
266
src_test() {
267
	run_tests cpp || die "emake cpp test failed"
268
269
	if use python ; then
270
		testing() {
271
			# tests require that the directory is named 'py'
272
			ln -f -s ../"${BUILD_DIR}"/python py/python || die
273
			run_tests py || die "emake py-${EPYTHON} test failed"
274
		}
275
		BUILD_DIR=py python_foreach_impl testing
276
	fi
277
278
	if use ruby ; then
279
		run_tests rb || die "emake rb test failed"
280
	fi
281
282
	if use mono ; then
283
		# skip mono tests, bug #498484
284
		ewarn "Tests for C# are currently disabled."
285
#		run_tests cs || die "emake cs test failed"
286
	fi
287
}
(-)a/dev-libs/Ice/files/Ice-3.5.1-libressl.patch (-1 / +69 lines)
Line 0 Link Here
0
- 
1
From 9f830aef955e9462c186c87d7cb1f8b71aba49d5 Mon Sep 17 00:00:00 2001
2
From: hasufell <hasufell@gentoo.org>
3
Date: Sat, 3 Oct 2015 15:15:01 +0200
4
Subject: [PATCH] Add LibreSSL support
5
6
---
7
 cpp/src/Glacier2/CryptPermissionsVerifierI.cpp | 3 ++-
8
 cpp/src/IceGrid/RegistryI.cpp                  | 3 ++-
9
 cpp/src/IceSSL/Instance.cpp                    | 2 +-
10
 3 files changed, 5 insertions(+), 3 deletions(-)
11
12
diff --git a/cpp/src/Glacier2/CryptPermissionsVerifierI.cpp b/cpp/src/Glacier2/CryptPermissionsVerifierI.cpp
13
index 1a437a6..e94bbde 100644
14
--- a/cpp/src/Glacier2/CryptPermissionsVerifierI.cpp
15
+++ b/cpp/src/Glacier2/CryptPermissionsVerifierI.cpp
16
@@ -9,6 +9,7 @@
17
 
18
 #include <Glacier2/CryptPermissionsVerifierI.h>
19
 #include <openssl/des.h>
20
+#include <openssl/opensslv.h>
21
 
22
 using namespace std;
23
 using namespace Ice;
24
@@ -39,7 +40,7 @@ Glacier2::CryptPermissionsVerifierI::checkPermissions(
25
 
26
     char buff[14];
27
     string salt = p->second.substr(0, 2);
28
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
29
+#if OPENSSL_VERSION_NUMBER >= 0x0090700fL || defined (LIBRESSL_VERSION_NUMBER)
30
     DES_fcrypt(password.c_str(), salt.c_str(), buff);
31
 #else
32
     des_fcrypt(password.c_str(), salt.c_str(), buff);
33
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
34
index 3c6128e..830d864 100644
35
--- a/cpp/src/IceGrid/RegistryI.cpp
36
+++ b/cpp/src/IceGrid/RegistryI.cpp
37
@@ -41,6 +41,7 @@
38
 #include <fstream>
39
 
40
 #include <openssl/des.h> // For crypt() passwords
41
+#include <openssl/opensslv.h>
42
 
43
 #include <sys/types.h>
44
 
45
@@ -95,7 +96,7 @@ public:
46
         
47
         char buff[14];
48
         string salt = p->second.substr(0, 2);
49
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
50
+#if OPENSSL_VERSION_NUMBER >= 0x0090700fL || defined (LIBRESSL_VERSION_NUMBER)
51
         DES_fcrypt(password.c_str(), salt.c_str(), buff);
52
 #else
53
         des_fcrypt(password.c_str(), salt.c_str(), buff);
54
diff --git a/cpp/src/IceSSL/Instance.cpp b/cpp/src/IceSSL/Instance.cpp
55
index eb2ae99..f7f8483 100644
56
--- a/cpp/src/IceSSL/Instance.cpp
57
+++ b/cpp/src/IceSSL/Instance.cpp
58
@@ -266,7 +266,7 @@ IceSSL::Instance::Instance(const CommunicatorPtr& communicator) :
59
                     }
60
                 }
61
             }
62
-#ifndef _WIN32
63
+#if !defined (_WIN32) && !defined (OPENSSL_NO_EGD)
64
             //
65
             // The Entropy Gathering Daemon (EGD) is not available on Windows.
66
             // The file should be a Unix domain socket for the daemon.
67
-- 
68
2.5.3
69

Return to bug 562122