Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#8447 from jamiesnape/licenses
Browse files Browse the repository at this point in the history
Annotate packages with their licenses
  • Loading branch information
sammy-tri authored Mar 26, 2018
2 parents 05001ec + d876633 commit 0b4e69a
Show file tree
Hide file tree
Showing 63 changed files with 244 additions and 25 deletions.
12 changes: 7 additions & 5 deletions third_party/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package(default_visibility = ["//visibility:public"])

exports_files(
["com_github_bazelbuild_bazel/tools/cpp/osx_cc_wrapper.sh"],
licenses = ["notice"], # Apache-2.0
visibility = [
"//common:__pkg__",
"//tools/cc_toolchain:__pkg__",
Expand All @@ -14,21 +15,19 @@ exports_files(

exports_files(
["net_sf_jchart2d/LICENSE"],
licenses = ["restricted"], # LGPL-3.0+
visibility = ["//tools/workspace/net_sf_jchart2d:__pkg__"],
)

exports_files(
["com_github_robotlocomotion_libbot2/LICENSE.ldpc"],
visibility = ["@libbot//:__pkg__"],
)

exports_files(
glob(["com_kitware_gitlab_cmake_cmake/**"]),
licenses = ["notice"], # BSD-3-Clause
visibility = ["//tools/workspace/find_protobuf_cmake:__pkg__"],
)

exports_files(
glob(["josephdavisco_spruce/**"]),
licenses = ["notice"], # BSD-3-Clause
visibility = ["@spruce//:__pkg__"],
)

Expand All @@ -37,11 +36,13 @@ exports_files(
"com_github_google_protobuf/LICENSE",
"com_github_google_protobuf/protobuf.bzl",
],
licenses = ["notice"], # BSD-3-Clause
visibility = ["@com_google_protobuf//:__pkg__"],
)

exports_files(
["com_github_google_protobuf/protobuf-ubsan-fixup.h"],
licenses = ["notice"], # BSD-3-Clause
visibility = ["//common/proto:__pkg__"],
)

Expand All @@ -51,6 +52,7 @@ exports_files(
"__init__.py",
"wrappers.py",
]],
licenses = ["notice"], # BSD-2-Clause
visibility = ["//bindings/pydrake/third_party:__pkg__"],
)

Expand Down
1 change: 1 addition & 0 deletions tools/lint/buildifier-tables.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"new_local_repository.path": 300,
"new_local_repository.build_file_content": 360,

"pkg_config_repository.licenses": 100,
"pkg_config_repository.atleast_version": 200,
"pkg_config_repository.static": 201,
"pkg_config_repository.pkg_config_paths": 202,
Expand Down
12 changes: 10 additions & 2 deletions tools/workspace/blas/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@ load(
"pkg_config_repository",
)

def blas_repository(name, modname = "blas", **kwargs):
pkg_config_repository(name = name, modname = modname, **kwargs)
def blas_repository(
name,
licenses = ["notice"], # BSD-3-Clause
modname = "blas",
**kwargs):
pkg_config_repository(
name = name,
licenses = licenses,
modname = modname,
**kwargs)
5 changes: 4 additions & 1 deletion tools/workspace/boost/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def _impl(repository_ctx):

repository_ctx.symlink("{}/include/boost".format(prefix), "boost")

