diff --git a/ports/libgpiod/portfile.cmake b/ports/libgpiod/portfile.cmake new file mode 100644 index 00000000000000..68ee7eff023d0f --- /dev/null +++ b/ports/libgpiod/portfile.cmake @@ -0,0 +1,42 @@ +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH + URL git://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git + REF dfc5d361e6748d5f48b706e5c4ac949d133b5470 # v1.6.3 + PATCHES +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND OPTIONS --enable-shared=yes) + list(APPEND OPTIONS --enable-static=no) +else() + list(APPEND OPTIONS --enable-shared=no) + list(APPEND OPTIONS --enable-static=yes) +endif() + +vcpkg_cmake_get_vars(cmake_vars_file) +include("${cmake_vars_file}") + +if (VCPKG_DETECTED_CMAKE_CROSSCOMPILING STREQUAL "TRUE") + list(APPEND OPTIONS CC=${VCPKG_DETECTED_CMAKE_C_COMPILER}) + if (VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + list(APPEND OPTIONS ac_cv_func_malloc_0_nonnull=yes) + list(APPEND OPTIONS ac_cv_func_realloc_0_nonnull=yes) + endif() +endif() + +vcpkg_configure_make( + AUTOCONFIG + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ${OPTIONS} + --enable-tools=no + --enable-tests=no + --enable-bindings-cxx=no + --enable-bindings-python=no +) + +vcpkg_install_make() +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file diff --git a/ports/libgpiod/vcpkg.json b/ports/libgpiod/vcpkg.json new file mode 100644 index 00000000000000..bbbca0c71bd686 --- /dev/null +++ b/ports/libgpiod/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "libgpiod", + "version": "1.6.3", + "description": "C library and tools for interacting with the linux GPIO character device", + "homepage": "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git", + "license": "LGPL-2.1-or-later", + "supports": "linux & (x64 | arm64)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 6b3147e52ca18c..c90d3f4a4a062b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3532,6 +3532,10 @@ "baseline": "1.42", "port-version": 3 }, + "libgpiod": { + "baseline": "1.6.3", + "port-version": 0 + }, "libgpod": { "baseline": "2019-08-29", "port-version": 4 diff --git a/versions/l-/libgpiod.json b/versions/l-/libgpiod.json new file mode 100644 index 00000000000000..8737d8f5d0f017 --- /dev/null +++ b/versions/l-/libgpiod.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "9a8b2a2d891f2435ff9ce3fbcea0bd870327bad0", + "version": "1.6.3", + "port-version": 0 + } + ] +}