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

Contents of /sci-mathematics/scilab/scilab-4.1.2-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Tue Dec 25 13:18:28 2012 UTC (6 years, 9 months ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Drop masked for removal package

1 # Copyright 1999-2012 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.2-r3.ebuild,v 1.4 2012/10/16 19:06:56 jlec Exp $
4
5 EAPI=4
6
7 inherit autotools eutils fortran-2 java-pkg-opt-2 multilib toolchain-funcs
8
9 DESCRIPTION="Scientific software package for numerical computations (Matlab lookalike)"
10 HOMEPAGE="http://www.scilab.org/"
11 SRC_URI="http://www.scilab.org/download/${PV}/${P}-src.tar.gz"
12
13 SLOT="0"
14 LICENSE="scilab"
15 KEYWORDS="amd64 ~ppc x86"
16 IUSE="examples gtk java ocaml Xaw3d"
17
18 RDEPEND="
19 virtual/blas
20 virtual/lapack
21 virtual/cblas
22 sys-libs/ncurses
23 gtk? (
24 virtual/jpeg
25 media-libs/libpng
26 sys-libs/zlib
27 x11-libs/gtk+:2
28 x11-libs/vte:0
29 gnome-extra/gtkhtml:2
30 )
31 >=dev-lang/tk-8.4
32 >=dev-lang/tcl-8.4
33 Xaw3d? ( x11-libs/libXaw3d )
34 ocaml? ( dev-lang/ocaml )
35 java? ( >=virtual/jdk-1.4 )"
36
37 DEPEND="${RDEPEND}
38 app-text/sablotron"
39
40 pkg_setup() {
41 fortran-2_pkg_setup
42 java-pkg-opt-2_pkg_setup
43 }
44
45 src_prepare() {
46 epatch \
47 "${FILESDIR}"/${PN}-4.0-makefile.patch \
48 "${FILESDIR}"/${PN}-4.1-java-pic.patch \
49 "${FILESDIR}"/${P}-header-fix.patch \
50 "${FILESDIR}"/${PN}-4.1-examples.patch \
51 "${FILESDIR}"/${P}-java-config.patch \
52 "${FILESDIR}"/${P}-tmp-fix.patch \
53 "${FILESDIR}"/${P}-gcc45.patch \
54 "${FILESDIR}"/${P}-gcc45-2.patch
55 eautoconf
56
57 sed \
58 -e "/^ATLAS_LAPACKBLAS\>/s,=.*,= $(pkg-config --libs blas cblas lapack)," \
59 -e 's,$(SCIDIR)/libs/lapack.a,,' \
60 -i Makefile.OBJ.in || die "Failed to fix Makefile.OBJ.in"
61
62 sed \
63 -e "s:\$(PREFIX):\${D}\$(PREFIX):g" \
64 -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):g" \
65 -i Makefile.in || die "Failed to fix Makefile.in"
66
67 sed \
68 -e "s|@CC_OPTIONS@|${CFLAGS}|" \
69 -e "s|@FC_OPTIONS@|${FFLAGS}|" \
70 -e "s|@LD_LDFLAGS@|${LDFLAGS} -lpthread|" \
71 -i Makefile.incl.in || die "Failed to fix Makefile.incl.in"
72
73 # fix bad C practices by failure of scilab build system to
74 # include proper headers
75 sed -e "s:-DNOTMPNAM:-DNOTMPNAM -DSYSVSTR -DHASSTDLIB:" \
76 -i pvm3/conf/LINUX.def -i pvm3/conf/LINUX64.def || \
77 die "Failed to fix pvm3 conf scripts."
78
79 # fix examples
80 local MAKE_TO_FIX="callsci inter* link* m* interface-multi-so/lib interface-general/lib"
81 cd examples/
82 for name in ${MAKE_TO_FIX}; do
83 sed -e "s:gentoo-scidir:/usr/$(get_libdir)/${P}:" \
84 -i ${name}/Makefile || die "Failed to fix examples"
85 done
86 }
87
88 src_configure() {
89 local myopts
90 myopts="${myopts} --with-atlas-library=/usr/$(get_libdir)"
91
92 # the tk interface is the default
93 myopts="${myopts} --with-tk"
94
95 if [[ $(tc-getFC) =~ gfortran ]]; then
96 myopts="${myopts} --with-gfortran"
97 fi
98
99 econf \
100 $(use_with Xaw3d xaw3d) \
101 $(use_with gtk gtk2 ) \
102 $(use_with ocaml) \
103 $(use_with java ) \
104 ${myopts}
105 }
106
107 src_compile() {
108 env HOME="${S}" emake -j1 all
109 }
110
111 src_install() {
112 default
113
114 # some postinstall fixes
115 echo "SCIDIR=/usr/$(get_libdir)/${P}" > \
116 "${D}/usr/$(get_libdir)/${P}/Path.incl"
117
118 # install docs
119 dodoc ACKNOWLEDGEMENTS Readme_Visual.txt
120
121 # install examples
122 if use examples; then
123 insinto /usr/share/${PN}/
124 doins -r examples/
125 fi
126
127 # install static libs since they are needed to link some third
128 # party apps (see bug #257252)
129 insinto /usr/$(get_libdir)/${P}/libs
130 doins libs/*.a
131
132 insinto /usr/$(get_libdir)/${P}
133 doins Makefile.incl
134
135 exeinto /usr/$(get_libdir)/${P}
136 doexe libtool
137
138 insinto /usr/$(get_libdir)/${P}/config
139 doins config/Makeso.incl
140
141 # The compile and install process causes the work folder
142 # to be registered as the runtime folder in many files.
143 # This is corrected here.
144 BAD_REF="${WORKDIR}/${P}"
145 FIXED_REF="/usr/$(get_libdir)/${P}"
146 local BIN_TO_FIX="Blpr BEpsf Blatexpr2 Blatexprs Blatexpr scilab"
147 for i in ${BIN_TO_FIX}; do
148 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
149 "${D}"/usr/$(get_libdir)/${P}/bin/${i} || \
150 die "Failed to fix wrapper scripts"
151 done
152 local MISC_TO_FIX="util/Blatdoc util/Blatdocs"
153 for i in ${MISC_TO_FIX}; do
154 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
155 "${D}"/usr/$(get_libdir)/${P}/${i} || \
156 die "Failed to fix Blatdocs"
157 done
158 }
159
160 pkg_postinst() {
161 einfo "To tell Scilab about your printers, set the environment"
162 einfo "variable PRINTERS in the form:"
163 einfo
164 einfo "PRINTERS=\"firstPrinter:secondPrinter:anotherPrinter\""
165 }

  ViewVC Help
Powered by ViewVC 1.1.20