# -*- python -*-

load("@drake//tools/install:install.bzl", "install_files")
load("//tools/lint:lint.bzl", "add_lint_tests")

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

# Make our package requirements (but not manual scripts) available to
# downstream projects.
exports_files([
    "mac/binary_distribution/Brewfile",
    "mac/binary_distribution/requirements.txt",
    "mac/source_distribution/Brewfile",
    "mac/source_distribution/Brewfile-doc-only",
    "mac/source_distribution/Brewfile-maintainer-only",
    "mac/source_distribution/requirements.txt",
    "mac/source_distribution/requirements-maintainer-only.txt",
    "mac/source_distribution/requirements-test-only.txt",
    "ubuntu/binary_distribution/packages-bionic.txt",
    "ubuntu/binary_distribution/packages-focal.txt",
    "ubuntu/source_distribution/packages-bionic.txt",
    "ubuntu/source_distribution/packages-bionic-doc-only.txt",
    "ubuntu/source_distribution/packages-bionic-maintainer-only.txt",
    "ubuntu/source_distribution/packages-bionic-test-only.txt",
    "ubuntu/source_distribution/packages-focal.txt",
    "ubuntu/source_distribution/packages-focal-doc-only.txt",
    "ubuntu/source_distribution/packages-focal-maintainer-only.txt",
    "ubuntu/source_distribution/packages-focal-test-only.txt",
])

install_files(
    name = "install",
    dest = "share/drake/setup",
    files = select({
        "//tools/cc_toolchain:apple": [
            "mac/binary_distribution/Brewfile",
            "mac/binary_distribution/install_prereqs.sh",
            "mac/binary_distribution/requirements.txt",
        ],
        "//tools/cc_toolchain:linux": [
            "ubuntu/binary_distribution/install_prereqs.sh",
            "ubuntu/binary_distribution/packages-bionic.txt",
            "ubuntu/binary_distribution/packages-focal.txt",
        ],
        "//conditions:default": [],
    }),
    strip_prefix = [
        "mac/binary_distribution",
        "ubuntu/binary_distribution",
    ],
    rename = {
        "share/drake/setup/install_prereqs.sh": "install_prereqs",
    },
)

add_lint_tests()
