diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL deleted file mode 100644 index 392ce10136d039..00000000000000 --- a/ports/tensorflow-cc/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: tensorflow-cc -Version: 2.3.1 -Port-Version: 1 -Homepage: https://github.com/tensorflow/tensorflow -Description: Library for computation using data flow graphs for scalable machine learning (C++ API version) -Supports: !(x86|arm|uwp) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 783fe8b70e459b..bf77e7148f57ee 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -2,9 +2,9 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "UWP") set(TF_LIB_SUFFIX "_cc") set(TF_PORT_SUFFIX "-cc") -set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external - ${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tensorflow-common") +set(TF_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include/tensorflow-external + ${CURRENT_INSTALLED_DIR}/include/tensorflow-external/src") +list(APPEND CMAKE_MODULE_PATH "${CURRENT_INSTALLED_DIR}/share/tensorflow-common") include(tensorflow-common) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow-external") diff --git a/ports/tensorflow-cc/vcpkg.json b/ports/tensorflow-cc/vcpkg.json new file mode 100644 index 00000000000000..5297a3b0731d7f --- /dev/null +++ b/ports/tensorflow-cc/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "tensorflow-cc", + "version-string": "2.3.1", + "port-version": 2, + "description": "Library for computation using data flow graphs for scalable machine learning (C++ API version)", + "homepage": "https://github.com/tensorflow/tensorflow", + "supports": "!(x86 | arm | uwp)", + "dependencies": [ + "tensorflow-common" + ] +} diff --git a/ports/tensorflow-common/CONTROL b/ports/tensorflow-common/CONTROL deleted file mode 100644 index a5f0364afd17eb..00000000000000 --- a/ports/tensorflow-common/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: tensorflow-common -Version: 2.3.1 -Port-Version: 0 -Homepage: https://github.com/tensorflow/tensorflow -Description: This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own. -Supports: false diff --git a/ports/tensorflow-common/LICENSE.txt b/ports/tensorflow-common/LICENSE.txt new file mode 100644 index 00000000000000..2e4eac8264fa4c --- /dev/null +++ b/ports/tensorflow-common/LICENSE.txt @@ -0,0 +1,23 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ports/tensorflow-common/portfile.cmake b/ports/tensorflow-common/portfile.cmake index 4d51544d829d29..5902d050214116 100644 --- a/ports/tensorflow-common/portfile.cmake +++ b/ports/tensorflow-common/portfile.cmake @@ -1 +1,27 @@ -message(FATAL_ERROR "This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.") +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + +set(TENSORFLOW_FILES + "${CMAKE_CURRENT_LIST_DIR}/change-macros-for-static-lib.patch" + "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_linux.py" + "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_windows.py" + "${CMAKE_CURRENT_LIST_DIR}/fix-build-error.patch" + "${CMAKE_CURRENT_LIST_DIR}/fix-dbg-build-errors.patch" + "${CMAKE_CURRENT_LIST_DIR}/fix-linux-build.patch" + "${CMAKE_CURRENT_LIST_DIR}/fix-more-build-errors.patch" + "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_linux.py" + "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_macos.py" + "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_windows.py" + "${CMAKE_CURRENT_LIST_DIR}/README-linux" + "${CMAKE_CURRENT_LIST_DIR}/README-macos" + "${CMAKE_CURRENT_LIST_DIR}/README-windows" + "${CMAKE_CURRENT_LIST_DIR}/tensorflow-common.cmake" + "${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-shared.cmake.in" + "${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-static.cmake.in" + "${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-windows-dll.cmake.in" + "${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-windows-lib.cmake.in" + ) + +file(COPY ${TENSORFLOW_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +# Use vcpkg's license +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/tensorflow-common/tensorflow-common.cmake b/ports/tensorflow-common/tensorflow-common.cmake index 1f9a7203c59f20..dd601ba9bd887c 100644 --- a/ports/tensorflow-common/tensorflow-common.cmake +++ b/ports/tensorflow-common/tensorflow-common.cmake @@ -110,14 +110,14 @@ else() endif() foreach(BUILD_TYPE dbg rel) - # prefer repeated source extraction here for each build type over extracting once above the loop and copying because users reported issues with copying symlinks + # prefer repeated source extraction here for each build type over extracting once above the loop and copying because users reported issues with copying symlinks set(STATIC_ONLY_PATCHES) set(LINUX_ONLY_PATCHES) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(STATIC_ONLY_PATCHES ../tensorflow-common/change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end + set(STATIC_ONLY_PATCHES "${CMAKE_CURRENT_LIST_DIR}/change-macros-for-static-lib.patch") # there is no static build option - change macros via patch and link library manually at the end endif() if(VCPKG_TARGET_IS_LINUX) - set(LINUX_ONLY_PATCHES ../tensorflow-common/fix-linux-build.patch) + set(LINUX_ONLY_PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-linux-build.patch") endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -126,9 +126,9 @@ foreach(BUILD_TYPE dbg rel) SHA512 e497ef4564f50abf9f918be4522cf702f4cf945cb1ebf83af1386ac4ddc7373b3ba70c7f803f8ca06faf2c6b5396e60b1e0e9b97bfbd667e733b08b6e6d70ef0 HEAD_REF master PATCHES - ../tensorflow-common/fix-build-error.patch # Fix namespace error - ../tensorflow-common/fix-dbg-build-errors.patch # Fix no return statement - ../tensorflow-common/fix-more-build-errors.patch # Fix no return statement + "${CMAKE_CURRENT_LIST_DIR}/fix-build-error.patch" # Fix namespace error + "${CMAKE_CURRENT_LIST_DIR}/fix-dbg-build-errors.patch" # Fix no return statement + "${CMAKE_CURRENT_LIST_DIR}/fix-more-build-errors.patch" # Fix no return statement ${STATIC_ONLY_PATCHES} ${LINUX_ONLY_PATCHES} ) diff --git a/ports/tensorflow-common/vcpkg.json b/ports/tensorflow-common/vcpkg.json new file mode 100644 index 00000000000000..5d6009d2fe2e99 --- /dev/null +++ b/ports/tensorflow-common/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "tensorflow-common", + "version-string": "2.3.1", + "port-version": 1, + "description": "This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.", + "homepage": "https://github.com/tensorflow/tensorflow" +} diff --git a/ports/tensorflow/CONTROL b/ports/tensorflow/CONTROL deleted file mode 100644 index 0f775ae8d9d46a..00000000000000 --- a/ports/tensorflow/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: tensorflow -Version: 2.3.1 -Port-Version: 0 -Homepage: https://github.com/tensorflow/tensorflow -Description: Library for computation using data flow graphs for scalable machine learning (C API version) -Supports: !(x86|arm|uwp) diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake index f3a43d24c2c370..0bd5ce3544dff4 100644 --- a/ports/tensorflow/portfile.cmake +++ b/ports/tensorflow/portfile.cmake @@ -2,18 +2,18 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "uwp") set(TF_LIB_SUFFIX "") set(TF_PORT_SUFFIX "") -set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tensorflow-common") +set(TF_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include") +list(APPEND CMAKE_MODULE_PATH "${CURRENT_INSTALLED_DIR}/share/tensorflow-common") include(tensorflow-common) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tensor_interface.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_file_statistics.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/dlpack.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tensor_interface.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_file_statistics.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api_experimental.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/dlpack.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager") diff --git a/ports/tensorflow/vcpkg.json b/ports/tensorflow/vcpkg.json new file mode 100644 index 00000000000000..2c3f6d4bf98ca3 --- /dev/null +++ b/ports/tensorflow/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "tensorflow", + "version-string": "2.3.1", + "port-version": 1, + "description": "Library for computation using data flow graphs for scalable machine learning (C API version)", + "homepage": "https://github.com/tensorflow/tensorflow", + "supports": "!(x86 | arm | uwp)", + "dependencies": [ + "tensorflow-common" + ] +} diff --git a/toolsrc/src/vcpkg/platform-expression.cpp b/toolsrc/src/vcpkg/platform-expression.cpp index b87ca4ce91bd5b..78627eb9c0416f 100644 --- a/toolsrc/src/vcpkg/platform-expression.cpp +++ b/toolsrc/src/vcpkg/platform-expression.cpp @@ -29,6 +29,7 @@ namespace vcpkg::PlatformExpression uwp, android, emscripten, + ios, static_link, }; @@ -48,6 +49,7 @@ namespace vcpkg::PlatformExpression {"uwp", Identifier::uwp}, {"android", Identifier::android}, {"emscripten", Identifier::emscripten}, + {"ios", Identifier::ios}, {"static", Identifier::static_link}, }; @@ -392,6 +394,7 @@ namespace vcpkg::PlatformExpression case Identifier::android: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Android"); case Identifier::emscripten: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Emscripten"); + case Identifier::ios: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "iOS"); case Identifier::wasm32: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "wasm32"); case Identifier::static_link: return true_if_exists_and_equal("VCPKG_LIBRARY_LINKAGE", "static");