From 47bf3d1ac192b3fa0feb6e6ac9c845de179eebe9 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Mon, 8 Jul 2024 16:46:55 +0200 Subject: [PATCH] [spglib] Add a new port (#39493) Signed-off-by: Cristian Le --- ports/spglib/portfile.cmake | 26 ++++++++++++++++++++++++++ ports/spglib/usage | 9 +++++++++ ports/spglib/vcpkg.json | 17 +++++++++++++++++ versions/baseline.json | 4 ++++ versions/s-/spglib.json | 9 +++++++++ 5 files changed, 65 insertions(+) create mode 100644 ports/spglib/portfile.cmake create mode 100644 ports/spglib/usage create mode 100644 ports/spglib/vcpkg.json create mode 100644 versions/s-/spglib.json diff --git a/ports/spglib/portfile.cmake b/ports/spglib/portfile.cmake new file mode 100644 index 00000000000000..8a9a9f0660427c --- /dev/null +++ b/ports/spglib/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO spglib/spglib + REF "v${VERSION}" + SHA512 15c0ced6168a436468d1f9db28bb93f3ff130467cd1f0b966cb9731d36be3d9877b3452561dbace3242351b7c9b41d41930a76ca2278f00c1b45620c06ee93e0 + HEAD_REF develop +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SPGLIB_SHARED_LIBS) + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DSPGLIB_WITH_TESTS=OFF + -DSPGLIB_SHARED_LIBS=${SPGLIB_SHARED_LIBS} +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Spglib) +vcpkg_fixup_pkgconfig() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +# handle copyright +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/spglib/usage b/ports/spglib/usage new file mode 100644 index 00000000000000..9fa321b40da0ba --- /dev/null +++ b/ports/spglib/usage @@ -0,0 +1,9 @@ +spglib provides CMake targets: + + find_package(Spglib CONFIG REQUIRED) + target_link_libraries(main PRIVATE Spglib::symspg) + +spglib provides pkg-config modules: + + # The spglib library + spglib diff --git a/ports/spglib/vcpkg.json b/ports/spglib/vcpkg.json new file mode 100644 index 00000000000000..94f4da8f929725 --- /dev/null +++ b/ports/spglib/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "spglib", + "version-semver": "2.4.0", + "description": "C library for finding and handling crystal symmetries", + "homepage": "https://spglib.readthedocs.io/en/latest/", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 5bc5f32922d089..b4fd3891634b40 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8408,6 +8408,10 @@ "baseline": "1.2.1", "port-version": 1 }, + "spglib": { + "baseline": "2.4.0", + "port-version": 0 + }, "spine-runtimes": { "baseline": "4.1.0", "port-version": 0 diff --git a/versions/s-/spglib.json b/versions/s-/spglib.json new file mode 100644 index 00000000000000..2c72c423a1b3be --- /dev/null +++ b/versions/s-/spglib.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "72a361224c8e7cc3dd14810ae402a410aad4c0bb", + "version-semver": "2.4.0", + "port-version": 0 + } + ] +}