Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aravis] add new port (+add to OpenCV 4 as optional feature) #42351

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions ports/aravis/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AravisProject/aravis
REF "${VERSION}"
SHA512 05f08ceb9b96b27be4cb6e66b39a59524efc6bc2ae4058fb69bba1e0ecb3eeec0f9754f25c356be8cda70d2c4d481b74b1b981d54f124e9656bebb35951d318f
HEAD_REF main
)

list(APPEND OPTIONS -Dviewer=disabled)
list(APPEND OPTIONS -Dgst-plugin=disabled)
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 -Dintrospection=enabled)
endif()

set(GLIB_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/glib")

vcpkg_configure_meson(
SOURCE_PATH
"${SOURCE_PATH}"
OPTIONS
${OPTIONS}
ADDITIONAL_BINARIES
glib-mkenums='${GLIB_TOOLS_DIR}/glib-mkenums'
glib-compile-resources='${GLIB_TOOLS_DIR}/glib-compile-resources${VCPKG_HOST_EXECUTABLE_SUFFIX}'
)
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")
40 changes: 40 additions & 0 deletions ports/aravis/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "aravis",
"version": "0.8.33",
"description": " A vision library for genicam based cameras.",
"homepage": "https://github.com/AravisProject/aravis",
"license": "LGPL-2.1-only",
"dependencies": [
"glib",
{
"name": "glib",
"host": true
},
"libxml2",
{
"name": "vcpkg-tool-meson",
"host": true
},
"zlib"
],
"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"
]
}
}
}
13 changes: 13 additions & 0 deletions ports/opencv/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "opencv",
"version": "4.10.0",
"port-version": 1,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",
Expand All @@ -26,6 +27,18 @@
}
]
},
"aravis": {
"description": "aravis",
"dependencies": [
{
"name": "opencv4",
"default-features": false,
"features": [
"aravis"
]
}
]
},
"calib3d": {
"description": "calib3d module",
"dependencies": [
Expand Down
8 changes: 8 additions & 0 deletions ports/opencv4/0002-install-options.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
include(cmake/OpenCVDetectPython.cmake)
endif()

@@ -730,6 +730,7 @@ endif()
# ----------------------------------------------------------------------------
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
# ----------------------------------------------------------------------------
+find_package(PkgConfig REQUIRED)
if(UNIX OR MINGW)
if(NOT APPLE_FRAMEWORK OR OPENCV_ENABLE_PKG_CONFIG)
if(CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{PKG_CONFIG_LIBDIR} AND NOT DEFINED ENV{PKG_CONFIG_SYSROOT_DIR}
--- a/cmake/OpenCVCompilerOptions.cmake
+++ b/cmake/OpenCVCompilerOptions.cmake
@@ -300,7 +300,6 @@ if(MSVC)
Expand Down
5 changes: 5 additions & 0 deletions ports/opencv4/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ vcpkg_from_github(
0019-opencl-kernel.patch
0020-miss-openexr.patch
)

vcpkg_find_acquire_program(PKGCONFIG)
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
Comment on lines +28 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this may also change behavior for other find modules, in unexpected/untested ways. (Mostly on Windows.)
And in most other CMake ports, we pass it as PKG_CONFIG_EXECUTABLE cmake option. (Nitpick.)


# Disallow accidental build of vendored copies
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/openexr")
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/flatbuffers")
Expand Down Expand Up @@ -52,6 +56,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
"contrib" WITH_CONTRIB
"cuda" WITH_CUBLAS
Expand Down
8 changes: 7 additions & 1 deletion ports/opencv4/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencv4",
"version": "4.10.0",
"port-version": 1,
"port-version": 2,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",
Expand Down Expand Up @@ -30,6 +30,12 @@
"ade"
]
},
"aravis": {
"description": "aravis",
"dependencies": [
"aravis"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable opt-out from usb.

Suggested change
"aravis"
{
"name": "aravis",
"default-features": false
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it might be better to leave usb away as a default feature from aravis? i now went with that option to stay aligned with aravis (though i think they make it dependent on the availability of the library by default since they set it to auto)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vcpkg will install aravis' default feature by default. This change enables the user to explicitly request installation of aravis without default features.

]
},
"calib3d": {
"description": "calib3d module"
},
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,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
Expand Down
8 changes: 8 additions & 0 deletions scripts/test_ports/vcpkg-ci-opencv/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@
],
"platform": "!android"
},
{
"name": "opencv",
"default-features": false,
"features": [
"aravis"
],
"platform": "!android & !uwp"
},
{
"name": "opencv",
"default-features": false,
Expand Down
9 changes: 9 additions & 0 deletions versions/a-/aravis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "c4152870b29fc3a69a03516358dd68d7319febf7",
"version": "0.8.33",
"port-version": 0
}
]
}
8 changes: 6 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@
"baseline": "0.11.0",
"port-version": 0
},
"aravis": {
"baseline": "0.8.33",
"port-version": 0
},
"arb": {
"baseline": "2.21.1",
"port-version": 2
Expand Down Expand Up @@ -6654,7 +6658,7 @@
},
"opencv": {
"baseline": "4.10.0",
"port-version": 0
"port-version": 1
},
"opencv2": {
"baseline": "2.4.13.7",
Expand All @@ -6666,7 +6670,7 @@
},
"opencv4": {
"baseline": "4.10.0",
"port-version": 1
"port-version": 2
},
"opendnp3": {
"baseline": "3.1.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opencv.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8c6345003b72978dc0b2b00e043ba314347e729d",
"version": "4.10.0",
"port-version": 1
},
{
"git-tree": "9d9cbb0bf2f2f7c07006342621932ce4928cb8e6",
"version": "4.10.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opencv4.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9373b1626ab549e7b5ff72fcf3208514d2dd7472",
"version": "4.10.0",
"port-version": 2
},
{
"git-tree": "6ba67264448ce7a60b8e109db62270331e657e38",
"version": "4.10.0",
Expand Down
Loading