public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "René Berber" <rene.berber@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Trying to build OCRmyPDF under Cygwin, hit a brick wall
Date: Thu, 14 May 2020 19:23:36 -0500	[thread overview]
Message-ID: <d4070d22-4298-9ee7-bc31-202cb107caf6@gmail.com> (raw)
In-Reply-To: <2afedbcf-f3d7-4e96-e196-fb3091630245@jhmg.net>

On 5/14/2020 5:50 PM, Jim Garrison via Cygwin wrote:

> The magic incantation necessary to get strdup turns out to be -
> D_GNU_SOURCE, as noted on StackOverflow.
> 
> However, now I'm encountering a problem with Python's DLL handling
> code.  When attempting to run OCRmyPDF I get
[snip]
> line 18, in <module>
>      from . import helpers, hocrtransform, leptonica, pdfa, pdfinfo
>    File
> "/usr/lib/python3.7/site-packages/ocrmypdf-9.8.0.post3+g5944044.d20200514-py3.7.egg/ocrmypdf/leptonica.py",
> line 67, in <module>
>      """
> ocrmypdf.exceptions.MissingDependencyError:
[snip]

> In the last file of the traceback (leptonica.py) there's this:
> 
> 
> from ctypes.util import find_library
> ...
> if os.name == 'nt':
>      libname = 'liblept-5'
>      os.environ['PATH'] = shim_paths_with_program_files()
> else:
>      libname = 'lept'
> 
> 
> In Cygwin, that library is /usr/bin/cyglept-5.dll (why was the name
> changed?)
> 
> First I created a symlink from cyglept-5.dll to liblept-5.dll, with no
> effect. So I added a test for Cygwin at that point, resulting in this
> code:
> 
> 
> if os.name == 'nt':
>      libname = 'liblept-5'
>      os.environ['PATH'] = shim_paths_with_program_files()

Notice this change in search path, dll files in Windows are executables 
and they are (must) installed in the system PATH (or the current directory).

> elif sys.platform == 'cygwin':
>      libname = 'cyglept-5'

On Cygwin you can do the same as above, it will contain /bin (or 
/usr/bin which are one and the same).

> else:
>      libname = 'lept'
> 
> 
> This also had no effect, so I tried playing with find_library() in the
> interactive shell.  In Cygwin, it doesn't seem to find any DLLs even
> though those DLLs are actually loadable.  Viz:
[snip]

My guess is the search path is incorrect.

Either that or python needs the symbols file, like the linker, which in 
this case would be /usr/lib/liblept.dll.a, which is in the -devel 
package, but I doubt it.
-- 
R.Berber



  reply	other threads:[~2020-05-15  0:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 19:45 Jim Garrison
2020-05-14 22:50 ` Jim Garrison
2020-05-15  0:23   ` René Berber [this message]
2020-05-15 18:17     ` Jim Garrison
2020-05-15  1:45   ` Marco Atzeri
2020-05-15 18:19     ` Jim Garrison
     [not found] <0d9b4a1b-05ba-8ab1-3783-c3d1f04f97b7@gmail.com>
2020-05-15 19:34 ` Marco Atzeri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4070d22-4298-9ee7-bc31-202cb107caf6@gmail.com \
    --to=rene.berber@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).