Building gutenprint recipe


Timm <timm@...>
 

There was a gutenprint recipe back in OE-Classic:
https://layers.openembedded.org/layerindex/oe-classic/recipe/12076/

But currently there is no gutenprint available for Yocto.

I tried to build my own recipe. But I got stuck at the stage where the
build process wants to call some generated binaries:

    | ./extract-strings `cat xml-stamp | sed -e
's;^;../../../gutenprint-5.2.11/src/xml/;'` > xmli18n-tmp.h.tmp
    | /lib/ld-linux-armhf.so.3: No such file or directory

So, I introduced a "native" recipe, which just compiles the
"extract-strings" for me: 

----------------------------------------------------------------------------------------------------------

SECTION = "libs"
require gutenprint_${PV}.bb
DEPENDS = "gettext-native"
inherit native autotools

EXTRA_OECONG = "\
        --disable-libgutenprintui2 \
            --disable-samples \
        --without-gimp2 \
        --without-doc \
        --disable-nls \
        --disable-nls-macos \
        --without-foomatic \
        --without-foomatic3 \
        --disable-escputil \
        --disable-test \
        --disable-testpattern \
        --without-cups \
               "

do_compile() {
    oe_runmake -C src/xml/ extract-strings
}

-----------------------------------------------------------------------------------------------------------------

The next step is quite unclear for me? How can I tell the build system
not to generate the extract-strings again and use the native instead?

As reference I used the build scripts from openwrt and buildroot. But
I'm not able to translate this build steps to Yocto.

https://github.com/FranciscoBorges/openwrt-printing-packages/blob/master/net/gutenprint/Makefile

https://github.com/buildroot/buildroot/blob/master/package/gutenprint/gutenprint.mk


Alexander Kanavin
 

How to do this is specific to each project. Generally, you want the
target recipe to depend on the native recipe (so that the necessary
native tools show up in the target sysroot), and then you need to
study the build system of the upstream component project (makefiles
etc.) to see how it can be instructed to use the tool installed in the
system, instead of building and using it's own version. Then patch the
source code accordingly from the recipe.

Alex

2018-07-07 12:02 GMT+02:00 Timm <timm@timmedia.de>:

There was a gutenprint recipe back in OE-Classic:
https://layers.openembedded.org/layerindex/oe-classic/recipe/12076/

But currently there is no gutenprint available for Yocto.

I tried to build my own recipe. But I got stuck at the stage where the
build process wants to call some generated binaries:

| ./extract-strings `cat xml-stamp | sed -e
's;^;../../../gutenprint-5.2.11/src/xml/;'` > xmli18n-tmp.h.tmp
| /lib/ld-linux-armhf.so.3: No such file or directory

So, I introduced a "native" recipe, which just compiles the
"extract-strings" for me:

----------------------------------------------------------------------------------------------------------

SECTION = "libs"
require gutenprint_${PV}.bb
DEPENDS = "gettext-native"
inherit native autotools

EXTRA_OECONG = "\
--disable-libgutenprintui2 \
--disable-samples \
--without-gimp2 \
--without-doc \
--disable-nls \
--disable-nls-macos \
--without-foomatic \
--without-foomatic3 \
--disable-escputil \
--disable-test \
--disable-testpattern \
--without-cups \
"

do_compile() {
oe_runmake -C src/xml/ extract-strings
}

-----------------------------------------------------------------------------------------------------------------

The next step is quite unclear for me? How can I tell the build system
not to generate the extract-strings again and use the native instead?

As reference I used the build scripts from openwrt and buildroot. But
I'm not able to translate this build steps to Yocto.

https://github.com/FranciscoBorges/openwrt-printing-packages/blob/master/net/gutenprint/Makefile

https://github.com/buildroot/buildroot/blob/master/package/gutenprint/gutenprint.mk
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Timm <timm@...>
 

Am 07.07.2018 um 12:17 schrieb Alexander Kanavin:
How to do this is specific to each project. Generally, you want the
target recipe to depend on the native recipe (so that the necessary
native tools show up in the target sysroot), 
Done that: gutenprint depends on gutenprint-native.
and then you need to
study the build system of the upstream component project (makefiles
etc.) to see how it can be instructed to use the tool installed in the
system, instead of building and using it's own version. Then patch the
source code accordingly from the recipe.
As I understand I have two options:
1. Patching the makefile that the makefile calls the upstream version of "extract-strings" from gutenprint-native.
2. Would be the openwrt-way: removing the directories with the extract-strings sources. So this part will not be compiled. Then copying the the binary build by gutenprint-native. I extracted the part of the openwrt-build-file:

define Build/Compile
# Replace the cross-compiled "extract-string" by a shell-script that
# runs the host's own compiled version (gutenprint needs to run this)
(cd $(PKG_BUILD_DIR) && $(MAKE) -C src/xml extract-strings && \
$(RM) src/xml/extract-strings && \
echo '#!/bin/sh' > src/xml/extract-strings && \
echo 'exec $(HOST_BUILD_DIR)/src/xml/extract-strings "$$$$@" ' \
>> src/xml/extract-strings && chmod +x src/xml/extract-strings && cp src/xml/extract-strings /tmp/)
$(call Build/Compile/Default)
endef   


Source: https://github.com/FranciscoBorges/openwrt-printing-packages/blob/master/net/gutenprint/Makefile

----------------------------------------------------------------------------------------------------------

There is one thing, I don't quite understand. How can I access the files which were created by the gutenprint-native recipe?



Alexander Kanavin
 

I do not recommend that you copy the binary over; it's better to clearly separate native and target. Just patch the makefile.

Alex

2018-07-07 13:30 GMT+02:00 Timm <timm@...>:

