public inbox for gentoo-devhelp@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-devhelp] sci-libs/sympy USE flags
@ 2008-01-23  9:37 Thomas Pani
  2008-01-23 13:01 ` Mike Frysinger
  2008-01-26 10:07 ` Peter Volkov
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Pani @ 2008-01-23  9:37 UTC (permalink / raw
  To: gentoo-devhelp

I've maintained the sci-libs/sympy ebuild (bug# 192785) in sunrise for
some time. Now Mateusz Paprocki provided an updated ebuild [1], but I've
got a few questions before I put it in sunrise:

- sympy uses libxml2 and libxslt to generate MathML code. Which USE-flag
would be more appropriate, `xslt' or `math' (or intruduce `mathml')?
app-office/abiword-plugins and www-apps/mediawiki both use the math use
flag to enable math rendering, but as Andrey Grozin pointed out sympy
provides math rendering via LaTeX, mathml, TeXmacs, so using `math'
would be ambiguous.

- Should there be a USE-flag that pulls in TeXmacs? If yes, which one?

- Once again for plotting. Uses pyglet ([2]), which is not yet in
portage but comes packaged with sympy. Which USE flag? Just `opengl' or
a new  `plot' flag?

- General ebuild review is also appreciated :)

Cheers,
thomas

[1] http://rafb.net/p/sW5y0d61.html
[2] http://www.pyglet.org/
-- 
gentoo-devhelp@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-devhelp] sci-libs/sympy USE flags
  2008-01-23  9:37 [gentoo-devhelp] sci-libs/sympy USE flags Thomas Pani
@ 2008-01-23 13:01 ` Mike Frysinger
  2008-01-23 19:11   ` Thomas Pani
  2008-01-26 10:07 ` Peter Volkov
  1 sibling, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2008-01-23 13:01 UTC (permalink / raw
  To: gentoo-devhelp; +Cc: Thomas Pani

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

On Wednesday 23 January 2008, Thomas Pani wrote:
> [1] http://rafb.net/p/sW5y0d61.html

unlike tinyurl, rafb.net expires.  please do not use links to rafb.net in 
e-mails.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-devhelp] sci-libs/sympy USE flags
  2008-01-23 13:01 ` Mike Frysinger
@ 2008-01-23 19:11   ` Thomas Pani
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Pani @ 2008-01-23 19:11 UTC (permalink / raw
  To: gentoo-devhelp

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

Mike Frysinger wrote:
> unlike tinyurl, rafb.net expires.  please do not use links to rafb.net in 
> e-mails.
> -mike

Sorry, I normally paste to OSL (set to `forever'), dunno what went wrong
here... ebuild's attached.

[-- Attachment #2: sympy-0.5.10.ebuild.new --]
[-- Type: text/plain, Size: 2166 bytes --]

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

NEED_PYTHON=2.4

inherit eutils distutils python multilib

DESCRIPTION="Python library for symbolic mathematics."
HOMEPAGE="http://code.google.com/p/sympy/"
SRC_URI="http://sympy.googlecode.com/files/${P}.tar.gz"

SLOT="0"

LICENSE="BSD"
KEYWORDS="~amd64 ~x86"
IUSE="examples math gtk latex plot test"

RDEPEND="math? (
		dev-libs/libxml2
		dev-libs/libxslt
		gtk? ( x11-libs/gtkmathview )
	)
	latex? (
		virtual/latex-base
		app-text/dvipng
		>=dev-python/pexpect-2.0
	)
	plot? (
		dev-python/pyopengl
		dev-python/imaging
		dev-python/ctypes
	)"
DEPEND="test? ( >=dev-python/py-0.9.0 )
	${RDEPEND}"

pkg_setup() {
	if use math ; then
		if ! built_with_use "dev-libs/libxml2" python ; then
			eerror "dev-libs/libxml2 has to be compiled with 'python' USE-flag."
			die "Needed USE-flag for dev-libs/libxml2 not found."
		fi

		if ! built_with_use "dev-libs/libxslt" python ; then
			eerror "dev-libs/libxslt has to be compiled with 'python' USE-flag."
			die "Needed USE-flag for dev-libs/libxslt not found."
		fi

		if use gtk && ! built_with_use "x11-libs/gtkmathview" gtk ; then
			eerror "x11-libs/gtkmathview has to be compiled with 'gtk' USE-flag."
			die "Needed USE-flag for x11-libs/gtkmathview not found."
		fi
	fi
}

src_test() {
	PYTHONPATH=build/lib/ "${python}" setup.py test || die "Unit tests failed!"
}

src_install() {
	distutils_src_install

	if use examples ; then
		insinto /usr/share/doc/${PF}
		doins -r examples
	fi

	python_version

	# 'pyglet' is not yet available in portage tree
	insinto ${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/sympy/thirdparty
	doins -r sympy/thirdparty/pyglet
}

pkg_postinst() {
	if ! has_version ">=dev-python/ipython-0.7.2" ; then
		elog
		elog "IPython 0.7.2 (or better) wasn't found on your system. It is"
		elog "highly recommended to install this package to optimize your"
		elog "work with SymPy. To do so, you can run:"
		elog
		elog " emerge '>=dev-python/ipython-0.7.2'"
		elog
	fi
}

pkg_postrm() {
	if use examples ; then
		python_mod_cleanup /usr/share/doc/${PF}
	fi
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-devhelp] sci-libs/sympy USE flags
  2008-01-23  9:37 [gentoo-devhelp] sci-libs/sympy USE flags Thomas Pani
  2008-01-23 13:01 ` Mike Frysinger
@ 2008-01-26 10:07 ` Peter Volkov
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Volkov @ 2008-01-26 10:07 UTC (permalink / raw
  To: gentoo-devhelp; +Cc: Thomas Pani

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

Generally I tend to name use flags based on features they enable instead
of dependencies they require as this better documents what feature this
use flag enables. But soon (I hope) we'll have better ways to document
USE flags so things could change in near future.


В Срд, 23/01/2008 в 10:37 +0100, Thomas Pani пишет:
> - sympy uses libxml2 and libxslt to generate MathML code. Which USE-flag
> would be more appropriate, `xslt' or `math' (or intruduce `mathml')?
> app-office/abiword-plugins and www-apps/mediawiki both use the math use
> flag to enable math rendering, but as Andrey Grozin pointed out sympy
> provides math rendering via LaTeX, mathml, TeXmacs, so using `math'
> would be ambiguous.

mathml is good choice.

> - Should there be a USE-flag that pulls in TeXmacs? If yes, which one?

If package allows to disable/enable this feature then yes. Call it USE
flag texmacs or latex as you chose.

> - Once again for plotting. Uses pyglet ([2]), which is not yet in
> portage but comes packaged with sympy. Which USE flag? Just `opengl' or
> a new  `plot' flag?

Does potting works without pyglet? Does package works without pyglet? If
this just adds opengl support for plotting then opengl is good choice of
USE flag too.


Generally I think ebuild uses USE flags only for dependencies but it
should also use them to configure package. See:

http://devmanual.gentoo.org/ebuild-writing/functions/src_compile/configuring/index.html

"Often the configure script will try to automatically enable support for
optional components based upon installed packages. This *must not* be
allowed to happen."

So in your case you need to tweak build system somehow to allow package
be built without plot support even if dev-python/pyopengl,
dev-python/imaging and dev-python/ctypes are installed.

-- 
Peter.

[-- Attachment #2: Эта часть сообщения подписана цифровой подписью --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-26 10:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-23  9:37 [gentoo-devhelp] sci-libs/sympy USE flags Thomas Pani
2008-01-23 13:01 ` Mike Frysinger
2008-01-23 19:11   ` Thomas Pani
2008-01-26 10:07 ` Peter Volkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox