From patchwork Thu Nov 14 20:17:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Perrad X-Patchwork-Id: 291358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 3FC712C009A for ; Fri, 15 Nov 2013 07:19:50 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 256F79BAD2; Thu, 14 Nov 2013 20:19:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X2gnez9BHx6C; Thu, 14 Nov 2013 20:19:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D61729BF06; Thu, 14 Nov 2013 20:19:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E8FDB1BF831 for ; Thu, 14 Nov 2013 20:19:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E65C88F748 for ; Thu, 14 Nov 2013 20:19:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tauyEqT3mbOa for ; Thu, 14 Nov 2013 20:19:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by whitealder.osuosl.org (Postfix) with ESMTPS id 056388F743 for ; Thu, 14 Nov 2013 20:19:29 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id b13so2617227wgh.20 for ; Thu, 14 Nov 2013 12:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IyBW0sY0Tg3TJmXxjmtg4+h4KXiS0+FKFEQ3Ow6oLbI=; b=XrVZL/zxrV33gk4fCUBuK6yUHdFfDKbUVZvcBF56RTCwQS43HzDRENUm4zI5Ysl3xT 7eUD6yJ3nd/FK0q4E/j5EOTVGShU060XIjhkV78ovmQ+AcCQlgSRl/dWuP1iBN7SgKlG Dk/p1NWEY9l9kv59c+ny+peKGx/qHaoemGSHzQsLTKHe2CtVMBGOmiZmE2Gs9LkbcFp3 yD4TwxZT4t9iM/K/Kw5wXrOS54ubQcoPoFfcFOeT3tLXUzX4lypKJ3csAJvvc6HVq52r NxjIgHlD9lY7+y6XUP4kts1FoI3gElg5fe9Gv9wk3EVwkPlhF4Pdor6AiCKRdO/lq7Az VCBA== X-Received: by 10.180.211.212 with SMTP id ne20mr4570384wic.31.1384460368586; Thu, 14 Nov 2013 12:19:28 -0800 (PST) Received: from localhost.localdomain (149.117.82.79.rev.sfr.net. [79.82.117.149]) by mx.google.com with ESMTPSA id uc12sm1924488wib.3.2013.11.14.12.19.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Nov 2013 12:19:28 -0800 (PST) From: Francois Perrad To: buildroot@busybox.net Date: Thu, 14 Nov 2013 21:17:29 +0100 Message-Id: <1384460249-32410-10-git-send-email-francois.perrad@gadz.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1384460249-32410-1-git-send-email-francois.perrad@gadz.org> References: <1384460249-32410-1-git-send-email-francois.perrad@gadz.org> Subject: [Buildroot] [pkg-luarocks infra V3 10/10] manual: adding packages luarocks X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Francois Perrad --- docs/manual/adding-packages-luarocks.txt | 91 ++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 93 insertions(+) create mode 100644 docs/manual/adding-packages-luarocks.txt diff --git a/docs/manual/adding-packages-luarocks.txt b/docs/manual/adding-packages-luarocks.txt new file mode 100644 index 0000000..d3a883b --- /dev/null +++ b/docs/manual/adding-packages-luarocks.txt @@ -0,0 +1,91 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +Infrastructure for LuaRocks-based packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[[luarocks-package-tutorial]] + ++luarocks-package+ tutorial +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +First, let's see how to write a +.mk+ file for a LuaRocks-based package, +with an example : + +------------------------ +01: ################################################################################ +02: # +03: # luafoo +04: # +05: ################################################################################ +06: +07: LUAFOO_VERSION = 1.0.2-1 +08: LUAFOO_DEPENDENCIES = foo +09: +10: LUAFOO_BUILD_OPT += FOO_INCDIR=$(STAGING_DIR)/usr/include +11: LUAFOO_BUILD_OPT += FOO_LIBDIR=$(STAGING_DIR)/usr/lib +12: +13: $(eval $(luarocks-package)) +------------------------ + +On line 7, we declare the version of the package (the same as in the rockspec, +which is the concatenation of the upstream version and the rockspec revision). + +On line 8, we declare our dependencies, so that they are built +before the build process of our package starts. + +On line 10-11, we tell Buildroot to pass custom options to LuaRocks when it is +building the package. + +Finally, on line 13, we invoke the +luarocks-package+ +macro that generates all the Makefile rules that actually allows the +package to be built. + +[[luarocks-package-reference]] + ++luarocks-package+ reference +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +LuaRocks is a deployment and management system for Lua modules. + +LuaRocks supports various +build.type+ : +builtin+, +make+, +cmake+. +This infrastructure supports only the +builtin+ mode, +the +make+ & +cmake+ modes could be directly handled by generic & cmake infrastructure. + +The main macro of the LuaRocks package infrastructure is ++luarocks-package+. It is similar to the +generic-package+ macro. +The +host-luarocks-package+ macro is not available, +only the +luarocks-package+ macro is available. + +Just like the generic infrastructure, the LuaRocks infrastructure works +by defining a number of variables before calling the +luarocks-package+ +macro. + +First, all the package metadata information variables that exist in +the generic infrastructure also exist in the LuaRocks infrastructure: ++LUAFOO_VERSION+, +LUAFOO_SOURCE+, +LUAFOO_SITE+, ++LUAFOO_DEPENDENCIES+. + +Two of them are populate by the LuaRocks infrastructure (for the ++download+ step) : + +* +LUAFOO_SITE+ with the +BR2_LUAROCKS_MIRROR+ value + +* +LUAFOO_SOURCE+ with +foo-$(FOO_VERSION).src.rock+ + +A few additional variables, specific to the LuaRocks infrastructure, are +also defined. They could be overrided in specific cases. + +* +LUAFOO_ROCKSPEC+ with +foo-$(FOO_VERSION).rockspec+ + +* +LUAFOO_SUBDIR+ with +foo-$(FOO_VERSION_WITHOUT_ROCKSPEC_REVISION)+ + +* +LUAFOO_BUILD_OPT+ contains the build option for +luarocks build+ call. + The default is empty. + +With the LuaRocks infrastructure, only 2 steps use +luarocks+ : +extract and install target. +luarocks+ handles building and install +in the same step. + +The step +patch+ is handled by the generic infrastructure. +The step +configure+ and +build+ stay empty. diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt index ae76e74..b9ac058 100644 --- a/docs/manual/adding-packages.txt +++ b/docs/manual/adding-packages.txt @@ -18,6 +18,8 @@ include::adding-packages-autotools.txt[] include::adding-packages-cmake.txt[] +include::adding-packages-luarocks.txt[] + include::adding-packages-hooks.txt[] include::adding-packages-gettext.txt[]