'An open source C library for efficient image processing and image analysis operations'. It is a dependency of modern versions of ocropus (bug #185810).
Created attachment 213236 [details] Proposed ebuild
Created attachment 213237 [details, diff] Patch to build shared lib
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/
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.
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.
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.
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.
Created attachment 254541 [details] leptonica-1.67.ebuild A little late but as promised, the autotools stuff was reworked for 1.67. Enjoy. :)
Created attachment 254543 [details] leptonica-1.67.ebuild" Doh. Forgot to run it through repoman.
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.
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.
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.
Don't use src_unpack to apply patches. Since EAPI 2, this should be done in src_prepare.
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?
Yes. Read "man 5 ebuild" instead.
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 ;)
Yeah I did notice that. Just trust me. ;)
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.
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.
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.
(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
(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.
ok, folks. I cleaned up the "final" ebuild a little bit and commited it to portage. So finally, it's in portage!