Skip to content

Commit

Permalink
[spglib] Add a new port (microsoft#39493)
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT authored Jul 8, 2024
1 parent 04d6149 commit 47bf3d1
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ports/spglib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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")
9 changes: 9 additions & 0 deletions ports/spglib/usage
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions ports/spglib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions versions/s-/spglib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "72a361224c8e7cc3dd14810ae402a410aad4c0bb",
"version-semver": "2.4.0",
"port-version": 0
}
]
}

0 comments on commit 47bf3d1

Please sign in to comment.