From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 99EA83851C3B for ; Fri, 15 May 2020 00:23:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 99EA83851C3B Received: by mail-ot1-x335.google.com with SMTP id 63so564313oto.8 for ; Thu, 14 May 2020 17:23:18 -0700 (PDT) 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) Received: from [192.168.10.3] ([200.57.195.23]) by smtp.gmail.com with ESMTPSA id a7sm158729otr.15.2020.05.14.17.23.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 17:23:16 -0700 (PDT) Subject: Re: Trying to build OCRmyPDF under Cygwin, hit a brick wall To: cygwin@cygwin.com References: <2afedbcf-f3d7-4e96-e196-fb3091630245@jhmg.net> From: =?UTF-8?Q?Ren=c3=a9_Berber?= 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-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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@cygwin.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: , X-List-Received-Date: Fri, 15 May 2020 00:23:29 -0000 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