Bitbake does not include my recipe in build - build

I am trying to do something straightforward: add a new layer and a new recipe. I used the
bitbake-layers create-layer
command to create the layer, and added the layer directory path to BBLAYERS variable in BUILDDIR/conf/bblayers.conf.
layer.conf
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "myname-mytest"
BBFILE_PATTERN_myname-mytest = "^${LAYERDIR}/"
BBFILE_PRIORITY_myname-mytest = "6"
LAYERVERSION_myname-mytest = "1"
LAYERSERIES_COMPAT_myname-mytest = "sumo"
Added this in local.conf:
local.conf
IMAGE_INSTALL_APPEND = " mytest-app"
bitbake-layers show-recipes
shows my layer and recipe.
mytest-app:
meta-myname-mytest 1.0
Errors in my recipe are caught in the bitbake build, but without any error, no output is produced under WORKDIR/image or logs are produced under WORKDIR/temp!
Have done this on other platforms, and can't for the life of me tell what I am doing wrong. Thanks for any help!!

It's IMAGE_INSTALL_append, not IMAGE_INSTALL_APPEND. c.f. https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html#appending-and-prepending-override-style-syntax

For the new yocto version, you need to use
IMAGE_INSTALL:append
instead of
IMAGE_INSTALL_append
and you will be OK

Related

meson add existing dll as dependency

I want to add a dll as dependency to my own project under Windows.
I tried following:
lept_include = include_directories('../libs/tesseract')
lept_lib = '/g/programming/meson/libs/tesseract/liblept-5.dll'
lept_dep = declare_dependency(link_with:lept_lib, include_directories:lept_include)
executable('test1', 'main.cpp', dependencies: [boost_dep, lept_dep])
but got this error:
..\meson.build:25:0: ERROR: '/g/programming/meson/libs/tesseract/liblept-5.dll' is not a target.
I also tried this but dit not work either:
cc = meson.get_compiler('cpp')
lib_l1 = cc.find_library('liblept-5.dll', dirs : ['/g/programming/meson/libs/tesseract'])
lib_l2 = cc.find_library('liblept-5', dirs : ['/g/programming/meson/libs/tesseract'])
lib_l3 = cc.find_library('lept-5.dll', dirs : ['/g/programming/meson/libs/tesseract'])
lib_l4 = cc.find_library('lept-5', dirs : ['/g/programming/meson/libs/tesseract'])
How can I achieve this?
thanks
Amazingly lib_l4 = cc.find_library('lept-5', dirs : ['/cygdrive/g/programming/meson/libs/tesseract']) is working now. At first I was using MSYS for windows, now I tried CYGWIN and the lib was found.

output 'external/name/x/lib/lib.so' was not created using bazel make

I was trying to follow the example provided by Building Makefile using bazel
post to build an external package in envoy. In the WORKSPACE file I added the following:
new_git_repository(
name = "name",
remote = "remote.git",
build_file = "//foo/bazel/external:x.BUILD",
)
And foo/bazel/external/x.BUILD has the following contents:
load("#rules_foreign_cc//tools/build_defs:make.bzl", "make")
filegroup(
name = "m_srcs",
srcs = glob(["code/**"]),
)
make(
name = "foo_bar",
make_commands = ["make lib"],
lib_source = ":m_srcs",
shared_libraries = ["lib.so"],
)
and I set the visibility in foo/bazel/BUILD as package(default_visibility = ["//visibility:public"])
On executing bazel build -s #name//:foo_bar, I get the error that external/name/x/lib/lib.so was not created.
I checked the bazel-bin/external/name/x/logs/GNUMake.log and make completes successfully. I see that BUILD_TMPDIR directory has created lib.so. I think it should have been copied to EXT_BUILD_DEPS/lib, but I am not sure why it was not copied. Would appreciate any tips to debug the error.
Edited make command to manually copy the lib to expected folder - make_commands = ["make libs; cp lib.so $INSTALLDIR/lib/lib.so"]

How to create a qmake function that creates a custom make target?

