directfb2 / DirectFB2

Core DirectFB library
GNU Lesser General Public License v2.1
136 stars 16 forks source link

DirectFB2 recipe for Yocto Project #95

Open Greijus opened 1 year ago

Greijus commented 1 year ago

Hi,

So far I've been able to install and test DirectFB2 (as well as FusionSound2 and the examples) manually in a Linux distro generated with the Yocto project. Now, I would like to automate the build and installation in my Linux image of these libraries using bitbake, but so far nothing works. I have used the devtool utility of Yocto running devtool add https://github.com/directfb2/DirectFB2.git. This generates a template that I have modified in several ways unsuccsesfully.

Does anyone have tried this before?

I susccesfully generated a recipe for flux which DirectFB depends on devtool add https://github.com/deniskropp/flux.git

My build host is Ubuntu 20.04 My target is a intel-corei7-64 machine I've tried mainly Dunfell (release 3.1) branch of Yocto, but also Kirkstone (release 4.0), to try to generate and build the DirectFB recipe.

There is a directfb-1.7.7 recipe available in the oe layer index, but no fusionsound. I think it would be cool if the DirectFB2 project could be added to the Yocto project.

Anyways, any help would be greatly appreciated.

Some additional info of the Yocto build:

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "intel-corei7-64"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.8"
TUNE_FEATURES        = "m64 corei7"
TARGET_FPU           = ""
Linux kernel:
# uname -r
5.4.123
nh-mike commented 1 year ago

As it happens, I have just learned of the DirectFB2 project. I am making an embedded system on a Raspberry Pi and am using Pygame, SDL2 and DirectFB but DirectFB is crashing out on me, so I a having a crack at writing a DirectFB2 recipe. I'll check back in with you if I have any success.

Greijus commented 1 year ago

As it happens, I have just learned of the DirectFB2 project. I am making an embedded system on a Raspberry Pi and am using Pygame, SDL2 and DirectFB but DirectFB is crashing out on me, so I a having a crack at writing a DirectFB2 recipe. I'll check back in with you if I have any success.

Hi mike! Did you succeded in creating recipe for DirectFB2?

nh-mike commented 1 year ago

As yet I haven't succeeded. It requires another library, fluxcomp, for compilation.

I've made another recipe for fluxcomp and that compiles successfully, but then the binary is not being pulled over into the DirectFB2 recipe, I don't know why not.

I've been a little preoccupied with another unrelated project lately but I'm hoping to be back into this one in a couple of days.

Greijus commented 1 year ago

I succeded as well in creating and buiding a recipe for flux using devtool: devtool add flux https://github.com/deniskropp/flux.git

It's pretty straightforward for flux since it uses autotools, but for DirectFB2 creates an empty recipe with the following note: # NOTE: no Makefile found, unable to determine what needs to be done So it doesn't recognizes the meson file.

Another issue I've faced is the meson version. The Dunfell branch of poky comes with meson-0.53.2and DirectFB2 requires meson-0.61.5. I haven't sucedded in creating a recipe for upgrading meson. Currently, I upgraded meson manually directly on target using pip3: $ pip3 install --upgrade meson==0.61.5 and from there instaling manually DirectFB2, FusionSound2 and the examples on target following the standard procedure:

            meson build/
            ninja ­-C build/  
            sudo ninja -­C build/ install
nh-mike commented 1 year ago

Sorry it's taken me a while to get back to my dev machine. Those are some interesting points, I just learned a few things there. I'll take what you've told me and see whether it will help me on my end and get back to you if I come up with anything.

I'm using Langdale. I find that the meson included in my build system is version 0.63.3. I had a crack at using the devtool add command but found that the recipe it generated was insufficient for me, and didn't resolve my issue anyway. The problem I am currently having is that when meson is configuring directfb2, it cannot find a fluxcomp executable.

When running a bitbake build-sysroots, I am currently finding that in poky/build/tmp/sysroots/x86_64/usr/bin/ there is a binary fluxcomp-native - I know it is not called that when being compiled and suspect that if I could figure out how to stop it from being renamed that I'd overcome this hurdle. When building with bitbake fluxcomp-native, it complains it cannot stat poky/build/tmp/work/x86_64-linux/fluxcomp-native/1.0+gitAUTOINC+10ad2ebc78-r0/build/fluxcomp-native, but in that directory is the fluxcomp binary.

I hope someone has more of an idea about this than I do.

Here is where I'm at with my recipe files at the moment. https://gist.github.com/nh-mike/5fedd35ac6a88069565814e611c6891c

Greijus commented 1 year ago

If you are using Langdale branch, you may need to downgrade the meson to 0.61.5 version in order to build and install DirectFB2. When I tried out meson build/ manually on my target, it showed me an error of some deprecated functionality, so it crashed...

caramelli commented 1 year ago

Version 0.63.3 of meson works fine for me. Can you detail your error regarding some deprecated features?

Greijus commented 1 year ago

I don't quite remember, I think at that moment I was using meson version 1.0.0, and for some reason I wasn't able to compile direcfb2. I just downgraded and worked, so I didn't go to deep into the issue. Maybe it was an isolated event....

caramelli commented 1 year ago

Yes, we get the following warning when running meson build/ with meson versions newer than 0.63.3:

WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

I updated the DirectFB2 INSTALL file accordingly: https://github.com/directfb2/DirectFB2/commit/f0904fdd06c972384bd526f440823a8e95393c19

Thanks.

nh-mike commented 1 year ago

Hi @Greijus, just to provide an update. I now have the fluxcomp build working and I am able to get through the install stage with directfb2 but not the do_populate_sysroot stage, it is giving me sanity check errors and installed but not shipped errors.

I have again updated my gist with the current state of my recipes. I'll be away for the long weekend so there will probably be no more progress from my end until Monday or Tuesday.

https://gist.github.com/nh-mike/5fedd35ac6a88069565814e611c6891c

nh-mike commented 1 year ago

Hi @Greijus I got back this afternoon and got back to work. Check my gist: https://gist.github.com/nh-mike/5fedd35ac6a88069565814e611c6891c

I have had success building directfb2, only with an error about an internal file dependency for an existing file which the QA system was unable to find, so I have changed that over into a warning.

While, I am able to build DirectFB2, I find that when trying to build core-image-base, I am having linking issues within cairo, trying to link to DirectFB2.

Greijus commented 1 year ago

Hi @nh-mike !

Build of fluxcomp was sucessfull for me; directfb2 failed though, again some issue with meson. I'm no expert on Yocto, so I would like to ask you if during the directfb2 build, is possible to modify the recipe so bitbake will use the meson on my build machine which is version 0.61.5?

As I metioned before, I'm using Dunfell branch of poky, which by default builds meson-0.53.2. I guess that bitbake uses this version to build direcfb2, right?

This is the build log gist: https://gist.github.com/Greijus/875894a6489b59d6acaf41b77b2ca822

nh-mike commented 1 year ago

I don't know for sure but I wouldn't think so. When building, it creates sysroots and uses everything from inside them.

I know that I can specify the version of meson required to build the recipe, so you can then include the recipe for the required meson version for DirectFB2. That does mean, however, that you would have to specify the preferred version in your main config file, like in the link below; https://stackoverflow.com/questions/68573676/specifying-prior-recipe-using-preferred-version-doesnt-work-in-yocto-bitbake