How to get gps.h into a Yocto recipe build? - gcc

I've built a simple recipe which works as long as I don't need gps.h:
recipes/foo (dunfell) $ cat foo_3.0.0.bb
DESCRIPTION = "FOO Daemon"
LICENSE = "CLOSED"
SRC_URI = " file://*.* \
"
S = "${WORKDIR}"
INSANE_SKIP_${PN} = "ldflags"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
do_compile() {
cd ${S}/src
make
cp foo ~/
cd -
}
do_install() {
install -d ${D}${bindir}
install -m 0755 foo ${D}${bindir}
}
gps.h is in /usr/include on my local machine, but as Yocto is cross-compiling it provides a reasonable explanation of why it can't use the local /usr/include/gps.h:
cc1: error: include location "/usr/include" is unsafe for cross-compilation [-Werror=poison-system-directories]
foo.c:54:10: fatal error: gps.h: No such file or directory
54 | #include <gps.h>
| ^~~~~~~
cc1: all warnings being treated as errors
I've tried IMAGE_INSTALL_append " libgps-dev" and " gps-lib-dev" in my layer.conf but neither of those work.
How can I get the gps.h header into my Yocto project/recipe at build time?

Let me copy your recipe and add some comments first:
DESCRIPTION = "FOO Daemon"
LICENSE = "CLOSED"
# --- COMMENT ---
# It is not recommended to use "*" with SRC_URI,
# as Yocto will not keep track of your files if you edit them
# so it will never rebuild automaticall after a change
# Best practice is to sepecify the local files like:
# SRC_URI = "file://src"
# This will make bitbake unpacks the "src" folder into ${WORKDIR}
# --- COMMENT ---
SRC_URI = " file://*.* \
"
# --- COMMENT ---
# The ${S} variable is the defautl workind directory for compilation tasks,
# do_configure, do_compile, ...,
# So, if you have "src" folder that will be unpacked into ${WORKDIR}
# you need to set S to that:
# S = "${WORKDIR}/src"
# --- COMMENT ---
S = "${WORKDIR}"
INSANE_SKIP_${PN} = "ldflags"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
# --- COMMENT ---
# If your project has a "Makefile" you can use the "autotools" class
# it runs oe_runmake automatically
# inherit autotools
# If you want to copy the output to your home directory you can do it in "do_install"
# If you use autotools you do not need do_compile
# --- COMMENT ---
do_compile() {
cd ${S}/src
make
cp foo ~/
cd -
}
do_install() {
install -d ${D}${bindir}
install -m 0755 foo ${D}${bindir}
}
# --- COMMENT ---
# Do not forget to specify your output files into FILES for do_package to work well
# FILES_${PN} = "${bindir}/foo"
# --- COMMENT ---
Now, after dealing with that, if your recipe requires something at build-time, than the dependency needs to exist in the same recipe's workding directory, because if you are adding libgps into IMAGE_INSTALL it will be present in the rootfs but not during your build time.
So, to do that, you need to specify the dependencies recipe with DEPENDS.
I have looked for gps.h and I found it packages with gpsd recipe.
So, try:
DEPENDS += "gpsd"
So, the final recipe would look like the following:
DESCRIPTION = "FOO Daemon"
LICENSE = "CLOSED"
SRC_URI = "file://src"
S = "${WORKDIR}/src"
DEPENDS += "gpsd"
inherit autotools
do_install(){
install -d ${D}${bindir}
install -m 0755 foo ${D}${bindir}
cp foo ~/
}
FILES_${PN} = "${bindir}/foo"
The only thing left is to test.

Related

Yocto do_install action not performed

