Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 297101 - [new ebuild] media-libs/leptonica
Summary: [new ebuild] media-libs/leptonica
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://code.google.com/p/leptonica/
Whiteboard: [sunrise-overlay]
Keywords: EBUILD, InOverlay
Depends on:
Blocks:
 
Reported: 2009-12-15 21:05 UTC by Michał Górny
Modified: 2012-02-16 00:09 UTC (History)
4 users (show)

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


Attachments
Proposed ebuild (leptonica-1.62.ebuild,887 bytes, text/plain)
2009-12-16 21:18 UTC, Michał Górny
Details
Patch to build shared lib (leptonica-build-shared.diff,1.10 KB, patch)
2009-12-16 21:18 UTC, Michał Górny
Details | Diff
Updated ebuild with "progs" support (leptonica-1.64.ebuild,1.46 KB, text/plain)
2010-03-17 20:57 UTC, Rodrigo Severo
Details
Patch to remove -Werror from the "progs" make (leptonica-prog-makefile-remove_Werror.diff,282 bytes, patch)
2010-03-17 20:58 UTC, Rodrigo Severo
Details | Diff
leptonica-1.67.ebuild (leptonica-1.67.ebuild,1.18 KB, text/plain)
2010-11-16 21:43 UTC, James Le Cuirot
Details
leptonica-1.67.ebuild" (leptonica-1.67.ebuild,1.17 KB, text/plain)
2010-11-16 21:46 UTC, James Le Cuirot
Details
leptonica-1.68.ebuild (leptonica-1.68.ebuild,1.05 KB, text/plain)
2011-03-15 11:54 UTC, James Le Cuirot
Details
Patch to fix emerge error with png use flag (leptonica-1.68-png-error.patch,326 bytes, patch)
2011-10-17 12:08 UTC, Rodrigo Severo
Details | Diff
Patch for files directory to fix ebuild error with png use flag (leptonica-1.68-zlib-include.patch,503 bytes, patch)
2011-10-17 12:09 UTC, Rodrigo Severo
Details | Diff
Patch to fix emerge error with png use flag (in src_prepare) (leptonica-1.68-png-error_in-prepare.patch,396 bytes, patch)
2011-10-17 17:37 UTC, Rodrigo Severo
Details | Diff
leptonica-1.68.ebuild, approved for sunrise commit (leptonica-1.68.ebuild,1.28 KB, text/plain)
2012-01-20 22:47 UTC, the_mgt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-12-15 21:05:52 UTC
'An open source C library for efficient image processing and image analysis operations'.

It is a dependency of modern versions of ocropus (bug #185810).
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-12-16 21:18:11 UTC
Created attachment 213236 [details]
Proposed ebuild
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-12-16 21:18:31 UTC
Created attachment 213237 [details, diff]
Patch to build shared lib
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-12-16 21:26:17 UTC
The ebuild was commited to Sunrise overlay. After review, it will be available at:
https://overlays.gentoo.org/svn/proj/sunrise/reviewed/media-libs/leptonica/
Comment 4 Rodrigo Severo 2010-03-17 20:57:07 UTC
Created attachment 224059 [details]
Updated ebuild with "progs" support

Ebuild for the new 1.64 version with a new use flag: progs. With it you can get the progs available at the progs directory.

It makes the previous 1.62 ebuild obsolete.
Comment 5 Rodrigo Severo 2010-03-17 20:58:36 UTC
Created attachment 224061 [details, diff]
Patch to remove -Werror from the "progs" make

Patch to remove the -Werror flag from the progs make.

It's used by the 1.64 ebuild.
Comment 6 Rodrigo Severo 2010-03-17 21:00:38 UTC
Michal and Gentoo devs,


This files are already been used in a few servers of mine.

Please fell free to use the above files in Sunrise overlay or Gentoo portage.

Comment 7 James Le Cuirot gentoo-dev 2010-07-12 09:14:30 UTC
I've recently been in close contact with the author of Leptonica and have been completely reworking the autotools stuff. It may not be released for another month but it'll be much better than it is now.
Comment 8 James Le Cuirot gentoo-dev 2010-11-16 21:43:37 UTC
Created attachment 254541 [details]
leptonica-1.67.ebuild

A little late but as promised, the autotools stuff was reworked for 1.67. Enjoy. :)
Comment 9 James Le Cuirot gentoo-dev 2010-11-16 21:46:02 UTC
Created attachment 254543 [details]
leptonica-1.67.ebuild"

