Patchwork [v2] jimtcl: New package

login
register
mail settings
Submitter Ezequiel Garcia
Date June 28, 2013, 2:32 p.m.
Message ID <1372429944-2732-1-git-send-email-elezegarcia@gmail.com>
Download mbox | patch
Permalink /patch/255400/
State Accepted
Headers show

Comments

Ezequiel Garcia - June 28, 2013, 2:32 p.m.
Add new jimtcl package - a lightweight tclsh alternative.
Useful for a lighter footprint usb_modeswitch installation.
tclsh size is ~700kB for ARM compared to ~200kB for jimtcl.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
Changes from v1:

 * Use selected Debian mirror to get the package sources,
   instead of Jim Tcl's Git repository. Suggested by Gustavo.

 * Use positive logic in ifeq's. Suggested by Gustavo.

 * Build a shared library by default, and make this depend on
   BR_PREFER_STATIC_LIB option.

 package/Config.in        |  1 +
 package/jimtcl/Config.in |  9 +++++++
 package/jimtcl/jimtcl.mk | 62 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 72 insertions(+)
 create mode 100644 package/jimtcl/Config.in
 create mode 100644 package/jimtcl/jimtcl.mk
Peter Korsgaard - July 2, 2013, 9:27 p.m.
>>>>> "Ezequiel" == Ezequiel Garcia <elezegarcia@gmail.com> writes:

 Ezequiel> Add new jimtcl package - a lightweight tclsh alternative.
 Ezequiel> Useful for a lighter footprint usb_modeswitch installation.
 Ezequiel> tclsh size is ~700kB for ARM compared to ~200kB for jimtcl.

 Ezequiel> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 Ezequiel> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
 Ezequiel> ---
 Ezequiel> Changes from v1:

 Ezequiel>  * Use selected Debian mirror to get the package sources,
 Ezequiel>    instead of Jim Tcl's Git repository. Suggested by Gustavo.

 Ezequiel>  * Use positive logic in ifeq's. Suggested by Gustavo.

 Ezequiel>  * Build a shared library by default, and make this depend on
 Ezequiel>    BR_PREFER_STATIC_LIB option.

 Ezequiel>  package/Config.in        |  1 +
 Ezequiel>  package/jimtcl/Config.in |  9 +++++++
 Ezequiel>  package/jimtcl/jimtcl.mk | 62 ++++++++++++++++++++++++++++++++++++++++++++++++
 Ezequiel>  3 files changed, 72 insertions(+)
 Ezequiel>  create mode 100644 package/jimtcl/Config.in
 Ezequiel>  create mode 100644 package/jimtcl/jimtcl.mk

 Ezequiel> diff --git a/package/Config.in b/package/Config.in
 Ezequiel> index 0eb6a9c..b62f90a 100644
 Ezequiel> --- a/package/Config.in
 Ezequiel> +++ b/package/Config.in
 Ezequiel> @@ -307,6 +307,7 @@ source "package/erlang/Config.in"
 Ezequiel>  source "package/enscript/Config.in"
 Ezequiel>  source "package/haserl/Config.in"
 Ezequiel>  source "package/jamvm/Config.in"
 Ezequiel> +source "package/jimtcl/Config.in"
 Ezequiel>  source "package/lua/Config.in"
 Ezequiel>  source "package/luajit/Config.in"
 Ezequiel>  if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT
 Ezequiel> diff --git a/package/jimtcl/Config.in b/package/jimtcl/Config.in
 Ezequiel> new file mode 100644
 Ezequiel> index 0000000..c7a12f2
 Ezequiel> --- /dev/null
 Ezequiel> +++ b/package/jimtcl/Config.in
 Ezequiel> @@ -0,0 +1,9 @@
 Ezequiel> +config BR2_PACKAGE_JIMTCL
 Ezequiel> +	bool "jimtcl"
 Ezequiel> +	help
 Ezequiel> +	  Jim Tcl is a small footprint reimplementation of the Tcl scripting language.
 Ezequiel> +	  The core language engine is compatible with Tcl 8.5+, while implementing
 Ezequiel> +	  a significant subset of the Tcl 8.6 command set, plus additional features
 Ezequiel> +	  available only in Jim Tcl.

Help text should get wrapped so it fits within 80 chars (including tab).

 Ezequiel> +
 Ezequiel> +	  http://jim.tcl.tk
 Ezequiel> diff --git a/package/jimtcl/jimtcl.mk b/package/jimtcl/jimtcl.mk
 Ezequiel> new file mode 100644
 Ezequiel> index 0000000..97c8a42
 Ezequiel> --- /dev/null
 Ezequiel> +++ b/package/jimtcl/jimtcl.mk
 Ezequiel> @@ -0,0 +1,62 @@
 Ezequiel> +#############################################################
 Ezequiel> +#
 Ezequiel> +# jimtcl
 Ezequiel> +#
 Ezequiel> +#############################################################

