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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Fri Nov 7 15:17:39 2008 UTC (11 years ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Added patch for insecure tempfile handling (CVE-2008-4983) (see bug #245922).
(Portage version: 2.2_rc13/cvs/Linux 2.6.27-SENTINEL-2 i686)

1 markusle 1.6 # Copyright 1999-2008 Gentoo Foundation
2 markusle 1.1 # Distributed under the terms of the GNU General Public License v2
3 markusle 1.7 # $Header: /var/cvsroot/gentoo-x86/sci-mathematics/scilab/scilab-4.1.1.ebuild,v 1.6 2008/01/09 03:04:10 markusle Exp $
4 markusle 1.1
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 markusle 1.2 SRC_URI="http://www.scilab.org/download/${PV}/${P}-src.tar.gz"
10 markusle 1.1 HOMEPAGE="http://www.scilab.org/"
11    
12     SLOT="0"
13 markusle 1.3 IUSE="ocaml gtk Xaw3d java"
14 markusle 1.1 KEYWORDS="~amd64 ~ppc ~x86"
15    
16     RDEPEND="virtual/blas
17     virtual/lapack
18 markusle 1.5 virtual/cblas
19 markusle 1.1 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 markusle 1.3 >=dev-lang/tk-8.4
29     >=dev-lang/tcl-8.4
30 markusle 1.1 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     java-pkg-opt-2_pkg_setup
39     need_fortran gfortran g77
40     }
41    
42     src_unpack() {
43     unpack ${A}
44     cd "${S}"
45    
46     epatch "${FILESDIR}"/${PN}-4.0-makefile.patch
47     epatch "${FILESDIR}"/${PN}-4.1-java-pic.patch
48     epatch "${FILESDIR}"/${PN}-4.1-header-fix.patch
49     epatch "${FILESDIR}"/${PN}-4.1-examples.patch
50    
51     sed -e '/^ATLAS_LAPACKBLAS\>/s,=.*,= $(ATLASDIR)/liblapack.so $(ATLASDIR)/libblas.so $(ATLASDIR)/libcblas.so,' \
52     -e 's,$(SCIDIR)/libs/lapack.a,,' \
53     -i Makefile.OBJ.in || die "Failed to fix Makefile.OBJ.in"
54    
55     sed -e "s:\$(PREFIX):\${D}\$(PREFIX):g" \
56     -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):g" \
57     -i Makefile.in || die "Failed to fix Makefile.in"
58    
59     sed -e "s:@CC_OPTIONS@:${CFLAGS}:" \
60     -e "s:@FC_OPTIONS@:${FFLAGS}:" \
61     -e "s:@LD_LDFLAGS@:${LDFLAGS} -lpthread:" \
62     -i Makefile.incl.in || die "Failed to fix Makefile.incl.in"
63    
64     # fix bad C practices by failure of scilab build system to
65     # include proper headers
66     sed -e "s:-DNOTMPNAM:-DNOTMPNAM -DSYSVSTR -DHASSTDLIB:" \
67     -i pvm3/conf/LINUX.def -i pvm3/conf/LINUX64.def || \
68     die "Failed to fix pvm3 conf scripts."
69    
70     # fix examples
71     local MAKE_TO_FIX="callsci inter* link* m* interface-multi-so/lib interface-general/lib"
72     cd examples/
73     for name in ${MAKE_TO_FIX}; do
74     sed -e "s:gentoo-scidir:/usr/$(get_libdir)/${P}:" \
75     -i ${name}/Makefile || die "Failed to fix examples"
76     done
77     }
78    
79     src_compile() {
80     local myopts
81     myopts="${myopts} --with-atlas-library=/usr/$(get_libdir)"
82    
83 mr_bones_ 1.4 # the tk interface is the default
84 markusle 1.3 myopts="${myopts} --with-tk"
85    
86 markusle 1.1 if [[ ${FORTRANC} == gfortran ]]; then
87     myopts="${myopts} --with-gfortran"
88     fi
89    
90 markusle 1.3 econf $(use_with Xaw3d xaw3d) \
91 markusle 1.1 $(use_with gtk gtk2 ) \
92     $(use_with ocaml) \
93     $(use_with java ) \
94     ${myopts} || die "econf failed"
95     env HOME="${S}" emake -j1 all || die "emake failed"
96     }
97    
98     src_install() {
99     DESTDIR="${D}" make install || die "installation failed"
100    
101     # some postinstall fixes
102     echo "SCIDIR=/usr/$(get_libdir)/${P}" > \
103     "${D}/usr/$(get_libdir)/${P}/Path.incl"
104    
105     # install docs
106     dodoc ACKNOWLEDGEMENTS CHANGES README_Unix RELEASE_NOTES \
107     Readme_Visual.txt || die "failed to install docs"
108    
109     # install examples
110     insinto /usr/share/${PN}/
111     doins -r examples/ || die "failed to install examples"
112    
113     insinto /usr/$(get_libdir)/${P}
114     doins Makefile.incl || die "failed to install Makefile.incl"
115    
116 mr_bones_ 1.4 # The compile and install process causes the work folder
117     # to be registered as the runtime folder in many files.
118 markusle 1.1 # This is corrected here.
119     BAD_REF="${WORKDIR}/${P}"
120     FIXED_REF="/usr/$(get_libdir)/${P}"
121     local BIN_TO_FIX="Blpr BEpsf Blatexpr2 Blatexprs Blatexpr scilab"
122     for i in ${BIN_TO_FIX}; do
123     sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
124     "${D}"/usr/$(get_libdir)/${P}/bin/${i} || \
125     die "Failed to fix wrapper scripts"
126     done
127     local MISC_TO_FIX="util/Blatdoc util/Blatdocs"
128     for i in ${MISC_TO_FIX}; do
129     sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
130     "${D}"/usr/$(get_libdir)/${P}/${i} || \
131     die "Failed to fix Blatdocs"
132     done
133     }
134    
135     pkg_postinst() {
136     einfo "To tell Scilab about your printers, set the environment"
137     einfo "variable PRINTERS in the form:"
138     einfo
139     einfo "PRINTERS=\"firstPrinter:secondPrinter:anotherPrinter\""
140     }

  ViewVC Help
Powered by ViewVC 1.1.20