here is my bbappend file.
LICENSE = "MIT"
IMAGE_LINGUAS = " "
# User preferences
inherit extrausers
# Change root password (note the capital -P)
EXTRA_USERS_PARAMS = "\
usermod -P toor root; \
useradd -P michael -G sudo michael; \
useradd -P nfi -G sudo nfi; \
"
# uncomment the line %sudo ALL=(ALL) ALL in /etc/sudoers
modify_sudoers() {
sed 's/# %sudo/%sudo/' < ${IMAGE_ROOTFS}${sysconfdir}/sudoers > ${IMAGE_ROOTFS}${sysconfdir}/sudoers.tmp
mv ${IMAGE_ROOTFS}${sysconfdir}/sudoers.tmp ${IMAGE_ROOTFS}${sysconfdir}/ROOTFS
}
sudoers_POSTPROCESS_COMMAND_append = " modify_sudoers;"
IMAGE_INSTALL = "base-files \
base-passwd \
busybox \
mtd-utils \
mtd-utils-ubifs \
libconfig \
swupdate \
swupdate-www \
${#bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts systemd', d)} \
util-linux-sfdisk \
mmc-utils \
e2fsprogs-resize2fs \
lua \
debugconfigs \
"
IMAGE_FSTYPES = "ext4.gz.u-boot ext4 cpio.gz.u-boot"
PACKAGE_EXCLUDE += " jailhouse kernel-module-jailhouse libncursesw5 libpanelw5 libpython3 python3* perl* apt dpkg "
SRC_URI += "file://set-ttymxc0-permissions.sh"
do_install() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/set-ttymxc0-permissions.sh ${D}${sysconfdir}/init.d/
}
addtask install after do_build
I am using SWUpdate. I can build their kernel and run it on my device. However I cannot login as root or any user I have created. It seems this could be related to user permissions in the getty serial terminal ttymxc0. So I am attempting to add a script to init.d. The script contains
#!/bin/sh
# Set permissions on ttymxc0
chmod 660 /dev/ttymxc0
chown root:tty /dev/ttymxc0
The bitbake file I am appending to is swupdate-image.bb. This file does not do much. It does not have a do_install section. So I am attempting to add one. However it is never run. Can anyone speculate as to why?
You actually noticed that the file swupdate-image.bb require an other file swupdate-image.inc.
You should pay attention to this line:
${#bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts systemd', d)} \
${#bb.utils.contains() is a (Python) function. Basically it will check the SWUPDATE_INIT variable, if there is a match with tiny then it will return virtual/initscripts-swupdate to IMAGE_INSTALL. Else, it will return initscripts systemd to IMAGE_INSTALL.
So you should only set your variable SWUPDATE_INIT= "tiny" in a .bbappend file.
Adding this should install rcS.swupdate in your final image according to initscripts-swupdate recipe:
https://github.com/sbabic/meta-swupdate/blob/master/recipes-core/initscripts-swupdate/initscripts-swupdate-usb.bb
N.B: I have noticed that you added resize2fs. If you want to add this binary make sure that the right kernel flag is set ! You will more likely need to create a .bbappend file and add the following :
EXTRA_OECONF_append_class-target = " --enable-resizer"

Yocto image is not adding the files to rootfs

I want to create a new folder in "/etc", as following
/etc
----/shared
-----------example.txt
I created a new recipe in a custom yocto layer. The recipe is under a folder meta-own\recipes-own\shared and the structure of recipes-own is:
.
├── files
│ ├── example.txt
└── shared_configuration_1.0.bb
and the recipe is:
DESCRIPTION = "Script for copying example configurations"
SUMMARY = "example configurations"
LICENSE = "CLOSED"
SRC_URI = "file://example.txt"
do_install_append() {
install -dm644 ${D}${sysconfdir}/shared
install -m 0755 ${WORKDIR}/example.txt ${D}${sysconfdir}/example.txt
FILES_${PN} = "\
${sysconfdir} \
"
When I add the recipe to my recipes-core/images/example-image.bb:
IMAGE_INSTALL_append = " \
bash \
util-linux \
shared_configuration \
"
it outputs me always:
ERROR: Nothing RPROVIDES
But if I don't place it in the example-image, it is running through but the file is not copied.
Try to rename shared_configuration to shared-configuration because after the underscore should be the version of the recipe.
[EDIT]
.
├── files
│ ├── example.txt
└── shared-configuration_1.0.bb
IMAGE_INSTALL_append = " \
bash \
util-linux \
shared-configuration \
"
And the recipe:
DESCRIPTION = "Script for copying example configurations"
SUMMARY = "example configurations"
LICENSE = "CLOSED"
SRC_URI = "file://example.txt"
do_install_append() {
install -d 644 ${D}${sysconfdir}
install -m 0755 ${WORKDIR}/example.txt ${D}${sysconfdir}
FILES_${PN} = "${sysconfdir}"

How to call Makefile recipe/rule multiple times?

With the following example:
.PHONY: hook1 hook2
# Default target
all: hook1 hook2 hook1
echo "Calling all"
hook1:
echo "Calling hook1"
hook2:
echo "Calling hook2"
I got the output:
$ make
echo "Calling hook1"
Calling hook1
echo "Calling hook2"
Calling hook2
echo "Calling all"
Calling all
But I would expect it to call the rule hook1 two times. This is because on Latex, I need to call the same program with the same command line, multiple times. Then I would like to reuse the make rules. For example, I would expect the above minimal code to be ran as:
$ make
echo "Calling hook1"
Calling hook1
echo "Calling hook2"
Calling hook2
echo "Calling hook1"
Calling hook1
echo "Calling all"
Calling all
Which call the same rule twice. This is code bellow my full main Makefile code, if anyone is interested. I tried to create the dummy rules pdflatex_hook1 and pdflatex_hook2 so I could do the call hierarchy pdflatex_hook biber_hook pdflatex_hook, but this do not fooled make and it still ignoring my last call to pdflatex_hook2:
#!/usr/bin/make -f
# https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang
ECHOCMD:=/bin/echo -e
# The main latex file
THESIS_MAIN_FILE = modelomain.tex
# This will be the pdf generated
THESIS_OUTPUT_NAME = thesis
# This is the folder where the temporary files are going to be
CACHE_FOLDER = setup/cache
# Find all files ending with `main.tex`
LATEX_SOURCE_FILES := $(wildcard *main.tex)
# Create a new variable within all `LATEX_SOURCE_FILES` file names ending with `.pdf`
LATEX_PDF_FILES := $(LATEX_SOURCE_FILES:.tex=.pdf)
# GNU Make silent by default
# https://stackoverflow.com/questions/24005166/gnu-make-silent-by-default
MAKEFLAGS += --silent
.PHONY: clean pdflatex_hook1 pdflatex_hook2 %.pdf %.tex
# How do I write the 'cd' command in a makefile?
# http://stackoverflow.com/questions/1789594/how-do-i-write-the-cd-command-in-a-makefile
.ONESHELL:
# Default target
all: biber
##
## Usage:
## make <target>
##
## Targets:
## biber build the main file with bibliography pass
## pdflatex build the main file with no bibliography pass
##
# Print the usage instructions
# https://gist.github.com/prwhite/8168133
help:
#fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Where to find official (!) and extended documentation for tex/latex's commandline options (especially -interaction modes)?
# https://tex.stackexchange.com/questions/91592/where-to-find-official-and-extended-documentation-for-tex-latexs-commandlin
PDF_LATEX_COMMAND = pdflatex --time-statistics --synctex=1 -halt-on-error -file-line-error
LATEX = $(PDF_LATEX_COMMAND)\
--interaction=batchmode\
-jobname="$(THESIS_OUTPUT_NAME)"\
-output-directory="$(CACHE_FOLDER)"\
-aux-directory="$(CACHE_FOLDER)"
# Run pdflatex, biber, pdflatex
biber: biber_hook pdflatex_hook2
# Calculate the elapsed seconds and print them to the screen
. ./setup/scripts/timer_calculator.sh
showTheElapsedSeconds "$(current_dir)"
# Internally called rule which does not attempt to show the elapsed time
biber_hook: pdflatex_hook1
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
biber "$(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME)"
# This rule will be called for every latex file and pdf associated
pdflatex: $(LATEX_PDF_FILES)
# Calculate the elapsed seconds and print them to the screen
. ./setup/scripts/timer_calculator.sh
showTheElapsedSeconds "$(current_dir)"
# Not show the elapsed time when called internally
pdflatex_hook1: $(LATEX_PDF_FILES)
pdflatex_hook2: $(LATEX_PDF_FILES)
%.pdf: %.tex
# Start counting the compilation time and import its shell functions
. ./setup/scripts/timer_calculator.sh
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
#$(LATEX) $<
cp $(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME).pdf $(current_dir)/$(THESIS_OUTPUT_NAME).pdf
Here when I call the rule make biber I got the output:
$ make biber
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6400)
entering extended mode
gross execution time: 62751 ms
user mode: 58406 ms, kernel mode: 1359 ms, total: 59765
INFO - This is Biber 2.7
INFO - Logfile is 'setup/cache/thesis.blg'
INFO - Reading 'setup/cache/thesis.bcf'
INFO - Found 14 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'modeloreferences.bib' for section 0
INFO - Decoding LaTeX character macros into UTF-8
INFO - Found BibTeX data source 'modeloreferences.bib'
INFO - Overriding locale 'pt-BR' defaults 'normalization = NFD' with 'normalization = prenormalized'
INFO - Overriding locale 'pt-BR' defaults 'variable = shifted' with 'variable = non-ignorable'
INFO - Sorting list 'nty/global/' of type 'entry' with scheme 'nty' and locale 'pt-BR'
INFO - No sort tailoring available for locale 'pt-BR'
INFO - Writing 'setup/cache/thesis.bbl' with encoding 'UTF-8'
INFO - Output to setup/cache/thesis.bbl
Could not calculate the seconds to run
Which is missing the second call to the rule pdflatex_hook2, only the first call to pdflatex_hook1 is being performed.`
I already know about latexmk and use it, but for biber above I would like to do these calls as they are. For latexmk I use this recipe/rule:
thesis: $(THESIS_MAIN_FILE)
# Start counting the compilation time and import its shell functions
. ./setup/scripts/timer_calculator.sh
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
# What is the difference between “-interaction=nonstopmode” and “-halt-on-error”?
# https://tex.stackexchange.com/questions/258814/what-is-the-difference-between-interaction-nonstopmode-and-halt-on-error
#
# What reasons (if any) are there for compiling in interactive mode?
# https://tex.stackexchange.com/questions/25267/what-reasons-if-any-are-there-for-compiling-in-interactive-mode
latexmk \
-pdf \
-silent \
-jobname="$(THESIS_OUTPUT_NAME)" \
-output-directory="$(CACHE_FOLDER)" \
-aux-directory="$(CACHE_FOLDER)" \
-pdflatex="$(PDF_LATEX_COMMAND) --interaction=batchmode" \
-use-make $(THESIS_MAIN_FILE)
# Copy the generated PDF file from the cache folder
cp $(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME).pdf $(current_dir)/$(THESIS_OUTPUT_NAME).pdf
# Calculate the elapsed seconds and print them to the screen
showTheElapsedSeconds "$(current_dir)"
Related questions:
Change a make variable, and call another rule, from a recipe in same Makefile?
How to manually call another target from a make target?
multiple targets from one recipe and parallel execution
To answer your initial question:
.PHONY: hook1 hook2
# Default target
all: hook1a hook2 hook1b
echo "Calling all"
hook1a hook1b:
echo "Calling hook1"
hook2:
echo "Calling hook2"
Produces the following output:
echo "Calling hook1"
Calling hook1
echo "Calling hook2"
Calling hook2
echo "Calling hook1"
Calling hook1
echo "Calling all"
Calling all
As illustrated in make recipe execute twice
Based on #David White answer I fixed my main script with the double recursion:
#!/usr/bin/make -f
# https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang
ECHOCMD:=/bin/echo -e
# The main latex file
THESIS_MAIN_FILE = modelomain.tex
# This will be the pdf generated
THESIS_OUTPUT_NAME = thesis
# This is the folder where the temporary files are going to be
CACHE_FOLDER = setup/cache
# Find all files ending with `main.tex`
LATEX_SOURCE_FILES := $(wildcard *main.tex)
# Create a new variable within all `LATEX_SOURCE_FILES` file names ending with `.pdf`
LATEX_PDF_FILES := $(LATEX_SOURCE_FILES:.tex=.pdf)
# GNU Make silent by default
# https://stackoverflow.com/questions/24005166/gnu-make-silent-by-default
MAKEFLAGS += --silent
.PHONY: clean biber pdflatex_hook1 pdflatex_hook2
# How do I write the 'cd' command in a makefile?
# http://stackoverflow.com/questions/1789594/how-do-i-write-the-cd-command-in-a-makefile
.ONESHELL:
# Default target
all: thesis
##
## Usage:
## make <target>
##
## Targets:
## all call the `thesis` make rule
## biber build the main file with bibliography pass
## latex build the main file with no bibliography pass
## thesis completely build the main file with minimum output logs
## verbose completely build the main file with maximum output logs
##
# Print the usage instructions
# https://gist.github.com/prwhite/8168133
help:
#fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Where to find official (!) and extended documentation for tex/latex's commandline options (especially -interaction modes)?
# https://tex.stackexchange.com/questions/91592/where-to-find-official-and-extended-documentation-for-tex-latexs-commandlin
PDF_LATEX_COMMAND = pdflatex --time-statistics --synctex=1 -halt-on-error -file-line-error
LATEX = $(PDF_LATEX_COMMAND)\
--interaction=batchmode\
-jobname="$(THESIS_OUTPUT_NAME)"\
-output-directory="$(CACHE_FOLDER)"\
-aux-directory="$(CACHE_FOLDER)"
# Run pdflatex, biber, pdflatex
biber: start_timer pdflatex_hook1 biber_hook pdflatex_hook2
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
# Copies the PDF to the current folder
cp $(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME).pdf $(current_dir)/$(THESIS_OUTPUT_NAME).pdf
# Calculate the elapsed seconds and print them to the screen
. ./setup/scripts/timer_calculator.sh
showTheElapsedSeconds "$(current_dir)"
start_timer:
# Start counting the elapsed seconds to print them to the screen later
. ./setup/scripts/timer_calculator.sh
# Internally called rule which does not attempt to show the elapsed time
biber_hook:
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
# Call biber to process the bibliography
biber "$(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME)"
# How to call Makefile recipe/rule multiple times?
# https://stackoverflow.com/questions/46135614/how-to-call-makefile-recipe-rule-multiple-times
pdflatex_hook1 pdflatex_hook2:
#$(LATEX) $(LATEX_SOURCE_FILES)
# This rule will be called for every latex file and pdf associated
latex: $(LATEX_PDF_FILES)
# Calculate the elapsed seconds and print them to the screen
. ./setup/scripts/timer_calculator.sh
showTheElapsedSeconds "$(current_dir)"
# Dynamically generated recipes for all PDF and latex files
%.pdf: %.tex
# Start counting the compilation time and import its shell functions
. ./setup/scripts/timer_calculator.sh
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
#$(LATEX) $<
cp $(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME).pdf $(current_dir)/$(THESIS_OUTPUT_NAME).pdf
thesis: $(THESIS_MAIN_FILE)
# Start counting the compilation time and import its shell functions
. ./setup/scripts/timer_calculator.sh
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
# What is the difference between “-interaction=nonstopmode” and “-halt-on-error”?
# https://tex.stackexchange.com/questions/258814/what-is-the-difference-between-interaction-nonstopmode-and-halt-on-error
#
# What reasons (if any) are there for compiling in interactive mode?
# https://tex.stackexchange.com/questions/25267/what-reasons-if-any-are-there-for-compiling-in-interactive-mode
latexmk \
-pdf \
-silent \
-jobname="$(THESIS_OUTPUT_NAME)" \
-output-directory="$(CACHE_FOLDER)" \
-aux-directory="$(CACHE_FOLDER)" \
-pdflatex="$(PDF_LATEX_COMMAND) --interaction=batchmode" \
-use-make $(THESIS_MAIN_FILE)
# Copy the generated PDF file from the cache folder
cp $(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME).pdf $(current_dir)/$(THESIS_OUTPUT_NAME).pdf
# Calculate the elapsed seconds and print them to the screen
showTheElapsedSeconds "$(current_dir)"
verbose: $(THESIS_MAIN_FILE)
# Start counting the compilation time and import its shell functions
. ./setup/scripts/timer_calculator.sh
# Creates the shell variable `current_dir` within the current folder path
$(eval current_dir := $(shell pwd)) echo $(current_dir) > /dev/null
# What is the difference between “-interaction=nonstopmode” and “-halt-on-error”?
# https://tex.stackexchange.com/questions/258814/what-is-the-difference-between-interaction-nonstopmode-and-halt-on-error
#
# What reasons (if any) are there for compiling in interactive mode?
# https://tex.stackexchange.com/questions/25267/what-reasons-if-any-are-there-for-compiling-in-interactive-mode
latexmk \
-pdf \
-jobname="$(THESIS_OUTPUT_NAME)" \
-output-directory="$(CACHE_FOLDER)" \
-aux-directory="$(CACHE_FOLDER)" \
-pdflatex="$(PDF_LATEX_COMMAND) --interaction=nonstopmode" \
-use-make $(THESIS_MAIN_FILE)
# Copy the generated PDF file from the cache folder
cp $(CACHE_FOLDER)/$(THESIS_OUTPUT_NAME).pdf $(current_dir)/$(THESIS_OUTPUT_NAME).pdf
# Calculate the elapsed seconds and print them to the screen
showTheElapsedSeconds "$(current_dir)"
# Using Makefile to clean subdirectories
# https://stackoverflow.com/questions/26007005/using-makefile-to-clean-subdirectories
#
# Exclude directory from find . command
# https://stackoverflow.com/questions/4210042/exclude-directory-from-find-command
GARBAGE_TYPES := "*.gz(busy)" *.aux *.log *.pdf *.aux *.bbl *.log *.out *.toc *.dvi *.blg\
*.synctex.gz *.fdb_latexmk *.fls *.lot *.lol *.lof *.idx
DIRECTORIES_TO_CLEAN := $(shell /bin/find -not -path "./**.git**" -not -path "./pictures**" -type d)
GARBAGE_TYPED_FOLDERS := $(foreach DIR, $(DIRECTORIES_TO_CLEAN), $(addprefix $(DIR)/,$(GARBAGE_TYPES)))
clean:
rm -rfv $(GARBAGE_TYPED_FOLDERS)
# veryclean:
# git clean -dxf

Package xkbcommon was not found in the pkg-config search path. when building Yocto image

On Ubuntu 14.04
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
Building a Yocto Poky image using the fido branch
inherit core-image
IMAGE_FEATURES += "x11-base x11-sato package-management ssh-server-dropbear"
IMAGE_INSTALL += "chromium \
lsb \
kernel-modules \
alsa-utils \
... and I am getting this sort of message
I look like it related to the Chromium recipe /meta-browser/recipes-browser/chromium/chromium_45.0.2454.85.bb which starts as such
include chromium.inc
DESCRIPTION = "Chromium browser"
DEPENDS += "libgnome-keyring"
and I get this message
ERROR: Logfile of failure stored in: /home/joel/yocto/build-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/45.0.2454.85-r0/temp/log.do_configure.28622
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: Executing shell function do_configure
| Updating projects from gyp files...
| Package xkbcommon was not found in the pkg-config search path.
| Perhaps you should add the directory containing `xkbcommon.pc'
| to the PKG_CONFIG_PATH environment variable
| No package 'xkbcommon' found
| gyp: Call to 'pkg-config --cflags xkbcommon' returned exit status 1.
| WARNING: exit code 1 from a shell command.
What I have tried
Installed the library
$ sudo apt-get install libxkbcommon-x11-dev
Search for xkbcommon.pc
$ apt-file search xkbcommon.pc
libxkbcommon-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/xkbcommon.pc
pkg-config
joel#linux-Lenovo-G50-70:~/yocto/build-fido$ pkg-config --cflags xkbcommon
<=== Return is EMPTY (?)
joel#linux-Lenovo-G50-70:~/yocto/build-fido$ pkg-config --libs xkbcommon
-lxkbcommon <=== Looks correct
Added PKG_CONFIG_PATH
$ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig/
$ export PKG_CONFIG_PATH
$ env | grep PKG
PKG_CONFIG_PATH=:/usr/lib/x86_64-linux-gnu/pkgconfig/
but I am still getting the same message when running bitbake
Any suggestions?
Find xkbcommon
$ find /usr/lib/ -name *xkbcommon*
/usr/lib/x86_64-linux-gnu/libxkbcommon.so
/usr/lib/x86_64-linux-gnu/libxkbcommon.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.a
/usr/lib/x86_64-linux-gnu/libxkbcommon.a
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so
/usr/lib/x86_64-linux-gnu/pkgconfig/xkbcommon.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/xkbcommon-x11.pc
/usr/lib/x86_64-linux-gnu/libxkbcommon.so.0
In this case, it was the chromium recipe that failed to find libxkbcommon. As the error occurred when building a recipe for the target system, we need to tell the build system that the chromium recipe has a dependency on libxkbcommmon.
This can be done by adding
DEPENDS += "libxkbcommon"
to the chromium recipe.
It's worth noting, that libxkbcommon quite likely is an optional dependency, and in that case, it should be handled by a suitable PACKAGECONFIG. (See PACKAGECONFIG in ref.manual).
Note: I've never built chromium myself, thus I'd prefer to not suggest any suitable PACKAGECONFIG.
I think the Chromium_45 recipe is taken down since the last time I saw it (don't see it anymore).
Anyway, this is what I did to Chromium_40.
I have disabled Wayland (ozone-wayland in Chromium) so that it will only use x11.
In local.conf, I added
CHROMIUM_ENABLE_WAYLAND = "0"
By doing this, I will bypass CHROMIUM_WAYLAND_DEPENDS = "wayland libxkbcommon"
CHROMIUM_X11_DEPENDS = "xextproto gtk+ libxi libxss"
CHROMIUM_X11_GYP_DEFINES = ""
CHROMIUM_WAYLAND_DEPENDS = "wayland libxkbcommon"
CHROMIUM_WAYLAND_GYP_DEFINES = "use_ash=1 use_aura=1 chromeos=0 use_ozone=1"
python() {
if d.getVar('CHROMIUM_ENABLE_WAYLAND', True) == '1':
d.appendVar('DEPENDS', ' %s ' % d.getVar('CHROMIUM_WAYLAND_DEPENDS', True))
d.appendVar('GYP_DEFINES', ' %s ' % d.getVar('CHROMIUM_WAYLAND_GYP_DEFINES', True))
else:
d.appendVar('DEPENDS', ' %s ' % d.getVar('CHROMIUM_X11_DEPENDS', True))
d.appendVar('GYP_DEFINES', ' %s ' % d.getVar('CHROMIUM_X11_GYP_DEFINES', True))
}
P.S.: One more thing I found weird is use-egl.
PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2" is overrided with PACKAGECONFIG[use-egl] = "" so I have removed PACKAGECONFIG[use-egl] = "" from chromium.inc
PACKAGECONFIG ??= "use-egl"
# this makes sure the dependencies for the EGL mode are present; otherwise, the configure scripts
# automatically and silently fall back to GLX
PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"
# Additional PACKAGECONFIG options - listed here to avoid warnings
PACKAGECONFIG[component-build] = ""
PACKAGECONFIG[disable-api-keys-info-bar] = ""
PACKAGECONFIG[ignore-lost-context] = ""
PACKAGECONFIG[impl-side-painting] = ""
PACKAGECONFIG[use-egl] = ""
PACKAGECONFIG[kiosk-mode] = ""

How to Create Installation Script for Tcl Package

I have a Tcl package which consists of a couple modules, unit tests, and samples; which I am looking to distribute. I have searched, but not found any easy/simple way to create installation script for it. I looked at other packages such as Tclx and looks like they use autotools--an untouched territory for me. So, is autotools the only way? My target platforms are mostly Macs and Linux, but might expand to Windows in the future.
It seems I have to create my own setup script. Right now, it is very crude: copy files to a location. It works for me now. I will continue to enhance my setup script to fix bugs and add features as the need arise. Here is my setup.tcl
#!/usr/bin/tclsh
# Crude setup script for my package
# ======================================================================
# Configurable items
# ======================================================================
# Install dir: $destLib/$packagename
set destLib [file join ~ Library Tcl]
set packageName tcl_tools
# List of source/dest to install
set filesList {
argparser.tcl
dateutils.tcl
htmlutils.tcl
listutils.tcl
pkgIndex.tcl
samples/common.tcl
samples/dateutils_sample.tcl
samples/httputils_sample.tcl
samples/parse_by_example_demo_missing_parameter.tcl
samples/parse_by_example_demo.tcl
samples/parse_simple_demo.tcl
}
# ======================================================================
# Determine the destination lib dir
# ======================================================================
if {[llength $::argv] == 1} {
set destLib [lindex $::argv 0]
}
if {[lsearch $auto_path $destLib] == -1} {
puts "ERROR: Invalid directory to install. Must be one of these:"
puts "[join $auto_path \n]"
exit 1
}
set destLib [file join $destLib $packageName]
file mkdir $destLib
# ======================================================================
# Install
# ======================================================================
foreach source $filesList {
set dest [file join $destLib $source]
puts "Installing $dest"
# Create destination dir if needed
set destDir [file dirname $dest]
if {![file isdirectory $destDir]} { file mkdir $destDir }
# Copy
file copy $source $dest
}
puts "Done"

Resources