From e1dfde4d08cc2b4dac5791459907e321cdefdc1e Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 24 Sep 2020 08:59:29 +0900 Subject: [PATCH 1/8] new port opensubdiv --- ports/opensubdiv/fix_compile-option.patch | 13 +++++++ ports/opensubdiv/portfile.cmake | 44 +++++++++++++++++++++++ ports/opensubdiv/vcpkg.json | 7 ++++ 3 files changed, 64 insertions(+) create mode 100644 ports/opensubdiv/fix_compile-option.patch create mode 100644 ports/opensubdiv/portfile.cmake create mode 100644 ports/opensubdiv/vcpkg.json diff --git a/ports/opensubdiv/fix_compile-option.patch b/ports/opensubdiv/fix_compile-option.patch new file mode 100644 index 00000000000000..1acae92c8495e7 --- /dev/null +++ b/ports/opensubdiv/fix_compile-option.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b69912ae..dcde4297 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -218,7 +218,7 @@ elseif(MSVC) + + list(APPEND OSD_COMPILER_FLAGS + /W3 # Use warning level recommended for production purposes. +- /WX # Treat all compiler warnings as errors. ++ # /WX # Treat all compiler warnings as errors. + + # warning C4005: macro redefinition + /wd4005 diff --git a/ports/opensubdiv/portfile.cmake b/ports/opensubdiv/portfile.cmake new file mode 100644 index 00000000000000..39c91cd7d3a79e --- /dev/null +++ b/ports/opensubdiv/portfile.cmake @@ -0,0 +1,44 @@ +# # Specifies if the port install should fail immediately given a condition +# vcpkg_fail_port_install(MESSAGE "opensubdiv currently only supports Linux and Mac platforms" ON_TARGET "Windows") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO PixarAnimationStudios/OpenSubdiv + REF 82ab1b9f54c87fdd7e989a3470d53e137b8ca270 # 3.4.3 + SHA512 607cb9aa05d83a24bc2102bfd28abfec58f5723b1c56f6f431111ebf98f105ff7ca2a77610953acd21f73cb74d8d8ec68db3aeb11be1f9ca56d87c36c58dd095 + HEAD_REF master + PATCHES + fix_compile-option.patch +) + +vcpkg_find_acquire_program(PYTHON2) +get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY) +vcpkg_add_to_path("${PYTHON2_DIR}") + + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS + -DNO_DX=ON + -DNO_EXAMPLES=ON + -DNO_TUTORIALS=ON + -DNO_REGRESSION=ON + -DNO_TESTS=ON +) + +vcpkg_install_cmake() + +# # Moves all .cmake files from /debug/share/opensubdiv/ to /share/opensubdiv/ +# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details +# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/opensubdiv) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# # Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/opensubdiv RENAME copyright) + +# # Post-build test for cmake libraries +# vcpkg_test_cmake(PACKAGE_NAME opensubdiv) diff --git a/ports/opensubdiv/vcpkg.json b/ports/opensubdiv/vcpkg.json new file mode 100644 index 00000000000000..bf9c3d6e63ae0b --- /dev/null +++ b/ports/opensubdiv/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "opensubdiv", + "version-string": "3.4.3", + "homepage": "https://github.com/PixarAnimationStudios/OpenSubdiv", + "description": "An Open-Source subdivision surface library.", + "dependencies": [] +} From 0652967e952f41ce4b598ff3dca1ede50774fd4c Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 24 Sep 2020 14:06:08 +0900 Subject: [PATCH 2/8] format-manifest ./vcpkg format-manifest ports/opensubdiv/vcpkg.json --- ports/opensubdiv/vcpkg.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ports/opensubdiv/vcpkg.json b/ports/opensubdiv/vcpkg.json index bf9c3d6e63ae0b..e239f58057a50e 100644 --- a/ports/opensubdiv/vcpkg.json +++ b/ports/opensubdiv/vcpkg.json @@ -1,7 +1,6 @@ -{ - "name": "opensubdiv", - "version-string": "3.4.3", - "homepage": "https://github.com/PixarAnimationStudios/OpenSubdiv", - "description": "An Open-Source subdivision surface library.", - "dependencies": [] -} +{ + "name": "opensubdiv", + "version-string": "3.4.3", + "description": "An Open-Source subdivision surface library.", + "homepage": "https://github.com/PixarAnimationStudios/OpenSubdiv" +} From 6a7b5a3944d4cd0b653ea3662c4494aa27b85270 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 24 Sep 2020 14:08:57 +0900 Subject: [PATCH 3/8] remove comment. use ${PORT} --- ports/opensubdiv/portfile.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ports/opensubdiv/portfile.cmake b/ports/opensubdiv/portfile.cmake index 39c91cd7d3a79e..d074f273b36a27 100644 --- a/ports/opensubdiv/portfile.cmake +++ b/ports/opensubdiv/portfile.cmake @@ -37,8 +37,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -# # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/opensubdiv RENAME copyright) - -# # Post-build test for cmake libraries -# vcpkg_test_cmake(PACKAGE_NAME opensubdiv) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) From 694aaa82ae03cda0b7006f2011f532c88b93a8f6 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 24 Sep 2020 19:44:36 +0900 Subject: [PATCH 4/8] limit targets --- ports/opensubdiv/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/opensubdiv/portfile.cmake b/ports/opensubdiv/portfile.cmake index d074f273b36a27..e7893f8b1402ea 100644 --- a/ports/opensubdiv/portfile.cmake +++ b/ports/opensubdiv/portfile.cmake @@ -1,5 +1,5 @@ -# # Specifies if the port install should fail immediately given a condition -# vcpkg_fail_port_install(MESSAGE "opensubdiv currently only supports Linux and Mac platforms" ON_TARGET "Windows") +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "linux" "osx" "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH From 8b97256e073d5db2a1b02163d5c06ed1e70f50e6 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 24 Sep 2020 19:54:19 +0900 Subject: [PATCH 5/8] add supports --- ports/opensubdiv/vcpkg.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/opensubdiv/vcpkg.json b/ports/opensubdiv/vcpkg.json index e239f58057a50e..9503b32f3367bf 100644 --- a/ports/opensubdiv/vcpkg.json +++ b/ports/opensubdiv/vcpkg.json @@ -2,5 +2,6 @@ "name": "opensubdiv", "version-string": "3.4.3", "description": "An Open-Source subdivision surface library.", - "homepage": "https://github.com/PixarAnimationStudios/OpenSubdiv" + "homepage": "https://github.com/PixarAnimationStudios/OpenSubdiv", + "supports": "windows & !arm & !uwp & !static" } From adb7f6eaeaaecc3d1b262f238492c38ebd3f994d Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 24 Sep 2020 20:10:41 +0900 Subject: [PATCH 6/8] NO_CUDA --- ports/opensubdiv/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/opensubdiv/portfile.cmake b/ports/opensubdiv/portfile.cmake index e7893f8b1402ea..55242172049f73 100644 --- a/ports/opensubdiv/portfile.cmake +++ b/ports/opensubdiv/portfile.cmake @@ -21,6 +21,7 @@ vcpkg_configure_cmake( PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DNO_DX=ON + -DNO_CUDA=ON -DNO_EXAMPLES=ON -DNO_TUTORIALS=ON -DNO_REGRESSION=ON From cd0522809c7cd4bfa14acf129753b7626ef98aad Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 25 Sep 2020 11:12:58 +0900 Subject: [PATCH 7/8] Update ports/opensubdiv/vcpkg.json Co-authored-by: Robert Schumacher --- ports/opensubdiv/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/opensubdiv/vcpkg.json b/ports/opensubdiv/vcpkg.json index 9503b32f3367bf..b66c98d7ba5250 100644 --- a/ports/opensubdiv/vcpkg.json +++ b/ports/opensubdiv/vcpkg.json @@ -3,5 +3,5 @@ "version-string": "3.4.3", "description": "An Open-Source subdivision surface library.", "homepage": "https://github.com/PixarAnimationStudios/OpenSubdiv", - "supports": "windows & !arm & !uwp & !static" + "supports": "windows & !arm & !uwp" } From ed595aef045622a401d8d6fdcab66e524eb440aa Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 25 Sep 2020 15:26:16 +0900 Subject: [PATCH 8/8] fix STATIC_CRT --- ports/opensubdiv/portfile.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/opensubdiv/portfile.cmake b/ports/opensubdiv/portfile.cmake index 55242172049f73..c23e14476fe3f7 100644 --- a/ports/opensubdiv/portfile.cmake +++ b/ports/opensubdiv/portfile.cmake @@ -1,5 +1,4 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "linux" "osx" "uwp") -vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -15,6 +14,11 @@ vcpkg_find_acquire_program(PYTHON2) get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY) vcpkg_add_to_path("${PYTHON2_DIR}") +if (VCPKG_CRT_LINKAGE STREQUAL static) + set(STATIC_CRT_LNK ON) +else() + set(STATIC_CRT_LNK OFF) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -26,6 +30,7 @@ vcpkg_configure_cmake( -DNO_TUTORIALS=ON -DNO_REGRESSION=ON -DNO_TESTS=ON + -DMSVC_STATIC_CRT=${STATIC_CRT_LNK} ) vcpkg_install_cmake()