NetBSD Problem Report #52190

From www@NetBSD.org  Sun Apr 23 19:40:03 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C3A017A0F8
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 23 Apr 2017 19:40:03 +0000 (UTC)
Message-Id: <20170423194002.5FF487A2BD@mollari.NetBSD.org>
Date: Sun, 23 Apr 2017 19:40:02 +0000 (UTC)
From: frank@phoenix.owl.de
Reply-To: frank@phoenix.owl.de
To: gnats-bugs@NetBSD.org
Subject: building graphics/cairo doesn't find ft2build.h
X-Send-Pr-Version: www-1.0

>Number:         52190
>Category:       pkg
>Synopsis:       building graphics/cairo doesn't find ft2build.h
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 23 19:45:00 +0000 2017
>Last-Modified:  Sun May 06 09:05:01 +0000 2018
>Originator:     Frank Wille
>Release:        pkgsrc2017Q1
>Organization:
NetBSD
>Environment:
NetBSD altair.owl.de 7.1_STABLE NetBSD 7.1_STABLE (IBOOKG4) #0: Thu Apr 13 11:26:49 CEST 2017  frank@tethys:/home/frank/netbsd/7/src/objmacppc/sys/arch/macppc/compile/IBOOKG4 macppc
>Description:
Links to Freetype and/or Freetype2 are missing. Freetype is also missing in /usr/pkg/share/x11-links/lib/ and pkgconfig.

Problem 1:

[...]
  CC       cairo-xlib-screen.lo
In file included from cairo-fontconfig-private.h:49:0,
                 from cairo-xlib-screen.c:66:
/usr/pkgsrc/graphics/cairo/work/.x11-buildlink/include/fontconfig/fcfreetype.h:27:22: fatal error: ft2build.h: No such file or directory
 #include <ft2build.h>
                      ^
compilation terminated.


Problem 2 (after manually fixing the previous):

[...]
  CCLD     libcairoboilerplate.la

*** Warning: This system cannot link to static lib archive ../src/libcairo.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
  CC       any2ppm-any2ppm.o
  CCLD     any2ppm
ld: cannot find -lfreetype
*** Error code 1

>How-To-Repeat:
Execute "make" in pkgsrc/graphics/cairo (pkgsrc2017Q1).

>Fix:
Not sure. I'm not familiar with the pkgsrc build system. I'm also unsure if I should linke to the freetype in /usr/X11R7 or in /usr/pkg.

Problem 1:
# cd pkgsrc/graphics/cairo/work/.buildlink/include
# ln -s /usr/X11R7/include/freetype2/ft2build.h .

Problem 2:
# cd pkgsrc/graphics/cairo/work/.buildlink/lib
# ln -s /usr/X11R7/lib/libfreetype.so.17.4.11 libfreetype.so

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52190: building graphics/cairo doesn't find ft2build.h
Date: Tue, 20 Feb 2018 06:59:39 +0000

 On Sun, Apr 23, 2017 at 07:45:00PM +0000, frank@phoenix.owl.de wrote:
  > Links to Freetype and/or Freetype2 are missing. Freetype is also
  > missing in /usr/pkg/share/x11-links/lib/ and pkgconfig.

 What is your X11_TYPE? If you're intending to use native X, make sure
 it's set that way ("native") and make sure you've updated/rebuilt
 x11-links recently.

 You ought to get /usr/pkg/share/x11-links/include/freetype2/ft2build.h,
 a link that points to /usr/X11R7/include/freetype2/ft2build.h.

 If the x11-links build fails to find freetype2, or thinks it shouldn't
 be used, that's the problem and we should debug why...

 -- 
 David A. Holland
 dholland@netbsd.org

From: Frank Wille <frank@phoenix.owl.de>
To: gnats-bugs@NetBSD.org,
	pkg-manager@netbsd.org,
	gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52190: building graphics/cairo doesn't find ft2build.h
