# Copyright (c) 2020 Project CHIP Authors
#
# 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.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

import("$dir_pw_build/python.gni")

import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/platform/python.gni")
import("${chip_root}/src/system/system.gni")
import("${dir_pw_unit_test}/test.gni")

if (current_os == "mac") {
  import("${build_root}/config/mac/mac_sdk.gni")
}

config("controller_wno_deprecate") {
  cflags = [ "-Wno-deprecated-declarations" ]
}

declare_args() {
  chip_python_version = "0.0"
  chip_python_package_prefix = "chip"
  chip_python_supports_stack_locking = chip_system_config_locking != "none"
}

shared_library("ChipDeviceCtrl") {
  if (chip_controller) {
    output_name = "_ChipDeviceCtrl"
  } else {
    output_name = "_ChipServer"
  }
  output_dir = "${target_out_dir}/chip"
  include_dirs = [ "." ]

  sources = [
    "chip/setup_payload/Generator.cpp",
    "chip/setup_payload/Parser.cpp",
  ]

  sources += [ "chip/native/CommonStackInit.cpp" ]

  defines = []

  if (chip_controller) {
    sources += [
      "ChipCommissionableNodeController-ScriptBinding.cpp",
      "ChipDeviceController-Discovery.cpp",
      "ChipDeviceController-IssueNocChain.cpp",
      "ChipDeviceController-ScriptBinding.cpp",
      "ChipDeviceController-ScriptDevicePairingDelegate.cpp",
      "ChipDeviceController-ScriptDevicePairingDelegate.h",
      "ChipDeviceController-ScriptPairingDeviceDiscoveryDelegate.cpp",
      "ChipDeviceController-ScriptPairingDeviceDiscoveryDelegate.h",
      "ChipDeviceController-StorageDelegate.cpp",
      "ChipDeviceController-StorageDelegate.h",
      "OpCredsBinding.cpp",
      "chip/clusters/attribute.cpp",
      "chip/clusters/command.cpp",
      "chip/commissioning/PlaceholderOperationalCredentialsIssuer.h",
      "chip/credentials/cert.cpp",
      "chip/credentials/cert.h",
      "chip/crypto/p256keypair.cpp",
      "chip/crypto/p256keypair.h",
      "chip/discovery/NodeResolution.cpp",
      "chip/interaction_model/Delegate.cpp",
      "chip/interaction_model/Delegate.h",
      "chip/internal/ChipThreadWork.cpp",
      "chip/internal/ChipThreadWork.h",
      "chip/internal/CommissionerImpl.cpp",
      "chip/logging/LoggingRedirect.cpp",
      "chip/native/ChipMainLoopWork.h",
      "chip/native/PyChipError.cpp",
      "chip/native/PyChipError.h",
      "chip/tracing/TracingSetup.cpp",
      "chip/utils/DeviceProxyUtils.cpp",
    ]
    defines += [ "CHIP_CONFIG_MAX_GROUPS_PER_FABRIC=50" ]
    defines += [ "CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC=50" ]

    if (chip_python_supports_stack_locking) {
      sources += [ "chip/native/ChipMainLoopWork_StackLock.cpp" ]
    } else {
      sources += [ "chip/native/ChipMainLoopWork_WorkSchedule.cpp" ]
    }
  } else {
    sources += [
      "chip/server/Options.cpp",
      "chip/server/Options.h",
      "chip/server/ServerInit.cpp",
    ]
  }

  if (chip_enable_ble) {
    if (current_os == "linux") {
      sources += [ "chip/ble/LinuxImpl.cpp" ]
    } else if (current_os == "mac") {
      sources += [
        "chip/ble/darwin/AdapterListing.mm",
        "chip/ble/darwin/Scanning.mm",
      ]
      cflags = [ "-fobjc-arc" ]
    } else {
      assert(false, "No BLE implementation available for the current OS.")
    }
  }

  public_deps = [
    "${chip_root}/src/app",
    "${chip_root}/src/app/server",
    "${chip_root}/src/credentials:default_attestation_verifier",
    "${chip_root}/src/lib",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/dnssd",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/platform",
    "${chip_root}/src/setup_payload",
    "${chip_root}/src/transport",
  ]

  if (chip_controller) {
    public_deps += [
      "${chip_root}/src/controller/data_model",
      "${chip_root}/src/credentials:file_attestation_trust_store",
      "${chip_root}/src/lib/support:testing",
      "${chip_root}/src/tracing/json",
      "${chip_root}/src/tracing/perfetto",
      "${chip_root}/src/tracing/perfetto:file_output",
      "${chip_root}/third_party/jsoncpp",
    ]

    deps = [
      "${chip_root}/src/tracing/perfetto:event_storage",
      "${chip_root}/src/tracing/perfetto:simple_initialization",
    ]
  } else {
    public_deps += [ "$chip_data_model" ]
  }

  configs += [ ":controller_wno_deprecate" ]
}

