X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C494F3840C18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1589502210; bh=m4lbGWVmErk2WwzcDH01gQKHW8eYL5wDJ1XE+S+cTuE=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qyJO9et3d6SelJAY0ahXoUwWIzUBKmU9wXtOoBGHLyJApHOiK1mKWWhwjJ9bc2B0J fezo4TvD6DTmcuftuKF/xcCJPudOfpn7MHKkHZ1Iw8WQBddvpilr9JqEtFEfT+JFBD NBwT9DWnFlbmPMr5vhE+43UXEKea5seovUBcdms0= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 99EA83851C3B X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rSQpRloC5zX6HNGtqzsymYQY8WXo8IKuvkt0Dp+n/T4=; b=hu1ryYHnb3bbWjVISZfbMKg6JSXDQCyfkZluOu49+I3jN4EEyGiYxfqiN8xk1pclHO nQRR7VfWtGMZZXoXCbpUOpXXRj8IMP5i2lhDF5vi4/Ttp5X81mXmZZwqAwDgh0U32Pjj 7V4C7H3VV3zHIC/lUYQ21P2SfSfB41/PftkqVGLQ9BYHgfJLtQow7RBfgmaHrcGwiFey Uy3OPPMUsUwxLDFvbgIqEmtJwG8rq5kIUNtwrZCbSWuLsiCxqGf4UvgT55pC/WlPrAzT jj2EudCkCYn48QObBAf0dbHcOWNYGLdtG3iTW40zYujQcub6VMPxJ4GVNfYFfvbzBZYm rjLw== X-Gm-Message-State: AOAM530lR5K89xp/1xDn5z16pl1A1u21atk8nc8RXHEthJkJZIfi+Htr Y3Nl6+wfbthHeQ52/SKNDiZmtgtQ X-Google-Smtp-Source: ABdhPJxHR1WAySY9/EEKVw8lpLoMJG40m+D4ffFPE3IqS94OGmJ3HadohBxMJ14iUIrsQ4yr15Vnkg== X-Received: by 2002:a9d:6d85:: with SMTP id x5mr410430otp.3.1589502197671; Thu, 14 May 2020 17:23:17 -0700 (PDT) Subject: Re: Trying to build OCRmyPDF under Cygwin, hit a brick wall To: cygwin AT cygwin DOT com References: <2afedbcf-f3d7-4e96-e196-fb3091630245 AT jhmg DOT net> Message-ID: Date: Thu, 14 May 2020 19:23:36 -0500 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Lightning/0.9 Thunderbird/2.0.0.19 Mnenhy/0.7.6.0 MIME-Version: 1.0 In-Reply-To: <2afedbcf-f3d7-4e96-e196-fb3091630245@jhmg.net> Content-Language: en-US X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Ren=C3=A9_Berber_via_Cygwin?= Reply-To: =?UTF-8?Q?Ren=c3=a9_Berber?= Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" 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 > 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 > """ > 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 -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple