Use https by default
[gentoo.git] / net-misc / mico / mico-9999.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="3"
6
7 inherit eutils flag-o-matic toolchain-funcs autotools
8
9 if [[ ${PV} == 9999 ]]; then
10         EDARCS_REPOSITORY="http://mico.org/mico-darcs-repository"
11         inherit darcs
12 fi
13
14 PATCH_VER=20120924
15
16 DESCRIPTION="A freely available and fully compliant implementation of the CORBA standard"
17 HOMEPAGE="http://www.mico.org/"
18 SRC_URI="http://www.mico.org/${P}.tar.gz"
19
20 [[ ${PV} == 9999 ]] &&
21         SRC_URI=""
22
23 [[ -n ${PATCH_VER} ]] &&
24         SRC_URI="${SRC_URI} https://dev.gentoo.org/~haubi/distfiles/${P}-gentoo-patches-${PATCH_VER}.tar.bz2"
25
26 LICENSE="GPL-2 LGPL-2"
27 SLOT="0"
28 KEYWORDS=""
29 IUSE="gtk postgres qt4 ssl tcl threads X"
30 RESTRICT="test" #298101
31
32 # doesn't compile:
33 #   bluetooth? ( net-wireless/bluez )
34
35 RDEPEND="
36         gtk?       ( x11-libs/gtk+:2 )
37         postgres?  ( dev-db/postgresql )
38         qt4?       ( dev-qt/qtgui:4[qt3support] )
39         ssl?       ( dev-libs/openssl )
40         tcl?       ( dev-lang/tcl:0 )
41         X?         ( x11-libs/libXt )
42 "
43 DEPEND="${RDEPEND}
44         >=sys-devel/flex-2.5.2
45         >=sys-devel/bison-1.22
46 "
47
48 if [[ ${PV} == 9999 ]]; then
49         src_unpack() {
50                 darcs_src_unpack
51                 default
52         }
53 fi
54
55 src_prepare() {
56         EPATCH_SUFFIX=patch epatch "${WORKDIR}"/patches
57
58         eautoreconf
59
60         # cannot use big TOC (AIX only), gdb doesn't like it.
61         # This assumes that the compiler (or -wrapper) uses
62         # gcc flag '-mminimal-toc' for compilation.
63         sed -i -e 's/,-bbigtoc//' "${S}"/configure
64
65         if use qt4; then
66                 sed -i -e "s, -lqt\", $(pkg-config --libs Qt3Support)\"," configure ||
67                         die "cannot update to use Qt3Support of qt4"
68         fi
69 }
70
71 src_configure() {
72         tc-export CC CXX
73
74         # Don't know which version of JavaCUP would suffice, but there is no
75         # configure argument to disable checking for JavaCUP.
76         # So we override the configure check to not find 'javac'.
77         export ac_cv_path_JAVAC=no
78
79         # '--without-ssl' just does not add another search path - the only way
80         # to disable openssl utilization seems to override the configure check.
81         use ssl || export ac_cv_lib_ssl_open=no
82
83         # CFLAGS aren't used when checking for <qapplication.h>, but CPPFLAGS are.
84         use qt4 && append-cppflags $(pkg-config --cflags Qt3Support)
85
86         local myconf=
87         myconf() {
88                 myconf="${myconf} $*"
89         }
90
91         myconf --disable-mini-stl
92         myconf $(use_enable threads)
93
94         # '--without-*' or '--with-*=no' does not disable some features,
95         # the value needs to be empty instead.
96         # This applies to: pgsql, qt, tcl, bluetooth.
97         myconf --with-pgsql=$(use postgres && echo "${EPREFIX}"/usr)
98         myconf --with-qt=$(   use qt4      && echo "${EPREFIX}"/usr)
99         myconf --with-tcl=$(  use tcl      && echo "${EPREFIX}"/usr)
100         # bluetooth and wireless both don't compile cleanly
101         myconf --with-bluetooth=''
102         myconf --disable-wireless
103         # But --without-x works.
104         myconf $(use_with X x "${EPREFIX}"/usr)
105         # Same for gtk after patch 013, searches for gtk release.
106         myconf $(use_with gtk gtk 2)
107
108         # http://www.mico.org/pipermail/mico-devel/2009-April/010285.html
109         [[ ${CHOST} == *-hpux* ]] && append-cppflags -D_XOPEN_SOURCE_EXTENDED
110
111         if [[ ${CHOST} == *-winnt* ]]; then
112                 # disabling static libs, since ar on interix takes nearly
113                 # one hour per library, thanks to mico's monster objects.
114                 use threads &&
115                 ewarn "disabling USE='threads', does not work on ${CHOST}"
116                 myconf --disable-threads --disable-static --enable-final
117                 append-flags -D__STDC__
118         fi
119
120         econf ${myconf}
121 }
122
123 src_install() {
124         emake INSTDIR="${ED}"usr SHARED_INSTDIR="${ED}"usr install LDCONFIG=: || die "install failed"
125         if [[ $(get_libdir) != lib ]]; then #500744
126                 mv "${ED}"usr/lib "${ED}"usr/$(get_libdir) || die
127         fi
128
129         dodir /usr/share || die
130         mv "${ED}"usr/man "${ED}"usr/share || die
131         dodir /usr/share/doc/${PF} || die
132         mv "${ED}"usr/doc "${ED}"usr/share/doc/${PF} || die
133
134         dodoc BUGS CHANGES* CONVERT README* ROADMAP TODO VERSION WTODO || die
135 }