template("chip_python_wheel_action") {
  _dist_dir = "${root_out_dir}/controller/python"

  _py_manifest_file = "${target_gen_dir}/${target_name}.py_manifest.json"

  pw_python_action(target_name) {
    script = "build-chip-wheel.py"
    forward_variables_from(invoker, "*")

    _py_manifest_files_rebased = []
    foreach(_manifest_entry, py_manifest_files) {
      inputs += _manifest_entry.sources
      _py_manifest_files_rebased += [
        {
          src_dir = rebase_path(_manifest_entry.src_dir,
                                get_path_info(_py_manifest_file, "dir"))
          sources =
              rebase_path(_manifest_entry.sources, _manifest_entry.src_dir)
        },
      ]
    }

    if (defined(invoker.py_scripts)) {
      _py_scripts = invoker.py_scripts
    } else {
      _py_scripts = []
    }

    _py_manifest = {
      files = _py_manifest_files_rebased
      packages = py_packages
      scripts = _py_scripts
      package_reqs = py_package_reqs
    }

    write_file(_py_manifest_file, _py_manifest, "json")

    args = [
      "--package_name",
      py_package_name,
      "--build_number",
      chip_python_version,
      "--build_dir",
      rebase_path("${target_gen_dir}/${target_name}.py_build", root_build_dir),
      "--dist_dir",
      rebase_path(_dist_dir, root_build_dir),
      "--manifest",
      rebase_path(_py_manifest_file, root_build_dir),
      "--plat-name",
      py_platform_tag,
    ]

    if (defined(invoker.lib_name)) {
      args += [
        "--lib-name",
        lib_name,
      ]
    }

    outputs = [ "${_dist_dir}/$output_name" ]
  }
}

chip_python_wheel_action("chip-core") {
  py_manifest_files = [
    {
      src_dir = "."
      sources = [
        "chip/CertificateAuthority.py",
        "chip/ChipBleBase.py",
        "chip/ChipBleUtility.py",
        "chip/ChipBluezMgr.py",
        "chip/ChipCommissionableNodeCtrl.py",
        "chip/ChipStack.py",
        "chip/FabricAdmin.py",
        "chip/__init__.py",
        "chip/ble/__init__.py",
        "chip/ble/commissioning/__init__.py",
        "chip/ble/get_adapters.py",
        "chip/ble/library_handle.py",
        "chip/ble/scan_devices.py",
        "chip/ble/types.py",
        "chip/clusters/Attribute.py",
        "chip/clusters/Command.py",
        "chip/clusters/__init__.py",
        "chip/commissioning/__init__.py",
        "chip/commissioning/commissioning_flow_blocks.py",
        "chip/commissioning/pase.py",
        "chip/configuration/__init__.py",
        "chip/credentials/cert.py",
        "chip/crypto/fabric.py",
        "chip/crypto/p256keypair.py",
        "chip/discovery/__init__.py",
        "chip/discovery/library_handle.py",
        "chip/discovery/types.py",
        "chip/exceptions/__init__.py",
        "chip/interaction_model/__init__.py",
        "chip/interaction_model/delegate.py",
        "chip/internal/__init__.py",
        "chip/internal/commissioner.py",
        "chip/internal/thread.py",
        "chip/internal/types.py",
        "chip/logging/__init__.py",
        "chip/logging/library_handle.py",
        "chip/logging/types.py",
        "chip/native/__init__.py",
        "chip/setup_payload/__init__.py",
        "chip/setup_payload/setup_payload.py",
        "chip/storage/__init__.py",
        "chip/tracing/__init__.py",
        "chip/utils/CommissioningBuildingBlocks.py",
        "chip/utils/__init__.py",
        "chip/yaml/__init__.py",
        "chip/yaml/data_model_lookup.py",
        "chip/yaml/errors.py",
        "chip/yaml/format_converter.py",
        "chip/yaml/runner.py",
      ]

      if (chip_controller) {
        sources += [ "chip/ChipDeviceCtrl.py" ]
      } else {
        sources += [ "chip/server/__init__.py" ]
      }
    },
    {
      src_dir = target_out_dir
      if (chip_controller) {
        sources = [ "${target_out_dir}/chip/_ChipDeviceCtrl.so" ]
      } else {
        sources = [ "${target_out_dir}/chip/_ChipServer.so" ]
      }
    },
    {
      src_dir = "//"
      sources = [ "//LICENSE" ]
    },
  ]

  inputs = []

  py_packages = [
    "chip",
    "chip.ble",
    "chip.ble.commissioning",
    "chip.configuration",
    "chip.commissioning",
    "chip.clusters",
    "chip.credentials",
    "chip.crypto",
    "chip.utils",
    "chip.discovery",
    "chip.exceptions",
    "chip.internal",
    "chip.interaction_model",
    "chip.logging",
    "chip.yaml",
    "chip.native",
    "chip.clusters",
    "chip.setup_payload",
    "chip.storage",
    "chip.tracing",
  ]

  if (!chip_controller) {
    py_packages += [ "chip.server" ]
  }

  py_package_reqs = [
    "coloredlogs",
    "construct",
    "dacite",
    "rich",
    "pyyaml",
    "ipdb",
    "deprecation",
    "cryptography",
    "ecdsa",
  ]

  if (current_cpu == "x64") {
    cpu_tag = "x86_64"
  } else if (current_cpu == "arm64" && current_os == "linux") {
    cpu_tag = "aarch64"
  } else if (current_cpu == "arm" && current_os == "linux") {
    cpu_tag = "armv7l"
  } else {
    cpu_tag = current_cpu
  }

  if (current_os == "mac") {
    py_platform_tag = string_replace(
            string_replace(mac_deployment_target, "macos", "macosx."),
            ".",
            "_")
  } else {
    py_platform_tag = current_os
  }

  py_platform_tag = py_platform_tag + "_" + cpu_tag

  tags = "cp37-abi3-" + py_platform_tag

  if (chip_controller) {
    lib_name = "_ChipDeviceCtrl.so"
  } else {
    lib_name = "_ChipServer.so"
  }

  py_package_name = "${chip_python_package_prefix}-core"
  py_package_output = string_replace(py_package_name, "-", "_")

  public_deps = [ ":ChipDeviceCtrl" ]

  output_name = "${py_package_output}-${chip_python_version}-${tags}.whl"
}

