<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>138252</bug_id>
          
          <creation_ts>2006-06-27 12:30 0000</creation_ts>
          <short_desc>scicos crashes, from scilab 4.0 ebuild</short_desc>
          <delta_ts>2006-07-04 08:18:58 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://www.scilab.org</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gentoo@wilfried.holzke.net</reporter>
          <assigned_to>sci@gentoo.org</assigned_to>
          <cc>gentoo@holzke.net</cc>

      

      
          <long_desc isprivate="0">
            <who>gentoo@wilfried.holzke.net</who>
            <bug_when>2006-06-27 12:30:35 0000</bug_when>
            <thetext>Everytime I click into the scicos-window it crashes and scilab too. 

The build 4 branch should fix this.
http://www.scilab.org/download/index_download.php?page=unstable.php

But I am not able to write a new ebuild for this.

The url of the new source:
http://www.scilab.org/download/unstable/scilab-4.0-b4-20060515-src.tar.gz

My attempt for an new ebuild based on version 4.0:

# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/scilab/scilab-4.0.ebuild,v 1.4 2006/06/01 15:34:16 markusle Exp $

inherit eutils fortran toolchain-funcs multilib autotools

DESCRIPTION=&quot;Scientific software package for numerical computations (Matlab lookalike)&quot;
LICENSE=&quot;scilab&quot;
SRC_URI=&quot;http://scilabsoft.inria.fr/download/unstable/scilab-4.0-b4-20060515-src.tar.gz&quot;
HOMEPAGE=&quot;http://www.scilab.org/&quot;

SLOT=&quot;0&quot;
IUSE=&quot;ocaml tcltk gtk Xaw3d java&quot;
KEYWORDS=&quot;~x86 ~ppc&quot;

RDEPEND=&quot;virtual/blas
	virtual/lapack
	sys-libs/ncurses
	gtk? (
		media-libs/jpeg
		media-libs/libpng
		sys-libs/zlib
		&gt;=x11-libs/gtk+-2
		&gt;=x11-libs/libzvt-2
		x11-libs/vte
		=gnome-extra/gtkhtml-2*
	)
	tcltk? ( &gt;=dev-lang/tk-8.4
		&gt;=dev-lang/tcl-8.4 )
	Xaw3d? ( x11-libs/Xaw3d )
	ocaml? ( dev-lang/ocaml )&quot;

DEPEND=&quot;${RDEPEND}
	app-text/sablotron&quot;

pkg_setup() {
	if ! use gtk &amp;&amp; ! use tcltk; then
		echo
		eerror &apos;scilab must be built with either USE=&quot;gtk&quot; or USE=&quot;tcltk&quot;&apos;
		die
	fi

	need_fortran gfortran g77

#	echo &quot;A = ${A}&quot;	
#	echo &quot;P = ${P}&quot;
#	echo &quot;D = ${D}&quot;

#	die
}

src_unpack() {
	unpack ${A}
	cd &quot;scilab-4.0-b4-20060515&quot;

#	epatch &quot;${FILESDIR}&quot;/${P}-makefile.patch

	# fix gfortran problems on ppc
	if [[ &quot;${ARCH}&quot; == &quot;ppc&quot; ]];then
		epatch &quot;${FILESDIR}&quot;/${PN}-ppc-gcc4.patch
		eautoconf || die &quot;autoconf failed&quot;
	fi

	sed -e &apos;/^ATLAS_LAPACKBLAS\&gt;/s,=.*,= $(ATLASDIR)/liblapack.so $(ATLASDIR)/libblas.so $(ATLASDIR)/libcblas.so,&apos; \
		-e &apos;s,$(SCIDIR)/libs/lapack.a,,&apos; \
		-i Makefile.OBJ.in || die &quot;Failed to fix Makefile.OBJ.in&quot;

	sed -e &quot;s:\$(PREFIX):\${D}/\$(PREFIX):g&quot; \
		-i Makefile.in || die &quot;Failed to fix Makefile.in&quot;

	sed -e &quot;s:@CC_OPTIONS@:${CFLAGS}:&quot; \
		-e &quot;s:@FC_OPTIONS@:${FFLAGS}:&quot; \
		-e &quot;s:@LD_LDFLAGS@:${LDFLAGS} -lpthread:&quot; \
		-i Makefile.incl.in || die &quot;Failed to fix Makefile.incl.in&quot;
}

src_compile() {
	cd &quot;${WORKDIR}/scilab-4.0-b4-20060515&quot;

	local myopts
	myopts=&quot;${myopts} --with-atlas-library=/usr/$(get_libdir)&quot;

	if [[ ${FORTRANC} == gfortran ]]; then
		myopts=&quot;${myopts} --with-gfortran&quot;
	fi

	econf $(use_with tcltk tk) \
		$(use_with Xaw3d xaw3d) \
		$(use_with gtk gtk2 ) \
		$(use_with ocaml) \
		$(use_with java ) \
		${myopts} || die &quot;econf failed&quot;
	env HOME=&quot;${S}&quot; emake -j1 all || die &quot;emake failed&quot;
}