The #### lines should be 80 chars.

 Ezequiel> +
 Ezequiel> +JIMTCL_VERSION = 0.73
 Ezequiel> +JIMTCL_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/j/jimtcl
 Ezequiel> +JIMTCL_SOURCE = jimtcl_$(JIMTCL_VERSION).orig.tar.bz2
 Ezequiel> +JIMTCL_INSTALL_STAGING = YES
 Ezequiel> +
 Ezequiel> +JIMTCL_HEADERS_TO_INSTALL = \
 Ezequiel> +	jim.h \
 Ezequiel> +	jim-eventloop.h \
 Ezequiel> +	jim-signal.h \
 Ezequiel> +	jim-subcmd.h \
 Ezequiel> +	jim-win32compat.h \

I don't know anything about jimsh, but with that file name is it really
needed?

Committed with these fixes, thanks.

Patch

diff --git a/package/Config.in b/package/Config.in
index 0eb6a9c..b62f90a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -307,6 +307,7 @@  source "package/erlang/Config.in"
 source "package/enscript/Config.in"
 source "package/haserl/Config.in"
 source "package/jamvm/Config.in"
+source "package/jimtcl/Config.in"
 source "package/lua/Config.in"
 source "package/luajit/Config.in"
 if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT
diff --git a/package/jimtcl/Config.in b/package/jimtcl/Config.in
new file mode 100644
index 0000000..c7a12f2
--- /dev/null
+++ b/package/jimtcl/Config.in
@@ -0,0 +1,9 @@ 
+config BR2_PACKAGE_JIMTCL
+	bool "jimtcl"
+	help
+	  Jim Tcl is a small footprint reimplementation of the Tcl scripting language.
+	  The core language engine is compatible with Tcl 8.5+, while implementing
+	  a significant subset of the Tcl 8.6 command set, plus additional features
+	  available only in Jim Tcl.
+
+	  http://jim.tcl.tk
diff --git a/package/jimtcl/jimtcl.mk b/package/jimtcl/jimtcl.mk
new file mode 100644
index 0000000..97c8a42
--- /dev/null
+++ b/package/jimtcl/jimtcl.mk
@@ -0,0 +1,62 @@ 
+#############################################################
+#
+# jimtcl
+#
+#############################################################
+
+JIMTCL_VERSION = 0.73
+JIMTCL_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/j/jimtcl
+JIMTCL_SOURCE = jimtcl_$(JIMTCL_VERSION).orig.tar.bz2
+JIMTCL_INSTALL_STAGING = YES
+
+JIMTCL_HEADERS_TO_INSTALL = \
+	jim.h \
+	jim-eventloop.h \
+	jim-signal.h \
+	jim-subcmd.h \
+	jim-win32compat.h \
+	jim-config.h \
+
+ifeq ($(BR2_PACKAGE_TCL),)
+define JIMTCL_LINK_TCLSH
+	ln -sf jimsh $(TARGET_DIR)/usr/bin/tclsh
+endef
+endif
+
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+JIMTCL_SHARED =
+JIMTCL_LIB = a
+JIMTCL_INSTALL_LIB =
+else
+JIMTCL_SHARED = --shared
+JIMTCL_LIB = so
+JIMTCL_INSTALL_LIB = $(INSTALL) -D $(@D)/libjim.$(JIMTCL_LIB) \
+		     $(TARGET_DIR)/usr/lib/libjim.$(JIMTCL_LIB)
+endif
+
+define JIMTCL_CONFIGURE_CMDS
+	(cd $(@D); \
+		$(TARGET_CONFIGURE_OPTS) \
+		./configure --prefix=/usr \
+		$(JIMTCL_SHARED) \
+	)
+endef
+
+define JIMTCL_BUILD_CMDS
+	$(MAKE) -C $(@D)
+endef
+
+define JIMTCL_INSTALL_STAGING_CMDS
+	for i in $(JIMTCL_HEADERS_TO_INSTALL); do \
+		cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ ; \
+	done; \
+	$(INSTALL) -D $(@D)/libjim.$(JIMTCL_LIB) $(STAGING_DIR)/usr/lib/libjim.$(JIMTCL_LIB)
+endef
+
+define JIMTCL_INSTALL_TARGET_CMDS
+	$(INSTALL) -D $(@D)/jimsh $(TARGET_DIR)/usr/bin/jimsh
+	$(JIMTCL_INSTALL_LIB)
+	$(JIMTCL_LINK_TCLSH)
+endef
+
+$(eval $(generic-package))