Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[s2geometry] Add new port #22107

Merged
merged 44 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8add833
[abseil] Upgrade to 2021.1102
jiayuehua Dec 14, 2021
d7902b9
revert portfile.cmake
JonLiu1993 Dec 16, 2021
b8c364a
update version
JonLiu1993 Dec 16, 2021
f27bc3c
update portfile.cmake
JonLiu1993 Dec 16, 2021
1ac8147
update version
JonLiu1993 Dec 16, 2021
fc96e70
[s2geometry] google s2 for for manipulating geometric shapes
jiayuehua Dec 14, 2021
757a375
[libevent] no absolute paths (#21179)
autoantwort Dec 14, 2021
b54d601
[Pcre2] Check if files exists before call vcpkg_replace_string. (#22003)
larshg Dec 14, 2021
8b8eb17
[lodepng] Fix cannot open include file "lodepng.h" (#22007)
LilyWangLL Dec 14, 2021
ef56f7d
[MyGUI] update to 3.4.1 (#22015)
FrankXie05 Dec 14, 2021
64672b7
[s2n] Update, add openssl dependency (#21484)
dg0yt Dec 14, 2021
34f4281
Libpq update and VCPKG_OSX_SYSROOT fix (#21583)
daschuer Dec 14, 2021
fab1111
[qhttpengine] New port (#22009)
kafeg Dec 14, 2021
a19bedd
[ xtensor-io ] Fix wrong hash (#22018)
JonLiu1993 Dec 14, 2021
1a0a2fe
[vcpkg] Update VMs for December 2021 Patch Tuesday (#22013)
BillyONeal Dec 15, 2021
bfb9db9
[starlink] Veggiesaurus/starlink ast cminpack fix (#20559)
veggiesaurus Dec 15, 2021
1bec8e8
[libunifex] Update to 2021-12-07 (#21995)
zeyangl Dec 15, 2021
9227e3e
[tensorflow] update to 2.7, including bazel latest 4.x update (#22022)
jgehw Dec 15, 2021
38f7c8e
[hiredis] Fix static build (#22038)
kafeg Dec 15, 2021
608d912
[vcpkg baseline] Fix mpg123 build failed on Linux (#22028)
LilyWangLL Dec 16, 2021
83c0859
[qt5-base] no _debug lib suffixes on macOS (#14225) (#21695)
autoantwort Dec 16, 2021
f8992fb
[python3] Support arm (#21528)
NancyLi1013 Dec 17, 2021
b84c9fc
[openmvg] update to 2.0 (#22020)
FrankXie05 Dec 17, 2021
2e46c24
[brynet] Update to 1.11.1 (#22021)
IronsDu Dec 17, 2021
91d0eea
[graphicsmagick] update to version 1.3.37 (#22024)
josuegomes Dec 17, 2021
6bc621a
[meson] fix windows linker detection (#22032)
Neumann-A Dec 17, 2021
df7ead3
[libgpg-error] Release-only build support (#22036)
kafeg Dec 17, 2021
9202ec0
[elfutils] provide static or shared libraries correctly (#22055)
csw Dec 17, 2021
87a780b
[gl3w] Use khrplatform.h from the egl-registry port (#22056)
cfillion Dec 17, 2021
a222dc6
[caf] Update to 0.18.5 (#22046)
PhoebeHui Dec 17, 2021
a941c14
[gmsh] Add new port (#21896)
xarthurx Dec 17, 2021
d416206
[kf5] upgrade to 5.89 (#21890)
wrobelda Dec 17, 2021
4f1784a
[ompl] Add vcpkg_check_linkage (#21659)
JackBoosY Dec 17, 2021
ba42f4c
[pcl] Add feature apps, visualization, simulation, examples and add u…
JackBoosY Dec 17, 2021
a32e324
[activemq-cpp] Added missing libuuid dependency (#22059)
daschuer Dec 17, 2021
503614c
[optimus-cpp] New port: ID hashing and Obfuscation using Knuth's Algo…
kafeg Dec 17, 2021
0ec3a89
[tensorflow-common] remove single quotes from vcpkg flags (#21869)
daschuer Dec 17, 2021
4112681
[sdl2-mixer] Fix link mpg123 error (#22049)
LilyWangLL Dec 17, 2021
e52f697
Merge branch 'microsoft:master' into master
jiayuehua Dec 20, 2021
79becf3
[s2geometry]: new port
jiayuehua Dec 20, 2021
21bd28f
[s2geometry]: new port
jiayuehua Dec 21, 2021
4dfa99b
[s2geometry]: new port
jiayuehua Dec 21, 2021
4abd41a
[s2geometry]: new port
jiayuehua Dec 21, 2021
a86b65e
[s2geometry] new port
jiayuehua Dec 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions ports/s2geometry/config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ecd280..1a8367f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -211,7 +211,11 @@ target_link_libraries(
# list(APPEND CMAKE_MODULE_PATH "<path_to_s2geometry_dir>/third_party/cmake")
# add_subdirectory(<path_to_s2geometry_dir> s2geometry)
# target_link_libraries(<target_name> s2)
-target_include_directories(s2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
+target_include_directories(s2 PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+$<INSTALL_INTERFACE:include>
+)
+

# We don't need to install all headers, only those
# transitively included by s2 headers we are exporting.
@@ -407,7 +411,17 @@ install(FILES src/s2/util/math/mathutil.h
install(FILES src/s2/util/units/length-units.h
src/s2/util/units/physical-units.h
DESTINATION include/s2/util/units)
-install(TARGETS s2 s2testing DESTINATION lib)
+ install(TARGETS s2 s2testing
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+install(TARGETS s2
+ EXPORT s2Targets
+ )
+install(EXPORT s2Targets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When upstream does not have targets, we tend to add unofficial- as a prefix so that if upstream ever decides to add targets, they won't conflict with the ones injected by vcpkg.

+ FILE s2Targets.cmake
+ DESTINATION share/s2/
+)

message("GTEST_ROOT: ${GTEST_ROOT}")
if (GTEST_ROOT)
@@ -534,3 +548,17 @@ endif()
if (${SWIG_FOUND} AND ${PYTHONLIBS_FOUND})
add_subdirectory("src/python" python)
endif()
+
+
+include(CMakePackageConfigHelpers)
+# generate the config file that is includes the exports
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggests that there is a missing vcpkg_fixup_pkgconfig call. Can you confirm that the generated pkgconfig file does not have absolute paths and correctly identifies the right settings after installed into the installed tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will fix them, Billy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Billy, I follow cmake tutorial https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20Export%20Configuration.html , I think I am correct.
generated s2Config.cmake content:
image

Don't need vcpkg_fixup_pkgconfig here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this is a CMake config script, not pkgconfig. OK!

+ "${CMAKE_CURRENT_BINARY_DIR}/s2Config.cmake"
+ INSTALL_DESTINATION "share/s2/"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+ install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/s2Config.cmake
+ DESTINATION "share/s2/"
+ )
diff --git a/Config.cmake.in b/Config.cmake.in
new file mode 100644
index 0000000..ac09b2d
--- /dev/null
+++ b/Config.cmake.in
@@ -0,0 +1,3 @@
+@PACKAGE_INIT@
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/s2Targets.cmake" )
28 changes: 28 additions & 0 deletions ports/s2geometry/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
vcpkg_fail_port_install(ON_TARGET "Windows")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/s2geometry
REF v0.9.0
SHA512 854ec84a54aff036b3092a6233be0f5fc0e4846ac5f882326bbb3f2b9ce88bd5c866a80ae352d8e7d5ae00b9c9a8ab1cff6a95412f990b7bc1fdc5ca3d632b9c
HEAD_REF main
PATCHES
config.patch
)


vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
MAYBE_UNUSED_VARIABLES BUILD_TESTING
)

vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")



file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

13 changes: 13 additions & 0 deletions ports/s2geometry/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "s2geometry",
"version": "0.9.0",
"description": "S2 is a library for spherical geometry that aims to have the same robustness, flexibility, and performance as the very best planar geometry libraries.",
"homepage": "https://s2geometry.io",
"supports": "!windows",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6132,6 +6132,10 @@
"baseline": "2.0",
"port-version": 5
},
"s2geometry": {
"baseline": "0.9.0",
"port-version": 0
},
"s2n": {
"baseline": "1.3.0",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/s-/s2geometry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "1061917340485b0fecaabf0b460101b34873a679",
"version": "0.9.0",
"port-version": 0
}
]
}