Commit graph

19 commits

Author SHA1 Message Date
Francois Perrad f5c6d238cf package/pkg-luarocks: add per package upgrade target
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-12-31 17:46:11 +01:00
Thomas Petazzoni 8676830223 package/pkg-luarocks: drop flock at installation time
In commit 22b327fc74 ("pkg-luarocks: fix
top-level parallel makefile support"), a flock on $(TARGET_DIR) was
added to ensure that two Luarocks packages are not installed at the
same time.

However, to support top-level parallel build, we have now clearly
decided that per-package folders is a requirement. Therefore,
TARGET_DIR is anyway going to be different for each package, making
this flock unnecessary.

Trying to use top-level parallel build without per-package folder is
simply not supported, so this commit drops the unnecessary flock.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: Francois Perrad <francois.perrad@gadz.org>
2018-11-19 21:43:34 +01:00
Thomas Petazzoni 7d47af583c package/pkg-luarocks: use <pkg>_EXTRACT_DEPENDENCIES
The host luarocks tool is needed when *extracting* luarocks
packages. Since regular dependencies are only available at the
configure step, it caused the "luarocks" program to be available too
late to be used to extract luarocks packages.

To work around this, host-luarocks was manually added as a dependency
of the extract step of luarocks packages. While this worked fine until
now, it breaks badly with per-package folders, because host-luarocks
is not recorded as an extract dependency of luarocks packages, and
therefore is not copied to the per-package host folder, causing a
failure.

In the mean time, the <pkg>_EXTRACT_DEPENDENCIES mechanism was added,
which aims at fixing exactly this problem, so let's use it and
simplify pkg-luarocks.mk.

Cc: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni &lt;<a href="mailto:thomas.petazzoni@bootlin.com" target="_blank">thomas.petazzoni@bootlin.com</a>&gt;<br>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-11-16 20:25:25 +01:00
Maxime Hadjinlian d506f873e4 pkg-{download, generic, luarocks}: use existing $($(PKG)_DL_DIR)
Let the infrastructure use the already existing variable $(PKG)_DL_DIR

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-04-02 16:04:03 +02:00
Arnout Vandecappelle 01372b0d60 luarocks-package: lowercase the upstream name for LuaRocks
LuaRocks has a policy that the rockspec and rock filenames are lower
case. However, the upstream name may contain uppercase characters.
We have several packages like that in Buildroot. To simplify the
package .mk files, apply the lowercase from within the infra.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-05 22:01:39 +01:00
Arnout Vandecappelle 75cf694bb0 luarocks-package: introduce PKG_NAME_UPSTREAM
Since we now require Lua package names to start with "lua", it is likely
that the Buildroot name is different from the upstream LuaRocks name.
Add a feature to the luarocks-package infra that makes it easier to
handle this situation: the package can explicitly specify the upstream
name in PKG_NAME_UPSTREAM, and that name will be used in PKG_ROCKSPEC,
PKG_SOURCE and PKG_SUBDIR.

Add an explanation of this feature to the manual. To make the example
relevant, it is changed to lua-foo, where the upstream name is plain
foo. To avoid confusion with the dependency on a native library, that
dependency is renamed to bar.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-02 23:25:55 +01:00
Arnout Vandecappelle 55d74b88d6 luarocks-package: rework extraction
The luarocks package infra extracts the package directly under
$(BUILD_DIR), because the contents are always in a subdirectory name
<pkg>-<version>. However, this only works when the upstream package name
is the same as the Buildroot package name.

Instead, we can rely on the fixed structure of a .src.rock: it always
contains the source subdirectory in a directory called foo, where foo
is the basename of the .src.rock file. Therefore, we can extract into
a subdirectory of $($(PKG)_DIR), then move its contents up two
directory levels.

Note, we can't extract directly into $($(PKG)_DIR) because it's
possible that $($(PKG)_SUBDIR) == <pkg>-<version>. In that case, we
would try to move the directory unto itself and get "Directory not
empty". This is the case e.g. for the lpty package.

Two alternatives were considered but are more complicated:
- instead of using wildcards for the move, we could have used
  <.src.rock basename>/$($(PKG)_SUBDIR);
- instead of extracting with luarocks, we could use unzip to extract
  (the .src.rock is a ZIP file), but then we also have to move the
  .rockspec into the subdir. In addition, sometimes the ZIP file
  contains a tarball instead of the extracted source.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-02 23:15:51 +01:00
Arnout Vandecappelle 0be874d89a luarocks-package: use $(HOST_PKG_VERSION) instead of $(PKG_VERSION)
The inner-luarocks-package macro was using $(3)_VERSION as the package
version, i.e. the version of the target package, even when it's the
host package. We should instead use $(2)_VERSION, i.e. the host package
version, like is done in inner-generic-package.

Since luarocks-package doesn't even support a host version, it doens't
make a whole lot of difference, but let's keep things consistent.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-02 22:39:30 +01:00
Fabio Porcedda 22b327fc74 pkg-luarocks: fix top-level parallel makefile support
In the *-install-target phase the manifest file is being updated, if multiply packages try to update it they fail.

To avoid multiple access to the manifest file use flock to sync
multiple luarocks packages.

e.g. installing three luarocks packages:
make lua-cjson-build lua-coat-build lua-coatpersistent-build
make lua-cjson lua-coat lua-coatpersistent -j

Fix error:
Updating manifest for /home/tetsuya/buildroot/br2/output/target/usr/lib/luarocks/rocks
No existing manifest. Attempting to rebuild...

Error: rock_manifest file not found for lua-coat 0.9.1-1 - not a LuaRocks 2 tree?

[Thomas: get rid of LUAROCKS_RUN, and use LUAROCKS_RUN_ENV +
LUAROCKS_RUN_CMD everywhere.]

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-04 15:21:33 +02:00
Jerzy Grzegorek e800531761 package: indentation cleanup
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-11-02 23:27:01 +01:00
Thomas De Schampheleire a603eb1c47 packages: rename FOO_BUILD_OPT into FOO_BUILD_OPTS
To be consistent with the recent change of FOO_MAKE_OPT into FOO_MAKE_OPTS,
make the same change for FOO_BUILD_OPT.

Sed command used:
   find * -type f | xargs sed -i 's#_BUILD_OPT\>#&S#g'

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-04 18:54:30 +02:00
Francois Perrad 5363cf1733 luarocks: move the option --deps-mode
The option moves from `luarocks make` command to the LuaRocks config file.

This change and the merge of PR https://github.com/keplerproject/luarocks/pull/236
in LuaRocks 2.2.0 avoids the confusing message "Missing dependency"

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-26 09:04:05 +02:00
Thomas De Schampheleire 60714bb2ed trivial: fix typo 'informations'
In English, unlike in French, almost all usages of the word 'information'
are uncountable, meaning that 'informations' is invalid.
This patch fixes this typo throughout the tree, except in CHANGES and
docs/news.html (historic text).

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-24 22:31:20 +02:00
Thomas De Schampheleire 5bd9ed6fe6 trivial: fix typo 'an host'
In English, unlike in French, the 'h' in 'host' is pronounced, meaning that
the article should be 'a' instead of 'an'.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-24 22:29:54 +02:00
Thomas De Schampheleire 54456cc698 infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.

This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.

In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).

Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
  $(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
  originally it would cause very odd results.

- The output of 'make printvars' is now much more useful. This target shows
  the value of all variables, and the expression that led to that value.
  However, if the expression was coming from an inner-xxx-targets block, and
  was using single dollar signs, it would show in printvars as
    VAR = value (value)
  while if double dollar signs are used, it would effectively look like
    VAR = value (actual expression)
  as is intended.
  This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
  FOO_SITE_METHOD and FOO_MAKE.

The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.

Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-14 19:09:54 +02:00
Fabio Porcedda 207d2acf6b infra: add to luarocks support for top-level parallel make
The host-luarock dependency is not always satisfied for the extract
phase because the %-extract target is not anymore in the dependency
chain.
To be sure that the dependency is satisfied add the dependency to the
stamp file $(%_TARGET_EXTRACT) instead of the %-extract target.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Francois Perrad <fperrad@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-04 23:45:38 +02:00
Thomas De Schampheleire 26aef889f1 infra: remove unused 4th parameter to package infrastructures (pkgparentdir)
The fourth parameter to inner-generic-package is no longer used. Removing
this parameters requires renaming all usages of $(5) to $(4), and updating
the calls to inner-generic-package (and equivalent for the other package
infrastructures).

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-05 12:10:35 +01:00
Thomas De Schampheleire 3880a6ab3c infra: remove redundant $(call) on pkgdir, pkgname, pkgparentdir
When calling make 'functions', the $(call) keyword is only needed if the
function takes arguments. For pkgdir, pkgname and pkgparentdir this is not
the case, so we can remove the call to make things more readable.

Suggested-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-05 12:09:35 +01:00
Francois Perrad 72afb294ff luarocks: new infrastructure
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[yann.morin.1998@free.fr: apply Thomas' comments]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-13 23:17:18 +01:00