Am 07.07.2018 um 12:17 schrieb Alexander Kanavin:
How to do this is specific to each project. Generally, you want the
target recipe to depend on the native recipe (so that the necessary
native tools show up in the target sysroot), 
Done that: gutenprint depends on gutenprint-native.
and then you need to
study the build system of the upstream component project (makefiles
etc.) to see how it can be instructed to use the tool installed in the
system, instead of building and using it's own version. Then patch the
source code accordingly from the recipe.
As I understand I have two options:
1. Patching the makefile that the makefile calls the upstream version of "extract-strings" from gutenprint-native.
2. Would be the openwrt-way: removing the directories with the extract-strings sources. So this part will not be compiled. Then copying the the binary build by gutenprint-native. I extracted the part of the openwrt-build-file:

define Build/Compile
# Replace the cross-compiled "extract-string" by a shell-script that
# runs the host's own compiled version (gutenprint needs to run this)
(cd $(PKG_BUILD_DIR) && $(MAKE) -C src/xml extract-strings && \
$(RM) src/xml/extract-strings && \
echo '#!/bin/sh' > src/xml/extract-strings && \
echo 'exec $(HOST_BUILD_DIR)/src/xml/extract-strings "$$$$@" ' \
>> src/xml/extract-strings && chmod +x src/xml/extract-strings && cp src/xml/extract-strings /tmp/)
$(call Build/Compile/Default)
endef   


Source: https://github.com/FranciscoBorges/openwrt-printing-packages/blob/master/net/gutenprint/Makefile

----------------------------------------------------------------------------------------------------------

There is one thing, I don't quite understand. How can I access the files which were created by the gutenprint-native recipe?




Ross Burton
 

If it's just a single simple binary that you need to run at build time
then you can build it manually in the target recipe before invoking
make.

The Pango recipe has an example of doing this.

Ross

On 7 July 2018 at 11:17, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
How to do this is specific to each project. Generally, you want the
target recipe to depend on the native recipe (so that the necessary
native tools show up in the target sysroot), and then you need to
study the build system of the upstream component project (makefiles
etc.) to see how it can be instructed to use the tool installed in the
system, instead of building and using it's own version. Then patch the
source code accordingly from the recipe.

Alex

2018-07-07 12:02 GMT+02:00 Timm <timm@timmedia.de>:
There was a gutenprint recipe back in OE-Classic:
https://layers.openembedded.org/layerindex/oe-classic/recipe/12076/

But currently there is no gutenprint available for Yocto.

I tried to build my own recipe. But I got stuck at the stage where the
build process wants to call some generated binaries:

| ./extract-strings `cat xml-stamp | sed -e
's;^;../../../gutenprint-5.2.11/src/xml/;'` > xmli18n-tmp.h.tmp
| /lib/ld-linux-armhf.so.3: No such file or directory

So, I introduced a "native" recipe, which just compiles the
"extract-strings" for me:

----------------------------------------------------------------------------------------------------------

SECTION = "libs"
require gutenprint_${PV}.bb
DEPENDS = "gettext-native"
inherit native autotools

EXTRA_OECONG = "\
--disable-libgutenprintui2 \
--disable-samples \
--without-gimp2 \
--without-doc \
--disable-nls \
--disable-nls-macos \
--without-foomatic \
--without-foomatic3 \
--disable-escputil \
--disable-test \
--disable-testpattern \
--without-cups \
"

do_compile() {
oe_runmake -C src/xml/ extract-strings
}

-----------------------------------------------------------------------------------------------------------------

The next step is quite unclear for me? How can I tell the build system
not to generate the extract-strings again and use the native instead?

As reference I used the build scripts from openwrt and buildroot. But
I'm not able to translate this build steps to Yocto.

https://github.com/FranciscoBorges/openwrt-printing-packages/blob/master/net/gutenprint/Makefile

https://github.com/buildroot/buildroot/blob/master/package/gutenprint/gutenprint.mk
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Randy MacLeod
 

On 2018-07-07 6:02 a.m., Timm wrote:
There was a gutenprint recipe back in OE-Classic:
https://layers.openembedded.org/layerindex/oe-classic/recipe/12076/
But currently there is no gutenprint available for Yocto.
Timm,

Did you ever get the gutenprint recipe to work?
Are you able to add it to meta-oe or share
what you have done so far here?

../Randy
I tried to build my own recipe. But I got stuck at the stage where the
build process wants to call some generated binaries:
    | ./extract-strings `cat xml-stamp | sed -e
's;^;../../../gutenprint-5.2.11/src/xml/;'` > xmli18n-tmp.h.tmp
    | /lib/ld-linux-armhf.so.3: No such file or directory
So, I introduced a "native" recipe, which just compiles the
"extract-strings" for me:
----------------------------------------------------------------------------------------------------------
SECTION = "libs"
require gutenprint_${PV}.bb
DEPENDS = "gettext-native"
inherit native autotools
EXTRA_OECONG = "\
        --disable-libgutenprintui2 \
            --disable-samples \
        --without-gimp2 \
        --without-doc \
        --disable-nls \
        --disable-nls-macos \
        --without-foomatic \
        --without-foomatic3 \
        --disable-escputil \
        --disable-test \
        --disable-testpattern \
        --without-cups \
               "
do_compile() {
    oe_runmake -C src/xml/ extract-strings
}
-----------------------------------------------------------------------------------------------------------------
The next step is quite unclear for me? How can I tell the build system
not to generate the extract-strings again and use the native instead?
As reference I used the build scripts from openwrt and buildroot. But
I'm not able to translate this build steps to Yocto.
https://github.com/FranciscoBorges/openwrt-printing-packages/blob/master/net/gutenprint/Makefile
https://github.com/buildroot/buildroot/blob/master/package/gutenprint/gutenprint.mk

--
# Randy MacLeod
# Wind River Linux