Add lib to SDK generated from meta-toolchain-qt5 with Yocto - sdk

I'm building an core-image-minimal for my target with Yocto.
To build an application for it, I generate an SDK using:
bitbake meta-toolchain-qt5
It works fine, but the SDK do not include all the lib installed on my target.
So, I tried the following:
bitbake core-image-minimal -c populate_sdk
It generate an SDK, but when installed, it does not include all the files present in the SDK generated by meta-toolchain-qt5
In sysroots/cortex...gnueabi/usr/lib/qt5 there is no directory mkspecs.
So I would like to generate the SDK using meta-toolchain-sdk, with a meta-toolchain-sdk.bbappend file to add the lib that I need. How can I do that?
I want to include log4cxx and tried the following:
SDKIMAGE_FEATURES += "liblog4cxx10"
Could not find log4cxx files in the SDK :-(
Any ideas?
Thank you

Related

Using a static iOS library in a NativeScript 5.4 plugin

NativeScript 5.4.2
tns-core-modules 5.4.3
tns-ios 5.4.2
Xcode 10.2.1
I am attempting to create a plugin for this background geolocation library for iOS: https://github.com/Yermo/background-geolocation-ios
The project produces a static library, libBackgroundGeolocation.a.
I have read the documentation on how to use a static iOS library: https://docs.nativescript.org/plugins/Use-Native-iOS-Libraries#static-libraries
I have read about the required directory structure: https://docs.nativescript.org/plugins/plugin-reference#directory-structure
My plugin is based on the official plugin seed, so I have a demo directory and a src directory containing my plugin code and a platforms/ios directory under that.
I have copied the BackgroundGeolocation.a file into src/platforms/ios.
I have created a src/platforms/ios/include/BackgroundGeolocation directory and copied the public header files from the project into that directory.
I notice that src/platforms/ios/include/BackgroundGeolocation/module.modulemap file has been created.
In the plugin directory I can successfully run 'npm run build'.
However, from the demo directory if I run 'tns build ios' I consistently get a "ld: Library not found for -lBackgroundGeolocation" error.
If I rename the library to libBackgroundGeolocation.a I get the "ENOENT: no such file or directory, scandir '.....ios/include/libBackgroundGeolocation" so I surmise it's at least recognizing that the library is there.
I thought that maybe it was a path problem so I tried setting the library include path explicitly in build.xcconfig using the full path to the platforms/ios directory.
No joy. It still doesn't find the library but if I misspell the name of the directory in the -L in build.xcconfig it flags a directory not found error.
I then thought that maybe it had to do with the targets in the library so I followed the recipe here Build fat static library (device + simulator) using Xcode and SDK 4+ to include multiple targets.
Still no joy.
I suspect I am missing something fundamental.
What am I doing wrong?
Is there a working recent working sample somewhere of how to wrap a static iOS library as a NativeScript plugin?
It turns out adding
LIBRARY_SEARCH_PATHS = $(inherited) "$(SRCROOT)/../../node_modules/<projectname>/platforms/ios
to the src/platforms/ios/build.xcconfig file resolved this issue.

Yocto SDK with cmake toolchain file

I provide a Yocto SDK to cross-build an application for an embedded target. The application itself is built using CMake. The SDK setup script provides many necessary environment variables (like location of the cross-compiler, sysroot, etc.), which so far was enough to build the application.
However, since recently the application has a dependency to the Boost library (through the command find_package(Boost REQUIRED) in the CMakeLists.txt). Now CMake complains that it cannot find the library, even though it's installed in the SDK sysroot. But if I build the application directly in Yocto, it works fine.
After some research it turned out that Yocto generates a toolchain.cmake file which is added to the cmake call. In this file, the variable CMAKE_FIND_ROOT_PATH is set, which CMake needs to find libraries. Using such a toolchain file, I can also build using the SDK.
Now I'm wondering if Yocto provides any mechanism to export such a toolchain file with the SDK. Or alternatively if the SDK provides a script or something to automatically create a toolchain file directly on the SDK build host.
Or shall I just tell the users of the SDK to manually create a toolchain file and add it to their cmake call?
Assuming that you're using the image based SDK, i.e. building it with bitbake <image> -c populate_sdk, adding the following toimage.bb should fix it:
TOOLCHAIN_HOST_TASK += "nativesdk-cmake"
That should give you a OEToolchainConfig.cmake file in the SDK. After sourcing the SDK environment file, cmake will be an alias to cmake -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake to further help your developers.
I'd like to add to Anders answer that while it worked great for me to add nativesdk-cmake this way it did not work when I tried to add nativesdk-python3-numpy. After some googling I found this, suggesting that TOOLCHAIN_HOST_TASK has to be extended using _append instead of +=.

How to integrate .proto files in Xcode compilation?

I am trying to port an android app to ios and new to mac/xcode ecosystem. My app uses Google proto buffs and using instructions at https://github.com/alexeyxo/protobuf-swift/blob/master/README.md I am able to build protobuf for swift and add ProtocolBuffers.xcodeproj to my project. I was even able to generate .swift files for my proto files outside of xcode using protoc directly. However, my question is how do I integrate .proto files in Xcode so xcode can find/compile them? Do I need to copy my .proto files manually in my project? I am using Xcode 7.2.1 and protoc version is 3.0.0. Thanks in advance.
Create a build rule for *.proto files, something like this:
Add your .proto file to "Compile Sources" build phase list.

add new plugin to phonegap 3.4

I'm trying to add new plugin (https://github.com/xu-li/cordova-plugin-wechat) to my phonegap project. but I get stuck on the installation number 1.
For number 1, they said Add wechat lib to your project. Don't forget to add the "URL Type". but I don't know where should I put library files to? which folder? because I know that every time I use cordova build ios command, it will generate new project files in platforms/ios. Should I put library files after generated?
Thank you.
Make sure you have install the required SDK. use command $ cordova platform add ios. Now add the generated files in the project folder. See if this works. Add Cordova command script file if required.

How to run a titanium module using Titanium 3.2.2

I am currently using Titanium 3.2.2 and Xcode 5.1.
I am following this documentation to create a module for my xcode project: https://wiki.appcelerator.org/display/guides/iOS+Module+Development+Guide
But this documentation is quite old and run command isn't excutable in this titanium.
Also how can I run titanium module using titanium application and not through command-line.
Try this link, much more up to date:
http://docs.appcelerator.com/titanium/3.0/#!/guide/iOS_Module_Development_Guide
Mostly you have to build the module and then drop the zip that is created into the correct folder, then add the Module in the Titanium tiapp.xml
See here for using legacy command line command
http://docs.appcelerator.com/titanium/3.0/#!/guide/Legacy_Command-Line_Interface-section-29004835_LegacyCommand-LineInterface-OSX
In short:
alias titanium.py="/Library/Application\ Support/Titanium/mobilesdk/osx/<VERSION>/titanium.py"
alias ios_builder="/Library/Application\ Support/Titanium/mobilesdk/osx/<VERSION>/iphone/builder.py"
or
alias titanium.py="$HOME/Library/Application\ Support/Titanium/mobilesdk/osx/<VERSION>/titanium.py"
alias ios_builder="$HOME/Library/Application\ Support/Titanium/mobilesdk/osx/<VERSION>/iphone/builder.py"
And please use titanium.py to create module project. Module projects created by titanium CLI cannot be run by titantium.py
I have created a ticket here: https://jira.appcelerator.org/browse/TC-4722
I think this may be a bug or incompatibility of titanium.py, but the project structure may be more appropriate than titanium.py (separate android and ios spaces in one module project), so for now, I just use ti to create a project structure, and copy assets, example and documentation to iphone directory and add .gitignore to ignore them.
Gulp #FTW
"gulpfile.js for Titanium Module Project"
https://github.com/yomybaby/gulpfile-timodule

Resources