diff mbox series

[2/2] package/nano: fix tiny build

Message ID 20210119175326.497192-2-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/2] Revert "package/nano: fix tiny build" | expand

Commit Message

Fabrice Fontaine Jan. 19, 2021, 5:53 p.m. UTC
Since upstream commit
https://git.savannah.gnu.org/cgit/nano.git/commit/configure.ac?id=235f92ce093099cd81f14827ab842bd331132790

--enable-color --enable-nanorc are needed for libmagic support in tiny
builds however as --enable-color needs fork() and tiny is selected when
!BR2_USE_MMU, it is easier to just disable libmagic with tiny builds

Fixes:
 - http://autobuild.buildroot.net/results/24894e62d6cf89d078959b12e67596c821d64696

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/nano/nano.mk | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Yann E. MORIN Jan. 19, 2021, 8:30 p.m. UTC | #1
Fabrice, All,

On 2021-01-19 18:53 +0100, Fabrice Fontaine spake thusly:
> Since upstream commit
> https://git.savannah.gnu.org/cgit/nano.git/commit/configure.ac?id=235f92ce093099cd81f14827ab842bd331132790
> 
> --enable-color --enable-nanorc are needed for libmagic support in tiny
> builds however as --enable-color needs fork() and tiny is selected when
> !BR2_USE_MMU, it is easier to just disable libmagic with tiny builds
> 
> Fixes:
>  - http://autobuild.buildroot.net/results/24894e62d6cf89d078959b12e67596c821d64696
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/nano/nano.mk | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/package/nano/nano.mk b/package/nano/nano.mk
> index c688ff216c..af6e1d62de 100644
> --- a/package/nano/nano.mk
> +++ b/package/nano/nano.mk
> @@ -19,18 +19,16 @@ NANO_CONF_ENV += ac_cv_prog_NCURSESW_CONFIG=false
>  NANO_MAKE_ENV += CURSES_LIB="-lncurses"
>  endif
>  
> -ifeq ($(BR2_PACKAGE_FILE),y)
> -NANO_DEPENDENCIES += file
> -NANO_CONF_OPTS += --enable-libmagic
> -else
> -NANO_CONF_OPTS += --disable-libmagic
> -endif
> -
>  ifeq ($(BR2_PACKAGE_NANO_TINY),y)
>  NANO_CONF_OPTS += --enable-tiny

Don't wee also need an explicit --disable-libmagice in this case?

>  define NANO_INSTALL_TARGET_CMDS
>  	$(INSTALL) -m 0755 $(@D)/src/nano $(TARGET_DIR)/usr/bin/nano
>  endef
> +else ifeq ($(BR2_PACKAGE_FILE),y)
> +NANO_DEPENDENCIES += file
> +NANO_CONF_OPTS += --enable-libmagic

And here, don't we need explicit --enable-color --enable-nanorc ?

Unless they are only needed for tiny?

Regards,
Yann E. MORIN.

> +else
> +NANO_CONF_OPTS += --disable-libmagic
>  endif
>  
>  $(eval $(autotools-package))
> -- 
> 2.29.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Fabrice Fontaine Jan. 19, 2021, 8:42 p.m. UTC | #2
Le mar. 19 janv. 2021 à 21:30, Yann E. MORIN <yann.morin.1998@free.fr> a écrit :
>
> Fabrice, All,
>
> On 2021-01-19 18:53 +0100, Fabrice Fontaine spake thusly:
> > Since upstream commit
> > https://git.savannah.gnu.org/cgit/nano.git/commit/configure.ac?id=235f92ce093099cd81f14827ab842bd331132790
> >
> > --enable-color --enable-nanorc are needed for libmagic support in tiny
> > builds however as --enable-color needs fork() and tiny is selected when
> > !BR2_USE_MMU, it is easier to just disable libmagic with tiny builds
> >
> > Fixes:
> >  - http://autobuild.buildroot.net/results/24894e62d6cf89d078959b12e67596c821d64696
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
> >  package/nano/nano.mk | 12 +++++-------
> >  1 file changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/package/nano/nano.mk b/package/nano/nano.mk
> > index c688ff216c..af6e1d62de 100644
> > --- a/package/nano/nano.mk
> > +++ b/package/nano/nano.mk
> > @@ -19,18 +19,16 @@ NANO_CONF_ENV += ac_cv_prog_NCURSESW_CONFIG=false
> >  NANO_MAKE_ENV += CURSES_LIB="-lncurses"
> >  endif
> >
> > -ifeq ($(BR2_PACKAGE_FILE),y)
> > -NANO_DEPENDENCIES += file
> > -NANO_CONF_OPTS += --enable-libmagic
> > -else
> > -NANO_CONF_OPTS += --disable-libmagic
> > -endif
> > -
> >  ifeq ($(BR2_PACKAGE_NANO_TINY),y)
> >  NANO_CONF_OPTS += --enable-tiny
>
> Don't wee also need an explicit --disable-libmagice in this case?
libmagic is disabled by default when tiny is enabled, here is an
extract of configure.ac:

