Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 392979 - media-gfx/fontforge-20110222-r1 fails to compile on x86-macos
Summary: media-gfx/fontforge-20110222-r1 fails to compile on x86-macos
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Mike Gilbert
Depends on:
Reported: 2011-12-03 04:16 UTC by MATSUI Tetsushi
Modified: 2017-08-20 01:53 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

modified ebuild (fontforge-20110222-r1.ebuild,3.90 KB, text/plain)
2011-12-03 04:17 UTC, MATSUI Tetsushi
fontoforge-20110222-gioftp-pthread.patch (fontforge-20110222-gioftp-pthread.patch,782 bytes, patch)
2011-12-03 04:19 UTC, MATSUI Tetsushi
Details | Diff
log (original ebuild) (media-gfx:fontforge-20110222-r1:20111204-123046.log,69.42 KB, text/plain)
2011-12-04 12:47 UTC, MATSUI Tetsushi
log (after only patch) (media-gfx:fontforge-20110222-r1:20111204-124207.log,203.68 KB, text/plain)
2011-12-04 12:49 UTC, MATSUI Tetsushi
modified ebuild (fontforge-20110222-r1.ebuild,3.82 KB, text/plain)
2012-05-31 12:28 UTC, MATSUI Tetsushi

Note You need to log in before you can comment on or make changes to this bug.
Description MATSUI Tetsushi 2011-12-03 04:16:00 UTC
media-gfx/fontforge-20110222-r1 fails to compile on x86-macos.

First problem is that pthread related function is used without ifdef macro in gioftp.c.
Second problem after fixing the first is undefined symbols.
Comment 1 MATSUI Tetsushi 2011-12-03 04:17:45 UTC
Created attachment 294559 [details]
modified ebuild

Here is my attempt to solve the problems.
Comment 2 MATSUI Tetsushi 2011-12-03 04:19:29 UTC
Created attachment 294561 [details, diff]

patch to fix the first problem.
Comment 3 Fabian Groffen gentoo-dev 2011-12-03 10:35:51 UTC
Not sure actually skipping locking is a good fix.  Besides, you're on Darwin, pthread_mutex_lock should exist, the code probably forgot a #include <pthread.h>.
Comment 4 MATSUI Tetsushi 2011-12-03 12:04:43 UTC
(In reply to comment #3)
> Not sure actually skipping locking is a good fix.  Besides, you're on Darwin,
> pthread_mutex_lock should exist, the code probably forgot a #include
> <pthread.h>.

I understand your worry.
But, if I have pthread.h and configure detects it,
then my patch has no effect, doen't it?

The pthread.h is actually included in gioP.h with #ifdef HAVE_PTHREAD_H,
which is included in gioftpP.h, which is included in gioftp.c.

Well, OK, I will try to read configure that seems to fail to detect pthread on Darwin.
Comment 5 Fabian Groffen gentoo-dev 2011-12-03 12:36:45 UTC
Ah, yes.  If pthread is included conditionally, then they can't rely on its functions, indeed.

However, in your case pthread should be there, so you don't need to fix this problem for upstream ;)
Comment 6 MATSUI Tetsushi 2011-12-03 12:56:38 UTC
I found that the detection failure was caused by my mistakenly set LIBS.
So, yes, we can ignore the patch.  The only problem for us is the linker errors.
Comment 7 Fabian Groffen gentoo-dev 2011-12-04 09:05:03 UTC
what linker errors?
Comment 8 MATSUI Tetsushi 2011-12-04 12:47:40 UTC
Created attachment 294705 [details]
log (original ebuild)

showing the failure at gioftp.c
Comment 9 MATSUI Tetsushi 2011-12-04 12:49:18 UTC
Created attachment 294707 [details]
log (after only patch)

I know the patch is unnecessary but, this shows the undefined symbols.
Comment 10 Fabian Groffen gentoo-dev 2011-12-04 12:51:03 UTC
Comment 11 MATSUI Tetsushi 2011-12-04 12:59:43 UTC
Two logs shows how builds fail.

On the way to reproduce the log (again), I recognize that the strange LIBS
problem is caused in configure.  If configure is run without --with-python-lib,
it tries to guess what it should be; the code

PyLib=`$python_prog -c "import distutils.sysconfig ;
print(distutils.sysconfig.get_config_var('LIBPL') + '/' +

is used and detect, at least on my environment, the messing path:

$ python -c "import distutils.sysconfig ;
print(distutils.sysconfig.get_config_var('LIBPL') + '/' +

On time I wrote the last comment, I stopped using the patch on gioftp.c but
continued to use other part of the modified ebuild, which pass
--with-python-lib, luckily avoiding the configure's misbehavior.  It's an
upstream bug that can be ignored, if we set --with-python-lib as in the
attached ebuild.
Comment 12 MATSUI Tetsushi 2012-05-31 12:28:59 UTC
Created attachment 313711 [details]
modified ebuild
Comment 13 Mike Gilbert gentoo-dev 2017-08-20 01:53:16 UTC
Please re-open this if the issue occurs with current versions of fontforge.