diff mbox

[PATCHv2,1/1] xterm: x-includes and x-libraries must be set for cross-compiling

Message ID 1437932796-16216-1-git-send-email-bas@bmail.ru
State Changes Requested
Headers show

Commit Message

kyak July 26, 2015, 5:46 p.m. UTC
From: Mikhail Peselnik <bas@bmail.ru>

These flags need to be set so that the configure script would
correctly use libICE from cross-toolchain rather than from host.
Also, the xterm package is missing the freetype2 dependency, as
noted by Romain Naour.

This fix is similar to "package/efl/libevas: x-includes and x-libraries
must be set for cross-compiling" done by Romain Naour on libecore.

Signed-off-by: Mikhail Peselnik <bas@bmail.ru>
---
 package/xterm/Config.in | 1 +
 package/xterm/xterm.mk  | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Yann E. MORIN July 26, 2015, 5:59 p.m. UTC | #1
Mikhail, All,

On 2015-07-26 20:46 +0300, kyak spake thusly:
> From: Mikhail Peselnik <bas@bmail.ru>
> 
> These flags need to be set so that the configure script would
> correctly use libICE from cross-toolchain rather than from host.
> Also, the xterm package is missing the freetype2 dependency, as
> noted by Romain Naour.
> 
> This fix is similar to "package/efl/libevas: x-includes and x-libraries
> must be set for cross-compiling" done by Romain Naour on libecore.
> 
> Signed-off-by: Mikhail Peselnik <bas@bmail.ru>

The From filed does not match your Signed-off-by; please fix your git
config with:

    git config --global user.name 'Mikhail Peselnik'
    git config --global user.email 'bas@bmail.ru'

> ---
>  package/xterm/Config.in | 1 +
>  package/xterm/xterm.mk  | 7 +++++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/package/xterm/Config.in b/package/xterm/Config.in
> index e17d2c6..f549df4 100644
> --- a/package/xterm/Config.in
> +++ b/package/xterm/Config.in
> @@ -4,6 +4,7 @@ config BR2_PACKAGE_XTERM
>  	select BR2_PACKAGE_XLIB_LIBXAW
>  	depends on BR2_PACKAGE_XORG7
>  	depends on BR2_USE_MMU # fork()
> +	depends on BR2_PACKAGE_FREETYPE

This should be a 'select' rather than a 'depends on'.

>  	help
>  	  xterm terminal emulator
>  
> diff --git a/package/xterm/xterm.mk b/package/xterm/xterm.mk
> index 56f692d..f7a332d 100644
> --- a/package/xterm/xterm.mk
> +++ b/package/xterm/xterm.mk
> @@ -10,6 +10,9 @@ XTERM_SITE = ftp://invisible-island.net/xterm
>  XTERM_DEPENDENCIES = ncurses xlib_libXaw
>  XTERM_LICENSE = MIT
>  XTERM_LICENSE_FILES = version.c
> -XTERM_CONF_OPTS = --enable-256-color
> -
> +XTERM_CONF_OPTS = --enable-256-color \
> +	--x-includes=$(STAGING_DIR)/usr/include \
> +	--x-libraries=$(STAGING_DIR)/usr/lib \
> +	--with-freetype-cflags=$(STAGING_DIR)/usr/include \

I guess this should instead be: -I$(STAGING_DIR)/usr/include

> +	--with-freetype-libs=$(STAGING_DIR)/usr/lib

And this: -L$(STAGING_DIR)/usr/lib

You may also want to add:

    --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config

Regards,
Yann E. MORIN.

>  $(eval $(autotools-package))
> -- 
> 2.4.6
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Romain Naour July 26, 2015, 7:37 p.m. UTC | #2
Hi Mikhail, Yann, All,

Le 26/07/2015 19:59, Yann E. MORIN a écrit :
> Mikhail, All,
> 
> On 2015-07-26 20:46 +0300, kyak spake thusly:
>> From: Mikhail Peselnik <bas@bmail.ru>
>>
>> These flags need to be set so that the configure script would
>> correctly use libICE from cross-toolchain rather than from host.
>> Also, the xterm package is missing the freetype2 dependency, as
>> noted by Romain Naour.

This patch does two things: add x-includes, x-libraries and add freetype2
dependency.
It would be good to split these changes in two different patches.

