Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237254 - dev-python/nltk-0.9.5.ebuild (New Package)
Summary: dev-python/nltk-0.9.5.ebuild (New Package)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Markos Chandras (RETIRED)
URL: http://nltk.org/
Whiteboard: sunrise-overlay
Keywords: EBUILD, InOverlay
Depends on:
Blocks: 237265 237268 272200
  Show dependency tree
 
Reported: 2008-09-10 04:07 UTC by Tom Lippincott
Modified: 2010-08-30 17:12 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The ebuild file for NLTK (nltk-0.9.5.ebuild,621 bytes, text/plain)
2008-09-10 04:10 UTC, Tom Lippincott
Details
Ebuild for the 2.0 version of nltk (nltk-2.0.ebuild,537 bytes, text/plain)
2010-03-12 13:24 UTC, Daniel M.
Details
nltk ebuild (nltk-2.0_beta9.ebuild,493 bytes, text/plain)
2010-08-05 14:47 UTC, montjoie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Lippincott 2008-09-10 04:07:39 UTC
Hi, this ebuild is for the NLTK (Natural Language Tool Kit) Python library.  Its a widely-used and actively-developed codebase for computational linguistics.  This does not include the data files and documentation, which I am submitting as separate ebuilds according to the wishes of the up-stream developers for licensing reasons.  All of this code is under GPL-2.

Reproducible: Always
Comment 1 Tom Lippincott 2008-09-10 04:10:52 UTC
Created attachment 165070 [details]
The ebuild file for NLTK
Comment 2 Tom Lippincott 2008-09-10 07:07:09 UTC
Also, this is the first ebuild I've put together, so I'll gladly rework it if its not written correctly.
Comment 3 Graham 2008-09-22 06:12:08 UTC
I discovered while trying to install this that this package needs a python that has been installed with the "tk" USE flag.

If it wasn't compiled with tk the install fails trying to find the Tkinter module

I don't know how to express that requirement in an ebuild

(
This explains how to install third party ebuilds
http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds)

Comment 4 Tom Lippincott 2008-09-22 07:12:11 UTC
(In reply to comment #3)
> I discovered while trying to install this that this package needs a python that
> has been installed with the "tk" USE flag.
> 
> If it wasn't compiled with tk the install fails trying to find the Tkinter
> module
> 
> I don't know how to express that requirement in an ebuild
> 
> (
> This explains how to install third party ebuilds
> http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds)
> 

Hmm, according to the dev manual <http://devmanual.gentoo.org/general-concepts/dependencies/index.html> its not possible to depend on another package having a particular use flag enabled.  I'll look into a way to do it though (there *must* be other packages that deal with this somehow), but in the meantime you could run "echo dev-lang/python tk >> /etc/portage/package.use", then "emerge --oneshot python" and that should get it working.

Keep posting any problems you run into and I'll look into them, thanks!

-Tom
Comment 5 Graham 2008-09-23 09:16:58 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > I discovered while trying to install this that this package needs a python that
> > has been installed with the "tk" USE flag.
> > 
> > If it wasn't compiled with tk the install fails trying to find the Tkinter
> > module
> > 
> > I don't know how to express that requirement in an ebuild
> > 
> > (
> > This explains how to install third party ebuilds
> > http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds)
> > 
> 
> Hmm, according to the dev manual
> <http://devmanual.gentoo.org/general-concepts/dependencies/index.html> its not
> possible to depend on another package having a particular use flag enabled. 
> I'll look into a way to do it though (there *must* be other packages that deal
> with this somehow), but in the meantime you could run "echo dev-lang/python tk
> >> /etc/portage/package.use", then "emerge --oneshot python" and that should
> get it working.
> 
> Keep posting any problems you run into and I'll look into them, thanks!
> 
> -Tom
> 

I got around the problem without much trouble, but I don't know how to solve it for the ebuild.  A second rate solution might be to  test for the USE flags python is compiled with and fail with a helpful message if it is not there.  It would be rude to reinstall someone's python as that is  the script language of gentoo and you might make a royal mess of someones old and fragile system. Maybe find a portage expert.

I was pasting in the examples from the ntlk book and discovered I needed the package 
 matplotlib
to show some of the graphs

Also had hunt for the source files and put them in /usr/portage/distfiles. the emerge didn't magically find them somewhere on the internet like it usually does. I guess perhaps because your packages aren't part of the core gentoo yet
Comment 6 Patrick Lauer gentoo-dev 2009-02-03 19:00:48 UTC
Right, this looks like fun.
One question: why do you make data an useflag and then tell users to install it in postinst? Wouldn't it be easier to unconditionally depend on it?
Comment 7 Tom Lippincott 2009-02-04 02:22:03 UTC
(In reply to comment #6)
> Right, this looks like fun.
> One question: why do you make data an useflag and then tell users to install it
> in postinst? Wouldn't it be easier to unconditionally depend on it?
> 

A while ago, the procedure for getting the data files was a little convoluted, and there were (are?) licensing differences such that its reasonable to just want the code by itself.  Also, hosting was moved from sourceforge to google code, so that's probably why the ebuild now fails...I'll upload a new one as soon as I get the chance.

-Tom
Comment 8 flamingspinach 2010-02-01 06:27:19 UTC
Any progress here? It'd be nice if this could be added to portage.
Comment 9 Daniel M. 2010-03-12 13:24:41 UTC
Created attachment 223275 [details]
Ebuild for the 2.0 version of nltk

I updated the ebuild to version 2.0.
There's not much magic involved here, I simply changed the download URL and the version.
I'm not that experienced with ebuilds, so anyone please check it and correct flaws.
Additionally I think that the data-ebuild is no longer needed (if I got that right, nltk provides an internal mechanism to fetch data), so I removed the corresponding useflag, dependency and notification.
Comment 10 montjoie 2010-08-05 14:47:47 UTC
Created attachment 241523 [details]
nltk ebuild
Comment 11 montjoie 2010-08-11 12:39:08 UTC
This is now in the sunrise overlay. You can find it at:
http://overlays.gentoo.org/proj/sunrise/browser/sunrise/dev-python/nltk/nltk-2.0_beta9.ebuild
Comment 12 Markos Chandras (RETIRED) gentoo-dev 2010-08-30 17:12:55 UTC
*nltk-2.0_beta9 (30 Aug 2010)

  30 Aug 2010; Markos Chandras <hwoarang@gentoo.org> +nltk-2.0_beta9.ebuild,
  +metadata.xml:
  Moved from sunrise overlay. Bug #237254. Thanks to ABBE Corentin
  (Montjoie) <corentin.labbe@geomatys.fr> for the ebuild