diff mbox

[1/2] ninja: new package

Message ID 1465047243-1169-2-git-send-email-eric.le.bihan.dev@free.fr
State Changes Requested
Headers show

Commit Message

Eric Le Bihan June 4, 2016, 1:34 p.m. UTC
This new package provides Ninja, a small build system with a focus on
speed.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/Config.in        |  1 +
 package/ninja/Config.in  | 11 +++++++++++
 package/ninja/ninja.hash |  1 +
 package/ninja/ninja.mk   | 39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 52 insertions(+)
 create mode 100644 package/ninja/Config.in
 create mode 100644 package/ninja/ninja.hash
 create mode 100644 package/ninja/ninja.mk

Comments

Bernd Kuhls June 4, 2016, 3:50 p.m. UTC | #1
Hi,

please try to add support for python3:

> +HOST_NINJA_DEPENDENCIES = host-python

HOST_NINJA_DEPENDENCIES = $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)

> +define HOST_NINJA_BUILD_CMDS
> +	(cd $(@D); ./configure.py --bootstrap)
> +endef

define HOST_NINJA_BUILD_CMDS
	(cd $(@D); ./configure.py --bootstrap --verbose --with-python=$(HOST_DIR)/usr/bin/python)
endef

What is the purpose of having ninja on the target machine?

Regards, Bernd
Eric Le Bihan June 4, 2016, 6:03 p.m. UTC | #2
Hi!

Le Sat, 04 Jun 2016 17:50:34 +0200,
Bernd Kuhls <bernd.kuhls@t-online.de> a écrit :

> please try to add support for python3:

OK, will do!

> What is the purpose of having ninja on the target machine?

Ninja is used by Meson, which I also provide for the target. It is true
that the "Development tools" section now only lists "make" as build
system, since autotools have been removed. I do not know if Buildroot
users frequently need build systems on their target, but I provided it
anyway.

If the policy is to provide build system packages only for the host,
I'm fine with it.

Thanks for the comments.
Thomas Petazzoni June 8, 2016, 8:16 p.m. UTC | #3
Hello,

On Sat,  4 Jun 2016 15:34:02 +0200, Eric Le Bihan wrote:

> diff --git a/package/ninja/ninja.hash b/package/ninja/ninja.hash
> new file mode 100644
> index 0000000..e5908f3
> --- /dev/null
> +++ b/package/ninja/ninja.hash
> @@ -0,0 +1 @@
> +none xxx ninja-v1.7.1.tar.gz

Please add a locally calculated hash here. Tarballs generated by github
are now stable, so we can add hashes.

Thanks,

Thomas
Thomas Petazzoni June 8, 2016, 8:17 p.m. UTC | #4
Hello,

On Sat, 4 Jun 2016 20:03:01 +0200, Eric Le Bihan wrote:

> Ninja is used by Meson, which I also provide for the target. It is true
> that the "Development tools" section now only lists "make" as build
> system, since autotools have been removed. I do not know if Buildroot
> users frequently need build systems on their target, but I provided it
> anyway.

"make" was only kept in the development tools because it was needed to
be able to *run* the uClibc test suite on the target. This has been
changed a few days ago, so I believe we don't really need "make"
anymore as a target package.

> If the policy is to provide build system packages only for the host,
> I'm fine with it.

Yes, please provide them only as host packages. However, do you have a
target package that would use them? Without this, the host packages are
orphan and never tested by anything, which isn't good.

So could you submit ninja/python-meson together with at least one
target package that uses them?

Thanks!

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 9f6e0d9..4146bf9 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -148,6 +148,7 @@  endif
 	source "package/jq/Config.in"
 	source "package/libtool/Config.in"
 	source "package/make/Config.in"
+	source "package/ninja/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/patch/Config.in"
 endif
diff --git a/package/ninja/Config.in b/package/ninja/Config.in
new file mode 100644
index 0000000..a8eba2e
--- /dev/null
+++ b/package/ninja/Config.in
@@ -0,0 +1,11 @@ 
+config BR2_PACKAGE_NINJA
+	bool "ninja"
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  Ninja is a small build system with a focus on speed.
+
+	  https://ninja-build.org/
+
+comment "ninja needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
diff --git a/package/ninja/ninja.hash b/package/ninja/ninja.hash
new file mode 100644
index 0000000..e5908f3
--- /dev/null
+++ b/package/ninja/ninja.hash
@@ -0,0 +1 @@ 
+none xxx ninja-v1.7.1.tar.gz
diff --git a/package/ninja/ninja.mk b/package/ninja/ninja.mk
new file mode 100644
index 0000000..ae9251c
--- /dev/null
+++ b/package/ninja/ninja.mk
@@ -0,0 +1,39 @@ 
+################################################################################
+#
+# ninja
+#
+################################################################################
+
+NINJA_VERSION = v1.7.1
+NINJA_SITE = $(call github,ninja-build,ninja,$(NINJA_VERSION))
+NINJA_LICENSE = Apache-2.0
+NINJA_LICENSE_FILES = COPYING
+
+NINJA_DEPENDENCIES = host-ninja
+
+NINJA_MAKE_OPTS = CXX="$(TARGET_CXX)" AR="$(TARGET_AR)"
+
+define NINJA_CONFIGURE_CMDS
+	(cd $(@D); $(NINJA_MAKE_OPTS) ./configure.py)
+endef
+
+define NINJA_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/ninja)
+endef
+
+define NINJA_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/ninja $(TARGET_DIR)/usr/bin/ninja
+endef
+
+HOST_NINJA_DEPENDENCIES = host-python
+
+define HOST_NINJA_BUILD_CMDS
+	(cd $(@D); ./configure.py --bootstrap)
+endef
+
+define HOST_NINJA_INSTALL_CMDS
+	$(INSTALL) -m 0755 $(@D)/ninja $(HOST_DIR)/usr/bin/ninja
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))