>>
>> This fix is similar to "package/efl/libevas: x-includes and x-libraries
>> must be set for cross-compiling" done by Romain Naour on libecore.
>>
>> Signed-off-by: Mikhail Peselnik <bas@bmail.ru>
> 
> The From filed does not match your Signed-off-by; please fix your git
> config with:
> 
>     git config --global user.name 'Mikhail Peselnik'
>     git config --global user.email 'bas@bmail.ru'
> 
>> ---
>>  package/xterm/Config.in | 1 +
>>  package/xterm/xterm.mk  | 7 +++++--
>>  2 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/package/xterm/Config.in b/package/xterm/Config.in
>> index e17d2c6..f549df4 100644
>> --- a/package/xterm/Config.in
>> +++ b/package/xterm/Config.in
>> @@ -4,6 +4,7 @@ config BR2_PACKAGE_XTERM
>>  	select BR2_PACKAGE_XLIB_LIBXAW
>>  	depends on BR2_PACKAGE_XORG7
>>  	depends on BR2_USE_MMU # fork()
>> +	depends on BR2_PACKAGE_FREETYPE
> 
> This should be a 'select' rather than a 'depends on'.

In not sure about select. There is a --disable-freetype option, see below.

> 
>>  	help
>>  	  xterm terminal emulator
>>  
>> diff --git a/package/xterm/xterm.mk b/package/xterm/xterm.mk
>> index 56f692d..f7a332d 100644
>> --- a/package/xterm/xterm.mk
>> +++ b/package/xterm/xterm.mk
>> @@ -10,6 +10,9 @@ XTERM_SITE = ftp://invisible-island.net/xterm
>>  XTERM_DEPENDENCIES = ncurses xlib_libXaw
>>  XTERM_LICENSE = MIT
>>  XTERM_LICENSE_FILES = version.c
>> -XTERM_CONF_OPTS = --enable-256-color
>> -
>> +XTERM_CONF_OPTS = --enable-256-color \
>> +	--x-includes=$(STAGING_DIR)/usr/include \
>> +	--x-libraries=$(STAGING_DIR)/usr/lib \
>> +	--with-freetype-cflags=$(STAGING_DIR)/usr/include \
> 
> I guess this should instead be: -I$(STAGING_DIR)/usr/include
> 
>> +	--with-freetype-libs=$(STAGING_DIR)/usr/lib
> 
> And this: -L$(STAGING_DIR)/usr/lib
> 
> You may also want to add:
> 
>     --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config

Maybe something like this (untested):

ifeq ($(BR2_PACKAGE_FREETYPE),y)
XTERM_CONF_OPTS += --with-freetype-config="$(STAGING_DIR)/usr/bin/freetype-config" \
                   --with-freetype-cflags="-I$(STAGING_DIR)/usr/include" \
                   --with-freetype-libs="-L$(STAGING_DIR)/usr/lib"
else
XTERM_CONF_OPTS += --disable-freetype
endif

But it you think that freetype must always be selected, this is ok.

Thoughts ?

Best regards,
Romain Naour

> 
> Regards,
> Yann E. MORIN.
> 
>>  $(eval $(autotools-package))
>> -- 
>> 2.4.6
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>
Thomas Petazzoni July 26, 2015, 7:44 p.m. UTC | #3
Yann,

On Sun, 26 Jul 2015 19:59:49 +0200, Yann E. MORIN wrote:

> On 2015-07-26 20:46 +0300, kyak spake thusly:
> > From: Mikhail Peselnik <bas@bmail.ru>
> > 
> > These flags need to be set so that the configure script would
> > correctly use libICE from cross-toolchain rather than from host.
> > Also, the xterm package is missing the freetype2 dependency, as
> > noted by Romain Naour.
> > 
> > This fix is similar to "package/efl/libevas: x-includes and x-libraries
> > must be set for cross-compiling" done by Romain Naour on libecore.
> > 
> > Signed-off-by: Mikhail Peselnik <bas@bmail.ru>
> 
> The From filed does not match your Signed-off-by; please fix your git
> config with:
> 
>     git config --global user.name 'Mikhail Peselnik'
>     git config --global user.email 'bas@bmail.ru'

Are you sure?

In the patch itself, I see:

  From: Mikhail Peselnik <bas@bmail.ru>
  Signed-off-by: Mikhail Peselnik <bas@bmail.ru>

which does match. However, it indeed doesn't match the From of the mail
itself:

  From: kyak <bas@bmail.ru>

Which I'm not sure is related to the Git configuration. And while it's
a bit ugly, I think it doesn't cause any problem because Git will use
the From: from inside the patch itself in preference over the From: of
the e-mail.

Thomas
Thomas Petazzoni July 26, 2015, 7:47 p.m. UTC | #4
Hello,

