diff mbox

[v2,2/9] execline: new package

Message ID 1481397650-14664-3-git-send-email-eric.le.bihan.dev@free.fr
State Changes Requested
Headers show

Commit Message

Eric Le Bihan Dec. 10, 2016, 7:20 p.m. UTC
This package provides execline, a (non-interactive) scripting language,
like sh, used in the s6 supervision system.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/Config.in               |  1 +
 package/execline/Config.in      | 12 +++++++
 package/execline/Config.in.host |  7 +++++
 package/execline/execline.hash  |  2 ++
 package/execline/execline.mk    | 69 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 91 insertions(+)
 create mode 100644 package/execline/Config.in
 create mode 100644 package/execline/Config.in.host
 create mode 100644 package/execline/execline.hash
 create mode 100644 package/execline/execline.mk

Comments

Thomas Petazzoni Dec. 10, 2016, 8:49 p.m. UTC | #1
Hello,

On Sat, 10 Dec 2016 20:20:43 +0100, Eric Le Bihan wrote:

> diff --git a/package/execline/Config.in.host b/package/execline/Config.in.host
> new file mode 100644
> index 0000000..4e188e1
> --- /dev/null
> +++ b/package/execline/Config.in.host
> @@ -0,0 +1,7 @@
> +config BR2_PACKAGE_HOST_EXECLINE
> +	bool "host execline"
> +	help
> +	  Host version of execline, a (non-interactive) scripting language,
> +	  like sh.
> +
> +	  http://skarnet.org/software/execline/

Do we really a menuconfig-visible option for the host variant?

If so, then please explain why in the commit log. Also mentioning in
the commit log why a host variant is introduced would be nice.

> +EXECLINE_CONF_OPTS = \
> +	--prefix=/usr \
> +	--with-sysdeps=$(STAGING_DIR)/usr/lib/skalibs/sysdeps \
> +	--with-include=$(STAGING_DIR)/usr/include \
> +	--with-dynlib=$(STAGING_DIR)/usr/lib \
> +	--with-lib=$(STAGING_DIR)/usr/lib/skalibs \

Ah, ok, so that's how it finds the static libraries?

> +HOST_EXECLINE_DEPENDENCIES = host-skalibs
> +
> +HOST_EXECLINE_CONF_OPTS = \
> +	--prefix=/usr \

Should be --prefix=$(HOST_DIR)/usr

> +	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
> +	--with-include=$(HOST_DIR)/usr/include \
> +	--with-dynlib=$(HOST_DIR)/usr/lib \
> +	--disable-static \
> +	--enable-shared \
> +	--disable-allstatic
> +
> +define HOST_EXECLINE_CONFIGURE_CMDS
> +	(cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_EXECLINE_CONF_OPTS))
> +endef
> +
> +define HOST_EXECLINE_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR)

DESTDIR= should not be needed.

> +endef
> +
> +define HOST_EXECLINE_INSTALL_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install

DESTDIR= is no longer needed with --prefix=$(HOST_DIR)/usr.

Thanks!

Thomas
Eric Le Bihan Dec. 11, 2016, 6:30 p.m. UTC | #2
Hi!

On 16-12-10 21:49:01, Thomas Petazzoni wrote:
> Hello,
>
> On Sat, 10 Dec 2016 20:20:43 +0100, Eric Le Bihan wrote:
>
> > diff --git a/package/execline/Config.in.host b/package/execline/Config.in.host
> > new file mode 100644
> > index 0000000..4e188e1
> > --- /dev/null
> > +++ b/package/execline/Config.in.host
> > @@ -0,0 +1,7 @@
> > +config BR2_PACKAGE_HOST_EXECLINE
> > +	bool "host execline"
> > +	help
> > +	  Host version of execline, a (non-interactive) scripting language,
> > +	  like sh.
> > +
> > +	  http://skarnet.org/software/execline/
>
> Do we really a menuconfig-visible option for the host variant?
>
> If so, then please explain why in the commit log. Also mentioning in
> the commit log why a host variant is introduced would be nice.

I will remove the menuconfig entry. It is used by the host variants of s6
and s6-rc, but having host-execline in their respective dependency lists
is enough. It is very unlikely that the user want to write post-build
scripts using execline with having built host-s6 and friends.

> > +EXECLINE_CONF_OPTS = \
> > +	--prefix=/usr \
> > +	--with-sysdeps=$(STAGING_DIR)/usr/lib/skalibs/sysdeps \
> > +	--with-include=$(STAGING_DIR)/usr/include \
> > +	--with-dynlib=$(STAGING_DIR)/usr/lib \
> > +	--with-lib=$(STAGING_DIR)/usr/lib/skalibs \
>
> Ah, ok, so that's how it finds the static libraries?

Yep! The skarnet build system may follow the "./configure; make; make
install" convention, but internally, this is another story. So the
libraries are stored in a subdirectory.

