From 62cbae69afd057d0e6983dd699fe9e83505d4527 Mon Sep 17 00:00:00 2001 From: sbrajchuk Date: Fri, 28 Apr 2023 23:21:43 +0300 Subject: [PATCH 1/3] [ryu] Fix toolchain selection on *nixes. Fix macOS build. Add support for Mingw-w64 on Windows --- ports/ryu/portfile.cmake | 163 ++++++++++++++++++++++++--------------- ports/ryu/vcpkg.json | 2 +- scripts/ci.baseline.txt | 3 - versions/baseline.json | 2 +- versions/r-/ryu.json | 5 ++ 5 files changed, 109 insertions(+), 66 deletions(-) diff --git a/ports/ryu/portfile.cmake b/ports/ryu/portfile.cmake index b44631b0006453..022bbe3ecbe2fa 100644 --- a/ports/ryu/portfile.cmake +++ b/ports/ryu/portfile.cmake @@ -1,17 +1,13 @@ function(prepare_bazel_opts flags opts switch) - string(STRIP ${${flags}} ${flags}) - if (${flags}) - string(REGEX REPLACE "[ ]+-" ";-" ${flags} ${${flags}}) - foreach (OPT IN LISTS ${flags}) - if (${opts}) - string(REGEX REPLACE "^([^ ]+)[ ]+\"?([^\"]+)\"?$" \\1\\2 OPT ${OPT}) - set(${opts} ${${opts}};${switch}=${OPT}) - else () - set(${opts} ${switch}=${OPT}) - endif () - endforeach () - set(${opts} ${${opts}} PARENT_SCOPE) - endif () + separate_arguments(${flags} NATIVE_COMMAND ${${flags}}) + list(TRANSFORM ${flags} PREPEND ${switch}=) + set(${opts} "${${flags}}" PARENT_SCOPE) +endfunction() + +function(prepare_bazel_env_opts flags env_name) + separate_arguments(${flags} NATIVE_COMMAND ${${flags}}) + list(JOIN ${flags} : ${flags}) + set(ENV{${env_name}} "${${flags}}") endfunction() vcpkg_from_github( @@ -22,64 +18,109 @@ vcpkg_from_github( HEAD_REF master ) -find_program(BAZEL bazel PATHS ${CURRENT_HOST_INSTALLED_DIR}/tools REQUIRED) -get_filename_component(BAZEL_DIR ${BAZEL} DIRECTORY) -vcpkg_add_to_path(PREPEND ${BAZEL_DIR}) -set(ENV{BAZEL_BIN_PATH} ${BAZEL}) +find_program(BAZEL bazel PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools" REQUIRED) +get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) +vcpkg_add_to_path(PREPEND "${BAZEL_DIR}") +set(ENV{BAZEL_BIN_PATH} "${BAZEL}") vcpkg_cmake_get_vars(cmake_vars_file) -include(${cmake_vars_file}) - -if (CMAKE_HOST_WIN32) - set(ENV{BAZEL_VC} $ENV{VCInstallDir}) - if (VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR STREQUAL x86) - set(BAZEL_CPU --cpu=x64_x86_windows) - elseif (VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR STREQUAL ARM) - set(BAZEL_CPU --cpu=x64_arm_windows) - elseif (VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR STREQUAL ARM64) - set(BAZEL_CPU --cpu=x64_arm64_windows) +include("${cmake_vars_file}") +if (VCPKG_HOST_IS_WINDOWS) + if (VCPKG_DETECTED_MSVC) + set(ENV{BAZEL_VC} "$ENV{VCInstallDir}") + elseif (VCPKG_TARGET_IS_MINGW) + if (NOT "${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + message(FATAL_ERROR "${TARGET_TRIPLET} is not supported on Windows!") + endif () + set(BAZEL_COMPILER "--compiler=mingw-gcc") + # BAZEL_SH can be propagated to the build environment using VCPKG_KEEP_ENV_VARS + if (NOT DEFINED ENV{BAZEL_SH}) + message("BAZEL_SH is not specified, trying to guess...") + get_filename_component(DIR "${VCPKG_DETECTED_CMAKE_C_COMPILER}" DIRECTORY) + # Bazel expects Mingw-w64 to be installed in MSYS2 (pacman -S mingw-w64-x86_64-toolchain). + # From BAZEL_SH it finds MSYS2 root, adds "mingw64" to the root and uses this path as the location of Mingw-w64. + # It is also possible to use non-MSYS2 binaries with Bazel if they are installed to a directory + # whose name ends with "mingw64", such as c:\mingw64 or c:\TDM-GCC-64\mingw64. + string(REGEX REPLACE /mingw64/bin$ "" MSYS2_ROOT "${DIR}") + set(ENV{BAZEL_SH} "${MSYS2_ROOT}/usr/bin/bash.exe") + message("BAZEL_SH $ENV{BAZEL_SH}") + endif () + else () + message(FATAL_ERROR "${TARGET_TRIPLET} is not supported!") + endif () + if ("${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86") + set(BAZEL_CPU "--cpu=x64_x86_windows") + elseif ("${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64" OR "${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + set(BAZEL_CPU "--cpu=x64_windows") + elseif ("${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM") + set(BAZEL_CPU "--cpu=x64_arm_windows") + elseif ("${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64") + set(BAZEL_CPU "--cpu=arm64_windows") + else () + message(FATAL_ERROR "${TARGET_TRIPLET} is not supported!") + endif () +else () + if (NOT DEFINED ENV{USER}) + set(ENV{USER} "root") + set(BAZEL_OUTPUT "--output_user_root=/tmp/bazel") endif () + set(ENV{BAZEL_USE_CPP_ONLY_TOOLCHAIN} "1") + set(ENV{CC} "${VCPKG_DETECTED_CMAKE_C_COMPILER}") endif () -if (VCPKG_DETECTED_CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - set(ENV{SDKROOT} ${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}) -endif () +if ("${VCPKG_BUILD_TYPE}" STREQUAL "" OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") -prepare_bazel_opts(VCPKG_COMBINED_C_FLAGS_RELEASE CONLY_OPTS_RELEASE --conlyopt) -prepare_bazel_opts(VCPKG_COMBINED_C_FLAGS_DEBUG CONLY_OPTS_DEBUG --conlyopt) -prepare_bazel_opts(VCPKG_COMBINED_STATIC_LINKER_FLAGS_RELEASE LINK_OPTS_RELEASE --linkopt) -prepare_bazel_opts(VCPKG_COMBINED_STATIC_LINKER_FLAGS_DEBUG LINK_OPTS_DEBUG --linkopt) + prepare_bazel_opts(VCPKG_COMBINED_C_FLAGS_RELEASE CONLY_OPTS_RELEASE "--conlyopt") + prepare_bazel_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE LINK_OPTS_RELEASE "--linkopt") + if (DEFINED ENV{CC}) + prepare_bazel_env_opts(VCPKG_COMBINED_C_FLAGS_RELEASE BAZEL_CXXOPTS) + prepare_bazel_env_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE BAZEL_LINKOPTS) + endif () -vcpkg_execute_build_process( - COMMAND ${BAZEL} --batch build ${BAZEL_CPU} ${CONLY_OPTS_RELEASE} ${LINK_OPTS_RELEASE} --verbose_failures --strategy=CppCompile=standalone //ryu //ryu:ryu_printf - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}-rel -) + vcpkg_execute_build_process( + COMMAND "${BAZEL}" --batch ${BAZEL_OUTPUT} build ${BAZEL_COMPILER} ${BAZEL_CPU} ${CONLY_OPTS_RELEASE} ${LINK_OPTS_RELEASE} --verbose_failures --strategy=CppCompile=standalone //ryu //ryu:ryu_printf + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME "build-${TARGET_TRIPLET}-rel" + ) + + if ("${CMAKE_STATIC_LIBRARY_SUFFIX}" STREQUAL ".lib") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu_printf.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") + else () + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu.a" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu_printf.a" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") + endif () -if (CMAKE_HOST_WIN32) - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/ryu.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/ryu_printf.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) -else () - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/libryu.a DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/libryu_printf.a DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) endif () -vcpkg_execute_build_process( - COMMAND ${BAZEL} --batch build ${BAZEL_CPU} ${CONLY_OPTS_DEBUG} ${LINK_OPTS_DEBUG} --verbose_failures --strategy=CppCompile=standalone //ryu //ryu:ryu_printf - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}-dbg -) +if ("${VCPKG_BUILD_TYPE}" STREQUAL "" OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") + + prepare_bazel_opts(VCPKG_COMBINED_C_FLAGS_DEBUG CONLY_OPTS_DEBUG "--conlyopt") + prepare_bazel_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG LINK_OPTS_DEBUG "--linkopt") + + if (DEFINED ENV{CC}) + prepare_bazel_env_opts(VCPKG_COMBINED_C_FLAGS_DEBUG BAZEL_CXXOPTS) + prepare_bazel_env_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG BAZEL_LINKOPTS) + endif () + + vcpkg_execute_build_process( + COMMAND "${BAZEL}" --batch ${BAZEL_OUTPUT} build ${BAZEL_COMPILER} ${BAZEL_CPU} ${CONLY_OPTS_DEBUG} ${LINK_OPTS_DEBUG} --verbose_failures --strategy=CppCompile=standalone //ryu //ryu:ryu_printf + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME "build-${TARGET_TRIPLET}-dbg" + ) + + if ("${CMAKE_STATIC_LIBRARY_SUFFIX}" STREQUAL ".lib") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu_printf.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") + else () + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu.a" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu_printf.a" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") + endif () -if (CMAKE_HOST_WIN32) - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/ryu.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/ryu_printf.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) -else () - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/libryu.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) - file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/libryu_printf.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) endif () -file(INSTALL ${SOURCE_PATH}/LICENSE-Boost DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(INSTALL ${SOURCE_PATH}/ryu/ryu.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/ryu/) -file(INSTALL ${SOURCE_PATH}/ryu/ryu2.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/ryu/) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/ryuConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL "${SOURCE_PATH}/LICENSE-Boost" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(INSTALL "${SOURCE_PATH}/ryu/ryu.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/ryu/") +file(INSTALL "${SOURCE_PATH}/ryu/ryu2.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/ryu/") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/ryuConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/ryu/vcpkg.json b/ports/ryu/vcpkg.json index 94e09b55d3c3fb..95a3a8e7710585 100644 --- a/ports/ryu/vcpkg.json +++ b/ports/ryu/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ryu", "version": "2.0", - "port-version": 8, + "port-version": 9, "description": "Ryu generates the shortest decimal representation of a floating point number that maintains round-trip safety.", "homepage": "https://github.com/ulfjack/ryu", "dependencies": [ diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index db07c3fa91c547..761c198cc914a1 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1351,9 +1351,6 @@ rtlsdr:x64-osx=fail rttr:arm-neon-android=fail rttr:arm64-android=fail rttr:x64-android=fail -ryu:arm-neon-android=fail -ryu:arm64-android=fail -ryu:x64-android=fail scintilla:arm-neon-android=fail scintilla:arm64-android=fail scintilla:x64-android=fail diff --git a/versions/baseline.json b/versions/baseline.json index bcf85f579721ec..6e6fb6c1147145 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7114,7 +7114,7 @@ }, "ryu": { "baseline": "2.0", - "port-version": 8 + "port-version": 9 }, "s2geometry": { "baseline": "0.10.0", diff --git a/versions/r-/ryu.json b/versions/r-/ryu.json index b0187b167d8e76..28714c26d35f39 100644 --- a/versions/r-/ryu.json +++ b/versions/r-/ryu.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0cae1da4f8b5b052b8771a8d623edf3de7e53e49", + "version": "2.0", + "port-version": 9 + }, { "git-tree": "660ffa1a7a15e75dbcff064ac704f53b8a2da880", "version": "2.0", From c437200c9362c11bf02150006dc6a1b0424b7ac4 Mon Sep 17 00:00:00 2001 From: sbrajchuk Date: Sun, 30 Apr 2023 17:10:04 +0300 Subject: [PATCH 2/3] Refactor code --- ports/ryu/portfile.cmake | 96 +++++++++++++++++----------------------- versions/r-/ryu.json | 2 +- 2 files changed, 41 insertions(+), 57 deletions(-) diff --git a/ports/ryu/portfile.cmake b/ports/ryu/portfile.cmake index 022bbe3ecbe2fa..b67f36421f320a 100644 --- a/ports/ryu/portfile.cmake +++ b/ports/ryu/portfile.cmake @@ -1,13 +1,40 @@ -function(prepare_bazel_opts flags opts switch) - separate_arguments(${flags} NATIVE_COMMAND ${${flags}}) - list(TRANSFORM ${flags} PREPEND ${switch}=) - set(${opts} "${${flags}}" PARENT_SCOPE) -endfunction() +function(bazel_build build_type) + set(c_flags "${VCPKG_COMBINED_C_FLAGS_RELEASE}") + set(linker_flags "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE}") + set(log_suffix "rel") + if (${build_type} STREQUAL "debug") + set(c_flags "${VCPKG_COMBINED_C_FLAGS_DEBUG}") + set(linker_flags "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG}") + set(log_suffix "dbg") + set(destination_modifier "/debug") + endif () + + separate_arguments(conly_opts NATIVE_COMMAND "${c_flags}") + separate_arguments(link_opts NATIVE_COMMAND "${linker_flags}") + + if (DEFINED ENV{CC}) + list(JOIN conly_opts ":" joined_opts) + set(ENV{BAZEL_CXXOPTS} "${joined_opts}") + list(JOIN link_opts ":" joined_opts) + set(ENV{BAZEL_LINKOPTS} "${joined_opts}") + endif () + + list(TRANSFORM conly_opts PREPEND "--conlyopt=") + list(TRANSFORM link_opts PREPEND "--linkopt=") + + vcpkg_execute_build_process( + COMMAND "${BAZEL}" --batch ${BAZEL_OUTPUT} build ${BAZEL_COMPILER} ${BAZEL_CPU} ${conly_opts} ${link_opts} --verbose_failures --strategy=CppCompile=standalone //ryu //ryu:ryu_printf + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME "build-${TARGET_TRIPLET}-${log_suffix}" + ) -function(prepare_bazel_env_opts flags env_name) - separate_arguments(${flags} NATIVE_COMMAND ${${flags}}) - list(JOIN ${flags} : ${flags}) - set(ENV{${env_name}} "${${flags}}") + if ("${CMAKE_STATIC_LIBRARY_SUFFIX}" STREQUAL ".lib") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu.lib" DESTINATION "${CURRENT_PACKAGES_DIR}${destination_modifier}/lib") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu_printf.lib" DESTINATION "${CURRENT_PACKAGES_DIR}${destination_modifier}/lib") + else () + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu.a" DESTINATION "${CURRENT_PACKAGES_DIR}${destination_modifier}/lib") + file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu_printf.a" DESTINATION "${CURRENT_PACKAGES_DIR}${destination_modifier}/lib") + endif () endfunction() vcpkg_from_github( @@ -69,58 +96,15 @@ else () endif () if ("${VCPKG_BUILD_TYPE}" STREQUAL "" OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") - - prepare_bazel_opts(VCPKG_COMBINED_C_FLAGS_RELEASE CONLY_OPTS_RELEASE "--conlyopt") - prepare_bazel_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE LINK_OPTS_RELEASE "--linkopt") - if (DEFINED ENV{CC}) - prepare_bazel_env_opts(VCPKG_COMBINED_C_FLAGS_RELEASE BAZEL_CXXOPTS) - prepare_bazel_env_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE BAZEL_LINKOPTS) - endif () - - vcpkg_execute_build_process( - COMMAND "${BAZEL}" --batch ${BAZEL_OUTPUT} build ${BAZEL_COMPILER} ${BAZEL_CPU} ${CONLY_OPTS_RELEASE} ${LINK_OPTS_RELEASE} --verbose_failures --strategy=CppCompile=standalone //ryu //ryu:ryu_printf - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME "build-${TARGET_TRIPLET}-rel" - ) - - if ("${CMAKE_STATIC_LIBRARY_SUFFIX}" STREQUAL ".lib") - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu_printf.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") - else () - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu.a" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu_printf.a" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/") - endif () - + bazel_build("release") endif () if ("${VCPKG_BUILD_TYPE}" STREQUAL "" OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") - - prepare_bazel_opts(VCPKG_COMBINED_C_FLAGS_DEBUG CONLY_OPTS_DEBUG "--conlyopt") - prepare_bazel_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG LINK_OPTS_DEBUG "--linkopt") - - if (DEFINED ENV{CC}) - prepare_bazel_env_opts(VCPKG_COMBINED_C_FLAGS_DEBUG BAZEL_CXXOPTS) - prepare_bazel_env_opts(VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG BAZEL_LINKOPTS) - endif () - - vcpkg_execute_build_process( - COMMAND "${BAZEL}" --batch ${BAZEL_OUTPUT} build ${BAZEL_COMPILER} ${BAZEL_CPU} ${CONLY_OPTS_DEBUG} ${LINK_OPTS_DEBUG} --verbose_failures --strategy=CppCompile=standalone //ryu //ryu:ryu_printf - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME "build-${TARGET_TRIPLET}-dbg" - ) - - if ("${CMAKE_STATIC_LIBRARY_SUFFIX}" STREQUAL ".lib") - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/ryu_printf.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") - else () - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu.a" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") - file(INSTALL "${SOURCE_PATH}/bazel-bin/ryu/libryu_printf.a" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/") - endif () - + bazel_build("debug") endif () file(INSTALL "${SOURCE_PATH}/LICENSE-Boost" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -file(INSTALL "${SOURCE_PATH}/ryu/ryu.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/ryu/") -file(INSTALL "${SOURCE_PATH}/ryu/ryu2.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/ryu/") +file(INSTALL "${SOURCE_PATH}/ryu/ryu.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/ryu") +file(INSTALL "${SOURCE_PATH}/ryu/ryu2.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/ryu") file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/ryuConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/versions/r-/ryu.json b/versions/r-/ryu.json index 28714c26d35f39..956f3ec47a9085 100644 --- a/versions/r-/ryu.json +++ b/versions/r-/ryu.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "0cae1da4f8b5b052b8771a8d623edf3de7e53e49", + "git-tree": "858268791161130834449f30d145b1f44d0db48a", "version": "2.0", "port-version": 9 }, From b7a7f9457693805d61d2f6bc717e9e5da9f6c169 Mon Sep 17 00:00:00 2001 From: sbrajchuk Date: Sun, 30 Apr 2023 17:39:32 +0300 Subject: [PATCH 3/3] Fix build type handling --- ports/ryu/portfile.cmake | 7 ++----- versions/r-/ryu.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ports/ryu/portfile.cmake b/ports/ryu/portfile.cmake index b67f36421f320a..826730a3b6d52e 100644 --- a/ports/ryu/portfile.cmake +++ b/ports/ryu/portfile.cmake @@ -95,11 +95,8 @@ else () set(ENV{CC} "${VCPKG_DETECTED_CMAKE_C_COMPILER}") endif () -if ("${VCPKG_BUILD_TYPE}" STREQUAL "" OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") - bazel_build("release") -endif () - -if ("${VCPKG_BUILD_TYPE}" STREQUAL "" OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") +bazel_build("release") +if (NOT VCPKG_BUILD_TYPE) bazel_build("debug") endif () diff --git a/versions/r-/ryu.json b/versions/r-/ryu.json index 956f3ec47a9085..d4e4ddb62f558d 100644 --- a/versions/r-/ryu.json +++ b/versions/r-/ryu.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "858268791161130834449f30d145b1f44d0db48a", + "git-tree": "c19f7f75e6695396873fa98b4d39512899a34fb5", "version": "2.0", "port-version": 9 },