From f3f3c26e6dbf78794be8637e1b74bde3f77a2933 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Fri, 26 May 2017 11:19:26 -0400 Subject: [PATCH] Enable drake to be used as an external Bazel project: * Move all non-rule externals to `@drake//tools:externals.bzl` * Replace `@//` with `@drake//` * Replace `tools/*.BUILD` with `@drake//tools:*.BUILD` --- WORKSPACE | 338 +------------------------ tools/bot_core_lcmtypes.BUILD | 2 +- tools/ccd.BUILD | 2 +- tools/eigen.BUILD | 8 +- tools/externals.bzl | 357 +++++++++++++++++++++++++++ tools/fcl.BUILD | 2 +- tools/gtest.BUILD | 2 +- tools/ignition_math.BUILD | 2 +- tools/ipopt.BUILD | 6 +- tools/lcm.BUILD | 12 +- tools/libbot.BUILD | 2 +- tools/nlopt.BUILD | 6 +- tools/robotlocomotion_lcmtypes.BUILD | 2 +- tools/sdformat.BUILD | 2 +- tools/semantic_version.BUILD | 2 +- tools/spdlog.BUILD | 2 +- 16 files changed, 395 insertions(+), 352 deletions(-) create mode 100644 tools/externals.bzl diff --git a/WORKSPACE b/WORKSPACE index 1bc607fb64f2..2d756868755f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -3,208 +3,16 @@ # This file marks a workspace root for the Bazel build system. see # http://bazel.io/ . -# To temporarily use a local copy of a github_archive, within this file add a -# local_repository_archive argument to its github_archive macro call, e.g.: -# -# github_archive( -# name = "foobar", -# local_repository_override = "/path/to/local/foo/bar", -# repository = "foo/bar", -# commit = "0123456789abcdef0123456789abcdef01234567", -# sha256 = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", -# ) - workspace(name = "drake") -load("//tools/third_party/kythe/tools/build_rules/config:pkg_config.bzl", "pkg_config_package") -load("//tools:bitbucket.bzl", "bitbucket_archive") -load("//tools:github.bzl", "github_archive") -load('@bazel_tools//tools/build_defs/repo:git.bzl', 'git_repository') - -pkg_config_package( - name = "glib", - modname = "glib-2.0", -) - -load("//tools:python.bzl", "python_repository") -python_repository( - name = "python", - version = "2.7", -) - -load("//tools:numpy.bzl", "numpy_repository") -numpy_repository( - name = "numpy", - python_version = "2.7", -) - -github_archive( - name = "gtest", - repository = "google/googletest", - commit = "release-1.8.0", - sha256 = "58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8", - build_file = "tools/gtest.BUILD", -) - -github_archive( - name = "com_github_gflags_gflags", - repository = "gflags/gflags", - commit = "95ffb27c9c7496ede1409e042571054c70cb9519", - sha256 = "723c21f783c720c0403c9b44bf500d1961a08bd2635cbc117107af22d2e1643f", -) - -github_archive( - name = "google_styleguide", - repository = "google/styleguide", - commit = "159b4c81bbca97a9ca00f1195a37174388398a67", - sha256 = "3ed86946e6e637f0fe21749c0323b086e62c4b8b93694d6cedad615cdc584512", - build_file = "tools/google_styleguide.BUILD", -) - -github_archive( - name = "pycodestyle", - repository = "PyCQA/pycodestyle", - commit = "2.3.1", - sha256 = "e9fc1ca3fd85648f45c0d2e33591b608a17d8b9b78e22c5f898e831351bacb03", - build_file = "tools/pycodestyle.BUILD", -) - -bitbucket_archive( - name = "eigen", - repository = "eigen/eigen", - # N.B. See #5785; do your best not to have to bump this to a newer commit. - commit = "3.3.3", - sha256 = "94878cbfa27b0d0fbc64c00d4aafa137f678d5315ae62ba4aecddbd4269ae75f", - build_file = "tools/eigen.BUILD", - strip_prefix = "eigen-eigen-67e894c6cd8f", -) - -github_archive( - name = "spdlog", - repository = "gabime/spdlog", - commit = "43a4048b92ef5b7eff6dc637a621c7da3a41d194", - build_file = "tools/spdlog.BUILD", - sha256 = "5166c036eacd625b86f725bfba356547e0bc497232649662c61cde7b1b423292", -) - -github_archive( - name = "fmt", - repository = "fmtlib/fmt", - commit = "3.0.1", - build_file = "tools/fmt.BUILD", - sha256 = "dce62ab75a161dd4353a98364feb166d35e7eea382169d59d9ce842c49c55bad", -) - -maven_jar( - name = "net_sf_jchart2d_jchart2d", - artifact = "net.sf.jchart2d:jchart2d:3.3.2", - sha1 = "4950821eefe4c204903e68b4d45a558b5ebdd6fa", -) - -github_archive( - name = "lcm", - repository = "lcm-proj/lcm", - commit = "c0a0093a950fc83e12e8d5918a0319b590356e7e", - build_file = "tools/lcm.BUILD", - sha256 = "d5bb1a0153b9c1526590e7d65be8ca79e4f5e9bf4ce58178c992eaca49d17fb0", -) - -github_archive( - name = "libbot", - repository = "RobotLocomotion/libbot2", - commit = "495ae366d5e380b58254368217fc5c798e72aadd", - build_file = "tools/libbot.BUILD", - sha256 = "c463460a4dd6133d6d21e6ab6e493fdcdca442d2df86bcb56749f6740bc61db5", -) - -github_archive( - name = "bullet", - repository = "RobotLocomotion/bullet3", - commit = "ae2c4ca0618d55c6a29900aed75b958604149fdb", - build_file = "tools/bullet.BUILD", - sha256 = "2121dc8b0d33f50adbad8fc9ac5e007141df5cf5738fce72200c5bac4ffc589b", -) - -github_archive( - name = "ccd", - repository = "danfis/libccd", - commit = "16b9379fb6e8610566fe5e1396166daf7106f165", - build_file = "tools/ccd.BUILD", - sha256 = "fc583888c731d91c9ef287ca9ba443426ecfce75056d6c468b063b383bd8efa1", -) - -github_archive( - name = "octomap", - repository = "OctoMap/octomap", - commit = "6d7c31ae4df2c93cb8a954e44d442338b58d3558", - build_file = "tools/octomap.BUILD", - sha256 = "023ddd5b1e8ed1a70374c352cbd5b02bd5a26707f61a13cfb087766d5ca466e3", -) - -github_archive( - name = "fcl", - repository = "flexible-collision-library/fcl", - commit = "06d48b3b6f3605b8caf119d5208d8156eb64fe0d", - build_file = "tools/fcl.BUILD", - sha256 = "0a5652cac609cca58f85d68c08298e177867188ad730e78c8c9ac97eea8d32b4", -) - -github_archive( - name = "ipopt", - repository = "RobotLocomotion/ipopt-mirror", - commit = "aecf5abd3913eebf1b99167c0edd4e65a6b414bc", - build_file = "tools/ipopt.BUILD", - sha256 = "4ddde882913b9edc91f281edcdffccdd5343a8b6f1bc42b541188f49159e9768", -) - -github_archive( - name = "nlopt", - repository = "stevengj/nlopt", - commit = "516aca7e96405939726648e00faeb26bd2c9b29f", - build_file = "tools/nlopt.BUILD", - sha256 = "6041ca30072b354ed3c235743779bf17dacf6199b2b30746c499f65082665d5f", -) - -github_archive( - name = "optitrack_driver", - repository = "RobotLocomotion/optitrack-driver", - commit = "3a5da8d7c66c95ca98cda4dc7ca604f681464168", - sha256 = "a4d4c61ed5af59f12a273629eb28fa95ac2349abffe8912468bc5cf6dff34d28", -) - -github_archive( - name = "pybind11", - repository = "RobotLocomotion/pybind11", - commit = "6d72785766558047ee2e2075198c07d8c25eb631", - build_file = "tools/pybind11.BUILD", - sha256 = "08b4813b3b17f607efc4e8ba8b73bf55759ba744cab125e9fc666b5161cb1d0a", -) - -github_archive( - name = "bot_core_lcmtypes", - repository = "openhumanoids/bot_core_lcmtypes", - commit = "99676541398749c2aab4b5b2c38be77d268085cc", - build_file = "tools/bot_core_lcmtypes.BUILD", - sha256 = "896fd3edf87c7dfaae378af12d52d233577cc495ae96b5076c48b5b9ca700b4a", -) +# -- START drake externals +# Copy and paste this code section to any external Bazel projects that depend +# on drake and need its dependencies for convenience. +# @note See @drake//tools:externals.bzl for more info. -github_archive( - name = "robotlocomotion_lcmtypes", - repository = "RobotLocomotion/lcmtypes", - commit = "409a2d1fedfffea07b3e56c18efe1d0d9352f468", - build_file = "tools/robotlocomotion_lcmtypes.BUILD", - sha256 = "3131ae0e72da26b968cac74c07a2e471f9ff5c5ab75cb4d32fc42aa6f5744b99", -) - -github_archive( - name = "tinyobjloader", - repository = "syoyo/tinyobjloader", - commit = "9d9e987c4776d9df54e0ab65639e1befddb1d5ae", - build_file = "tools/tinyobjloader.BUILD", - sha256 = "e5c7ce01a153a3d9101f6c197e10145490ecd84ba7d0b6463708a60bc2845d4b", -) - -# Necessary for buildifier. +# Rule prerequisites. +load("@drake//tools:github.bzl", "github_archive") +# Required for buildifier. github_archive( name = "io_bazel_rules_go", repository = "bazelbuild/rules_go", @@ -212,131 +20,9 @@ github_archive( sha256 = "afec53d875013de6cebe0e51943345c587b41263fdff36df5ff651fbf03c1c08", ) -# Necessary for buildifier. -load("@io_bazel_rules_go//go:def.bzl", "go_repositories", "new_go_repository") - -# Necessary for buildifier. -go_repositories() - -# Necessary for buildifier. -new_go_repository( - name = "org_golang_x_tools", - commit = "3d92dd60033c312e3ae7cac319c792271cf67e37", - importpath = "golang.org/x/tools", -) - -github_archive( - name = "com_github_bazelbuild_buildtools", - repository = "bazelbuild/buildtools", - commit = "0.4.5", - sha256 = "7a732ea12d88ddbf9adc99ff5b5c39bfda53b6286ecc79c3bc082d5f53f46f44", -) - -github_archive( - name = "yaml_cpp", - repository = "jbeder/yaml-cpp", - commit = "85af926ddc5f3c8fb438001743e65ec3a039ceec", - build_file = "tools/yaml_cpp.BUILD", - sha256 = "d94cdb84f346ce4d9f1f891505ed257796103f70ce56590bdd02e025c8503b16", -) - -load("//tools:gurobi.bzl", "gurobi_repository") -gurobi_repository( - name = "gurobi", -) - -load("//tools:mosek.bzl", "mosek_repository") -mosek_repository( - name = "mosek", -) - -load("//tools:soft_failure.bzl", "soft_failure_binary_repository") -soft_failure_binary_repository( - name = "drake_visualizer", - local_path = __workspace_dir__ + "/build/install/bin/drake-visualizer", -) - -load("//tools:gfortran.bzl", "gfortran_repository") -gfortran_repository( - name = "gfortran", -) - -git_repository( - name = "snopt", - remote = "git@github.com:RobotLocomotion/snopt.git", - commit = "2ec980370eeb72897135b11570033a19bda885a7", -) - -# Python Libraries -load("//tools:pypi.bzl", "pypi_archive") -pypi_archive( - name = "six_archive", - package = "six", - version = "1.10.0", - sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a", - build_file = "tools/six.BUILD", -) - -bind( - name = "six", - actual = "@six_archive//:six", -) - -github_archive( - name = "protobuf", - repository = "google/protobuf", - commit = "v3.1.0", - sha256 = "0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7", -) - -pypi_archive( - name = "semantic_version", - version = "2.6.0", - sha256 = "2a4328680073e9b243667b201119772aefc5fc63ae32398d6afafff07c4f54c0", - build_file = "tools/semantic_version.BUILD", - strip_prefix = "semantic_version", -) - -github_archive( - name = "pycps", - repository = "mwoehlke/pycps", - commit = "a05280f1ef1d8970aca8c67dc4cf753953e3cdf7", - sha256 = "3024d25ddcb6bb6835834575e577f36bfd6e768501b8c2a2fd66181eb27108ce", - build_file = "tools/pycps.BUILD", -) - -# The "@python_headers//:python_headers" target is required by protobuf -# during "bazel query" but not "bazel build", so a stub is fine. -new_local_repository( - name = "python_headers", - path = "not/real/stub", - build_file_content = ("cc_library(name = 'python_headers', " + - "visibility = ['//visibility:public'])") -) - -bitbucket_archive( - name = "ignition_math", - repository = "ignitionrobotics/ign-math", - commit = "ignition-math3_3.2.0", - sha256 = "1948c1610fa4403bce7ba2a262a29662990ee66aab00882411a0868afe0e5309", - build_file = "tools/ignition_math.BUILD", - strip_prefix = "ignitionrobotics-ign-math-e86e5bb392e4" -) - -bitbucket_archive( - name = "ignition_rndf", - repository = "ignitionrobotics/ign-rndf", - commit = "ignition-rndf_0.1.2", - sha256 = "e0aa1489311679639717d3614c7c55edaa5f6de9a78c31ea48ea637bc1ba001a", - build_file = "tools/ignition_rndf.BUILD", - strip_prefix = "ignitionrobotics-ign-rndf-b20a4f68333f", -) - -bitbucket_archive( - name = "sdformat", - repository = "osrf/sdformat", - commit = "deca28cd6cd5", - sha256 = "d89a03178ef71d0a222247bf3fc4ccb8c490aebe83516f7290181d64e5da8dac", - build_file = "tools/sdformat.BUILD", - strip_prefix = "osrf-sdformat-deca28cd6cd5", +# Load external repostories. +load("@drake//tools:externals.bzl", "drake_external_repositories") +drake_external_repositories( + cmake_install_dir = __workspace_dir__ + "/build/install", ) +# -- END drake externals diff --git a/tools/bot_core_lcmtypes.BUILD b/tools/bot_core_lcmtypes.BUILD index 46c3b4062208..9b91a8cc06b8 100644 --- a/tools/bot_core_lcmtypes.BUILD +++ b/tools/bot_core_lcmtypes.BUILD @@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"]) -load("@//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") +load("@drake//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") lcm_cc_library( name = "bot_core_lcmtypes", diff --git a/tools/ccd.BUILD b/tools/ccd.BUILD index 9baafdb2caf9..114e8bfa4e41 100644 --- a/tools/ccd.BUILD +++ b/tools/ccd.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates config.h based on the defines= we want in Drake. cmake_configure_file( diff --git a/tools/eigen.BUILD b/tools/eigen.BUILD index 385a52e68601..9be5a170d505 100644 --- a/tools/eigen.BUILD +++ b/tools/eigen.BUILD @@ -1,7 +1,7 @@ # -*- python -*- -load("@//tools:install.bzl", "install", "install_files") -load("@//tools:python_lint.bzl", "python_lint") +load("@drake//tools:install.bzl", "install", "install_files") +load("@drake//tools:python_lint.bzl", "python_lint") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") package( @@ -25,8 +25,8 @@ cc_library( py_binary( name = "create-cps", - srcs = ["@//tools:eigen-create-cps.py"], - main = "@//tools:eigen-create-cps.py", + srcs = ["@drake//tools:eigen-create-cps.py"], + main = "@drake//tools:eigen-create-cps.py", visibility = ["//visibility:private"], ) diff --git a/tools/externals.bzl b/tools/externals.bzl new file mode 100644 index 000000000000..eaf2be856870 --- /dev/null +++ b/tools/externals.bzl @@ -0,0 +1,357 @@ +# -*- python -*- + +# This structure permits consuming drake as an external project in Bazel. +# This uses the workaround from the following Bazel GitHub issue: +# @ref https://github.com/bazelbuild/bazel/issues/2757#issuecomment-290448615 + +# Must use "load()" external to macros +# @ref https://github.com/bazelbuild/bazel/issues/1550 + +# This package must be loaded by WORKSPACE. +load("@io_bazel_rules_go//go:def.bzl", "go_repositories", "new_go_repository") + +# Generic repository types. +load("//tools/third_party/kythe/tools/build_rules/config:pkg_config.bzl", "pkg_config_package") +load("//tools:bitbucket.bzl", "bitbucket_archive") +load("//tools:github.bzl", "github_archive") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("//tools:soft_failure.bzl", "soft_failure_binary_repository") +load("//tools:pypi.bzl", "pypi_archive") + +# Specific repository types. +load("//tools:python.bzl", "python_repository") +load("//tools:numpy.bzl", "numpy_repository") +load("//tools:gurobi.bzl", "gurobi_repository") +load("//tools:mosek.bzl", "mosek_repository") +load("//tools:gfortran.bzl", "gfortran_repository") + +# To temporarily use a local copy of a github_archive, within this file add a +# local_repository_archive argument to its github_archive macro call, e.g.: +# +# github_archive( +# name = "foobar", +# local_repository_override = "/path/to/local/foo/bar", +# repository = "foo/bar", +# commit = "0123456789abcdef0123456789abcdef01234567", +# sha256 = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", +# ) + +def drake_external_repositories(cmake_install_dir=""): + """A macro to be called in the WORKSPACE that adds all externals that are + required by drake. + + This enables `drake` to be consumed as an external in Bazel, via mechanisms + such as + + The optional cmake_install_dir= is a workaround for #5621. This may point + to the CMake "build/install" directory which will contain `drake-visualizer` + under "$(cmake_install_dir)/bin/drake-visualizer". + """ + + # TODO(eric.cousineau): Add a list of packages to not define (e.g., if they are already incorporated). + # When this is added, add instructions on "bind" ("native.bind"), if a user + # would like to alias their external (or their own version of the library). + # TODO(eric.cousineau): Ensure "bind" works for aliasing externals still as + # an external, e.g., 'bind("@glib_local", "@glib")'. + + pkg_config_package( + name = "glib", + modname = "glib-2.0", + ) + + python_repository( + name = "python", + version = "2.7", + ) + + numpy_repository( + name = "numpy", + python_version = "2.7", + ) + + github_archive( + name = "gtest", + repository = "google/googletest", + commit = "release-1.8.0", + sha256 = "58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8", + build_file = "@drake//tools:gtest.BUILD", + ) + + github_archive( + name = "com_github_gflags_gflags", + repository = "gflags/gflags", + commit = "95ffb27c9c7496ede1409e042571054c70cb9519", + sha256 = "723c21f783c720c0403c9b44bf500d1961a08bd2635cbc117107af22d2e1643f", + ) + + github_archive( + name = "google_styleguide", + repository = "google/styleguide", + commit = "159b4c81bbca97a9ca00f1195a37174388398a67", + sha256 = "3ed86946e6e637f0fe21749c0323b086e62c4b8b93694d6cedad615cdc584512", + build_file = "@drake//tools:google_styleguide.BUILD", + ) + + github_archive( + name = "pycodestyle", + repository = "PyCQA/pycodestyle", + commit = "2.3.1", + sha256 = "e9fc1ca3fd85648f45c0d2e33591b608a17d8b9b78e22c5f898e831351bacb03", + build_file = "@drake//tools:pycodestyle.BUILD", + ) + + bitbucket_archive( + name = "eigen", + repository = "eigen/eigen", + # N.B. See #5785; do your best not to have to bump this to a newer commit. + commit = "3.3.3", + sha256 = "94878cbfa27b0d0fbc64c00d4aafa137f678d5315ae62ba4aecddbd4269ae75f", + build_file = "@drake//tools:eigen.BUILD", + strip_prefix = "eigen-eigen-67e894c6cd8f", + ) + + github_archive( + name = "spdlog", + repository = "gabime/spdlog", + commit = "43a4048b92ef5b7eff6dc637a621c7da3a41d194", + build_file = "@drake//tools:spdlog.BUILD", + sha256 = "5166c036eacd625b86f725bfba356547e0bc497232649662c61cde7b1b423292", + ) + + github_archive( + name = "fmt", + repository = "fmtlib/fmt", + commit = "3.0.1", + build_file = "@drake//tools:fmt.BUILD", + sha256 = "dce62ab75a161dd4353a98364feb166d35e7eea382169d59d9ce842c49c55bad", + ) + + native.maven_jar( + name = "net_sf_jchart2d_jchart2d", + artifact = "net.sf.jchart2d:jchart2d:3.3.2", + sha1 = "4950821eefe4c204903e68b4d45a558b5ebdd6fa", + ) + + github_archive( + name = "lcm", + repository = "lcm-proj/lcm", + commit = "c0a0093a950fc83e12e8d5918a0319b590356e7e", + build_file = "@drake//tools:lcm.BUILD", + sha256 = "d5bb1a0153b9c1526590e7d65be8ca79e4f5e9bf4ce58178c992eaca49d17fb0", + ) + + github_archive( + name = "libbot", + repository = "RobotLocomotion/libbot2", + commit = "495ae366d5e380b58254368217fc5c798e72aadd", + build_file = "@drake//tools:libbot.BUILD", + sha256 = "c463460a4dd6133d6d21e6ab6e493fdcdca442d2df86bcb56749f6740bc61db5", + ) + + github_archive( + name = "bullet", + repository = "RobotLocomotion/bullet3", + commit = "ae2c4ca0618d55c6a29900aed75b958604149fdb", + build_file = "@drake//tools:bullet.BUILD", + sha256 = "2121dc8b0d33f50adbad8fc9ac5e007141df5cf5738fce72200c5bac4ffc589b", + ) + + github_archive( + name = "ccd", + repository = "danfis/libccd", + commit = "16b9379fb6e8610566fe5e1396166daf7106f165", + build_file = "@drake//tools:ccd.BUILD", + sha256 = "fc583888c731d91c9ef287ca9ba443426ecfce75056d6c468b063b383bd8efa1", + ) + + github_archive( + name = "octomap", + repository = "OctoMap/octomap", + commit = "6d7c31ae4df2c93cb8a954e44d442338b58d3558", + build_file = "@drake//tools:octomap.BUILD", + sha256 = "023ddd5b1e8ed1a70374c352cbd5b02bd5a26707f61a13cfb087766d5ca466e3", + ) + + github_archive( + name = "fcl", + repository = "flexible-collision-library/fcl", + commit = "06d48b3b6f3605b8caf119d5208d8156eb64fe0d", + build_file = "@drake//tools:fcl.BUILD", + sha256 = "0a5652cac609cca58f85d68c08298e177867188ad730e78c8c9ac97eea8d32b4", + ) + + github_archive( + name = "ipopt", + repository = "RobotLocomotion/ipopt-mirror", + commit = "aecf5abd3913eebf1b99167c0edd4e65a6b414bc", + build_file = "@drake//tools:ipopt.BUILD", + sha256 = "4ddde882913b9edc91f281edcdffccdd5343a8b6f1bc42b541188f49159e9768", + ) + + github_archive( + name = "nlopt", + repository = "stevengj/nlopt", + commit = "516aca7e96405939726648e00faeb26bd2c9b29f", + build_file = "@drake//tools:nlopt.BUILD", + sha256 = "6041ca30072b354ed3c235743779bf17dacf6199b2b30746c499f65082665d5f", + ) + + github_archive( + name = "optitrack_driver", + repository = "RobotLocomotion/optitrack-driver", + commit = "3a5da8d7c66c95ca98cda4dc7ca604f681464168", + sha256 = "a4d4c61ed5af59f12a273629eb28fa95ac2349abffe8912468bc5cf6dff34d28", + ) + + github_archive( + name = "pybind11", + repository = "RobotLocomotion/pybind11", + commit = "6d72785766558047ee2e2075198c07d8c25eb631", + build_file = "@drake//tools:pybind11.BUILD", + sha256 = "08b4813b3b17f607efc4e8ba8b73bf55759ba744cab125e9fc666b5161cb1d0a", + ) + + github_archive( + name = "bot_core_lcmtypes", + repository = "openhumanoids/bot_core_lcmtypes", + commit = "99676541398749c2aab4b5b2c38be77d268085cc", + build_file = "@drake//tools:bot_core_lcmtypes.BUILD", + sha256 = "896fd3edf87c7dfaae378af12d52d233577cc495ae96b5076c48b5b9ca700b4a", + ) + + github_archive( + name = "robotlocomotion_lcmtypes", + repository = "RobotLocomotion/lcmtypes", + commit = "409a2d1fedfffea07b3e56c18efe1d0d9352f468", + build_file = "@drake//tools:robotlocomotion_lcmtypes.BUILD", + sha256 = "3131ae0e72da26b968cac74c07a2e471f9ff5c5ab75cb4d32fc42aa6f5744b99", + ) + + github_archive( + name = "tinyobjloader", + repository = "syoyo/tinyobjloader", + commit = "9d9e987c4776d9df54e0ab65639e1befddb1d5ae", + build_file = "@drake//tools:tinyobjloader.BUILD", + sha256 = "e5c7ce01a153a3d9101f6c197e10145490ecd84ba7d0b6463708a60bc2845d4b", + ) + + # Necessary for buildifier. + go_repositories() + + # Necessary for buildifier. + new_go_repository( + name = "org_golang_x_tools", + commit = "3d92dd60033c312e3ae7cac319c792271cf67e37", + importpath = "golang.org/x/tools", + ) + + github_archive( + name = "com_github_bazelbuild_buildtools", + repository = "bazelbuild/buildtools", + commit = "0.4.5", + sha256 = "7a732ea12d88ddbf9adc99ff5b5c39bfda53b6286ecc79c3bc082d5f53f46f44", + ) + + github_archive( + name = "yaml_cpp", + repository = "jbeder/yaml-cpp", + commit = "85af926ddc5f3c8fb438001743e65ec3a039ceec", + build_file = "@drake//tools:yaml_cpp.BUILD", + sha256 = "d94cdb84f346ce4d9f1f891505ed257796103f70ce56590bdd02e025c8503b16", + ) + + gurobi_repository( + name = "gurobi", + ) + + mosek_repository( + name = "mosek", + ) + + soft_failure_binary_repository( + name = "drake_visualizer", + local_path = cmake_install_dir + "/bin/drake-visualizer", + ) + + gfortran_repository( + name = "gfortran", + ) + + git_repository( + name = "snopt", + remote = "git@github.com:RobotLocomotion/snopt.git", + commit = "2ec980370eeb72897135b11570033a19bda885a7", + ) + + # Python Libraries + pypi_archive( + name = "six_archive", + package = "six", + version = "1.10.0", + sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a", + build_file = "@drake//tools:six.BUILD", + ) + + native.bind( + name = "six", + actual = "@six_archive//:six", + ) + + github_archive( + name = "protobuf", + repository = "google/protobuf", + commit = "v3.1.0", + sha256 = "0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7", + ) + + pypi_archive( + name = "semantic_version", + version = "2.6.0", + sha256 = "2a4328680073e9b243667b201119772aefc5fc63ae32398d6afafff07c4f54c0", + build_file = "@drake//tools:semantic_version.BUILD", + strip_prefix = "semantic_version", + ) + + github_archive( + name = "pycps", + repository = "mwoehlke/pycps", + commit = "a05280f1ef1d8970aca8c67dc4cf753953e3cdf7", + sha256 = "3024d25ddcb6bb6835834575e577f36bfd6e768501b8c2a2fd66181eb27108ce", + build_file = "@drake//tools:pycps.BUILD", + ) + + # The "@python_headers//:python_headers" target is required by protobuf + # during "bazel query" but not "bazel build", so a stub is fine. + native.new_local_repository( + name = "python_headers", + path = "not/real/stub", + build_file_content = ("cc_library(name = 'python_headers', " + + "visibility = ['//visibility:public'])") + ) + + bitbucket_archive( + name = "ignition_math", + repository = "ignitionrobotics/ign-math", + commit = "ignition-math3_3.2.0", + sha256 = "1948c1610fa4403bce7ba2a262a29662990ee66aab00882411a0868afe0e5309", + build_file = "@drake//tools:ignition_math.BUILD", + strip_prefix = "ignitionrobotics-ign-math-e86e5bb392e4" + ) + + bitbucket_archive( + name = "ignition_rndf", + repository = "ignitionrobotics/ign-rndf", + commit = "ignition-rndf_0.1.2", + sha256 = "e0aa1489311679639717d3614c7c55edaa5f6de9a78c31ea48ea637bc1ba001a", + build_file = "@drake//tools:ignition_rndf.BUILD", + strip_prefix = "ignitionrobotics-ign-rndf-b20a4f68333f", + ) + + bitbucket_archive( + name = "sdformat", + repository = "osrf/sdformat", + commit = "deca28cd6cd5", + sha256 = "d89a03178ef71d0a222247bf3fc4ccb8c490aebe83516f7290181d64e5da8dac", + build_file = "@drake//tools:sdformat.BUILD", + strip_prefix = "osrf-sdformat-deca28cd6cd5", + ) diff --git a/tools/fcl.BUILD b/tools/fcl.BUILD index 89185252c7f9..e39110900585 100644 --- a/tools/fcl.BUILD +++ b/tools/fcl.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates config.h based on the version numbers in CMake code. cmake_configure_file( diff --git a/tools/gtest.BUILD b/tools/gtest.BUILD index eebd3d145594..e2df62234ffc 100644 --- a/tools/gtest.BUILD +++ b/tools/gtest.BUILD @@ -30,7 +30,7 @@ cc_library( "googletest/include", ], linkopts = select({ - "@//tools:linux": ["-pthread"], + "@drake//tools:linux": ["-pthread"], "@//conditions:default": [], }), linkstatic = 1, diff --git a/tools/ignition_math.BUILD b/tools/ignition_math.BUILD index 5ca09bff909d..8c72d715d141 100644 --- a/tools/ignition_math.BUILD +++ b/tools/ignition_math.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates config.hh based on the version numbers in CMake code. cmake_configure_file( diff --git a/tools/ipopt.BUILD b/tools/ipopt.BUILD index f0d8942c7397..2ac062ea51b0 100644 --- a/tools/ipopt.BUILD +++ b/tools/ipopt.BUILD @@ -103,7 +103,7 @@ genrule( cmd = " ".join([ "(", "env", - "cdexec=$(location @//tools/third_party/kythe/tools/cdexec:cdexec)", + "cdexec=$(location @drake//tools/third_party/kythe/tools/cdexec:cdexec)", "top_builddir=$(@D)", "tools/ipopt_build_with_autotools.sh", " 2>&1 > ipopt_build_with_autotools.log", @@ -111,8 +111,8 @@ genrule( "|| (cat ipopt_build_with_autotools.log && false)", ]), tools = [ - "@//tools:ipopt_build_with_autotools.sh", - "@//tools/third_party/kythe/tools/cdexec:cdexec", + "@drake//tools:ipopt_build_with_autotools.sh", + "@drake//tools/third_party/kythe/tools/cdexec:cdexec", ], visibility = ["//visibility:private"], ) diff --git a/tools/lcm.BUILD b/tools/lcm.BUILD index 7fde6668f853..ea9556f742f9 100644 --- a/tools/lcm.BUILD +++ b/tools/lcm.BUILD @@ -1,9 +1,9 @@ # -*- python -*- -load("@//tools:drake.bzl", "drake_generate_file") -load("@//tools:generate_export_header.bzl", "generate_export_header") -load("@//tools:install.bzl", "install", "install_files") -load("@//tools:python_lint.bzl", "python_lint") +load("@drake//tools:drake.bzl", "drake_generate_file") +load("@drake//tools:generate_export_header.bzl", "generate_export_header") +load("@drake//tools:install.bzl", "install", "install_files") +load("@drake//tools:python_lint.bzl", "python_lint") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") package(default_visibility = ["//visibility:public"]) @@ -200,8 +200,8 @@ pkg_tar( py_binary( name = "create-cps", - srcs = ["@//tools:lcm-create-cps.py"], - main = "@//tools:lcm-create-cps.py", + srcs = ["@drake//tools:lcm-create-cps.py"], + main = "@drake//tools:lcm-create-cps.py", visibility = ["//visibility:private"], ) diff --git a/tools/libbot.BUILD b/tools/libbot.BUILD index 413237697c10..d027d395d85b 100644 --- a/tools/libbot.BUILD +++ b/tools/libbot.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:lcm.bzl", "lcm_java_library", "lcm_py_library") +load("@drake//tools:lcm.bzl", "lcm_java_library", "lcm_py_library") package(default_visibility = ["//visibility:public"]) diff --git a/tools/nlopt.BUILD b/tools/nlopt.BUILD index a77c7c24acc3..48db4e8f78df 100644 --- a/tools/nlopt.BUILD +++ b/tools/nlopt.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Chooses the nlopt preprocessor substitutions that we want to use from Bazel. cmake_configure_file( @@ -50,9 +50,9 @@ genrule( "api/nlopt.h", ], outs = ["api/nlopt.hpp"], - cmd = "$(location @//tools:nlopt-gen-hpp.sh) $(SRCS) $(OUTS) 2>&1 1>log" + + cmd = "$(location @drake//tools:nlopt-gen-hpp.sh) $(SRCS) $(OUTS) 2>&1 1>log" + " || (cat log && false)", - tools = ["@//tools:nlopt-gen-hpp.sh"], + tools = ["@drake//tools:nlopt-gen-hpp.sh"], ) cc_library( diff --git a/tools/robotlocomotion_lcmtypes.BUILD b/tools/robotlocomotion_lcmtypes.BUILD index 6a22dffa2eec..e82a64b6bafa 100644 --- a/tools/robotlocomotion_lcmtypes.BUILD +++ b/tools/robotlocomotion_lcmtypes.BUILD @@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"]) -load("@//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") +load("@drake//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") lcm_cc_library( name = "robotlocomotion_lcmtypes", diff --git a/tools/sdformat.BUILD b/tools/sdformat.BUILD index 5717e4ff7bee..587ff5d8036b 100644 --- a/tools/sdformat.BUILD +++ b/tools/sdformat.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates sdf_config.h based on the version numbers in CMake code. cmake_configure_file( diff --git a/tools/semantic_version.BUILD b/tools/semantic_version.BUILD index 2ed78c4aa39c..01a9c22b1bce 100644 --- a/tools/semantic_version.BUILD +++ b/tools/semantic_version.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:drake.bzl", "drake_generate_file") +load("@drake//tools:drake.bzl", "drake_generate_file") py_library( name = "semantic_version", diff --git a/tools/spdlog.BUILD b/tools/spdlog.BUILD index 8f9180b369a3..82bf5def918a 100644 --- a/tools/spdlog.BUILD +++ b/tools/spdlog.BUILD @@ -15,7 +15,7 @@ cc_library( ], includes = ["include"], linkopts = select({ - "@//tools:linux": ["-pthread"], + "@drake//tools:linux": ["-pthread"], "@//conditions:default": [], }), deps = ["@fmt"],