confusing cairo.h error when gtk3 not provided
Hi,
Attempting to build from commit ddc3dc2d472aa0bb93ae0663b774734dfd94ab4b, and when not using gtksourceview-2, I get:
In file included from ../hiro/core/core.cpp:8,
from ../hiro/hiro.cpp:5:
../hiro/core/../gtk/header.hpp:34:12: fatal error: cairo.h: No such file or directory
34 | #include <cairo.h>
| ^~~~~~~~~
compilation terminated.
It looks like cairo.h's directory is not being added to include directories.
Adding gtk+ (v3) to the build resolves the issue. I'm not sure what that means, perhaps the cairo pkg-config dependencies were not satisfied on my system without it? (GNU Guix).
Just verified, the cairo pkg-config requirements are satisfied by the cairo package alone, so it propagates needed things correctly:
$ guix shell --container pkg-config cairo -- pkg-config --cflags cairo
[...]
-I/gnu/store/vj1rbvh8k32yc7a773lr25hf5mhha8ai-cairo-1.18.4/include/cairo -I/gnu/store/j36cca0pw872gxhfhxmj3icl1aax4yi3-fontconfig-minimal-2.14.0/include -I/gnu/store/f2fnd437xd4099gw7iqv6njk615xsf5y-expat-2.7.1/include -I/gnu/store/c291xzawzl3y81y5nzb480mmb5zkg6nj-freetype-2.13.3/include/freetype2 -I/gnu/store/1dlwzyjk51xbn1k7v7b010gidrxxvida-libpng-1.6.39/include/libpng16 -I/gnu/store/zi0sk0ir42360dnhfhmjp9pcg3gyi919-zlib-1.3.1/include -I/gnu/store/4nh5f9ran789jzf6ywd8zllwkhgans74-libxext-1.3.6/include -I/gnu/store/n55iqgnywara6ibmnca77wk76hhzjyw5-libxrender-0.9.12/include -I/gnu/store/008naskq2zc7dq93fpz4ard66qiyzywy-libx11-1.8.10/include -I/gnu/store/83ixxjndw57manc28cwxgj7yc3fmzqx6-libxcb-1.17.0/include -I/gnu/store/k3hngckmw3lp5r2aq2jb3hjrxhiyq330-libxau-1.0.12/include -I/gnu/store/naykzk2jnwpf94gbyd1rp3smjxql8b7b-libxdmcp-1.1.5/include -I/gnu/store/y8lks65p8vjxi6ds29kklgkyk2y6hiva-pixman-0.42.2/include/pixman-1 -I/gnu/store/zffxlhpj3lgrdxcny9phx7rld1bbzj1v-xorgproto-2024.1/include
I guess the hiro component should just search for cairo's pkg-config cflags, since it #includes it.
Hm, that's not needed, as it's pulled in by gtk+-3.0. Perhaps the build could error earlier for clarity when gtk3 is not found. Here's why it works:
$ guix shell --container pkg-config gtk+ -- pkg-config --cflags gtk+-3.0
-pthread -I/gnu/store/jd59bp9az0fbyrjniar2qd40il5ak4rd-gtk+-3.24.43/include/gtk-3.0 -I/gnu/store/3aa76zfwda25hqkg59jdmnkgnkvzas35-at-spi2-core-2.52.0/include/at-spi2-atk/2.0 -I/gnu/store/3aa76zfwda25hqkg59jdmnkgnkvzas35-at-spi2-core-2.52.0/include/at-spi-2.0 -I/gnu/store/3bsflk2cccmxn609imkbd3mm9f2qqz84-libxtst-1.2.5/include -I/gnu/store/9aqzn1gjxvnslzr48mmqc3jr8kw388gv-dbus-1.15.8/include/dbus-1.0 -I/gnu/store/9aqzn1gjxvnslzr48mmqc3jr8kw388gv-dbus-1.15.8/lib/dbus-1.0/include -I/gnu/store/rx9fvgchvhjf0bvlad6xsaxkszjw622m-glib-2.83.3/include -I/gnu/store/jd59bp9az0fbyrjniar2qd40il5ak4rd-gtk+-3.24.43/include/gtk-3.0 -I/gnu/store/rx9fvgchvhjf0bvlad6xsaxkszjw622m-glib-2.83.3/include/gio-unix-2.0 -I/gnu/store/09svzwj34qjz6h1p3fxj3nwshcaj6a42-libxi-1.8.2/include -I/gnu/store/jxna3z553n440y2a5c5v94zzv9fpvyk4-libxrandr-1.5.4/include -I/gnu/store/pra648i7g5jwkjbzlvz21bf3qj7q5a6z-libxcursor-1.2.3/include -I/gnu/store/mrh6iidn1fzq5abvjrfjczl38pgmfns6-libxcomposite-0.4.6/include -I/gnu/store/px3mz00p7l7zy06djy6hyrcccflghy6g-libxdamage-1.1.6/include -I/gnu/store/ry2c15chhf69pxm25196ga7291vh1f9j-libxinerama-1.1.5/include -I/gnu/store/90r6dz9v5c4irj45x99b1abfw2ih6986-libxkbcommon-1.6.0/include -I/gnu/store/d8z3aap403zn1y535a03vazp47bp4zhx-wayland-1.23.1/include -I/gnu/store/lqfi9pnsrfx4akpgh5xx27wz384zh76f-cairo-1.18.4/include -I/gnu/store/0gdjzah3hzgzj4hiib25dwsq3qxpkp82-libepoxy-1.5.10/include -I/gnu/store/4x4kxmwrjd9fmgzb7s5nj88p56wwhrdw-mesa-25.1.3/include -I/gnu/store/m38p6cj8d1x77saxknwiicab6k9y2aib-libxfixes-6.0.1/include -I/gnu/store/008naskq2zc7dq93fpz4ard66qiyzywy-libx11-1.8.10/include -I/gnu/store/83ixxjndw57manc28cwxgj7yc3fmzqx6-libxcb-1.17.0/include -I/gnu/store/rghcc2bkizf2xwlgp1hracij123lbwg5-libxxf86vm-1.1.6/include -I/gnu/store/zd37xi6n4lwdwvar9s8shc83dl05c3kx-libdrm-2.4.124/include -I/gnu/store/zd37xi6n4lwdwvar9s8shc83dl05c3kx-libdrm-2.4.124/include/libdrm -I/gnu/store/8krhi46fnvl15s8f2b60n4rfx5fhp0g0-libcloudproviders-minimal-0.3.6/include/cloudproviders -I/gnu/store/7s6ac2lx449p4csqr9md1pf3c232nki3-pango-1.54.0/include/pango-1.0 -I/gnu/store/8cnxnh04p4wcr2jvl1mwlmjazplb9q4i-harfbuzz-8.3.0/include/harfbuzz -I/gnu/store/7s6ac2lx449p4csqr9md1pf3c232nki3-pango-1.54.0/include/pango-1.0 -I/gnu/store/lhfqw72kmb7pnsf5xywdj4szy0f8dnhm-fribidi-1.0.12/include/fribidi -I/gnu/store/vh5i8vvfq5xx27lpc5jky00jj9f6db63-libthai-0.1.29/include -I/gnu/store/fij0r9gwidl2207nswki7h0r8klfl2vn-libdatrie-0.2.13/include -I/gnu/store/7phfihzxnyrd4i2v8jy4l4h4rc3vfiws-libxft-2.3.8/include -I/gnu/store/8cnxnh04p4wcr2jvl1mwlmjazplb9q4i-harfbuzz-8.3.0/include/harfbuzz -I/gnu/store/wxqdlb22gfn44kjdhlhvzhgffigh4wrg-graphite2-1.3.13/include -I/gnu/store/3aa76zfwda25hqkg59jdmnkgnkvzas35-at-spi2-core-2.52.0/include/atk-1.0 -I/gnu/store/lqfi9pnsrfx4akpgh5xx27wz384zh76f-cairo-1.18.4/include/cairo -I/gnu/store/j36cca0pw872gxhfhxmj3icl1aax4yi3-fontconfig-minimal-2.14.0/include -I/gnu/store/f2fnd437xd4099gw7iqv6njk615xsf5y-expat-2.7.1/include -I/gnu/store/c291xzawzl3y81y5nzb480mmb5zkg6nj-freetype-2.13.3/include/freetype2 -I/gnu/store/4nh5f9ran789jzf6ywd8zllwkhgans74-libxext-1.3.6/include -I/gnu/store/n55iqgnywara6ibmnca77wk76hhzjyw5-libxrender-0.9.12/include -I/gnu/store/008naskq2zc7dq93fpz4ard66qiyzywy-libx11-1.8.10/include -I/gnu/store/83ixxjndw57manc28cwxgj7yc3fmzqx6-libxcb-1.17.0/include -I/gnu/store/k3hngckmw3lp5r2aq2jb3hjrxhiyq330-libxau-1.0.12/include -I/gnu/store/naykzk2jnwpf94gbyd1rp3smjxql8b7b-libxdmcp-1.1.5/include -I/gnu/store/y8lks65p8vjxi6ds29kklgkyk2y6hiva-pixman-0.42.2/include/pixman-1 -I/gnu/store/q31dqnln6kd1wrlbqn0scn4yk3ffcxzw-gdk-pixbuf-2.42.12/include/gdk-pixbuf-2.0 -I/gnu/store/1dlwzyjk51xbn1k7v7b010gidrxxvida-libpng-1.6.39/include/libpng16 -I/gnu/store/qdc4r122cxy08vks5pdhsh9grsrkhd1v-libjpeg-turbo-2.1.4/include -I/gnu/store/c6rp834531gnd6cv3dh8r922b4h9afjp-libtiff-4.4.0/include -I/gnu/store/rx9fvgchvhjf0bvlad6xsaxkszjw622m-glib-2.83.3/include -I/gnu/store/zi0sk0ir42360dnhfhmjp9pcg3gyi919-zlib-1.3.1/include -I/gnu/store/mp1biwg967ivg8bff65qskyc88d1ypwc-util-linux-2.40.4-lib/include/libmount -I/gnu/store/mp1biwg967ivg8bff65qskyc88d1ypwc-util-linux-2.40.4-lib/include/blkid -I/gnu/store/rx9fvgchvhjf0bvlad6xsaxkszjw622m-glib-2.83.3/include -I/gnu/store/1y0ap95cw5d9n32510wlca3ldg9ncx10-libffi-3.4.6/include -I/gnu/store/rx9fvgchvhjf0bvlad6xsaxkszjw622m-glib-2.83.3/include/glib-2.0 -I/gnu/store/rx9fvgchvhjf0bvlad6xsaxkszjw622m-glib-2.83.3/lib/glib-2.0/include -I/gnu/store/fai25956abk0pjg4fk9pci57ff4s1km4-pcre2-10.42/include -I/gnu/store/zffxlhpj3lgrdxcny9phx7rld1bbzj1v-xorgproto-2024.1/include