I know that we have QMAKE_EXTRA_TARGETS to create new makefile targets, that is used as follows (as seen in http://blog.qt.io/blog/2008/04/16/the-power-of-qmake/):
conv.target=convert
conv.input=file.in
conv.output=file.out
conv.commands=convert.sh file.in file.out
QMAKE_EXTRA_TARGETS+=conv
In my case, convert.sh is used for multiple files and targets. I would like to create a method with arguments (target_name, input_file, output_file), that creates the task for me, so that I don't have to repeat the above lines.
The documentation on qmake is quite lacking, or I haven't found the correct source, but to my understanding, there are two types of functions in qmake: replace and test (http://doc.qt.io/qt-5/qmake-language.html#replace-functions) and we can create custom ones using defineReplace and defineTest.
I have tried:
defineTest(createConvertTask) {
custom.target = $$1
custom.input = $$2
custom.output = $$3
custom.commands = convert.sh $$2 > $$3
QMAKE_EXTRA_TARGETS += custom
}
but that doesn't really work, as after calling createConvertTask multiple times, QMAKE_EXTRA_TARGETS will just contain multiple copies of the string custom.
However, this
defineTest(createConvertTask) {
$$1.target = $$1
$$1.input = $$2
$$1.output = $$3
$$1.commands = convert.sh $$2 > $$3
QMAKE_EXTRA_TARGETS += $$1
}
fails with error example.pro:2: error: Left hand side of assignment must expand to exactly one word.
Any ideas on how to approach this?
1.Option: custom compiler
Use a custom compiler like this:
convert.input = LIST_OF_IN_FILES # note: no $$
convert.output = $${SOME_DIR}/${QMAKE_FILE_BASE}.ext
convert.commands = convert.sh ${QMAKE_FILE_IN} > $${SOME_DIR}/${QMAKE_FILE_BASE}.ext
convert.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += convert
The variables ${QMAKE_FILE_IN} contains the current input file, same as ${QMAKE_FILE_BASE} but without extension. Here, the output filenames are generated out of the input files. The CONFIG options tell qmake not to add the output files to the objects list and to add them as prerequisites of the main target. Additionally a make target compiler_convert_make_all will be generated.
Just add files:
LIST_OF_IN_FILES += file1 file2
and make
make compiler_convert_make_all
This option also adds all output files to the clean target (will be deleted on make clean.
2.Option: use eval() and export()
To use variables as left hand expression you can use the eval() function, that 'Evaluates the contents of the string using qmake syntax rules'.
eval($${1}.target = $$1)
Since this is done inside a function you need to export() all variables to the global scope.
eval(export($${1}.target))
Afterwards add target and export QMAKE_EXTRA_TARGETS as well:
QMAKE_EXTRA_TARGETS += $${1}
export(QMAKE_EXTRA_TARGETS)
Complete with a replace function, the return value will be added to the dependencies of the custom convert target:
convert.target = convert
defineReplace(createConvertTask) {
eval($${2}_custom.target = $$2)
eval($${2}_custom.depends = $$1)
eval($${2}_custom.commands = convert.sh $$1 > $$2)
eval(export($${2}_custom.target))
eval(export($${2}_custom.depends))
eval(export($${2}_custom.commands))
QMAKE_EXTRA_TARGETS += $${2}_custom
export(QMAKE_EXTRA_TARGETS)
return($${2}_custom)
}
convert.depends += $$createConvertTask(in_file_1, out_file_1)
convert.depends += $$createConvertTask(in_file_2, out_file_2)
QMAKE_EXTRA_TARGETS += convert
The results in the generated Makefile:
out_file_1: in_file_1
convert.sh in_file_1 > out_file_1
out_file_2: in_file_2
convert.sh in_file_2 > out_file_2
convert: out_file_1 out_file_2
This approach is more flexible and can be extended to support the a variable target parameter (here constant convert).

Using Mixins with Foundation 5

I've just installed Foundation 5 with Sass and am using Compass to watch my stylesheets. I wanted to know what's the best practice for adding my custom styles. I've already created a custom.scss file and am referencing it using #import "custom"; in my app.scss file.
If I wanted to go ahead and change the background colour of the body, for example, how would I go about doing this using the mixins. I'm adding:
$body-bg: red;
to my custom.scss file, but the body's background isn't changing. Should I just edit the _settings.scss file, that seems wrong...
Any idea what I'm doing wrong? Thanks in advance!
Here's my config.rb:
# Require any additional compass plugins here.
add_import_path "bower_components/foundation/scss"
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "javascripts"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
In your case maybe would be better use these structure:
app.scss:
#import "custom"; //where you define variables for foundation such as $body-bg: red;
#import "foundation";
#import "other styles";
Yes, I've always just edited the _settings.scss file -- then use a decent file comparison (like Araxis Merge or Kaleidoscope to merge in new options as updates are made). If I have custom variables, I'll stick those at the top of the settings file (that need to effect both the settings and my global stuff after the fact).

SCons: How can I attach a listener?

I need to attach to the SCons build in order to be notified when things happened during it: file compilation, files linkage, etc.
I know similar is possible for ANT builds via -listener option. Could you please tell how to do it for SCons builds?
When targets are built in SCons, you can associate a post action via the AddPostAction(target, action) function as documented here.
Here is a simple example with a python function action:
# Create yourAction here:
# can be a python function or external (shell) command line
def helloWorldAction(target = None, source = None, env = None):
'''
target: a Node object representing the target file
source: a Node object representing the source file
env: the construction environment used for building the target file
The target and source arguments may be lists of Node objects if there
is more than one target file or source file.
'''
print "PostAction for target: %s" % str(target)
# you can get a map of the source files like this:
# source_file_names = map(lambda x: str(x), source)
# compilation options, etc can be retrieved from the env
return 0
env = Environment()
progTarget = env.Program(target = "helloWorld", source = "helloWorld.cc")
env.AddPostAction(progTarget, helloWorldAction)
# Or create the action object like this:
# a = Action(helloWorldAction)
Then, each time helloWorld is built, the helloWorldAction python function will be executed afterwords.
Regarding doing this without modifying the given SConstruct, I dont see how that would be possible.