src_install() {
	cd &quot;${WORKDIR}/scilab-4.0-b4-20060515&quot;

	DESTDIR=&quot;${D}&quot; make install || die &quot;installation failed&quot;

	echo &quot;Make Install successfull!&quot;	

	echo &quot;get_libdir: $(get_libdir)&quot;

	# some postinstall fixes
#	echo &quot;SCIDIR=/usr/$(get_libdir)/${P}&quot; &gt; \
#		&quot;${D}/usr/$(get_libdir)/${P}/Path.incl&quot;
#	strip &quot;${D}/usr/$(get_libdir)/${P}/bin/scilex&quot;

	# install docs
	dodoc ACKNOWLEDGEMENTS CHANGES README_Unix RELEASE_NOTES \
		Readme_Visual.txt license.txt \
		|| die &quot;failed to install docs&quot;

	# install examples
	insinto /usr/share/${P}/
	doins -r examples/ || die &quot;failed to install examples&quot;

	# The compile and install process causes the work folder 
	# to be registered as the runtime folder in many files. 
	# This is corrected here.
	BAD_REF=&quot;${WORKDIR}/scilab-4.0-b4-20060515&quot;
	FIXED_REF=&quot;/usr/$(get_libdir)/${P}&quot;
	BIN_TO_FIX=&quot;Blpr BEpsf Blatexpr2 Blatexprs Blatexpr scilab&quot;
	for i in ${BIN_TO_FIX}; do
		sed -e &quot;s%${BAD_REF}%${FIXED_REF}%&quot; -i \
		&quot;${D}&quot;/usr/$(get_libdir)/${P}/bin/${i} || \
		die &quot;Failed to fix wrapper scripts&quot;
	done
	MAN_TO_FIX=&quot;eng fr&quot;
	for i in ${MAN_TO_FIX}; do
		for j in &quot;${D}&quot;/usr/$(get_libdir)/${P}/man/${i}/*.h*; do
			sed -e &quot;s%${BAD_REF}%${FIXED_REF}%&quot; -i ${j} || \
			die &quot;Failed to fix manuals&quot;
		done
	done
	MISC_TO_FIX=&quot;util/Blatdoc util/Blatdocs&quot;
	for i in ${MISC_TO_FIX}; do
		sed -e &quot;s%${BAD_REF}%${FIXED_REF}%&quot; -i \
		&quot;${D}&quot;/usr/$(get_libdir)/${P}/${i} || \
		die &quot;Failed to fix Blatdocs&quot;
	done
}

pkg_postinst() {
	einfo &quot;To tell Scilab about your printers, set the environment&quot;
	einfo &quot;variable PRINTERS in the form:&quot;
	einfo
	einfo &quot;PRINTERS=\&quot;firstPrinter:secondPrinter:anotherPrinter\&quot;&quot;
}</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2006-06-27 13:06:05 0000</bug_when>
            <thetext>Most certainly not a bugzilla bug.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>markusle@gentoo.org</who>
            <bug_when>2006-06-28 13:06:29 0000</bug_when>
            <thetext>Hi Wilfried,

Thanks for your report! Is there any chance you could provide a 
patch that fixes this particular issue from the list of fixed bugs at the
link you posted.

Thanks,
Markus </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@holzke.net</who>
            <bug_when>2006-06-28 13:35:59 0000</bug_when>
            <thetext>No, I don&apos;t have a patch, only the build-4 archive. I tried to get this ebuild to work, but I can&apos;t get the part after &quot;echo &quot;Make Install successfull!&quot;&quot; to work.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>markusle@gentoo.org</who>
            <bug_when>2006-06-29 09:22:44 0000</bug_when>
            <thetext>Created an attachment (id=90442)
patch to fix gtk crashes

I can confirm the crashing scicos window. The attached patch fixes this
for me. Please give it a try and report back.

Thanks,
Markus</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@holzke.net</who>
            <bug_when>2006-07-03 15:48:20 0000</bug_when>
            <thetext>How can I use this patch with an ebuild?
Or do I have to use it with the source manually?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>markusle@gentoo.org</who>
            <bug_when>2006-07-03 18:06:02 0000</bug_when>
            <thetext>Move the patch file into the files directory of the scilab directory
(best in your local portage overlay), add the line

epatch &quot;${FILESDIR}&quot;/${P}-gtk-fix.patch

just below the already existing epatch line, re-digest the ebuild and
then re-emerge scilab.

Best,
Markus</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@holzke.net</who>
            <bug_when>2006-07-04 03:33:41 0000</bug_when>
            <thetext>Yes, the patch solves the problem.
Thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>markusle@gentoo.org</who>
            <bug_when>2006-07-04 08:18:58 0000</bug_when>
            <thetext>Hi Wilfried,

Great and thanks for testing!
The patch is now in portage cvs.

Best,
Markus</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>90442</attachid>
            <date>2006-06-29 09:22 0000</date>
            <desc>patch to fix gtk crashes</desc>
            <filename>scilab-4.0-gtk-fix.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHNjaWxhYi00LjAvcm91dGluZXMvZ3JhcGhpY3MvcGVyaUd0ay5jCTIwMDYtMDItMDggMTE6
MzM6NDAuMDAwMDAwMDAwIC0wNTAwCisrKyBzY2lsYWItNC4wLWI0LTIwMDYwNTE1L3JvdXRpbmVz
L2dyYXBoaWNzL3BlcmlHdGsuYwkyMDA2LTAyLTIwIDA0OjA1OjA1LjAwMDAwMDAwMCAtMDUwMApA
QCAtMzk1LDE2ICszOTUsM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