/[gentoo-x86]/sci-libs/torch/torch-3.ebuild
Gentoo

Contents of /sci-libs/torch/torch-3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sat Jul 24 18:37:44 2010 UTC (9 years, 10 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +5 -6 lines
Parallel build fix
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/torch/torch-3.ebuild,v 1.5 2009/09/23 20:09:57 patrick Exp $
4
5 inherit toolchain-funcs multilib
6
7 DESCRIPTION="machine-learning library, written in simple C++"
8 HOMEPAGE="http://www.torch.ch/"
9 SRC_URI="http://www.torch.ch/archives/Torch${PV}src.tgz
10 doc? ( http://www.torch.ch/archives/Torch3doc.tgz )"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="x86 ~amd64"
15 IUSE="doc debug"
16
17 DEPEND=""
18
19 S=${WORKDIR}/Torch${PV}
20
21 torch_packages="convolutions datasets decoder distributions gradients kernels matrix nonparametrics speech"
22
23 src_compile() {
24 local shalldebug="OPT"
25 use debug && shalldebug="DBG"
26 # -malign-double makes no sense on a 64-bit arch
27 use amd64 || extraflags="-malign-double"
28 cp config/Makefile_options_Linux .
29 sed -i \
30 -e "s:^PACKAGES.*:PACKAGES = ${torch_packages}:" \
31 -e "s:^DEBUG.*:DEBUG = ${shalldebug}:" \
32 -e "s:^CFLAGS_OPT_FLOAT.*:CFLAGS_OPT_FLOAT = -Wall ${CFLAGS} -ffast-math ${extraflags}:" \
33 Makefile_options_Linux
34
35 make depend
36 emake || die "emake failed"
37 }
38
39 src_install() {
40 dolib lib/*/*.a
41 dodir /usr/include/torch
42 insinto /usr/include/torch
43 for directory in core ${torch_packages}; do
44 doins ${directory}/*.h
45 done
46 # prepare the options Makefile
47 sed -i \
48 -e "s:^LIBS_DIR.*:LIBS_DIR=/usr/$(get_libdir):" \
49 -e 's|^INCS := .*|INCS := -I /usr/include/torch $(MYINCS)|' \
50 -e '/^INCS +=/c\\' \
51 Makefile_options_Linux
52 dodir /usr/share/${PN}
53 insinto /usr/share/${PN}
54 doins Makefile_options_Linux
55 dodir /usr/share/doc/${PF}
56 insinto /usr/share/doc/${PF}
57 cp -pPR examples "${D}"/usr/share/doc/${PF}
58 cd "${D}"/usr/share/doc/${PF}
59 sed -i \
60 -e 's|^TORCHDIR.*|TORCHDIR := /usr/share/torch|' \
61 -e '/MAKE/c\\' -e '/VERSION_KEY/c\\' \
62 examples/*/Makefile
63 for ex in examples/*/Makefile; do
64 echo -e '\t$(CC) $(CFLAGS_$(MODE)) $(INCS) -o $@ $< $(LIBS)' >> ${ex}
65 done
66 if use doc; then
67 cd "${WORKDIR}"/docs
68 doins *.pdf
69 dohtml -r manual/.
70 fi
71 }

  ViewVC Help
Powered by ViewVC 1.1.20