Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.045 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'subject:Python': 0.06; 'binary': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; '10:00': 0.16; '23,': 0.16; 'circumvent': 0.16; 'extension.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:library': 0.16; 'wrote:': 0.18; 'mechanism': 0.19; 'thu,': 0.19; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'install': 0.23; 'load': 0.23; 'cc:2**0': 0.24; 'extension': 0.26; 'pass': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'along': 0.30; 'loading': 0.31; 'relies': 0.31; 'another': 0.32; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'library.': 0.36; 'possible': 0.36; 'christian': 0.38; 'system,': 0.38; 'depends': 0.38; 'issue': 0.38; 'even': 0.60; 'problems.': 0.60; 'solve': 0.60; 'then,': 0.60; 'simply': 0.61; 'save': 0.62; 'different': 0.65; 'license': 0.66; 'person.': 0.69; 'computers.': 0.84; 'grabbing': 0.84; 'subject:Using': 0.84; 'tie': 0.84; 'trouble.': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=6evSkt1y4RZh1PidIFbq+i2v38HgDx2p9tOzRp189qc=; b=J3dwnzfdTJVnkFmpIQkCK6tTifom65naRQJgDRSfk+wblkBu9Cn3WgSeQhg/57eFx1 bUv6xxnJRAyRZCHbqasoigc13GqXV2IZCSPRxzIXCKr8hs7+xIE9Fc37bQ1FZxHk+bJJ FoVdiWltoKpZTCZf4BD3c0YNIrjpll4JFb2C/huRooyW4x6/efilcSRs8yjvdAVkj3AD LFdnHdSrwJewHpBiDqBkMbRuGCA6xgxjgD2b8w2tUYTzJumDnCCco6qn/mgsDYuMnPfH 3Aga8k126JxB+cr80hT8nE1l/GPi23l5cBPFFw0OUqKhKz3EX3/k7tXl23GwsRZZGq5o Pjgg== MIME-Version: 1.0 X-Received: by 10.66.118.71 with SMTP id kk7mr5421599pab.14.1390444396550; Wed, 22 Jan 2014 18:33:16 -0800 (PST) In-Reply-To: References: <52dfa51e$0$3621$426a74cc@news.free.fr> Date: Thu, 23 Jan 2014 13:33:16 +1100 Subject: Re: Using a static library in a C extension for Python From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1390444399 news.xs4all.nl 2878 [2001:888:2000:d::a6]:50410 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64556 On Thu, Jan 23, 2014 at 10:00 AM, Christian Gollwitzer wrote: > There might be another issue with the license of the library. Cairo is both > LGPL and MPL. For LGPL, only dynamic linking is without doubt, for MPL it > seems to be accepted to link statically. It all depends on whether you plan > to pass on the binary to another person. > To circumvent this problem, it might be feasable to just install libcairo > along with you extension. > > Then, the exact same version of python must be used on both computers. Since > the extension loading mechanism completely relies on the OS dynamic linker, > it is not possible to load an extension into a different version of python > than it was built for. If you can tie in with your OS's package manager, that would solve all of these problems. You get the OS-supplied Pythom and the OS-supplied libcairo; grabbing libcairo-dev (or, on my Debian system, libcairo2-dev to go with libcairo2) gets you what you need to build your extension; you then might even package your extension the same way, and then simply declare dependencies. Can save a HUGE amount of trouble. ChrisA