From patchwork Sun May 17 22:33:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus X-Patchwork-Id: 1292272 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=cosmos-ink.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=cosmos-ink.net header.i=@cosmos-ink.net header.a=rsa-sha256 header.s=dkim header.b=RLOFTjdL; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49QHGY0GPyz9sT4 for ; Mon, 18 May 2020 08:42:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BE599869BC; Sun, 17 May 2020 22:42:41 +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 0XgRKYMEl1MA; Sun, 17 May 2020 22:42:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 00BF4869AC; Sun, 17 May 2020 22:42:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0B7271BF390 for ; Sun, 17 May 2020 22:42:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 07E4C869AC for ; Sun, 17 May 2020 22:42:39 +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 Y2hizeQZ1dus for ; Sun, 17 May 2020 22:42:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.cosmos-ink.net (mail.cosmos-ink.net [45.9.61.171]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 957B38699E for ; Sun, 17 May 2020 22:42:37 +0000 (UTC) Received: from cosmos-ink.net (unknown [10.77.77.5]) by mail.cosmos-ink.net (Postcow) with ESMTP id 314732C1B9A; Mon, 18 May 2020 00:34:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cosmos-ink.net; s=dkim; t=1589754840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/KahgeVkBH2mec8hYgt8JnLJzwonHbIeeohWHWH41DY=; b=RLOFTjdLq2acmHpfynRtay5M/t7wA6FmXH1xKtRkrKmPgborkV3KlS4KT7s4tuWk46AQS3 F9Hy7VDnzvmgkH96DwGtD0Bo+atE8h4UdjoggOtWobcgwBzxo4axtxvyxxUWLHYtKNfqb/ n4HjXdoSeQwZZzMjrfC4ddZ778M/UzvOn5jkTXN6d3dBkda6VRhtO/hI4p40HniUvky77r 6o2+XgsI5hZ9kG8mLYR2qBRp6gI98BT7soI5E9RYU9UukTe/cHZjz8vQwFcE0VIw5GUcBH /mwQgMbTYIdo6W5pSxw6kLIX2dVxOtEVcyM/BwKLlVc9Li2fmm886tXZXg+zMA== From: Linus Kaschulla To: buildroot@buildroot.org Date: Mon, 18 May 2020 00:33:28 +0200 Message-Id: <20200517223328.97234-1-linus@cosmos-ink.net> In-Reply-To: References: MIME-Version: 1.0 X-Last-TLS-Session-Version: None Authentication-Results: mail.cosmos-ink.net; none X-Rspamd-Queue-Id: 314732C1B9A X-Spamd-Result: default: False [11.40 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_FIVE(0.00)[6]; FREEMAIL_ENVRCPT(0.00)[gmail.com,free.fr,gmx.net]; DKIM_SIGNED(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SPOOFED_UNAUTH(5.00)[]; FREEMAIL_CC(0.00)[gmail.com,barkynet.com,free.fr,gmx.net,cosmos-ink.net]; SUSPICIOUS_RECIPS(1.50)[]; RCPT_MAILCOW_DOMAIN(0.00)[cosmos-ink.net] X-Spam: Yes Subject: [Buildroot] [PATCH 1/1] package/nodejs: expose capability to compile host library X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Seiderer , Linus Kaschulla , Daniel Price , "Yann E . MORIN" , Martin Bark Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" To use nodejs on the host (independant of the actual system) to create some static files to place onto the target rootfs nodejs can be very helpful. The provided nodejs package didn't show the possibility to create a host package. But upon further examination I noticed that the package does it in fact (in the .mk). It specifies dependencies for the package with the host prefix and also invokes $(host-generic-package) as well as $(generic-package) which is the only one assumed from the config. This commit adds a Config.in.host file that uses the dependencies given from HOST_NODEJS_DEPENDENCIES in the makefile. (It also add the host config to the package overview.) With this change other packages can require BR2_PACKAGE_HOST_NODEJS without any problems or the buildsystem not fully knowing about this. Seems that someone added the capability (as a step for the cross- compiled nodejs) and didn't notice that this is a handy package by itself. When installing global npm packages (with -g), the parameter `--prefix $(HOST_DIR)` can be used to ensure that nodejs doesn't try to install it onto the real host filesystem. I already used this change to create static web files from Angular and place onto a target that doesn't need nodejs itself. This patch contains fixes based on feedback from: - Peter Seiderer - Yann E. MORIN Signed-off-by: Linus Kaschulla --- package/Config.in.host | 1 + package/nodejs/Config.in.host | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 package/nodejs/Config.in.host diff --git a/package/Config.in.host b/package/Config.in.host index f1246c708f..510249a496 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -48,6 +48,7 @@ menu "Host utilities" source "package/mtd/Config.in.host" source "package/mtools/Config.in.host" source "package/mxsldr/Config.in.host" + source "package/nodejs/Config.in.host" source "package/omap-u-boot-utils/Config.in.host" source "package/openocd/Config.in.host" source "package/opkg-utils/Config.in.host" diff --git a/package/nodejs/Config.in.host b/package/nodejs/Config.in.host new file mode 100644 index 0000000000..b149023b0d --- /dev/null +++ b/package/nodejs/Config.in.host @@ -0,0 +1,3 @@ +config BR2_PACKAGE_HOST_NODEJS + bool "host nodejs" + select BR2_PACKAGE_HOST_PYTHON