Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 693714 - sys-apps/dtc should depend on dev-libs/libyaml - yamltree.c:23:10: fatal error: yaml.h: No such file or directory
Summary: sys-apps/dtc should depend on dev-libs/libyaml - yamltree.c:23:10: fatal erro...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-07 21:36 UTC by m.manico
Modified: 2020-07-06 22:40 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description m.manico 2019-09-07 21:36:21 UTC
When running

# armv7a-hardfloat-linux-gnueabi-emerge -avt sys-apps/dtc

emerge failed with

armv7a-hardfloat-linux-gnueabi-gcc -I libfdt -I . -O2 -pipe -fomit-frame-pointer -fPIC  -Wall -Wpointer-arith -Wcast-qual -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow -I/usr/include/valgrind  -o yamltree.o -c yamltree.c
yamltree.c:23:10: fatal error: yaml.h: No such file or directory
 #include <yaml.h>
          ^~~~~~~~
compilation terminated.
make: *** [Makefile:333: yamltree.o] Error 1
 * ERROR: sys-apps/dtc-1.5.0::gentoo failed (compile phase):


After running

armv7a-hardfloat-linux-gnueabi-emerge -avt dev-libs/libyaml

I was able to successfully emerge sys-apps/dtc
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-08 19:52:12 UTC
I think it's a case where host pkg-config was used against target:
    NO_YAML := $(shell $(PKG_CONFIG) --exists yaml-0.1; echo $$?)

We have 2 bugs here:
- automagic libyaml dependency
- missing PKG_CONFIG setting
Comment 2 David Michael 2020-02-04 17:08:07 UTC
I hit this error myself earlier.  The correct pkg-config can be set with the PKG_CONFIG environment variable.  Could something like this be done to disable the automatic feature?  (It would also be nice to have an EAPI 7 bump to use BDEPEND properly.)

--- sys-apps/dtc/dtc-1.5.0.ebuild
+++ sys-apps/dtc/dtc-1.5.0.ebuild
@@ -17,9 +17,10 @@
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="static-libs"
+IUSE="static-libs yaml"
 
 DEPEND="
+	yaml? ( dev-libs/libyaml )
 	sys-devel/bison
 	sys-devel/flex
 "
@@ -44,6 +45,7 @@
 		-e 's:-g -Os::' \
 		-e "/^PREFIX =/s:=.*:= ${EPREFIX}/usr:" \
 		-e "/^LIBDIR =/s:=.*:= \$(PREFIX)/$(get_libdir):" \
+		-e "/^NO_YAML :=/s/=.*/= $(usex yaml 0 1)/" \
 		Makefile || die
 
 	tc-export AR CC
Comment 3 Larry the Git Cow gentoo-dev 2020-07-06 22:40:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d79c54aba7eba3ca94367d9f864b066d7e04012

commit 3d79c54aba7eba3ca94367d9f864b066d7e04012
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-07-06 22:39:55 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-07-06 22:40:03 +0000

    sys-apps/dtc: add USE=yaml
    
    While at it added pkgconfig to build-time depends.
    
    Reported-by: m.manico@gmx.at
    Closes: https://bugs.gentoo.org/693714
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-apps/dtc/dtc-1.5.0-r1.ebuild | 64 ++++++++++++++++++++++++++++++++++++++++
 sys-apps/dtc/dtc-9999.ebuild     | 14 ++++++---
 sys-apps/dtc/metadata.xml        |  3 ++
 3 files changed, 77 insertions(+), 4 deletions(-)