On Sun, 26 Jul 2015 20:46:36 +0300, kyak wrote:
> From: Mikhail Peselnik <bas@bmail.ru>
> 
> These flags need to be set so that the configure script would
> correctly use libICE from cross-toolchain rather than from host.
> Also, the xterm package is missing the freetype2 dependency, as
> noted by Romain Naour.

So it should be two patches.

Basically, if your patch does something that isn't summarized in the
commit title, then probably something wrong is going on.

So, one patch for x-includes/x-libraries, one patch for the missing
freetype2 dependency.

However, I believe Romain was maybe wrong: the freetype dependency
seems to be optional, according to configure.in. So it should probably
just be:

ifeq ($(BR2_PACKAGE_FREETYPE),y)
XTERM_DEPENDENCIES += freetype
XTERM_CONF_OPTS += --enable-freetype
else
XTERM_CONF_OPTS += --disable-freetype
endif

Romain, can you confirm?

Best regards,

Thomas
Yann E. MORIN July 26, 2015, 8:02 p.m. UTC | #5
Thomas, All,

On 2015-07-26 21:44 +0200, Thomas Petazzoni spake thusly:
> On Sun, 26 Jul 2015 19:59:49 +0200, Yann E. MORIN wrote:
> > On 2015-07-26 20:46 +0300, kyak spake thusly:
> > > From: Mikhail Peselnik <bas@bmail.ru>
> > The From filed does not match your Signed-off-by; please fix your git
> > config with:
> > 
> >     git config --global user.name 'Mikhail Peselnik'
> >     git config --global user.email 'bas@bmail.ru'
> 
> Are you sure?
> 
> In the patch itself, I see:
> 
>   From: Mikhail Peselnik <bas@bmail.ru>
>   Signed-off-by: Mikhail Peselnik <bas@bmail.ru>

Ah, right. Then it would be:

    git conmfig --global sendemail.from 'Mikhail Peselnik <bas@bmail.ru>'

> which does match. However, it indeed doesn't match the From of the mail
> itself:
> 
>   From: kyak <bas@bmail.ru>
> 
> Which I'm not sure is related to the Git configuration. And while it's
> a bit ugly, I think it doesn't cause any problem because Git will use
> the From: from inside the patch itself in preference over the From: of
> the e-mail.

Indeed, forget what I said. I was just a bit surprised that the From
field in the mail headers did not match the SoB line; but since there's
a From field in the patch itself, all is good wrt. git keeping
authorship.

Regards,
Yann E. MORIN.
Romain Naour July 26, 2015, 9:03 p.m. UTC | #6
Thomas,

Le 26/07/2015 21:47, Thomas Petazzoni a écrit :
> Hello,
> 
> On Sun, 26 Jul 2015 20:46:36 +0300, kyak wrote:
>> From: Mikhail Peselnik <bas@bmail.ru>
>>
>> These flags need to be set so that the configure script would
>> correctly use libICE from cross-toolchain rather than from host.
>> Also, the xterm package is missing the freetype2 dependency, as
>> noted by Romain Naour.
> 
> So it should be two patches.
> 
> Basically, if your patch does something that isn't summarized in the
> commit title, then probably something wrong is going on.
> 
> So, one patch for x-includes/x-libraries, one patch for the missing
> freetype2 dependency.
> 
> However, I believe Romain was maybe wrong: the freetype dependency
> seems to be optional, according to configure.in. So it should probably
> just be:
> 
> ifeq ($(BR2_PACKAGE_FREETYPE),y)
> XTERM_DEPENDENCIES += freetype
> XTERM_CONF_OPTS += --enable-freetype
> else
> XTERM_CONF_OPTS += --disable-freetype
> endif
> 
> Romain, can you confirm?

I don't know much the xterm package but indeed the freetype support seems
optional. However, it depends on libXft.

So I made this change:

# freetype support needs libXft, so enable it only when
# libxft package is selected.
# Note: freetype is automatically selected by libXft.
ifeq ($(BR2_PACKAGE_XLIB_LIBXFT),y)
XTERM_DEPENDENCIES += freetype xlib_libXft
XTERM_CONF_OPTS += --enable-freetype \
	--with-freetype-cflags="-I$(STAGING_DIR)/usr/include/freetype2" \
	--with-freetype-libs="-L$(STAGING_DIR)/usr/lib"
else
XTERM_CONF_OPTS += --disable-freetype
endif

It doesn't work when freetype-config is used directly with:
--with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config

Mikhail, can you resend an updated version with this change?

Best regards,
Romain

> 
> Best regards,
> 
> Thomas
>
Thomas Petazzoni July 26, 2015, 9:25 p.m. UTC | #7
Romain,