chip_python_wheel_action("chip-clusters") {
  py_manifest_files = [
    {
      src_dir = "."
      sources = [
        "chip/ChipUtility.py",
        "chip/clusters/CHIPClusters.py",
        "chip/clusters/ClusterObjects.py",
        "chip/clusters/Objects.py",
        "chip/clusters/TestObjects.py",
        "chip/clusters/Types.py",
        "chip/clusters/enum.py",
        "chip/tlv/__init__.py",
        "chip/tlv/tlvlist.py",
      ]
    },
    {
      src_dir = "//"
      sources = [ "//LICENSE" ]
    },
  ]

  inputs = []

  py_packages = [
    "chip",
    "chip.clusters",
    "chip.tlv",
  ]

  py_package_reqs = [
    "dacite",
    "aenum",
  ]

  py_package_name = "${chip_python_package_prefix}-clusters"
  py_package_output = string_replace(py_package_name, "-", "_")
  py_platform_tag = "any"

  output_name = "${py_package_output}-${chip_python_version}-py3-none-any.whl"
}

chip_python_wheel_action("chip-repl") {
  py_scripts = [
    "chip-device-ctrl.py",
    "chip-repl.py",
  ]

  py_manifest_files = [
    {
      src_dir = "."
      sources = [
        "chip/ChipBluezMgr.py",
        "chip/ChipCoreBluetoothMgr.py",
        "chip/ChipReplStartup.py",
      ]
      sources += py_scripts
    },
    {
      src_dir = "//"
      sources = [ "//LICENSE" ]
    },
  ]

  inputs = []

  py_packages = [ "chip" ]

  py_package_reqs = [
    "coloredlogs",

    #
    # IPython 7.30.0 has a bug which results in the use of await ... failing on some platforms (see https://github.com/ipython/ipython/pull/13269)
    # For now, let's just avoid that version.
    #
    # IPython 8.1.0 has a bug which causes issues: https://github.com/ipython/ipython/issues/13554
    #
    #
    "ipython!=8.1.0",
    "rich",
    "ipykernel",
  ]

  if (current_os == "mac") {
    py_package_reqs += [ "pyobjc-framework-corebluetooth" ]
  } else if (current_os == "linux") {
    py_package_reqs += [
      "dbus-python==1.2.18",
      "pygobject",
    ]
  }

  py_package_name = "${chip_python_package_prefix}-repl"
  py_package_output = string_replace(py_package_name, "-", "_")
  py_platform_tag = "any"

  data_deps = [
    ":chip-clusters",
    ":chip-core",
  ]

  output_name = "${py_package_output}-${chip_python_version}-py3-none-any.whl"
}
