Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

harbour formula can't find "cairo.h" using --with-x11 option #48341

Closed
endersonmaia opened this issue Jan 22, 2016 · 12 comments
Closed

harbour formula can't find "cairo.h" using --with-x11 option #48341

endersonmaia opened this issue Jan 22, 2016 · 12 comments

Comments

@endersonmaia
Copy link
Contributor

I'm having trouble compiling the Harbour formula using --with-x11.

I attached the logs of the failing build with homebrew.

There's a conversation that moght be relevant on vszakats/harbour-core#195.

✗ brew --version
Homebrew 0.9.5 (git revision dbb25; last commit 2016-01-21)

make.fail-with-homebrew.txt

@dunn
Copy link
Contributor

dunn commented Jan 23, 2016

Looks like the X11 build requires Cairo:

In file included from ../../../../../contrib/hbcairo/text.c:47:
../../../../../contrib/hbcairo/hbcairo.h:53:10: fatal error: 'cairo.h' file not found
#include "cairo.h"
         ^
In file included from ../../../../../contrib/hbcairo/ps.c:47:
../../../../../contrib/hbcairo/hbcairo.h:53:10: fatal error: 'cairo.h' file not found
#include "cairo.h"
         ^
1 error generated.
1 error generated.
In file included from ../../../../../contrib/hbcairo/util.c:47:
../../../../../contrib/hbcairo/hbcairo.h:53:10: fatal error: 'cairo.h' file not found
#include "cairo.h"
         ^
1 error generated.
In file included from ../../../../../contrib/hbcairo/surface.c:47:
../../../../../contrib/hbcairo/hbcairo.h:53:10: fatal error: 'cairo.h' file not found
#include "cairo.h"
         ^
1 error generated.
In file included from ../../../../../contrib/hbcairo/transfor.c:47:
../../../../../contrib/hbcairo/hbcairo.h:53:10: fatal error: 'cairo.h' file not found
#include "cairo.h"
         ^

Can you try adding a depends_on "cairo" to the formula and see if that works?

@endersonmaia
Copy link
Contributor Author

I added depends_on :cairo and it compiled fine.

I'm in doubt if it should be :

  • depends_on :cairo => :optional
  • depends_on :cairo if build.with? "x11"
  • depends_on :cairo => :optional if build.with? "x11"

/cc @vszakats

@vszakats
Copy link
Contributor

X11 support doesn't require cairo, but one independent component (hbcairo contrib) does, and if detected it will build against it.

@endersonmaia
Copy link
Contributor Author

@vszakats and hbcairo doesn't require X11, right ?

@vszakats
Copy link
Contributor

@endersonmaia correct, hbcairo depends on cairo only.

@endersonmaia
Copy link
Contributor Author

So, the question is, depends_on :cairo => :optional will allow homebrew's users to add --with-cairo when installing harbour.

But if cairo is already installed, the harbour build script will detect cairo and build the hbcairo contrib, even if it was not explicitly invoked --with-cairo ?

Should this be addressed for all Harbour's contribs ?

@vszakats
Copy link
Contributor

I'd think it should. If the goal is to tightly control Harbour's dependencies, maybe the best is to not let Harbour autodetect them, but pass location of headers via the HB_WITH_<COMPONENT> envvars, or the value no if we don't want it to find that specific component. (All this is only supposed to work with 3.4 HEAD, that includes the patch referenced in the linked 3.4 discussion)

Then cross fingers that everything pans out correctly.

@MikeMcQuaid
Copy link
Member

depends_on :cairo if build.with? "x11"

This seems like the easiest option.

If the goal is to tightly control Harbour's dependencies, maybe the best is to not let Harbour autodetect them, but pass location of headers via the HB_WITH_ envvars, or the value no if we don't want it to find that specific component.

This seems like the best option.

@endersonmaia
Copy link
Contributor Author

@vszakats I could't find HB_WITH_CAIRO on Harbour's README.

And when compiling it with just with HB_BUILD_CONTRIBS=cairo, through homebrew, libhbcairo.a wasn't available.

My strategy was have all contribs as :optional and to feed a contribs array for each --with-<contrib> during install.

And we end up with HB_BUILD_CONTRIBS=cairo [<other> ...]. before calling make.

@vszakats
Copy link
Contributor

It's intentional, README doesn't cover anything contrib related. Contribs are meant to be self-contained and managed independently from Harbour core.

HB_WITH_* macros are listed in .hbp files in their -depcontrol= lines. You can list them using command:

contrib $ grep HB_WITH_ $(find . -name *.hbp)

Using HB_BUILD_CONTRIBS= will merely tell the build process which contribs to deal with. It won't affect how/where/if their dependencies are detected. Also note that multiple contribs may depend on the same dependency.

@endersonmaia
Copy link
Contributor Author

Ok, I'll use that info and try to make a solution for the harbour formula when I get the time.

@MikeMcQuaid
Copy link
Member

If this is still broken: we'll accept PRs for this but we're not actively working on it at this time.

@Homebrew Homebrew locked and limited conversation to collaborators Aug 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants