You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2022/04/05 10:04:26 UTC

[buildstream-plugins] 11/49: Initially adding make element

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git

commit 2e26118765815f3592e8e5a2818e420dd5c10fc3
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Fri Mar 18 17:16:45 2022 +0900

    Initially adding make element
    
    From bst-plugins-experimental
---
 src/buildstream_plugins/elements/make.py   | 52 ++++++++++++++++++++++++++++++
 src/buildstream_plugins/elements/make.yaml | 48 +++++++++++++++++++++++++++
 2 files changed, 100 insertions(+)

diff --git a/src/buildstream_plugins/elements/make.py b/src/buildstream_plugins/elements/make.py
new file mode 100644
index 0000000..4a94132
--- /dev/null
+++ b/src/buildstream_plugins/elements/make.py
@@ -0,0 +1,52 @@
+#
+#  Copyright Bloomberg Finance LP
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+#  Authors:
+#        Ed Baunton <eb...@bloomberg.net>
+
+"""
+make - Make build element
+=========================
+This is a `BuildElement
+<https://docs.buildstream.build/master/buildstream.scriptelement.html#module-buildstream.scriptelement>`_
+implementation for using GNU make based build.
+
+.. note::
+
+   The ``make`` element is available since `format version 9
+   <https://docs.buildstream.build/master/format_project.html#project-format-version>`_
+
+Here is the default configuration for the ``make`` element in full:
+
+  .. literalinclude:: ../../../src/buildstream_plugins/elements/make.yaml
+     :language: yaml
+
+See `built-in functionality documentation
+<https://docs.buildstream.build/master/buildstream.buildelement.html#core-buildelement-builtins>`_ for
+details on common configuration options for build elements.
+"""
+
+from buildstream import BuildElement
+
+
+# Element implementation for the 'make' kind.
+class MakeElement(BuildElement):
+
+    BST_MIN_VERSION = "2.0"
+
+
+# Plugin entry point
+def setup():
+    return MakeElement
diff --git a/src/buildstream_plugins/elements/make.yaml b/src/buildstream_plugins/elements/make.yaml
new file mode 100644
index 0000000..58e2da4
--- /dev/null
+++ b/src/buildstream_plugins/elements/make.yaml
@@ -0,0 +1,48 @@
+# make default configurations
+
+variables:
+  make-args: >-
+    PREFIX="%{prefix}"
+  make-install-args: >-
+    %{make-args}
+    DESTDIR="%{install-root}"
+    install
+  make: make %{make-args}
+  make-install: make -j1 %{make-install-args}
+
+  # Set this if the sources cannot handle parallelization.
+  #
+  # notparallel: True
+
+config:
+
+  # Commands for building the software
+  #
+  build-commands:
+  - |
+    %{make}
+
+  # Commands for installing the software into a
+  # destination folder
+  #
+  install-commands:
+  - |
+    %{make-install}
+
+  # Commands for stripping debugging information out of
+  # installed binaries
+  #
+  strip-commands:
+  - |
+    %{strip-binaries}
+
+# Use max-jobs CPUs for building and enable verbosity
+environment:
+  MAKEFLAGS: -j%{max-jobs}
+  V: 1
+
+# And dont consider MAKEFLAGS or V as something which may
+# affect build output.
+environment-nocache:
+- MAKEFLAGS
+- V