AC_ARG_ENABLE(tiny,
AS_HELP_STRING([--enable-tiny], [Disable features for the sake of size]))
if test "x$enable_tiny" = xyes; then
  AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as
small as possible.])
  if test "x$enable_libmagic" != xyes; then
    enable_libmagic=no
  fi
fi
>
> >  define NANO_INSTALL_TARGET_CMDS
> >       $(INSTALL) -m 0755 $(@D)/src/nano $(TARGET_DIR)/usr/bin/nano
> >  endef
> > +else ifeq ($(BR2_PACKAGE_FILE),y)
> > +NANO_DEPENDENCIES += file
> > +NANO_CONF_OPTS += --enable-libmagic
>
> And here, don't we need explicit --enable-color --enable-nanorc ?
>
> Unless they are only needed for tiny?
Yes, they're only needed for tiny, here is an extract of configure.ac:

AC_ARG_ENABLE(libmagic,
AS_HELP_STRING([--disable-libmagic], [Disable detection of file types
via libmagic]))
if test "x$enable_libmagic" = xyes; then
  if test "x$enable_tiny" = xyes; then
    if test "x$enable_color" != xyes; then
      AC_MSG_ERROR([
        ***  --enable-libmagic needs --enable-color and
--enable-nanorc to work])
    fi
  fi
  if test "x$enable_color" = xno; then
    AC_MSG_ERROR([
      ***  --enable-libmagic cannot work with --disable-color nor
--disable-nanorc])
  fi
fi
>
> Regards,
> Yann E. MORIN.
>
> > +else
> > +NANO_CONF_OPTS += --disable-libmagic
> >  endif
> >
> >  $(eval $(autotools-package))
> > --
> > 2.29.2
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
Best Regards,

Fabrice
Yann E. MORIN Jan. 24, 2021, 9:38 p.m. UTC | #3
Fabrice, All,

On 2021-01-19 21:42 +0100, Fabrice Fontaine spake thusly:
> Le mar. 19 janv. 2021 à 21:30, Yann E. MORIN <yann.morin.1998@free.fr> a écrit :
> > On 2021-01-19 18:53 +0100, Fabrice Fontaine spake thusly:
> > > Since upstream commit
> > > https://git.savannah.gnu.org/cgit/nano.git/commit/configure.ac?id=235f92ce093099cd81f14827ab842bd331132790
> > > --enable-color --enable-nanorc are needed for libmagic support in tiny
> > > builds however as --enable-color needs fork() and tiny is selected when
> > > !BR2_USE_MMU, it is easier to just disable libmagic with tiny builds
[--SNIP--]
> > Don't wee also need an explicit --disable-libmagice in this case?
> libmagic is disabled by default when tiny is enabled, here is an
> extract of configure.ac:
[--SNIP--]
> > And here, don't we need explicit --enable-color --enable-nanorc ?
> > Unless they are only needed for tiny?
> Yes, they're only needed for tiny, here is an extract of configure.ac:
[--SNIP--]

So I eventually applied this, but I did add the explicit options, rather
than relying on defaults.

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/package/nano/nano.mk b/package/nano/nano.mk
index c688ff216c..af6e1d62de 100644
--- a/package/nano/nano.mk
+++ b/package/nano/nano.mk
@@ -19,18 +19,16 @@  NANO_CONF_ENV += ac_cv_prog_NCURSESW_CONFIG=false
 NANO_MAKE_ENV += CURSES_LIB="-lncurses"
 endif
 
-ifeq ($(BR2_PACKAGE_FILE),y)
-NANO_DEPENDENCIES += file
-NANO_CONF_OPTS += --enable-libmagic
-else
-NANO_CONF_OPTS += --disable-libmagic
-endif
-
 ifeq ($(BR2_PACKAGE_NANO_TINY),y)
 NANO_CONF_OPTS += --enable-tiny
 define NANO_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 0755 $(@D)/src/nano $(TARGET_DIR)/usr/bin/nano
 endef
+else ifeq ($(BR2_PACKAGE_FILE),y)
+NANO_DEPENDENCIES += file
+NANO_CONF_OPTS += --enable-libmagic
+else
+NANO_CONF_OPTS += --disable-libmagic
 endif
 
 $(eval $(autotools-package))