From f61747a671c9d717fabd1432f1900eb739595bf0 Mon Sep 17 00:00:00 2001 From: Ralph Ursprung <39383228+rursprung@users.noreply.github.com> Date: Wed, 12 Mar 2025 14:58:31 +0100 Subject: [PATCH] [aravis] add new port (+add to OpenCV 4 as optional feature) (#42351) Co-authored-by: Stefano Sinigardi Co-authored-by: WangWeiLin-MV <156736127+WangWeiLin-MV@users.noreply.github.com> --- ports/aravis/portfile.cmake | 70 +++++++++++++++++++ ports/aravis/vcpkg.json | 43 ++++++++++++ ports/opencv/vcpkg.json | 14 +++- ports/opencv4/portfile.cmake | 1 + ports/opencv4/vcpkg.json | 11 ++- scripts/ci.baseline.txt | 4 ++ scripts/test_ports/vcpkg-ci-opencv/vcpkg.json | 8 +++ versions/a-/aravis.json | 9 +++ versions/baseline.json | 8 ++- versions/o-/opencv.json | 5 ++ versions/o-/opencv4.json | 5 ++ 11 files changed, 174 insertions(+), 4 deletions(-) create mode 100644 ports/aravis/portfile.cmake create mode 100644 ports/aravis/vcpkg.json create mode 100644 versions/a-/aravis.json diff --git a/ports/aravis/portfile.cmake b/ports/aravis/portfile.cmake new file mode 100644 index 0000000000..548a6615fd --- /dev/null +++ b/ports/aravis/portfile.cmake @@ -0,0 +1,70 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO AravisProject/aravis + REF "${VERSION}" + SHA512 3a71228fdd3d2fc6926b4efc99f268130ad4c460a8d8573d7cfa9bc0833355e88e5fc8900302eb8b891a1cc1a7f4b8753a295e5fe10d9653b32258ab62ed2113 + HEAD_REF main +) + +set(OPTIONS "") +set(OPTIONS_RELEASE "") +if("usb" IN_LIST FEATURES) + list(APPEND OPTIONS -Dusb=enabled) +else() + list(APPEND OPTIONS -Dusb=disabled) +endif() +if("packet-socket" IN_LIST FEATURES) + list(APPEND OPTIONS -Dpacket-socket=enabled) +else() + list(APPEND OPTIONS -Dpacket-socket=disabled) +endif() +if("fast-heartbeat" IN_LIST FEATURES) + list(APPEND OPTIONS -Dfast-heartbeat=true) +else() + list(APPEND OPTIONS -Dfast-heartbeat=false) +endif() +if("introspection" IN_LIST FEATURES) + list(APPEND OPTIONS_RELEASE -Dintrospection=enabled) +else() + list(APPEND OPTIONS_RELEASE -Dintrospection=disabled) +endif() + +set(GLIB_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/glib") +set(GIR_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection") +if(CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(GIR_TOOLS_DIR "${CURRENT_INSTALLED_DIR}/tools/gobject-introspection") +endif() + +vcpkg_configure_meson( + SOURCE_PATH + "${SOURCE_PATH}" + OPTIONS + ${OPTIONS} + -Dviewer=disabled + -Dgst-plugin=disabled + OPTIONS_RELEASE + ${OPTIONS_RELEASE} + OPTIONS_DEBUG + -Dintrospection=disabled + ADDITIONAL_BINARIES + "glib-mkenums='${GLIB_TOOLS_DIR}/glib-mkenums'" + "glib-compile-resources='${GLIB_TOOLS_DIR}/glib-compile-resources${VCPKG_HOST_EXECUTABLE_SUFFIX}'" + "g-ir-compiler='${GIR_TOOLS_DIR}/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}'" + "g-ir-scanner='${GIR_TOOLS_DIR}/g-ir-scanner'" +) +vcpkg_install_meson() + +vcpkg_copy_pdbs() + +vcpkg_fixup_pkgconfig() + +vcpkg_copy_tools( + AUTO_CLEAN + TOOL_NAMES + arv-camera-test-0.8 + arv-fake-gv-camera-0.8 + arv-test-0.8 + arv-tool-0.8 +) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/aravis/vcpkg.json b/ports/aravis/vcpkg.json new file mode 100644 index 0000000000..ff52b5c23b --- /dev/null +++ b/ports/aravis/vcpkg.json @@ -0,0 +1,43 @@ +{ + "name": "aravis", + "version": "0.8.34", + "description": " A vision library for genicam based cameras.", + "homepage": "https://github.com/AravisProject/aravis", + "license": "LGPL-2.0-or-later", + "dependencies": [ + "glib", + { + "name": "glib", + "host": true + }, + "libxml2", + { + "name": "vcpkg-tool-meson", + "host": true + }, + "zlib" + ], + "default-features": [ + "usb" + ], + "features": { + "fast-heartbeat": { + "description": "Enable faster heartbeat rate" + }, + "introspection": { + "description": "Build introspection data", + "dependencies": [ + "gobject-introspection" + ] + }, + "packet-socket": { + "description": "Enable packet socket support" + }, + "usb": { + "description": "Enable USB support", + "dependencies": [ + "libusb" + ] + } + } +} diff --git a/ports/opencv/vcpkg.json b/ports/opencv/vcpkg.json index 40493ffc0d..7d514746b0 100644 --- a/ports/opencv/vcpkg.json +++ b/ports/opencv/vcpkg.json @@ -1,7 +1,7 @@ { "name": "opencv", "version": "4.10.0", - "port-version": 2, + "port-version": 3, "description": "computer vision library", "homepage": "https://github.com/opencv/opencv", "license": "Apache-2.0", @@ -24,6 +24,18 @@ } ] }, + "aravis": { + "description": "aravis", + "dependencies": [ + { + "name": "opencv4", + "default-features": false, + "features": [ + "aravis" + ] + } + ] + }, "calib3d": { "description": "calib3d module", "dependencies": [ diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index 432d987d21..a084d95d82 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -70,6 +70,7 @@ set(ADE_DIR ${CURRENT_INSTALLED_DIR}/share/ade CACHE PATH "Path to existing ADE vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES "ade" WITH_ADE + "aravis" WITH_ARAVIS "calib3d" BUILD_opencv_calib3d "carotene" WITH_CAROTENE "contrib" WITH_CONTRIB diff --git a/ports/opencv4/vcpkg.json b/ports/opencv4/vcpkg.json index bf35ffb9f1..33482b9e1f 100644 --- a/ports/opencv4/vcpkg.json +++ b/ports/opencv4/vcpkg.json @@ -1,7 +1,7 @@ { "name": "opencv4", "version": "4.10.0", - "port-version": 5, + "port-version": 6, "description": "computer vision library", "homepage": "https://github.com/opencv/opencv", "license": "Apache-2.0", @@ -67,6 +67,15 @@ "ade" ] }, + "aravis": { + "description": "aravis", + "dependencies": [ + { + "name": "aravis", + "default-features": false + } + ] + }, "calib3d": { "description": "calib3d module" }, diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 0d92379bdf..fda79551d0 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -55,6 +55,10 @@ apr:arm64-android=fail apr:x64-android=fail apsi:arm-neon-android=fail apsi:x64-android=fail +# needs NDK w/ API level >=24, CI currently has API level 21 +aravis:arm-neon-android=fail +aravis:arm64-android=fail +aravis:x64-android=fail # Broken with CUDA 12; needs update to 3.8.3 and https://github.com/arrayfire/arrayfire/issues/3349 fixed arrayfire:x64-linux=fail avro-c:arm-neon-android=fail diff --git a/scripts/test_ports/vcpkg-ci-opencv/vcpkg.json b/scripts/test_ports/vcpkg-ci-opencv/vcpkg.json index 09163cf590..06fc7e5987 100644 --- a/scripts/test_ports/vcpkg-ci-opencv/vcpkg.json +++ b/scripts/test_ports/vcpkg-ci-opencv/vcpkg.json @@ -120,6 +120,14 @@ ], "platform": "!uwp & !android & !(windows & (arm | arm64)) & !(osx & arm64)" }, + { + "name": "opencv", + "default-features": false, + "features": [ + "aravis" + ], + "platform": "!android & !uwp" + }, { "name": "opencv2", "default-features": false, diff --git a/versions/a-/aravis.json b/versions/a-/aravis.json new file mode 100644 index 0000000000..b576a5c209 --- /dev/null +++ b/versions/a-/aravis.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "9de676f9a27354906fbff6a6005d11719e8f09e1", + "version": "0.8.34", + "port-version": 0 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 3fe9edfa43..7dca5a4d58 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -184,6 +184,10 @@ "baseline": "0.11.0", "port-version": 0 }, + "aravis": { + "baseline": "0.8.34", + "port-version": 0 + }, "arb": { "baseline": "2.21.1", "port-version": 2 @@ -6738,7 +6742,7 @@ }, "opencv": { "baseline": "4.10.0", - "port-version": 2 + "port-version": 3 }, "opencv2": { "baseline": "2.4.13.7", @@ -6750,7 +6754,7 @@ }, "opencv4": { "baseline": "4.10.0", - "port-version": 5 + "port-version": 6 }, "opendnp3": { "baseline": "3.1.1", diff --git a/versions/o-/opencv.json b/versions/o-/opencv.json index a55a01b3c9..0c289db99f 100644 --- a/versions/o-/opencv.json +++ b/versions/o-/opencv.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b64f8548c2b8c03acf0f510c100785725c6e3f6f", + "version": "4.10.0", + "port-version": 3 + }, { "git-tree": "22a0035d6e4154c97495125f9482180d7810fe91", "version": "4.10.0", diff --git a/versions/o-/opencv4.json b/versions/o-/opencv4.json index 273478c295..85d9223001 100644 --- a/versions/o-/opencv4.json +++ b/versions/o-/opencv4.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "93ab740dda4563da56f1b89ddbd8bc9802ec6df2", + "version": "4.10.0", + "port-version": 6 + }, { "git-tree": "176f72c465d0770b93bc5c394d4993de54ad9c71", "version": "4.10.0",