From 807354de0d1f4e67dcd640b5447a7c97f0e77bfc Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Tue, 22 Feb 2022 01:40:04 -0600 Subject: [PATCH 1/5] [libgpiod] Add new port. --- ports/libgpiod/portfile.cmake | 46 +++++++++++++++++++++++++++++++++++ ports/libgpiod/vcpkg.json | 14 +++++++++++ 2 files changed, 60 insertions(+) create mode 100644 ports/libgpiod/portfile.cmake create mode 100644 ports/libgpiod/vcpkg.json diff --git a/ports/libgpiod/portfile.cmake b/ports/libgpiod/portfile.cmake new file mode 100644 index 00000000000000..815bcc1bcc4adc --- /dev/null +++ b/ports/libgpiod/portfile.cmake @@ -0,0 +1,46 @@ + + +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) + + diff --git a/ports/libgpiod/vcpkg.json b/ports/libgpiod/vcpkg.json new file mode 100644 index 00000000000000..ce9326ae125156 --- /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", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ], + "supports": "linux & (x64 | arm64)" +} From ff62b5a07e37e6138a7a92f6d204fff12985d4b8 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Tue, 22 Feb 2022 01:43:43 -0600 Subject: [PATCH 2/5] [libgpiod] add version file + apply manifest formatting. --- ports/libgpiod/vcpkg.json | 4 ++-- versions/baseline.json | 4 ++++ versions/l-/libgpiod.json | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 versions/l-/libgpiod.json diff --git a/ports/libgpiod/vcpkg.json b/ports/libgpiod/vcpkg.json index ce9326ae125156..bbbca0c71bd686 100644 --- a/ports/libgpiod/vcpkg.json +++ b/ports/libgpiod/vcpkg.json @@ -4,11 +4,11 @@ "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 } - ], - "supports": "linux & (x64 | arm64)" + ] } 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..1a173293585fdf --- /dev/null +++ b/versions/l-/libgpiod.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "98b005671873a0755f4e3135e53fa6d2caf92197", + "version": "1.6.3", + "port-version": 0 + } + ] +} From 06982b0b016956f38970339915879a110f3d8e4c Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Tue, 22 Feb 2022 04:26:06 -0600 Subject: [PATCH 3/5] Update hash. --- versions/l-/libgpiod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/libgpiod.json b/versions/l-/libgpiod.json index 1a173293585fdf..58ec1000e6bd41 100644 --- a/versions/l-/libgpiod.json +++ b/versions/l-/libgpiod.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "98b005671873a0755f4e3135e53fa6d2caf92197", + "git-tree": "bee35d9df1cadb1f55fa8db8219c3f450944c33a", "version": "1.6.3", "port-version": 0 } From 9a730ba9b69903c5e6a7d40b71b85fea10c4460d Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Tue, 22 Feb 2022 05:42:12 -0600 Subject: [PATCH 4/5] [libgpiod] Aesthetic: remove top & bottom lines. --- ports/libgpiod/portfile.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ports/libgpiod/portfile.cmake b/ports/libgpiod/portfile.cmake index 815bcc1bcc4adc..68ee7eff023d0f 100644 --- a/ports/libgpiod/portfile.cmake +++ b/ports/libgpiod/portfile.cmake @@ -1,5 +1,3 @@ - - vcpkg_from_git( OUT_SOURCE_PATH SOURCE_PATH URL git://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git @@ -41,6 +39,4 @@ vcpkg_install_make() vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - - +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file From 76b7a914585692fd1e9771d188bbce65121a7a37 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Tue, 22 Feb 2022 05:42:50 -0600 Subject: [PATCH 5/5] [libgpiod] Update hash. --- versions/l-/libgpiod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/libgpiod.json b/versions/l-/libgpiod.json index 58ec1000e6bd41..8737d8f5d0f017 100644 --- a/versions/l-/libgpiod.json +++ b/versions/l-/libgpiod.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "bee35d9df1cadb1f55fa8db8219c3f450944c33a", + "git-tree": "9a8b2a2d891f2435ff9ce3fbcea0bd870327bad0", "version": "1.6.3", "port-version": 0 }