# 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/python_wheel.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" ]
}

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/bdx/bdx-transfer.cpp",
      "chip/bdx/bdx-transfer.h",
      "chip/bdx/bdx.cpp",
      "chip/bdx/test-bdx-transfer-server.cpp",
      "chip/bdx/test-bdx-transfer-server.h",
      "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/icd/PyChipCheckInDelegate.cpp",
      "chip/icd/PyChipCheckInDelegate.h",
      "chip/interaction_model/Delegate.cpp",
      "chip/interaction_model/Delegate.h",
      "chip/internal/ChipThreadWork.cpp",
      "chip/internal/ChipThreadWork.h",
      "chip/internal/CommissionerImpl.cpp",
      "chip/logging/LoggingFilter.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/icd/client:handler",
    "${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/platform/logging:default",
    "${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" ]
}

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/bdx/Bdx.py",
        "chip/bdx/BdxProtocol.py",
        "chip/bdx/BdxTransfer.py",
        "chip/bdx/__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/__init__.py",
        "chip/credentials/cert.py",
        "chip/crypto/__init__.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.bdx",
    "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-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"
}