Doh. Forgot to run it through repoman.
Comment 10 James Le Cuirot gentoo-dev 2011-03-15 11:54:19 UTC
Created attachment 265943 [details]
leptonica-1.68.ebuild

After a lot of hard work by myself and others, 1.68 has now been released. The autotools stuff should be even more reliable now and it even uses -Wl,--as-needed automatically, which is practically unheard of. :)

This version adds WebP support but there's no ebuild for libwebp yet. I'll look into that as soon as I can.

The utils flag still installs a LOT of binaries to /usr/bin that perhaps shouldn't be installed at all but we're currently discussing that for the next release.
Comment 11 Rodrigo Severo 2011-10-17 12:08:07 UTC
Created attachment 290069 [details, diff]
Patch to fix emerge error with png use flag

leptonica-1.68 ebuild fails with the following error when png use flag is set:

/bin/sh ../libtool --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..     -O2 -mtune=generic -fomit-frame-pointer -DSAVING_ALWAYS_PERMIT -pipe -MT pnmio.lo -MD -MP -MF .deps/pnmio.Tpo -c -o pnmio.lo pnmio.c
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -O2 -mtune=generic -fomit-frame-pointer -DSAVING_ALWAYS_PERMIT -pipe -MT pnmio.lo -MD -MP -MF .deps/pnmio.Tpo -c pnmio.c  -fPIC -DPIC -o .libs/pnmio.o
mv -f .deps/pngiostub.Tpo .deps/pngiostub.Plo
pngio.c:119:41: error: 'Z_DEFAULT_COMPRESSION' undeclared here (not in a function)
/bin/sh ../libtool --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..     -O2 -mtune=generic -fomit-frame-pointer -DSAVING_ALWAYS_PERMIT -pipe -MT pnmiostub.lo -MD -MP -MF .deps/pnmiostub.Tpo -c -o pnmiostub.lo pnmiostub.c
make[2]: *** [pngio.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/pixcomp.Tpo .deps/pixcomp.Plo
mv -f .deps/pixtiling.Tpo .deps/pixtiling.Plo
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -O2 -mtune=generic -fomit-frame-pointer -DSAVING_ALWAYS_PERMIT -pipe -MT pnmiostub.lo -MD -MP -MF .deps/pnmiostub.Tpo -c pnmiostub.c  -fPIC -DPIC -o .libs/pnmiostub.o
pnmio.c: In function 'pixWriteStreamAsciiPnm':
pnmio.c:521:27: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
pnmio.c:526:27: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
pnmio.c:531:27: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
pnmio.c:536:27: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
pnmio.c:559:27: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
pnmio.c: In function 'pixWriteStreamPnm':
pnmio.c:384:23: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
pnmio.c:403:27: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
pnmio.c:412:27: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
mv -f .deps/pnmiostub.Tpo .deps/pnmiostub.Plo
mv -f .deps/pnmio.Tpo .deps/pnmio.Plo
mv -f .deps/pixconv.Tpo .deps/pixconv.Plo
make[2]: Leaving directory `/var/tmp/portage/media-libs/leptonica-1.68/work/leptonica-1.68/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-libs/leptonica-1.68/work/leptonica-1.68'
make: *** [all] Error 2
emake failed
 * ERROR: media-libs/leptonica-1.68 failed (compile phase):
 *   died running emake, base_src_make

This is treated on the following upstream  bug report http://code.google.com/p/leptonica/issues/detail?id=56

Version 1.69 of leptonica will have this error fixed.

The attached patch for leptonica 1.68 ebuild fixes this. It's necessary to include the leptonica-1.68-zlib-include.patch in the files directory also.
Comment 12 Rodrigo Severo 2011-10-17 12:09:34 UTC
Created attachment 290071 [details, diff]
Patch for files directory to fix ebuild error with png use flag

This file should be included in the files directory to fix the emerge error when png use flag is turned on.
Comment 13 James Le Cuirot gentoo-dev 2011-10-17 12:20:47 UTC
Don't use src_unpack to apply patches. Since EAPI 2, this should be done in src_prepare.
Comment 14 Rodrigo Severo 2011-10-17 12:54:39 UTC
Ok. I got the orientation to apply patchs with src_unpack on the Gentoo Linux Documentation -- Ebuild HOWTO page at http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=1#doc_chap2_pre1

Is this page outdated?
Comment 15 James Le Cuirot gentoo-dev 2011-10-17 12:58:25 UTC
Yes. Read "man 5 ebuild" instead.
Comment 16 Rodrigo Severo 2011-10-17 13:09:17 UTC
In "man 5 ebuild"
src_unpack description mentions taht patches should be done in src_unpack.
src_prepare description says that patches should be done in src_prepare

I bet the man page is also outdated ;)
Comment 17 James Le Cuirot gentoo-dev 2011-10-17 13:18:54 UTC
Yeah I did notice that. Just trust me. ;)
Comment 18 Rodrigo Severo 2011-10-17 17:37:41 UTC
Created attachment 290105 [details, diff]
Patch to fix emerge error with png use flag (in src_prepare)

Patch for leptonica ebuild to include a patch for leptonica source to fix emerge error with png use flag. Now applied in src_prepare instead of src_unpack.
Comment 19 the_mgt 2012-01-20 22:47:06 UTC
Created attachment 299427 [details]
leptonica-1.68.ebuild, approved for sunrise commit

Since I needed a recent version of this lib for tesseract-3 and the one in sunrise was heavily outdated, I took the one already present in this bug and did some modifications until it was accepted for sunrise commit.

tesseract-2 is already in main tree and I'd like (and need) it bumped to 3.01, so I would like to see leptonica moved to main tree in near future, if possible. I am willing to proxy maintain it.
Comment 20 James Le Cuirot gentoo-dev 2012-01-20 23:03:52 UTC
If you use the autotools-utils eclass then this will handle the .la file removal for you. You can then also use DOCS as I did before as this is formally supported in EAPI4.

Note that 1.69 will probably be released soon. I think this fixes the png bug.
Comment 21 the_mgt 2012-01-20 23:14:44 UTC
(In reply to comment #20)
> If you use the autotools-utils eclass then this will handle the .la file
> removal for you. You can then also use DOCS as I did before as this is formally
> supported in EAPI4.
Yes the DOCS thing was far more elegant, sunrise people insisted that it was provided by the autotools stuff and I couldn't rely on that. Somebody might remove the inheritance. I'll try to get more info about that, do you have a link?
Same thing for the .la removal.

 
> Note that 1.69 will probably be released soon. I think this fixes the png bug.
Did you send the patch upstream? I was going to do that now. (Just wrote that here but got a mid-air collision :)

Thanks for the fast comment!

This bug blocks bug #343211 - app-text/tesseract 3.00 released
Comment 22 James Le Cuirot gentoo-dev 2012-01-21 00:09:57 UTC
(In reply to comment #21)
> Yes the DOCS thing was far more elegant, sunrise people insisted that it was
> provided by the autotools stuff and I couldn't rely on that. Somebody might
> remove the inheritance. I'll try to get more info about that, do you have a
> link?
> Same thing for the .la removal.

I'm not sure what you mean about the inheritance but "man 5 ebuild" says to use DOCS in EAPI4. Also take a look at the autotools-utils.eclass source because there's some helpful comments in there.

> Did you send the patch upstream? I was going to do that now. (Just wrote that
> here but got a mid-air collision :)

I am in close contact with upstream but I didn't send the patch. I do have a preview of 1.69 though and I see that it is fixed. Someone else probably reported the issue.
Comment 23 Stefan Briesenick (RETIRED) gentoo-dev 2012-02-16 00:09:19 UTC
ok, folks. I cleaned up the "final" ebuild a little bit and commited it to portage.

So finally, it's in portage!