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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (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.15: +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-r2.ebuild,v 1.15 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 eautoconf
55
56 sed \
57 -e "/^ATLAS_LAPACKBLAS\>/s,=.*,= $(pkg-config --libs blas cblas lapack)," \
58 -e 's,$(SCIDIR)/libs/lapack.a,,' \
59 -i Makefile.OBJ.in || die "Failed to fix Makefile.OBJ.in"
60
61 sed \
62 -e "s:\$(PREFIX):\${D}\$(PREFIX):g" \
63 -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):g" \
64 -i Makefile.in || die "Failed to fix Makefile.in"
65
66 sed \
67 -e "s|@CC_OPTIONS@|${CFLAGS}|" \
68 -e "s|@FC_OPTIONS@|${FFLAGS}|" \
69 -e "s|@LD_LDFLAGS@|${LDFLAGS} -lpthread|" \
70 -i Makefile.incl.in || die "Failed to fix Makefile.incl.in"
71
72 # fix bad C practices by failure of scilab build system to
73 # include proper headers
74 sed -e "s:-DNOTMPNAM:-DNOTMPNAM -DSYSVSTR -DHASSTDLIB:" \
75 -i pvm3/conf/LINUX.def -i pvm3/conf/LINUX64.def || \
76 die "Failed to fix pvm3 conf scripts."
77
78 # fix examples
79 local MAKE_TO_FIX="callsci inter* link* m* interface-multi-so/lib interface-general/lib"
80 cd examples/
81 for name in ${MAKE_TO_FIX}; do
82 sed -e "s:gentoo-scidir:/usr/$(get_libdir)/${P}:" \
83 -i ${name}/Makefile || die "Failed to fix examples"
84 done
85 }
86
87 src_configure() {
88 local myopts
89 myopts="${myopts} --with-atlas-library=/usr/$(get_libdir)"
90
91 # the tk interface is the default
92 myopts="${myopts} --with-tk"
93
94 if [[ $(tc-getFC) =~ gfortran ]]; then
95 myopts="${myopts} --with-gfortran"
96 fi
97
98 econf \
99 $(use_with Xaw3d xaw3d) \
100 $(use_with gtk gtk2 ) \
101 $(use_with ocaml) \
102 $(use_with java ) \
103 ${myopts}
104 }
105
106 src_compile() {
107 env HOME="${S}" emake -j1 all
108 }
109
110 src_install() {
111 default
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 Readme_Visual.txt
119
120 # install examples
121 if use examples; then
122 insinto /usr/share/${PN}/
123 doins -r examples/
124 fi
125
126 # install static libs since they are needed to link some third
127 # party apps (see bug #257252)
128 insinto /usr/$(get_libdir)/${P}/libs
129 doins libs/*.a
130
131 insinto /usr/$(get_libdir)/${P}
132 doins Makefile.incl
133
134 exeinto /usr/$(get_libdir)/${P}
135 doexe libtool
136
137 insinto /usr/$(get_libdir)/${P}/config
138 doins config/Makeso.incl
139
140 # The compile and install process causes the work folder
141 # to be registered as the runtime folder in many files.
142 # This is corrected here.
143 BAD_REF="${WORKDIR}/${P}"
144 FIXED_REF="/usr/$(get_libdir)/${P}"
145 local BIN_TO_FIX="Blpr BEpsf Blatexpr2 Blatexprs Blatexpr scilab"
146 for i in ${BIN_TO_FIX}; do
147 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
148 "${D}"/usr/$(get_libdir)/${P}/bin/${i} || \
149 die "Failed to fix wrapper scripts"
150 done
151 local MISC_TO_FIX="util/Blatdoc util/Blatdocs"
152 for i in ${MISC_TO_FIX}; do
153 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
154 "${D}"/usr/$(get_libdir)/${P}/${i} || \
155 die "Failed to fix Blatdocs"
156 done
157 }
158
159 pkg_postinst() {
160 einfo "To tell Scilab about your printers, set the environment"
161 einfo "variable PRINTERS in the form:"
162 einfo
163 einfo "PRINTERS=\"firstPrinter:secondPrinter:anotherPrinter\""
164 }

  ViewVC Help
Powered by ViewVC 1.1.20