On Sun, 26 Jul 2015 23:03:13 +0200, Romain Naour wrote:

> I don't know much the xterm package but indeed the freetype support seems
> optional. However, it depends on libXft.

No, I think it's not the way it works. What xterm calls "freetype" is
*not* freetype, it's libXft, i.e X Freetype. If you look at the
definition of CF_X_FREETYPE, it searches for xft, and never for
freetype.

> # freetype support needs libXft, so enable it only when
> # libxft package is selected.
> # Note: freetype is automatically selected by libXft.

Don't add this comment.

> ifeq ($(BR2_PACKAGE_XLIB_LIBXFT),y)
> XTERM_DEPENDENCIES += freetype xlib_libXft

Don't add the freetype dependency here.

> XTERM_CONF_OPTS += --enable-freetype \
> 	--with-freetype-cflags="-I$(STAGING_DIR)/usr/include/freetype2" \
> 	--with-freetype-libs="-L$(STAGING_DIR)/usr/lib"

I think these are wrong. Instead, do:

	--with-freetype-config=auto

It will use pkg-config to find libXft. Of course, make sure
host-pkgconf is in the dependencies.

> It doesn't work when freetype-config is used directly with:
> --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config

Yes, because it's not looking for freetype, but Xft.

Best regards,

Thomas
Romain Naour July 27, 2015, 2:49 p.m. UTC | #8
Hi Thomas,

Le 26/07/2015 23:25, Thomas Petazzoni a écrit :
> Romain,
> 
> On Sun, 26 Jul 2015 23:03:13 +0200, Romain Naour wrote:
> 
>> I don't know much the xterm package but indeed the freetype support seems
>> optional. However, it depends on libXft.
> 
> No, I think it's not the way it works. What xterm calls "freetype" is
> *not* freetype, it's libXft, i.e X Freetype. If you look at the
> definition of CF_X_FREETYPE, it searches for xft, and never for
> freetype.

Thanks for the explanation, I was completely confused between (the real)
freetype and libXft...
Let me (or Mikhail) look again at the issue ;-)

Best regards,
Romain
> 
>> # freetype support needs libXft, so enable it only when
>> # libxft package is selected.
>> # Note: freetype is automatically selected by libXft.
> 
> Don't add this comment.
> 
>> ifeq ($(BR2_PACKAGE_XLIB_LIBXFT),y)
>> XTERM_DEPENDENCIES += freetype xlib_libXft
> 
> Don't add the freetype dependency here.
> 
>> XTERM_CONF_OPTS += --enable-freetype \
>> 	--with-freetype-cflags="-I$(STAGING_DIR)/usr/include/freetype2" \
>> 	--with-freetype-libs="-L$(STAGING_DIR)/usr/lib"
> 
> I think these are wrong. Instead, do:
> 
> 	--with-freetype-config=auto
> 
> It will use pkg-config to find libXft. Of course, make sure
> host-pkgconf is in the dependencies.
> 
>> It doesn't work when freetype-config is used directly with:
>> --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config
> 
> Yes, because it's not looking for freetype, but Xft.
> 
> Best regards,
> 
> Thomas
>
diff mbox

Patch

diff --git a/package/xterm/Config.in b/package/xterm/Config.in
index e17d2c6..f549df4 100644
--- a/package/xterm/Config.in
+++ b/package/xterm/Config.in
@@ -4,6 +4,7 @@  config BR2_PACKAGE_XTERM
 	select BR2_PACKAGE_XLIB_LIBXAW
 	depends on BR2_PACKAGE_XORG7
 	depends on BR2_USE_MMU # fork()
+	depends on BR2_PACKAGE_FREETYPE
 	help
 	  xterm terminal emulator
 
diff --git a/package/xterm/xterm.mk b/package/xterm/xterm.mk
index 56f692d..f7a332d 100644
--- a/package/xterm/xterm.mk
+++ b/package/xterm/xterm.mk
@@ -10,6 +10,9 @@  XTERM_SITE = ftp://invisible-island.net/xterm
 XTERM_DEPENDENCIES = ncurses xlib_libXaw
 XTERM_LICENSE = MIT
 XTERM_LICENSE_FILES = version.c
-XTERM_CONF_OPTS = --enable-256-color
-
+XTERM_CONF_OPTS = --enable-256-color \
+	--x-includes=$(STAGING_DIR)/usr/include \
+	--x-libraries=$(STAGING_DIR)/usr/lib \
+	--with-freetype-cflags=$(STAGING_DIR)/usr/include \
+	--with-freetype-libs=$(STAGING_DIR)/usr/lib
 $(eval $(autotools-package))