Date: Wed, 21 Feb 2018 11:53:19 +0100

 Warning: This is a message in MIME format. Your mail reader does
 not support MIME. Some parts of this message will be readable as
 plain text. To see the rest, you will need to upgrade your mail
 reader. Following are some URLs where you can find MIME-capable
 mail programs for common platforms:

   AmigaOS...........: http://www.yam.ch/
   Unix/MacOS/Windows: http://www.mozilla.com/thunderbird/

 General information about MIME can be found at:
 http://en.wikipedia.org/wiki/MIME

 ----=_BOUNDARY.20cef79854acd5a.01
 Content-Type: text/plain

 David Holland wrote:

 >  On Sun, Apr 23, 2017 at 07:45:00PM +0000, frank@phoenix.owl.de wrote:
 >> Links to Freetype and/or Freetype2 are missing. Freetype is also
 >> missing in /usr/pkg/share/x11-links/lib/ and pkgconfig.
 >  
 >  What is your X11_TYPE?

 Nothing. No /etc/mk.conf exists during my pkgsrc builds.


 > If you're intending to use native X, make sure
 >  it's set that way ("native") and make sure you've updated/rebuilt
 >  x11-links recently.

 Yes, I'm always using native X, but I was under the impression that this is
 the default, when X11_TYPE is undefined. Also reading doc/pkgsrc.txt makes
 me think so.

 Nevertheless, I tried with X11_TYPE=native in /etc/mk.conf now, but there is
 no difference.


 >  You ought to get
 >  /usr/pkg/share/x11-links/include/freetype2/ft2build.h, a link that
 >  points to /usr/X11R7/include/freetype2/ft2build.h.

 It's still missing on my 7.1-stable macppc system.

 But... surprisingly it works as you say on a 6.1.5 amd64 system! I made some
 tests today, using the same pkgsrc-2017Q1. The freetype2 directory and also
 the library links do exist there.


 >  If the x11-links build fails to find freetype2, or thinks it shouldn't
 >  be used, that's the problem and we should debug why...

 I made a comparison between the output of both systems, building x11-links.
 You find the output attached.

 Here is the difference. On the amd64 there are two additional lines, which
 probably fix something:

 => Fixes wrong module version in freetype2.pc
 WARNING: [subst.mk:fx-ft2-pc-version] Ignoring non-existent file
 "/usr/pkgsrc/pkgtools/x11-links/work/.x11-buildlink/lib/pkgconfig/freetype2.pc".

 Now I don't know whether the different architecture or the different NetBSD
 version causes this fix on my iBook G4 to fail.

 Thanks in advance!

 -- 
 Frank Wille

 ----=_BOUNDARY.20cef79854acd5a.01
 Content-Type: text/plain;
 	name="x11links-615amd64.txt"
 Content-Disposition: inline;
 	filename="x11links-615amd64.txt"

 ===> Creating toolchain wrappers for x11-links-1.05
 src=/usr/X11R7/lib/pkgconfig/fixesproto.pc  dst=/usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig/fixesext.pc;  /bin/mkdir -p /usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig;  if test -f ${src}; then  /bin/ln -sf ${src} ${dst};  fi
 src=/usr/X11R7/lib/pkgconfig/compositeproto.pc  dst=/usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig/compositeext.pc;  /bin/mkdir -p /usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig;  if test -f ${src}; then  /bin/ln -sf ${src} ${dst};  fi
 => Fixes wrong module version in freetype2.pc
 WARNING: [subst.mk:fx-ft2-pc-version] Ignoring non-existent file "/usr/pkgsrc/pkgtools/x11-links/work/.x11-buildlink/lib/pkgconfig/freetype2.pc".
 ===> Configuring for x11-links-1.05

 ----=_BOUNDARY.20cef79854acd5a.01
 Content-Type: text/plain;
 	name="x11links-71macppc.txt"
 Content-Disposition: inline;
 	filename="x11links-71macppc.txt"

 ===> Creating toolchain wrappers for x11-links-1.05
 src=/usr/X11R7/lib/pkgconfig/fixesproto.pc  dst=/usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig/fixesext.pc;  /bin/mkdir -p /usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig;  if test -f ${src}; then  /bin/ln -sf ${src} ${dst};  fi
 src=/usr/X11R7/lib/pkgconfig/compositeproto.pc  dst=/usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig/compositeext.pc;  /bin/mkdir -p /usr/pkgsrc/pkgtools/x11-links/work/.buildlink/lib/pkgconfig;  if test -f ${src}; then  /bin/ln -sf ${src} ${dst};  fi
 ===> Configuring for x11-links-1.05

 ----=_BOUNDARY.20cef79854acd5a.01--


