[PATCH] D38298: A logic to copy LLVM licences into docker images.

Ilya Biryukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 11:20:23 PDT 2017


ilya-biryukov updated this revision to Diff 116847.
ilya-biryukov added a comment.

- Copy licenses in bash instead of Python.


https://reviews.llvm.org/D38298

Files:
  utils/docker/debian8/release/Dockerfile
  utils/docker/example/release/Dockerfile
  utils/docker/nvidia-cuda/release/Dockerfile
  utils/docker/scripts/build_install_llvm.sh


Index: utils/docker/scripts/build_install_llvm.sh
===================================================================
--- utils/docker/scripts/build_install_llvm.sh
+++ utils/docker/scripts/build_install_llvm.sh
@@ -191,6 +191,37 @@
   echo "Skipping checksumming checks..."
 fi
 
+# Copy licences into docker image.
+LICENCES_DIR="$CLANG_INSTALL_DIR/share/llvm/licenses"
+mkdir -p "$LICENCES_DIR"
+
+function copy_license_file() {
+  local SOURCE_RELPATH="$1"
+  local SOURCE_DIR_RELPATH="$(dirname "$SOURCE_RELPATH")"
+
+  echo "Copying licencese file $SOURCE_RELPATH"
+  mkdir -p "$LICENCES_DIR/$SOURCE_DIR_RELPATH"
+  cp "$SOURCE_RELPATH" "$LICENCES_DIR/$SOURCE_RELPATH"
+}
+
+echo "Copying licences for the Docker images."
+echo "Please note that the list of licenses may be incomplete or outdated."
+
+pushd "$CLANG_BUILD_DIR/src"
+
+for PROJECT in $LLVM_PROJECTS; do
+  find "$PROJECT" -iname "license*" | while read SOURCE_FILE; do
+    copy_license_file "$SOURCE_FILE"
+  done
+
+  if [ "$PROJECT" == "llvm" ]; then
+    copy_license_file "llvm/lib/Support/MD5.cpp"
+    copy_license_file "llvm/include/llvm/Support/MD5.h"
+  fi
+done
+
+popd # "$CLANG_BUILD_DIR/src"
+
 mkdir "$CLANG_BUILD_DIR/build"
 pushd "$CLANG_BUILD_DIR/build"
 
Index: utils/docker/nvidia-cuda/release/Dockerfile
===================================================================
--- utils/docker/nvidia-cuda/release/Dockerfile
+++ utils/docker/nvidia-cuda/release/Dockerfile
@@ -16,6 +16,7 @@
 
 # FIXME: Change maintainer name.
 LABEL maintainer "LLVM Developers"
+LABEL licences "LLVM licenses are under /usr/local/share/llvm/licences"
 
 # Unpack clang installation into this container.
 ADD clang.tar.gz /usr/local/
Index: utils/docker/example/release/Dockerfile
===================================================================
--- utils/docker/example/release/Dockerfile
+++ utils/docker/example/release/Dockerfile
@@ -15,6 +15,7 @@
 
 # FIXME: Change maintainer name.
 LABEL maintainer "Maintainer <maintainer at email>"
+LABEL licences "LLVM licenses are under /usr/local/share/llvm/licences"
 
 # FIXME: Install all packages you want to have in your release container.
 # A minimal useful installation must include libstdc++ and binutils.
Index: utils/docker/debian8/release/Dockerfile
===================================================================
--- utils/docker/debian8/release/Dockerfile
+++ utils/docker/debian8/release/Dockerfile
@@ -11,6 +11,7 @@
 FROM launcher.gcr.io/google/debian8:latest
 
 LABEL maintainer "LLVM Developers"
+LABEL licences "LLVM licenses are under /usr/local/share/llvm/licences"
 
 # Install packages for minimal useful image.
 RUN apt-get update && \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38298.116847.patch
Type: text/x-patch
Size: 2681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170927/b37d6762/attachment.bin>


More information about the llvm-commits mailing list