Summary: | media-gfx/fontforge fails to build with Python 2.7 (PyBytes_Decode) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Diego Elio Pettenò (RETIRED) <flameeyes> |
Component: | New packages | Assignee: | Gentoo Fonts Team <fonts> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hanno, krinpaus, kripton, markus, steffen, tdalman |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://fontforge.cvs.sourceforge.net/viewvc/fontforge/fontforge/fontforge/ffpython.h?r1=1.8&r2=1.9 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 292401 | ||
Attachments: |
Build log
patch to make fontforge compile on python-2.7 changed ebuild to include patch for python-2.7 compatibility |
Description
Diego Elio Pettenò (RETIRED)
2010-07-06 09:14:03 UTC
Created attachment 237703 [details]
Build log
Found a patch here: https://sourceforge.net/mailarchive/message.php?msg_name=20100803075528.GA25670%40crud.chemoelectric.org Will upload patch and changed ebuild (only added an epatch line) Created attachment 242289 [details, diff]
patch to make fontforge compile on python-2.7
Created attachment 242291 [details]
changed ebuild to include patch for python-2.7 compatibility
Steffen, thanks for coming up with this patch. Did you talk to upstream? It would be nice if we can ascertain that a similar patch will be in the next upstream release. Same issue here with Python 2.7.1. Upstream patch looks different: http://fontforge.cvs.sourceforge.net/viewvc/fontforge/fontforge/fontforge/ffpython.h?r1=1.8&r2=1.9 Simple fix COMPILE IT WITH USE=-python ! Anyway found this comment on a mailing list: http://old.nabble.com/Compiling-error-with-Python-td29226850.html Re: Compiling error with Python Click to flag this post by Barry Schwartz-2 Aug 03, 2010; 09:55am :: Rate this Message: - Use ratings to moderate (?) Reply | Print | View Threaded | Show Only this Message Kevin Fenzi <kevin@...> skribis: > The following small patch makes it build here with python 2.7: > > diff -Nur fontforge-20100501.orig/fontforge/ffpython.h fontforge-20100501/fontforge/ffpython.h > --- fontforge-20100501.orig/fontforge/ffpython.h 2010-04-05 14:10:26.000000000 -0600 > +++ fontforge-20100501/fontforge/ffpython.h 2010-07-28 12:07:25.000000000 -0600 > @@ -25,7 +25,7 @@ > * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > > -#if PY_MAJOR_VERSION >= 3 > +#if PY_MAJOR_VERSION >= 3 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) > > #define PyInt_Check PyLong_Check > #define PyInt_AsLong PyLong_AsLong ... [show rest of quote] That's probably not right, plus the Python 3 code is incomplete and its Python extension is badly designed. I know, because I created it. :) What probably happened is that they removed the #define for PyBytes_Decode that was in 2.6, because there those defines were to ease transition to Python 3 (wherein "PyString" stuff is renamed "PyBytes"), but Python 3 wasn't actually going to have a PyBytes_Decode -- the function was simply going to be dropped. Simplest fix in that case is to go back to the old name: diff --git a/fontforge/ffpython.h b/fontforge/ffpython.h index e81c3ec..70ba318 100644 --- a/fontforge/ffpython.h +++ b/fontforge/ffpython.h @@ -43,7 +43,7 @@ #define STRING_CHECK PyBytes_Check #define STRING_TO_PY PyBytes_FromString -#define DECODE_UTF8(s, size, errors) PyBytes_Decode(s, size, "UTF-8", errors) +#define DECODE_UTF8(s, size, errors) PyString_Decode(s, size, "UTF-8", errors) #define PYBYTES_UTF8(str) PyString_AsEncodedObject(str, "UTF-8", NULL) #define STRING_FROM_FORMAT PyBytes_FromFormat Added patch from upstream. All further discussion about better solutions should be handled with upstream. |