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:28 UTC

[buildstream-plugins] 13/49: Initially adding setuptools 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 c108d3ef4c7221f63acb6d93a652f4583b602c0b
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Fri Mar 18 17:23:49 2022 +0900

    Initially adding setuptools element
    
    Previously the distutils element from bst-plugins-experimental
---
 src/buildstream_plugins/elements/setuptools.py   | 46 +++++++++++++++++++++++
 src/buildstream_plugins/elements/setuptools.yaml | 47 ++++++++++++++++++++++++
 2 files changed, 93 insertions(+)

diff --git a/src/buildstream_plugins/elements/setuptools.py b/src/buildstream_plugins/elements/setuptools.py
new file mode 100644
index 0000000..e0de141
--- /dev/null
+++ b/src/buildstream_plugins/elements/setuptools.py
@@ -0,0 +1,46 @@
+#
+#  Copyright (C) 2016 Codethink Limited
+#
+#  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:
+#        Tristan Van Berkom <tr...@codethink.co.uk>
+
+"""
+setuptools - Python setuptools element
+======================================
+A `BuildElement
+<https://docs.buildstream.build/master/buildstream.buildelement.html#module-buildstream.buildelement>`_
+implementation for using python setuptools
+
+The setuptools default configuration:
+  .. literalinclude:: ../../../src/buildstream_plugins/elements/setuptools.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 python 'setuptools' kind.
+class SetuptoolsElement(BuildElement):
+
+    BST_MIN_VERSION = "2.0"
+
+
+# Plugin entry point
+def setup():
+    return SetuptoolsElement
diff --git a/src/buildstream_plugins/elements/setuptools.yaml b/src/buildstream_plugins/elements/setuptools.yaml
new file mode 100644
index 0000000..c407937
--- /dev/null
+++ b/src/buildstream_plugins/elements/setuptools.yaml
@@ -0,0 +1,47 @@
+# Default python distutils configuration
+
+variables:
+
+  # When building for python2 distutils, simply
+  # override this in the element declaration
+  python: python3
+
+  python-build: |
+
+    %{python} %{conf-root}/setup.py build
+
+  install-args: |
+
+    --prefix "%{prefix}" \
+    --root "%{install-root}"
+
+  python-install: |
+
+    %{python} %{conf-root}/setup.py install %{install-args}
+
+
+config:
+
+  # Commands for configuring the software
+  #
+  configure-commands: []
+
+  # Commands for building the software
+  #
+  build-commands:
+  - |
+    %{python-build}
+
+  # Commands for installing the software into a
+  # destination folder
+  #
+  install-commands:
+  - |
+    %{python-install}
+
+  # Commands for stripping debugging information out of
+  # installed binaries
+  #
+  strip-commands:
+  - |
+    %{strip-binaries}