From 83fc3b74c9ec54d12702e2f0bdd92a89a1e5a027 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Mon, 9 May 2022 23:00:29 +0200 Subject: [PATCH] [vcpkg-tool-ninja] Add only the ninja port (#23911) * [vcpkg-tool-ninja] add ninja tool as a port * version stuff * add Unix Makefiles to list of valid generators for bootstraping ninja * nicole CRs * update version db * revert vcpkg_build_cmake changes * retrigger ci * download patch * version stuff * Remove checked in diff copy. Co-authored-by: Alexander Neumann Co-authored-by: nicole mazzuca Co-authored-by: Billy Robert O'Neal III --- ports/vcpkg-tool-ninja/portfile.cmake | 28 +++++++++++++++++++ .../vcpkg-tool-ninja/vcpkg-port-config.cmake | 1 + ports/vcpkg-tool-ninja/vcpkg.json | 12 ++++++++ scripts/build_info.cmake | 3 ++ versions/baseline.json | 4 +++ versions/v-/vcpkg-tool-ninja.json | 9 ++++++ 6 files changed, 57 insertions(+) create mode 100644 ports/vcpkg-tool-ninja/portfile.cmake create mode 100644 ports/vcpkg-tool-ninja/vcpkg-port-config.cmake create mode 100644 ports/vcpkg-tool-ninja/vcpkg.json create mode 100644 versions/v-/vcpkg-tool-ninja.json diff --git a/ports/vcpkg-tool-ninja/portfile.cmake b/ports/vcpkg-tool-ninja/portfile.cmake new file mode 100644 index 0000000000..8cb941b47b --- /dev/null +++ b/ports/vcpkg-tool-ninja/portfile.cmake @@ -0,0 +1,28 @@ +set(VCPKG_POLICY_CMAKE_HELPER_PORT enabled) + +vcpkg_download_distfile( + LONG_PATH_PATCH + URLS "https://patch-diff.githubusercontent.com/raw/ninja-build/ninja/pull/2056.diff" # stable? + FILENAME 2056.diff + SHA512 90f17c2cbb5e0c5b41de748f75a3fc3e0c9da8837a0507c8570a49affe15ae7258661dc1f1bc201574847d93ea8b7fe4cbecfffd868395d50ca821033c5f295d +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ninja-build/ninja + REF 170c387a7461d476523ae29c115a58f16e4d3430 + SHA512 75c0f263ad325d14c99c9a1d85e571832407b481271a2733e78183a478f7ecd22d84451fc8d7ce16ab20d641ce040761d7ab266695d66bbac5b2b9a3a29aa521 + HEAD_REF master + PATCHES "${LONG_PATH_PATCH}" # Long path support windows +) +set(VCPKG_BUILD_TYPE release) #we only need release here! +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}") +vcpkg_cmake_install() +vcpkg_copy_tools( + TOOL_NAMES ninja + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/ninja" + AUTO_CLEAN +) + +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-port-config.cmake" @ONLY) diff --git a/ports/vcpkg-tool-ninja/vcpkg-port-config.cmake b/ports/vcpkg-tool-ninja/vcpkg-port-config.cmake new file mode 100644 index 0000000000..8bf42e9f6a --- /dev/null +++ b/ports/vcpkg-tool-ninja/vcpkg-port-config.cmake @@ -0,0 +1 @@ +set(NINJA "${CMAKE_CURRENT_LIST_DIR}/../../tools/ninja/ninja@VCPKG_TARGET_EXECUTABLE_SUFFIX@") diff --git a/ports/vcpkg-tool-ninja/vcpkg.json b/ports/vcpkg-tool-ninja/vcpkg.json new file mode 100644 index 0000000000..434990e25f --- /dev/null +++ b/ports/vcpkg-tool-ninja/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "vcpkg-tool-ninja", + "version-date": "2022-03-31", + "description": "Ninja is a small build system with a focus on speed.", + "homepage": "https://ninja-build.org/", + "license": "Apache-2.0", + "supports": "native", + "dependencies": [ + "vcpkg-cmake", + "vcpkg-cmake-config" + ] +} diff --git a/scripts/build_info.cmake b/scripts/build_info.cmake index a6208016ae..112e074654 100644 --- a/scripts/build_info.cmake +++ b/scripts/build_info.cmake @@ -35,6 +35,9 @@ endif() if (DEFINED VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicySkipArchitectureCheck: ${VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK}\n") endif() +if (DEFINED VCPKG_POLICY_CMAKE_HELPER_PORT) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyCmakeHelperPort: ${VCPKG_POLICY_CMAKE_HELPER_PORT}\n") +endif() if (DEFINED VCPKG_HEAD_VERSION) file(APPEND ${BUILD_INFO_FILE_PATH} "Version: ${VCPKG_HEAD_VERSION}\n") endif() diff --git a/versions/baseline.json b/versions/baseline.json index c6c8e75337..c799f509de 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7368,6 +7368,10 @@ "baseline": "3.3", "port-version": 0 }, + "vcpkg-tool-ninja": { + "baseline": "2022-03-31", + "port-version": 0 + }, "vcpkg-tool-nodejs": { "baseline": "14.17.4", "port-version": 0 diff --git a/versions/v-/vcpkg-tool-ninja.json b/versions/v-/vcpkg-tool-ninja.json new file mode 100644 index 0000000000..643a736c0a --- /dev/null +++ b/versions/v-/vcpkg-tool-ninja.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "0d55ba6e9ede00479127566b8f39fce7034e1b05", + "version-date": "2022-03-31", + "port-version": 0 + } + ] +}