From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] new package: jsen
Date: Tue, 16 Feb 2016 22:25:40 +0100 [thread overview]
Message-ID: <20160216222540.64878554@free-electrons.com> (raw)
In-Reply-To: <1455605293-1869-1-git-send-email-atul.singh.mandla@rockwellcollins.com>
Atul,
Thanks also for this contribution. As usual, a few comments.
First, the title should be:
jsen: new package
As per our convention for naming the commits for new packages.
On Tue, 16 Feb 2016 12:18:13 +0530, Atul Singh wrote:
> diff --git a/package/Config.in b/package/Config.in
> index a5b31aa..cb3a3c8 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -994,6 +994,7 @@ menu "JSON/XML"
> source "package/expat/Config.in"
> source "package/ezxml/Config.in"
> source "package/jansson/Config.in"
> + source "package/jsen/Config.in"
> source "package/json-c/Config.in"
> source "package/json-glib/Config.in"
> source "package/jsoncpp/Config.in"
I am not sure JSON/XML is the appropriate place. Yes, jsen is related
to JSON, but I believe its main characteristic is that it is a
Javascript library. So it should probably go under the Javascript menu,
where we already have another package named json-javascript.
Yegor, what do you think? If the number of Javascript libraries becomes
really huge, then we can start creating sub-categories. But it is too
early to do this now.
> diff --git a/package/jsen/jsen.mk b/package/jsen/jsen.mk
> new file mode 100644
> index 0000000..e939739
> --- /dev/null
> +++ b/package/jsen/jsen.mk
> @@ -0,0 +1,32 @@
> +################################################################################
> +#
> +# jsen
> +#
> +################################################################################
> +
> +JSEN_VERSION = v0.6.0
> +JSEN_SITE = $(call github,bugventure,jsen,$(JSEN_VERSION))
> +JSEN_LICENSE = MIT
> +JSEN_LICENSE_FILES = LICENSE
> +JSEN_DIRECTORIES_LIST = dist lib
> +JSEN_ROOT_FILES_LIST = index.js
> +
> +define JSEN_INSTALL_TARGET_CMDS
> + # Install required directories
> + for dir in $(JSEN_DIRECTORIES_LIST); \
> + do \
> + $(INSTALL) -d $(TARGET_DIR)/usr/share/jsen/$$dir && \
> + $(INSTALL) -m 0644 -t $(TARGET_DIR)/usr/share/jsen/$$dir \
> + $(@D)/$$dir/*.* || exit 1; \
> + done
> +
> + # Install required files from the root directory
> + for file in $(JSEN_ROOT_FILES_LIST); \
> + do \
> + $(INSTALL) -D -m 0644 $(@D)/$$file \
> + $(TARGET_DIR)/usr/share/jsen/$$file \
> + || exit 1; \
> + done
> +endef
I think this is more complicated than it needs to be. What about:
define JSEN_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/share/jsen
$(foreach d,dist lib index.js,\
cp -dpfr $(@D)/$(d) $(TARGET_DIR)/usr/share/jsen/$(sep))
endef
As a side note, I am wondering if we shouldn't create some common
infrastructure to simplify all those packages that just need to "copy"
stuff. Either a special variable in the generic-package infrastructure,
or a separate "copy-package" infrastructure that provides a special
variable that allows the package to list "stuff to be copied" and
another listing "where to copy". But that's clearly beyond the scope of
your patch, so don't worry about this.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-02-16 21:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 6:48 [Buildroot] [PATCH 1/1] new package: jsen Atul Singh
2016-02-16 21:25 ` Thomas Petazzoni [this message]
2016-02-16 21:34 ` Yegor Yefremov
2016-02-16 23:33 ` [Buildroot] copy-package infrastructure [was: Re: [PATCH 1/1] new package: jsen] Arnout Vandecappelle
2016-02-17 7:55 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160216222540.64878554@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox