[1/3] ninja: New package

Message ID 20201226164800.18960-1-stefan.schantl@ipfire.org
State Accepted
Commit f8c5644dc5facad5a1b3a0265ff4ff3bf9f6fe49
Headers
Series [1/3] ninja: New package |

Commit Message

Stefan Schantl Dec. 26, 2020, 4:47 p.m. UTC
  This tool required to build more and more packages.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/rootfiles/common/ninja |  1 +
 lfs/ninja                     | 84 +++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 config/rootfiles/common/ninja
 create mode 100644 lfs/ninja
  

Comments

Michael Tremer Dec. 27, 2020, 10:53 a.m. UTC | #1
Hello,

Excellent work.

I am not entirely sure if we might not need to move this a little bit up in make.sh, but we will see that as soon as more and more things have to be built with it. As far as I can see, we could even package these things for the toolchain, which I would like to avoid if we can.

Thank you for looking into this. Merged.

-Michael

> On 26 Dec 2020, at 17:47, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> This tool required to build more and more packages.
> 
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
> config/rootfiles/common/ninja |  1 +
> lfs/ninja                     | 84 +++++++++++++++++++++++++++++++++++
> 2 files changed, 85 insertions(+)
> create mode 100644 config/rootfiles/common/ninja
> create mode 100644 lfs/ninja
> 
> diff --git a/config/rootfiles/common/ninja b/config/rootfiles/common/ninja
> new file mode 100644
> index 000000000..f402add1b
> --- /dev/null
> +++ b/config/rootfiles/common/ninja
> @@ -0,0 +1 @@
> +#usr/bin/ninja
> diff --git a/lfs/ninja b/lfs/ninja
> new file mode 100644
> index 000000000..c968345f4
> --- /dev/null
> +++ b/lfs/ninja
> @@ -0,0 +1,84 @@
> +###############################################################################
> +#                                                                             #
> +# IPFire.org - A linux based firewall                                         #
> +# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
> +#                                                                             #
> +# This program is free software: you can redistribute it and/or modify        #
> +# it under the terms of the GNU General Public License as published by        #
> +# the Free Software Foundation, either version 3 of the License, or           #
> +# (at your option) any later version.                                         #
> +#                                                                             #
> +# This program is distributed in the hope that it will be useful,             #
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
> +# GNU General Public License for more details.                                #
> +#                                                                             #
> +# You should have received a copy of the GNU General Public License           #
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
> +#                                                                             #
> +###############################################################################
> +
> +###############################################################################
> +# Definitions
> +###############################################################################
> +
> +include Config
> +
> +VER        = 1.10.2
> +
> +THISAPP    = ninja-$(VER)
> +DL_FILE    = $(THISAPP).tar.gz
> +DL_FROM    = $(URL_IPFIRE)
> +DIR_APP    = $(DIR_SRC)/$(THISAPP)
> +TARGET     = $(DIR_INFO)/$(THISAPP)
> +
> +###############################################################################
> +# Top-level Rules
> +###############################################################################
> +
> +objects = $(DL_FILE)
> +
> +$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
> +
> +$(DL_FILE)_MD5 = 639f75bc2e3b19ab893eaf2c810d4eb4
> +
> +install : $(TARGET)
> +
> +check : $(patsubst %,$(DIR_CHK)/%,$(objects))
> +
> +download :$(patsubst %,$(DIR_DL)/%,$(objects))
> +
> +md5 : $(subst %,%_MD5,$(objects))
> +
> +###############################################################################
> +# Downloading, checking, md5sum
> +###############################################################################
> +
> +$(patsubst %,$(DIR_CHK)/%,$(objects)) :
> +	@$(CHECK)
> +
> +$(patsubst %,$(DIR_DL)/%,$(objects)) :
> +	@$(LOAD)
> +
> +$(subst %,%_MD5,$(objects)) :
> +	@$(MD5)
> +
> +###############################################################################
> +# Installation Details
> +###############################################################################
> +
> +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
> +	@$(PREBUILD)
> +	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
> +
> +	# Configure and bootstrap the build environment
> +	cd $(DIR_APP) && python3 configure.py --bootstrap --verbose
> +
> +	# Build ninja
> +	cd $(DIR_APP) && ./ninja -v all 
> +
> +	# Install ninja.
> +	cd $(DIR_APP) && install -vm755 ninja /usr/bin/
> +
> +	@rm -rf $(DIR_APP)
> +	@$(POSTBUILD)
> -- 
> 2.20.1
>
  

Patch

diff --git a/config/rootfiles/common/ninja b/config/rootfiles/common/ninja
new file mode 100644
index 000000000..f402add1b
--- /dev/null
+++ b/config/rootfiles/common/ninja
@@ -0,0 +1 @@ 
+#usr/bin/ninja
diff --git a/lfs/ninja b/lfs/ninja
new file mode 100644
index 000000000..c968345f4
--- /dev/null
+++ b/lfs/ninja
@@ -0,0 +1,84 @@ 
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 1.10.2
+
+THISAPP    = ninja-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 639f75bc2e3b19ab893eaf2c810d4eb4
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+	@$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+	@$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+	@$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+	@$(PREBUILD)
+	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+
+	# Configure and bootstrap the build environment
+	cd $(DIR_APP) && python3 configure.py --bootstrap --verbose
+
+	# Build ninja
+	cd $(DIR_APP) && ./ninja -v all 
+
+	# Install ninja.
+	cd $(DIR_APP) && install -vm755 ninja /usr/bin/
+
+	@rm -rf $(DIR_APP)
+	@$(POSTBUILD)