From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52190: building graphics/cairo doesn't find ft2build.h
Date: Wed, 21 Feb 2018 22:30:24 +0700

 This and the issue in pkg/53007 look to be the same thing.

 Either bl3 or x11-links is doing something bogus. and messing things
 up, as outside pkgsrc the compile (in 53007 anyway) just works.

 kre

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52190: building graphics/cairo doesn't find ft2build.h
Date: Sat, 28 Apr 2018 07:42:27 +0000

 On Wed, Feb 21, 2018 at 10:55:01AM +0000, Frank Wille wrote:
  >  >  You ought to get
  >  >  /usr/pkg/share/x11-links/include/freetype2/ft2build.h, a link that
  >  >  points to /usr/X11R7/include/freetype2/ft2build.h.
  >  
  >  It's still missing on my 7.1-stable macppc system.
  >  
  >  But... surprisingly it works as you say on a 6.1.5 amd64 system! I
  >  made some tests today, using the same pkgsrc-2017Q1. The freetype2
  >  directory and also the library links do exist there.
  >  
  >  >  If the x11-links build fails to find freetype2, or thinks it shouldn't
  >  >  be used, that's the problem and we should debug why...
  >  
  >  I made a comparison between the output of both systems, building x11-links.
  >  You find the output attached.
  >  
  >  Here is the difference. On the amd64 there are two additional lines, which
  >  probably fix something:
  >  
  >  => Fixes wrong module version in freetype2.pc
  >  WARNING: [subst.mk:fx-ft2-pc-version] Ignoring non-existent file
  >  "/usr/pkgsrc/pkgtools/x11-links/work/.x11-buildlink/lib/pkgconfig/freetype2.pc".

 So, that apparently comes from freetype2's builtin.mk.

 When some builtin.mk fails to do its thing, the first thing to check is:
    % make show-var VARNAME=IS_BUILTIN.freetype2
    % make show-var VARNAME=USE_BUILTIN.freetype2

 (from pkgtools/x11-links, after making clean if necessary)

 If IS_BUILTIN is no, then the question is why it's not finding it; if
 USE_BUILTIN is no, the question is why it's rejecting it.

 Also, check to make sure that X11BASE is set correctly...

 -- 
 David A. Holland
 dholland@netbsd.org

From: Frank Wille <frank@phoenix.owl.de>
To: gnats-bugs@NetBSD.org,
	pkg-manager@netbsd.org,
	gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52190: building graphics/cairo doesn't find ft2build.h
