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
Created attachment 165070 [details] The ebuild file for NLTK
Also, this is the first ebuild I've put together, so I'll gladly rework it if its not written correctly.
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)
(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
(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
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?
(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
Any progress here? It'd be nice if this could be added to portage.
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.
Created attachment 241523 [details] nltk ebuild
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
*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