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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sat Jan 19 13:00:52 2008 UTC (11 years, 9 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Version bump (see bug #206607).
(Portage version: 2.1.4)

1 # Copyright 1999-2008 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.1.ebuild,v 1.7 2008/01/09 03:04:10 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
44 if use gtk && use tk; then
45 echo
46 ewarn "You have selected both gtk and tk support which"
47 ewarn "are mutually exclusive. In this case, the gtk "
48 ewarn "interface will be built."
49 epause 5
50 fi
51
52 java-pkg-opt-2_pkg_setup
53 need_fortran gfortran g77
54 }
55
56 src_unpack() {
57 unpack ${A}
58 cd "${S}"
59
60 epatch "${FILESDIR}"/${PN}-4.0-makefile.patch
61 epatch "${FILESDIR}"/${P}-java-pic.patch
62 epatch "${FILESDIR}"/${P}-header-fix.patch
63 epatch "${FILESDIR}"/${P}-examples.patch
64
65 sed -e '/^ATLAS_LAPACKBLAS\>/s,=.*,= $(ATLASDIR)/liblapack.so $(ATLASDIR)/libblas.so $(ATLASDIR)/libcblas.so,' \
66 -e 's,$(SCIDIR)/libs/lapack.a,,' \
67 -i Makefile.OBJ.in || die "Failed to fix Makefile.OBJ.in"
68
69 sed -e "s:\$(PREFIX):\${D}\$(PREFIX):g" \
70 -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):g" \
71 -i Makefile.in || die "Failed to fix Makefile.in"
72
73 sed -e "s:@CC_OPTIONS@:${CFLAGS}:" \
74 -e "s:@FC_OPTIONS@:${FFLAGS}:" \
75 -e "s:@LD_LDFLAGS@:${LDFLAGS} -lpthread:" \
76 -i Makefile.incl.in || die "Failed to fix Makefile.incl.in"
77
78 # fix bad C practices by failure of scilab build system to
79 # include proper headers
80 sed -e "s:-DNOTMPNAM:-DNOTMPNAM -DSYSVSTR -DHASSTDLIB:" \
81 -i pvm3/conf/LINUX.def -i pvm3/conf/LINUX64.def || \
82 die "Failed to fix pvm3 conf scripts."
83
84 # fix examples
85 local MAKE_TO_FIX="callsci inter* link* m* interface-multi-so/lib interface-general/lib"
86 cd examples/
87 for name in ${MAKE_TO_FIX}; do
88 sed -e "s:gentoo-scidir:/usr/$(get_libdir)/${P}:" \
89 -i ${name}/Makefile || die "Failed to fix examples"
90 done
91 }
92
93 src_compile() {
94 local myopts
95 myopts="${myopts} --with-atlas-library=/usr/$(get_libdir)"
96
97 if [[ ${FORTRANC} == gfortran ]]; then
98 myopts="${myopts} --with-gfortran"
99 fi
100
101 econf $(use_with tk) \
102 $(use_with Xaw3d xaw3d) \
103 $(use_with gtk gtk2 ) \
104 $(use_with ocaml) \
105 $(use_with java ) \
106 ${myopts} || die "econf failed"
107 env HOME="${S}" emake -j1 all || die "emake failed"
108 }
109
110 src_install() {
111 DESTDIR="${D}" make install || die "installation failed"
112
113 # some postinstall fixes
114 echo "SCIDIR=/usr/$(get_libdir)/${P}" > \
115 "${D}/usr/$(get_libdir)/${P}/Path.incl"
116
117 # install docs
118 dodoc ACKNOWLEDGEMENTS CHANGES README_Unix RELEASE_NOTES \
119 Readme_Visual.txt || die "failed to install docs"
120
121 # install examples
122 insinto /usr/share/${PN}/
123 doins -r examples/ || die "failed to install examples"
124
125 insinto /usr/$(get_libdir)/${P}
126 doins Makefile.incl || die "failed to install Makefile.incl"
127
128 # The compile and install process causes the work folder
129 # to be registered as the runtime folder in many files.
130 # This is corrected here.
131 BAD_REF="${WORKDIR}/${P}"
132 FIXED_REF="/usr/$(get_libdir)/${P}"
133 local BIN_TO_FIX="Blpr BEpsf Blatexpr2 Blatexprs Blatexpr scilab"
134 for i in ${BIN_TO_FIX}; do
135 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
136 "${D}"/usr/$(get_libdir)/${P}/bin/${i} || \
137 die "Failed to fix wrapper scripts"
138 done
139 local MISC_TO_FIX="util/Blatdoc util/Blatdocs"
140 for i in ${MISC_TO_FIX}; do
141 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
142 "${D}"/usr/$(get_libdir)/${P}/${i} || \
143 die "Failed to fix Blatdocs"
144 done
145 }
146
147 pkg_postinst() {
148 einfo "To tell Scilab about your printers, set the environment"
149 einfo "variable PRINTERS in the form:"
150 einfo
151 einfo "PRINTERS=\"firstPrinter:secondPrinter:anotherPrinter\""
152 }

  ViewVC Help
Powered by ViewVC 1.1.20