Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447172 - request for unbundled libstemmer (from app-misc/sphinx)
Summary: request for unbundled libstemmer (from app-misc/sphinx)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Hans de Graaff
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-13 21:35 UTC by Tianon
Modified: 2013-07-18 09:04 UTC (History)
1 user (show)

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


Attachments
libstemmer_c-shared-library.patch (libstemmer_c-shared-library.patch,790 bytes, patch)
2012-12-14 22:45 UTC, Tianon
Details | Diff
libstemmer-20091122.ebuild (libstemmer-20091122.ebuild,1.10 KB, text/plain)
2012-12-14 22:46 UTC, Tianon
Details
snowball-stemmer-20091122.ebuild (snowball-stemmer-20091122.ebuild,1.08 KB, text/plain)
2012-12-15 17:57 UTC, Tianon
Details
libstemmer_c-shared-library.patch (libstemmer_c-shared-library.patch,824 bytes, patch)
2012-12-15 23:42 UTC, Tianon
Details | Diff
snowball-stemmer-20091122.ebuild (snowball-stemmer-20091122.ebuild,1.22 KB, text/plain)
2012-12-15 23:44 UTC, Tianon
Details
libstemmer_c-shared-library.patch (libstemmer_c-shared-library.patch,837 bytes, patch)
2012-12-15 23:46 UTC, Tianon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tianon 2012-12-13 21:35:59 UTC
Currently, libstemmer is only available as a bundled library directly within app-misc/sphinx.  It would be very handy to have an ebuild akin to the "libstemmer-dev" package in Debian that contains a shared library for libstemmer to include in other projects and/or future ebuilds more easily.
Comment 1 Tianon 2012-12-14 02:56:12 UTC
Looking into this more, upstream does not build a shared library by default.  The source for the Debian package (http://packages.debian.org/wheezy/libstemmer-dev) includes a patch to snowball's GNUmakefile to build libstemmer.so instead of libstemmer.o.

I think for Gentoo it might be easier to use the same tgz we've got (mirror://gentoo/libstemmer_c-20091122.tgz) and build the shared library directly in the ebuild since the patch to the snowball makefile simply adds a few lines to build a shared library from the single source file.

I'm definitely not an expert on ebuild best practices though, so I'm relaying my research and ideas in case they're helpful.
Comment 2 Hans de Graaff gentoo-dev Security 2012-12-14 06:32:54 UTC
This is on my todo list because the last sphinx release allows building against an out-of-tree libstemmer. Not sure when I'll get to it, so patches welcome :-)
Comment 3 Tianon 2012-12-14 22:45:53 UTC
Created attachment 332330 [details, diff]
libstemmer_c-shared-library.patch
Comment 4 Tianon 2012-12-14 22:46:45 UTC
Created attachment 332332 [details]
libstemmer-20091122.ebuild

Please don't judge my ebuild skills too harshly, but I would absolutely love input on how I could or should improve. :)
Comment 5 Tianon 2012-12-14 22:48:37 UTC
Oh, I guess I ought to mention that I've put my ebuild in "dev-libs/libstemmer".  I'm not positive if that is the appropriate place (but I did look around to make sure it's at least similar to what's in dev-libs).  Also, as evidenced by the comments in the ebuild, I'm not sure if this should be called "libstemmer_c", or if this one ebuild should instead handle both "libstemmer_c" and "libstemmer_java".  We're concerned with having libstemmer_c, so that's all I've worked on here. :)
Comment 6 Hans de Graaff gentoo-dev Security 2012-12-15 09:17:09 UTC
I had a quick visual look at the ebuild, and it looks good in general.

In EAPI=5 you can install header files with doheader. Also, we could use a static-libs USE flag here to control building the .a version of the library.

Also, I'm wondering if we should not call this dev-libs/snowball, or dev-libs/snowball-stemmer.
Comment 7 Tianon 2012-12-15 17:46:55 UTC
Ah, static-libs makes sense, and I'm glad to see we get doheader in EAPI=5.  I'll switch over to 5 and use that. :)

My concern with calling it "snowball" is that we aren't actually packaging snowball itself, just its stemmer, so I definitely would vote for "snowball-stemmer" (I went with libstemmer to match Debian, which really doesn't matter much :P).
That doesn't answer the question of whether it ought to also include the Java version, though.  With a generic name like that, I would guess that it probably should, but I've never even looked at a java-including ebuild before, so I wouldn't even know where to try putting the files, or whether they'd need to be compiled. :)

I'll make a few tweaks based on your input here and reupload. :)
Comment 8 Tianon 2012-12-15 17:57:01 UTC
Created attachment 332384 [details]
snowball-stemmer-20091122.ebuild

Ok, here's a tweaked version of the ebuild.  I still need to adapt my patch to allow for conditional building of the .a file (right now, we just build both and only install the .a if the static-libs use flag is enabled).
Comment 9 Tianon 2012-12-15 23:42:18 UTC
Created attachment 332422 [details, diff]
libstemmer_c-shared-library.patch

Updated patch to support building the shared library and the static library individually.  Updated ebuild will follow shortly.
Comment 10 Tianon 2012-12-15 23:44:25 UTC
Created attachment 332424 [details]
snowball-stemmer-20091122.ebuild

Updated ebuild with proper conditional building, only doing as much work as requested. :)
Comment 11 Tianon 2012-12-15 23:46:13 UTC
Created attachment 332426 [details, diff]
libstemmer_c-shared-library.patch

Sorry for the multiple posting, this should be the final one for this bit.  This is a slight update to the patch to make the final Makefile more complete with a proper "clean" target, in case we need that working correctly later or someone else borrows the patch.
Comment 12 Hans de Graaff gentoo-dev Security 2013-07-18 09:04:06 UTC
I've now added this to the tree as snowball-stemmer 0.20091122.

Thanks for providing the ebuild and patch.