/[gentoo-x86]/sci-mathematics/scilab/scilab-4.0.ebuild
Gentoo

Contents of /sci-mathematics/scilab/scilab-4.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Tue Jun 22 12:50:37 2010 UTC (9 years, 4 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +1 -1 lines
FILE REMOVED
Removed broken version, #147900 & #155893
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-mathematics/scilab/scilab-4.0.ebuild,v 1.13 2007/10/20 09:58:24 markusle Exp $
4
5 inherit eutils fortran toolchain-funcs multilib autotools java-pkg-opt-2
6
7 DESCRIPTION="Scientific software package for numerical computations (Matlab lookalike)"
8 LICENSE="scilab"
9 SRC_URI="http://scilabsoft.inria.fr/download/stable/${P}-src.tar.gz"
10 HOMEPAGE="http://www.scilab.org/"
11
12 SLOT="0"
13 IUSE="ocaml tk gtk Xaw3d java"
14 KEYWORDS="~amd64 ~ppc x86"
15
16 RDEPEND="virtual/blas
17 virtual/lapack
18 virtual/cblas
19 sys-libs/ncurses
20 gtk? (
21 media-libs/jpeg
22 media-libs/libpng
23 sys-libs/zlib
24 >=x11-libs/gtk+-2
25 x11-libs/vte
26 =gnome-extra/gtkhtml-2*
27 )
28 tk? ( >=dev-lang/tk-8.4
29 >=dev-lang/tcl-8.4 )
30 Xaw3d? ( x11-libs/Xaw3d )
31 ocaml? ( dev-lang/ocaml )
32 java? ( >=virtual/jdk-1.4 )"
33
34 DEPEND="${RDEPEND}
35 app-text/sablotron"
36
37 pkg_setup() {
38 if ! use gtk && ! use tk; then
39 echo
40 eerror 'scilab must be built with either USE="gtk" or USE="tk"'
41 die
42 fi
43 java-pkg-opt-2_pkg_setup
44 need_fortran gfortran g77
45 }
46
47 src_unpack() {
48 unpack ${A}
49 cd "${S}"
50
51 epatch "${FILESDIR}"/${P}-makefile.patch
52 epatch "${FILESDIR}"/${P}-gtk-fix.patch
53 epatch "${FILESDIR}"/${P}-configure-gfortran.patch
54 epatch "${FILESDIR}"/${P}-java-pic.patch
55
56 # fix gfortran problems on ppc
57 if [[ "${ARCH}" == "ppc" ]];then
58 epatch "${FILESDIR}"/${PN}-ppc-gcc4.patch
59 eautoconf || die "autoconf failed"
60 fi
61
62 sed -e '/^ATLAS_LAPACKBLAS\>/s,=.*,= $(ATLASDIR)/liblapack.so $(ATLASDIR)/libblas.so $(ATLASDIR)/libcblas.so,' \
63 -e 's,$(SCIDIR)/libs/lapack.a,,' \
64 -i Makefile.OBJ.in || die "Failed to fix Makefile.OBJ.in"
65
66 sed -e "s:\$(PREFIX):\${D}/\$(PREFIX):g" \
67 -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):g" \
68 -i Makefile.in || die "Failed to fix Makefile.in"
69
70 sed -e "s:@CC_OPTIONS@:${CFLAGS}:" \
71 -e "s:@FC_OPTIONS@:${FFLAGS}:" \
72 -e "s:@LD_LDFLAGS@:${LDFLAGS} -lpthread:" \
73 -i Makefile.incl.in || die "Failed to fix Makefile.incl.in"
74 }
75
76 src_compile() {
77 local myopts
78 myopts="${myopts} --with-atlas-library=/usr/$(get_libdir)"
79
80 if [[ ${FORTRANC} == gfortran ]]; then
81 myopts="${myopts} --with-gfortran"
82 fi
83
84 econf $(use_with tk) \
85 $(use_with Xaw3d xaw3d) \
86 $(use_with gtk gtk2 ) \
87 $(use_with ocaml) \
88 $(use_with java ) \
89 ${myopts} || die "econf failed"
90 env HOME="${S}" emake -j1 all || die "emake failed"
91 }
92
93 src_install() {
94 DESTDIR="${D}" make install || die "installation failed"
95
96 # some postinstall fixes
97 echo "SCIDIR=/usr/$(get_libdir)/${P}" > \
98 "${D}/usr/$(get_libdir)/${P}/Path.incl"
99 strip "${D}/usr/$(get_libdir)/${P}/bin/scilex"
100
101 # install docs
102 dodoc ACKNOWLEDGEMENTS CHANGES README_Unix RELEASE_NOTES \
103 Readme_Visual.txt license.txt \
104 || die "failed to install docs"
105
106 # install examples
107 insinto /usr/share/${PN}/
108 doins -r examples/ || die "failed to install examples"
109
110 # The compile and install process causes the work folder
111 # to be registered as the runtime folder in many files.
112 # This is corrected here.
113 BAD_REF="${WORKDIR}/${P}"
114 FIXED_REF="/usr/$(get_libdir)/${P}"
115 BIN_TO_FIX="Blpr BEpsf Blatexpr2 Blatexprs Blatexpr scilab"
116 for i in ${BIN_TO_FIX}; do
117 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
118 "${D}"/usr/$(get_libdir)/${P}/bin/${i} || \
119 die "Failed to fix wrapper scripts"
120 done
121 MAN_TO_FIX="eng fr"
122 for i in ${MAN_TO_FIX}; do
123 for j in "${D}"/usr/$(get_libdir)/${P}/man/${i}/*.h*; do
124 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i ${j} || \
125 die "Failed to fix manuals"
126 done
127 done
128 MISC_TO_FIX="util/Blatdoc util/Blatdocs"
129 for i in ${MISC_TO_FIX}; do
130 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
131 "${D}"/usr/$(get_libdir)/${P}/${i} || \
132 die "Failed to fix Blatdocs"
133 done
134 }
135
136 pkg_postinst() {
137 einfo "To tell Scilab about your printers, set the environment"
138 einfo "variable PRINTERS in the form:"
139 einfo
140 einfo "PRINTERS=\"firstPrinter:secondPrinter:anotherPrinter\""
141 }

  ViewVC Help
Powered by ViewVC 1.1.20