/[gentoo-x86]/sci-libs/shogun/shogun-1.1.0.ebuild
Gentoo

Contents of /sci-libs/shogun/shogun-1.1.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Tue Jul 24 13:50:21 2012 UTC (2 years, 4 months ago) by jlec
Branch: MAIN
Changes since 1.2: +4 -4 lines
sci-libs/shogun: Fix broken sed, #427884; add missing die

(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)

1 bicatali 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 jlec 1.3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/shogun/shogun-1.1.0.ebuild,v 1.2 2012/06/25 19:41:18 bicatali Exp $
4 bicatali 1.1
5     EAPI=4
6    
7 jlec 1.3 inherit eutils multilib versionator toolchain-funcs java-pkg-opt-2
8 bicatali 1.1
9     MYPV=$(get_version_component_range 1-2)
10     MYPD=${PN}-data-0.3
11    
12     DESCRIPTION="Large Scale Machine Learning Toolbox"
13     HOMEPAGE="http://shogun-toolbox.org/"
14     SRC_URI="ftp://shogun-toolbox.org/shogun/releases/${MYPV}/sources/${P}.tar.bz2
15 bicatali 1.2 test? ( ftp://shogun-toolbox.org/shogun/data/${MYPD}.tar.bz2 )
16     examples? ( ftp://shogun-toolbox.org/shogun/data/${MYPD}.tar.bz2 )"
17 bicatali 1.1
18     LICENSE="GPL-3 free-noncomm"
19     SLOT="0"
20     KEYWORDS="~amd64 ~x86"
21     IUSE="arpack bzip2 doc examples glpk gzip hdf5 json lapack lpsolve mono lua lzma
22     lzo java R ruby octave python readline snappy static-libs superlu test xml"
23    
24     RDEPEND="sci-libs/gsl
25     sys-libs/zlib
26     arpack? ( sci-libs/arpack )
27     bzip2? ( app-arch/bzip2 )
28     glpk? ( sci-mathematics/glpk )
29     gzip? ( app-arch/gzip )
30     hdf5? ( sci-libs/hdf5 )
31     java? ( >=virtual/jdk-1.5 )
32     json? ( dev-libs/json-c )
33     lapack? ( virtual/cblas virtual/lapack )
34     lpsolve? ( sci-mathematics/lpsolve )
35     lua? ( dev-lang/lua )
36     lzo? ( dev-libs/lzo )
37     mono? ( dev-lang/mono )
38     octave? ( sci-mathematics/octave[hdf5=] )
39     python? ( dev-python/numpy )
40     R? ( dev-lang/R )
41     readline? ( sys-libs/readline )
42     ruby? ( >=dev-ruby/narray-0.6.0.1-r2 )
43     snappy? ( app-arch/snappy )
44     superlu? ( sci-libs/superlu )
45     xml? ( dev-libs/libxml2 )"
46    
47     DEPEND="${RDEPEND}
48     virtual/pkgconfig
49     doc? ( app-doc/doxygen[dot] )
50     java? ( dev-lang/swig dev-java/ant )
51     octave? ( dev-lang/swig )
52     python? ( dev-lang/swig test? ( sci-libs/scipy ) )
53     ruby? ( dev-lang/swig )"
54    
55     S="${WORKDIR}/${P}/src"
56    
57     src_prepare() {
58     epatch \
59     "${FILESDIR}"/${P}-respect-ldflags.patch \
60     "${FILESDIR}"/${P}-test-snappy.patch \
61     "${FILESDIR}"/${P}-test-readline.patch
62    
63     # dist-packages is only for debian
64     # remove exagarated optimizations (-O9 does not exist...)
65     # use gentoo lapack framework
66     sed -i \
67     -e 's/dist-packages/site-packages/g' \
68     -e '/^COMP_OPTS=/d' \
69 jlec 1.3 -e "s:-llapack -lcblas:$(pkg-config --libs cblas lapack):g" \
70 bicatali 1.1 configure || die
71    
72     # disable ldconfig which violates sandbox
73     # install in gentoo java standard paths
74     sed -i \
75     -e '/ldconfig/d' \
76     -e '/share\/java/d' \
77     -e '/jni/d' \
78     Makefile.template || die
79     }
80    
81     src_configure() {
82     # define interfaces to shogun library to build
83     local x iface
84     for x in java lua octave python ruby ; do
85     use ${x} && iface="${iface}${x}_modular,"
86     done
87     use mono && iface="${iface}csharp_modular,"
88     use R && iface="${iface}r_modular,"
89     if use static-libs; then
90     iface="${iface}cmdline_static,"
91     use octave && iface="${iface}octave_static,"
92     use python && iface="${iface}python_static,"
93     use R && iface="${iface}r_static,"
94     use octave && use python && use R && iface="${iface}elwms_static,"
95     fi
96     iface="${iface%,}"
97    
98     # gentoo bug #302621
99     use hdf5 && has_version sci-libs/hdf5[mpi] && export CXX=mpicxx CC=mpicc
100    
101     ./configure \
102     --disable-cpudetection \
103     --destdir="${ED}" \
104     --prefix="${EPREFIX}/usr" \
105     --mandir="${EPREFIX}/usr/share/man" \
106     --libdir="${EPREFIX}/usr/$(get_libdir)" \
107     --cc="$(tc-getCC)" \
108     --cxx="$(tc-getCXX)" \
109     --target="${CTARGET}" \
110     --interfaces=${iface} \
111     $(use_enable arpack) \
112     $(use_enable bzip2) \
113     $(use_enable doc doxygen) \
114     $(use_enable glpk) \
115     $(use_enable gzip) \
116     $(use_enable hdf5) \
117     $(use_enable json) \
118     $(use_enable lapack) \
119     $(use_enable lpsolve) \
120     $(use_enable lzma) \
121     $(use_enable lzo) \
122     $(use_enable readline) \
123     $(use_enable snappy) \
124     $(use_enable static-libs static) \
125     $(use_enable superlu) \
126 jlec 1.3 $(use_enable xml) || die
127 bicatali 1.1 }
128    
129     src_compile() {
130     emake
131     use doc && emake -C ../doc
132     }
133    
134     src_test() {
135     use lapack || return
136     ln -s ../../${MYPD}/* ../data/
137     emake DESTDIR="${D}" install
138     # disable because very long and buggy dynamic paths (assumed install)
139     # emake tests
140     emake -C shogun check-examples
141     }
142    
143     src_install() {
144     default
145     use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.a
146     if use java; then
147     java-pkg_dojar interfaces/java_modular/shogun.jar
148     java-pkg_doso interfaces/java_modular/libmodshogun.so
149     fi
150    
151     use doc && dohtml -r ../doc/html/*
152     if use examples; then
153     insinto /usr/share/doc/${PF}
154 bicatali 1.2 emake -C ../examples clean && doins -r ../examples
155     insinto /usr/share/doc/${PF}/data
156     doins -r "${WORKDIR}"/${MYPD}/*
157 bicatali 1.1 fi
158     }

  ViewVC Help
Powered by ViewVC 1.1.20