> > +HOST_EXECLINE_DEPENDENCIES = host-skalibs
> > +
> > +HOST_EXECLINE_CONF_OPTS = \
> > +	--prefix=/usr \
>
> Should be --prefix=$(HOST_DIR)/usr
>
> > +	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
> > +	--with-include=$(HOST_DIR)/usr/include \
> > +	--with-dynlib=$(HOST_DIR)/usr/lib \
> > +	--disable-static \
> > +	--enable-shared \
> > +	--disable-allstatic
> > +
> > +define HOST_EXECLINE_CONFIGURE_CMDS
> > +	(cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_EXECLINE_CONF_OPTS))
> > +endef
> > +
> > +define HOST_EXECLINE_BUILD_CMDS
> > +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR)
>
> DESTDIR= should not be needed.
>
> > +endef
> > +
> > +define HOST_EXECLINE_INSTALL_CMDS
> > +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install
>
> DESTDIR= is no longer needed with --prefix=$(HOST_DIR)/usr.

See the skalibs review for details about this topic.

Thanks for the review.

--
ELB
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index d640035..ec90202 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -504,6 +504,7 @@  menu "Erlang libraries/modules"
 	source "package/erlang-p1-zlib/Config.in"
 endmenu
 endif
+	source "package/execline/Config.in"
 	source "package/ficl/Config.in"
 	source "package/gauche/Config.in"
 	source "package/guile/Config.in"
diff --git a/package/execline/Config.in b/package/execline/Config.in
new file mode 100644
index 0000000..8e2e6dc
--- /dev/null
+++ b/package/execline/Config.in
@@ -0,0 +1,12 @@ 
+config BR2_PACKAGE_EXECLINE
+	bool "execline"
+	select BR2_PACKAGE_SKALIBS
+	depends on BR2_USE_MMU # skalibs
+	help
+	  execline is a (non-interactive) scripting language, like sh ; but its
+	  syntax is quite different from a traditional shell syntax.
+	  The execlineb program is meant to be used as an interpreter for a text
+	  file; the other commands are essentially useful inside an execlineb
+	  script.
+
+	  http://skarnet.org/software/execline/
diff --git a/package/execline/Config.in.host b/package/execline/Config.in.host
new file mode 100644
index 0000000..4e188e1
--- /dev/null
+++ b/package/execline/Config.in.host
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_HOST_EXECLINE
+	bool "host execline"
+	help
+	  Host version of execline, a (non-interactive) scripting language,
+	  like sh.
+
+	  http://skarnet.org/software/execline/
diff --git a/package/execline/execline.hash b/package/execline/execline.hash
new file mode 100644
index 0000000..61fc99c
--- /dev/null
+++ b/package/execline/execline.hash
@@ -0,0 +1,2 @@ 
+# Locally generated
+sha256 93bd744f2e3ad204cb89f147efdc6ca4e622f9c6bfc9895e0b2cb8b0480029de execline-2.2.0.0.tar.gz
diff --git a/package/execline/execline.mk b/package/execline/execline.mk
new file mode 100644
index 0000000..5f17eea
--- /dev/null
+++ b/package/execline/execline.mk
@@ -0,0 +1,69 @@ 
+################################################################################
+#
+# execline
+#
+################################################################################
+
+EXECLINE_VERSION = 2.2.0.0
+EXECLINE_SITE = http://skarnet.org/software/execline
+EXECLINE_LICENSE = ISC
+EXECLINE_LICENSE_FILES = COPYING
+EXECLINE_INSTALL_STAGING = YES
+EXECLINE_DEPENDENCIES = skalibs
+
+EXECLINE_CONF_OPTS = \
+	--prefix=/usr \
+	--with-sysdeps=$(STAGING_DIR)/usr/lib/skalibs/sysdeps \
+	--with-include=$(STAGING_DIR)/usr/include \
+	--with-dynlib=$(STAGING_DIR)/usr/lib \
+	--with-lib=$(STAGING_DIR)/usr/lib/skalibs \
+	$(if $(BR2_STATIC_LIBS),,--disable-allstatic) \
+	$(SHARED_STATIC_LIBS_OPTS)
+
+define EXECLINE_CONFIGURE_CMDS
+	(cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure $(EXECLINE_CONF_OPTS))
+endef
+
+define EXECLINE_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define EXECLINE_REMOVE_STATIC_LIB_DIR
+	rm -rf $(TARGET_DIR)/usr/lib/execline
+endef
+
+EXECLINE_POST_INSTALL_TARGET_HOOKS += EXECLINE_REMOVE_STATIC_LIB_DIR
+
+define EXECLINE_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+define EXECLINE_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+endef
+
+HOST_EXECLINE_DEPENDENCIES = host-skalibs
+
+HOST_EXECLINE_CONF_OPTS = \
+	--prefix=/usr \
+	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
+	--with-include=$(HOST_DIR)/usr/include \
+	--with-dynlib=$(HOST_DIR)/usr/lib \
+	--disable-static \
+	--enable-shared \
+	--disable-allstatic
+
+define HOST_EXECLINE_CONFIGURE_CMDS
+	(cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_EXECLINE_CONF_OPTS))
+endef
+
+define HOST_EXECLINE_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR)
+endef
+
+define HOST_EXECLINE_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))