file_content = """
file_content = """# -*- python -*-
licenses(["notice"]) # BSL-1.0
cc_library(
name = "boost_headers",
hdrs = glob({}),
Expand Down
5 changes: 4 additions & 1 deletion tools/workspace/buildifier/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def _impl(repository_ctx):

repository_ctx.download(urls, output, sha256, executable = True)

content = """
content = """# -*- python -*-
licenses(["notice"]) # Apache-2.0
exports_files(
["buildifier"],
)
Expand Down
6 changes: 6 additions & 0 deletions tools/workspace/bullet/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ load(
)
load("@drake//tools/lint:python_lint.bzl", "python_lint")

licenses(["notice"]) # Zlib AND (BSD-3-Clause OR LGPL-2.1+ OR Zlib)

# Gimpact, which is used by BulletCollision offers a choice of three licenses,
# and we choose Zlib to match the license of the rest of Bullet. Hence, the
# license type only includes "notice" and not "restricted."

package(default_visibility = ["//visibility:public"])

config_setting(
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/ccd/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ load(
"install",
)

licenses(["notice"]) # BSD-3-Clause

package(
default_visibility = ["//visibility:public"],
)
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/com_google_protobuf/package.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- python -*-

licenses(["notice"]) # BSD-3-Clause

package(
default_visibility = ["//visibility:public"],
)
Expand Down
2 changes: 1 addition & 1 deletion tools/workspace/com_jidesoft_jide_oss/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def com_jidesoft_jide_oss_repository(
mirrors = None):
java_import_external(
name = name,
licenses = [],
licenses = ["restricted"], # GPL-2.0 WITH Classpath-exception-2.0
jar_urls = [
x.format(fulljar = "com/jidesoft/jide-oss/2.9.7/jide-oss-2.9.7.jar") # noqa
for x in mirrors.get("maven")
Expand Down
2 changes: 1 addition & 1 deletion tools/workspace/commons_io/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def commons_io_repository(
mirrors = None):
java_import_external(
name = name,
licenses = [],
licenses = ["notice"], # Apache-2.0
jar_urls = [
x.format(fulljar = "commons-io/commons-io/1.3.1/commons-io-1.3.1.jar") # noqa
for x in mirrors.get("maven")
Expand Down
17 changes: 17 additions & 0 deletions tools/workspace/drake_visualizer/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ def _impl(repository_ctx):

file_content = """# -*- python -*-
licenses([
"notice", # Apache-2.0 AND BSD-3-Clause AND Python-2.0
"reciprocal", # MPL-2.0
"restricted", # LGPL-2.1 AND LGPL-2.1+
"unencumbered", # Public-Domain
])
# drake-visualizer has the following non-system dependencies in addition to
# those declared in deps:
# ctkPythonConsole: Apache-2.0
# Eigen: BSD-3-Clause AND MPL-2.0 AND Public-Domain
# LCM: BSD-3-Clause AND LGPL-2.1 AND LGPL-2.1+
# Python: Python-2.0
# PythonQt: LGPL-2.1
# QtPropertyBrowser: LGPL-2.1
# TODO(jamiesnape): Enumerate system dependencies.
py_library(
name = "drake_visualizer_python_deps",
deps = [
Expand Down
12 changes: 12 additions & 0 deletions tools/workspace/dreal/package-ubuntu.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ load(
"IBEX_VERSION",
)

licenses(["notice"]) # Apache-2.0

package(default_visibility = ["//visibility:public"])

_DREAL_BASE = "opt/dreal/{}/".format(DREAL_VERSION)
Expand All @@ -34,6 +36,11 @@ cc_library(
],
)

# IBEX has the following dependencies in addition to those declared in deps:
# Clp: EPL-1
# CoinUtils: EPL-1
# bzip2: bzip2-1.0.6

cc_library(
name = "ibex",
srcs = [_IBEX_BASE + "lib/libdrake_ibex.so"],
Expand All @@ -44,6 +51,11 @@ cc_library(
_IBEX_BASE + "include/ibex",
_IBEX_BASE + "include/ibex/3rd",
],
licenses = [
"notice", # bzip2-1.0.6
"reciprocal", # EPL-1
"restricted", # LGPL-3.0
],
# The linkopts= here are transcribed from the contents of the *.pc file.
linkopts = [
"-lClp",
Expand Down
1 change: 1 addition & 0 deletions tools/workspace/dreal/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def _impl(repo_ctx):
format(repo_ctx.name, result.error))

dreal_repository = repository_rule(
# TODO(jamiesnape): Pass down licenses to setup_pkg_config_repository.
attrs = {
"modname": attr.string(default = "dreal"),
# This attribute is only used for macOS. It is documented in the
Expand Down
6 changes: 6 additions & 0 deletions tools/workspace/eigen/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ load(
)
load("@drake//tools/lint:python_lint.bzl", "python_lint")

licenses([
"notice", # BSD-3-Clause
"reciprocal", # MPL-2.0
"unencumbered", # Public-Domain
])

package(
default_visibility = ["//visibility:public"],
)
Expand Down
6 changes: 5 additions & 1 deletion tools/workspace/expat/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def _impl(repository_ctx):
repository_ctx.symlink("/usr/include/expat_external.h",
"include/expat_external.h")

file_content = """
file_content = """# -*- python -*-
licenses(["notice"]) # MIT
cc_library(
name = "expat",
hdrs = [
Expand All @@ -62,6 +65,7 @@ cc_library(
fail(error)

expat_repository = repository_rule(
# TODO(jamiesnape): Pass down licenses to setup_pkg_config_repository.
attrs = {
"modname": attr.string(default = "expat"),
},
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/fcl/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ load(
"drake_generate_include_header",
)

licenses(["notice"]) # BSD-3-Clause

package(
default_visibility = ["//visibility:public"],
)
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/fmt/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ load(
"install_cmake_config",
)

licenses(["notice"]) # BSD-2-Clause

package(
default_visibility = ["//visibility:public"],
)
Expand Down
15 changes: 13 additions & 2 deletions tools/workspace/freetype2/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ load(
"pkg_config_repository",
)

def freetype2_repository(name, modname = "freetype2", **kwargs):
pkg_config_repository(name = name, modname = modname, **kwargs)
def freetype2_repository(
name,
licenses = ["notice"], # BSD-2-Clause AND BSD-3-Clause AND
# (FTL OR GPL-2.0+)
modname = "freetype2",
pkg_config_paths = ["/usr/local/opt/freetype/lib/pkgconfig"],
**kwargs):
pkg_config_repository(
name = name,
licenses = licenses,
modname = modname,
pkg_config_paths = pkg_config_paths,
**kwargs)
6 changes: 5 additions & 1 deletion tools/workspace/gflags/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def _impl(repository_ctx):
if os_result.ubuntu_release == "16.04":
repository_ctx.symlink("/usr/include/gflags", "include/gflags")

file_content = """
file_content = """# -*- python -*-
licenses(["notice"]) # BSD-3-Clause
cc_library(
name = "gflags",
hdrs = [
Expand All @@ -62,6 +65,7 @@ cc_library(
fail(error)

gflags_repository = repository_rule(
# TODO(jamiesnape): Pass down licenses to setup_pkg_config_repository.
attrs = {
"modname": attr.string(default = "gflags"),
"pkg_config_paths": attr.string_list(
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/glew/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ load(

def glew_repository(
name,
licenses = ["notice"], # BSD-3-Clause AND MIT
modname = "glew",
pkg_config_paths = ["/usr/local/opt/glew/lib/pkgconfig"],
**kwargs):
pkg_config_repository(
name = name,
licenses = licenses,
modname = modname,
pkg_config_paths = pkg_config_paths,
**kwargs)
2 changes: 2 additions & 0 deletions tools/workspace/glib/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ load(

def glib_repository(
name,
licenses = ["restricted"], # LGPL-2.0+
modname = "glib-2.0",
pkg_config_paths = ["/usr/local/opt/glib/lib/pkgconfig"],
**kwargs):
pkg_config_repository(
name = name,
licenses = licenses,
modname = modname,
pkg_config_paths = pkg_config_paths,
**kwargs)
10 changes: 9 additions & 1 deletion tools/workspace/godotengine/package.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# -*- python -*-

licenses([
"notice", # Apache-2.0 AND BSD-3-Clause AND ISC AND MIT AND Zlib
"unencumbered", # Public-Domain
])

# Compile a tool that knows how to emit the version*.gen.h files.
py_binary(
name = "update_version",
Expand Down Expand Up @@ -87,7 +92,10 @@ cc_library(
],
)

# The packages that we want. Use "/**" to also glob their subpackages.
# The packages that we want. Use "/**" to also glob their subpackages. When
# adding new third-party packages to this list, verify that the licenses()
# function call at the top of this file and the inline comments next to it are
# still accurate.
_PACKAGES = [
"core/**",
"drivers",
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/gtest/package.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- python -*-

licenses(["notice"]) # BSD-3-Clause

config_setting(
name = "linux",
values = {"cpu": "k8"},
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/gurobi/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def _gurobi_impl(repository_ctx):

file_content = """# -*- python -*-
licenses(["by_exception_only"]) # Gurobi
package(default_visibility = ["//visibility:public"])
GUROBI_HDRS = glob([
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/ignition_math/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ load(
)
load("@drake//tools/workspace:generate_file.bzl", "generate_file")

licenses(["notice"]) # Apache-2.0

package(default_visibility = ["//visibility:public"])

config_setting(
Expand Down
2 changes: 2 additions & 0 deletions tools/workspace/ignition_rndf/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ load(
)
load("@drake//tools/workspace:generate_file.bzl", "generate_file")

licenses(["notice"]) # Apache-2.0

package(default_visibility = ["//visibility:public"])

config_setting(
Expand Down
Loading

0 comments on commit 0b4e69a

Please sign in to comment.