Date: Tue, 01 May 2018 20:24:40 +0200

 David Holland wrote:

 On 28.04.18 07:45:01 you wrote:

 >  On Wed, Feb 21, 2018 at 10:55:01AM +0000, Frank Wille wrote:
 >> [...]
 >>  I made a comparison between the output of both systems, building
 >>  x11-links. You find the output attached.
 >>  
 >>  Here is the difference. On the amd64 there are two additional lines,
 >>  which probably fix something:
 >>  
 >>  => Fixes wrong module version in freetype2.pc
 >>  WARNING: [subst.mk:fx-ft2-pc-version] Ignoring non-existent file
 >>
 >> 
 > 
 "/usr/pkgsrc/pkgtools/x11-links/work/.x11-buildlink/lib/pkgconfig/freetype2.pc".
 >
 >  So, that apparently comes from freetype2's builtin.mk.
 >  
 >  When some builtin.mk fails to do its thing, the first thing to check is:
 >     % make show-var VARNAME=IS_BUILTIN.freetype2

 "yes"

 >     % make show-var VARNAME=USE_BUILTIN.freetype2

 "no"


 >  If IS_BUILTIN is no, then the question is why it's not finding it; if
 >  USE_BUILTIN is no, the question is why it's rejecting it.

 Good question. Any ideas how to debug that further?


 >  Also, check to make sure that X11BASE is set correctly...

 I'm not sure how to do that. I have never set X11BASE on any NetBSD system
 in the past when compiling pkgsrc. And I always use the built-in Xorg, not
 the pkgsrc one.

 -- 
 Frank Wille

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52190: building graphics/cairo doesn't find ft2build.h
Date: Sat, 5 May 2018 22:50:42 +0000

 On Tue, May 01, 2018 at 07:45:01PM +0000, Frank Wille wrote:
  >>  So, that apparently comes from freetype2's builtin.mk.
  >>  
  >>  When some builtin.mk fails to do its thing, the first thing to check is:
  >>     % make show-var VARNAME=IS_BUILTIN.freetype2
  >  
  >  "yes"
  >  
  >>     % make show-var VARNAME=USE_BUILTIN.freetype2
  >  
  >  "no"
  >  
  >  
  >>  If IS_BUILTIN is no, then the question is why it's not finding it; if
  >>  USE_BUILTIN is no, the question is why it's rejecting it.
  >  
  >  Good question. Any ideas how to debug that further?

 It is almost always a giant pain.

 (1) Check the value of BUILTIN_PKG.freetype2, which includes the
 version that builtin.mk thinks it's found. Compare this to
 BUILDLINK_API_DEPENDS.freetype2. If it's too low, you need to figure
 out if that's a real problem (in which case you effectively can't use
 the native version, but pkgsrc ought to build the pkgsrc version for
 you, and I'm not sure why that's not happening) or if builtin.mk is
 generating rubbish. On current I get freetype2-2.6.3 and in cairo at
 least the requirement is >= 2.4.5.

 (2) Check if freetype2 appears in FORCED_PKGSRC, which is the list of
 packages for which the builtin version is itself ok but the package
 depends on something that needs to come from pkgsrc. If it's in there,
 the variable FORCED_PKGSRC_REASONS (which I added recently and may not
 be in the stable branch, I forget) will tell you which package
 triggered it. This shouldn't be happening because freetype2 doesn't
 depend on anything but zlib, but...

 (3) Make sure PREFER.freetype2 didn't somehow get set to "pkgsrc".

 AFAICR that should cover the possibilities...

  >  >  Also, check to make sure that X11BASE is set correctly...
  >  
  >  I'm not sure how to do that. I have never set X11BASE on any NetBSD system
  >  in the past when compiling pkgsrc. And I always use the built-in Xorg, not
  >  the pkgsrc one.

 make show-var VARNAME=X11BASE

 if you haven't done anything it should be /usr/X11R7, but if for some
 reason it's not that would explain a lot of weirdness.

 BTW, it looks like the pkgconfig fixup thing you mentioned earlier is
 failing only because x11-links isn't providing the freetype2 links,
 and if we can fix that it should resolve itself.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Frank Wille <frank@phoenix.owl.de>
To: gnats-bugs@NetBSD.org,
	pkg-manager@netbsd.org,
	gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52190: building graphics/cairo doesn't find ft2build.h
Date: Sun, 06 May 2018 11:02:16 +0200

 David Holland wrote:

 >  (1) Check the value of BUILTIN_PKG.freetype2, which includes the
 >  version that builtin.mk thinks it's found.

 freetype2-2.4.3


 >  Compare this to BUILDLINK_API_DEPENDS.freetype2.

 It emits three results:
 freetype2>=2.4.5 freetype2>=2.1.3 freetype2>=2.1.3

 Can I find out where the first dependency is coming from?


 >  If it's too low, you need to figure out if that's a real problem

 The first one, "freetype2>=2.4.5", would be a real problem, I guess?


 > (in which case you effectively can't use
 >  the native version, but pkgsrc ought to build the pkgsrc version for
 >  you, and I'm not sure why that's not happening)

 Hmm.  This is a 7.1_STABLE system and pkgsrc is 2017Q1. I don't remember
 when 7.1 was released, but I wouldn't think that it is much too old for
 2017Q1.


 >  (2) Check if freetype2 appears in FORCED_PKGSRC,

 No. There's nothing.


 >  (3) Make sure PREFER.freetype2 didn't somehow get set to "pkgsrc".

 It is "native".


 >  make show-var VARNAME=X11BASE
 >  
 >  if you haven't done anything it should be /usr/X11R7,

 Correct. That's the case.


 -- 
 Frank Wille

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.