diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-11-05 03:03:37 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-11-05 03:03:37 +0000 |
commit | 564cd64dc5f2727c4df6aeb1bb51327503c84e78 (patch) | |
tree | 44f51d1887abfcdb7df61a570c2ffa0d6841d7db /media-libs | |
parent | 3cc82055be7dba177f4aea15af9f5414b532da7e (diff) |
gentoo auto-resync : 05:11:2024 - 03:03:37
Diffstat (limited to 'media-libs')
26 files changed, 2110 insertions, 175 deletions
diff --git a/media-libs/Manifest.gz b/media-libs/Manifest.gz Binary files differindex 68250fcfadcf..4171eec0d549 100644 --- a/media-libs/Manifest.gz +++ b/media-libs/Manifest.gz diff --git a/media-libs/libcanberra-gtk3/Manifest b/media-libs/libcanberra-gtk3/Manifest new file mode 100644 index 000000000000..59fe7787d6e5 --- /dev/null +++ b/media-libs/libcanberra-gtk3/Manifest @@ -0,0 +1,5 @@ +AUX libcanberra-0.30-wayland.patch 2382 BLAKE2B bc2be1eb32541c80483538b8e3105f281023cee22a2a0f67c8210b8cfc97273f5323cf31e3b7955e8b944af1a414b30554c9dff7d2de97cb1bcfb13f4cd56baa SHA512 9822e67dea1b541fedb0fa9779cfcb101ba8bd24d9ff238af59920b937cb1f5fbe5854ee5e642ff53e65f8d2d0996f2c46be67a51a211d2e76ae89ae98ec553a +AUX libcanberra-gtk-module.sh 275 BLAKE2B d7f863f77983d4144035eefc7ce3abb4eb411ecc3aac5f5737b7ce0f44e42cf713b963a17c6a6afdaa95833eedaa510ccd9371056c2c6f0e805febf16c245e36 SHA512 6c945211ad9d461e5bdac209c83e0fc0c714eb194f6d57e4f18db1d904528fe845cd628572d0ab9eb4d53005c00073b376b6d718bcd0cddaeee83dc90042643d +DIST libcanberra-0.30.tar.xz 318960 BLAKE2B c90c6863738b103c256eeb0907060a0f74b73ef50ac0728d2114aa558a7a1ad7cbae4184860573d3fac0032eba77327a4de94c459b99a81c3dc19da0e98adfda SHA512 f7543582122256826cd01d0f5673e1e58d979941a93906400182305463d6166855cb51f35c56d807a56dc20b7a64f7ce4391368d24990c1b70782a7d0b4429c2 +EBUILD libcanberra-gtk3-0.30.ebuild 2212 BLAKE2B c15369eec11e2e6a8aaa0ebe485995f2876544fef605e42857889bada5b30ec72312a240aaccac5656174b12649476079f996547124c4c8ade5475e2a6bbbaa6 SHA512 9e001687ad7f73dffd7249661c7ca566884ac9c61999b98541d96fe1318bd83cb6d6289d757fe73d93a11c9498f98eb44996ad04995ee343b820a7a36342a953 +MISC metadata.xml 368 BLAKE2B 191cf45377c726b49548737b12f971668c0e735f5226ee54fa9dde31c5575e29c9a5cb9d54bf9bc2f1aff6a565c4c7931928f5b6edb291781477464858edda39 SHA512 d227c9f4b6956e4e6c20004cfc93e54643fb94eaef0da7abc20e0489248747dae47eb7ceb0551c70c7c0cd3c5291b305b0a103fa2769144b6b6484212ed2bca0 diff --git a/media-libs/libcanberra-gtk3/files/libcanberra-0.30-wayland.patch b/media-libs/libcanberra-gtk3/files/libcanberra-0.30-wayland.patch new file mode 100644 index 000000000000..e51cfe00c0df --- /dev/null +++ b/media-libs/libcanberra-gtk3/files/libcanberra-0.30-wayland.patch @@ -0,0 +1,64 @@ +From c0620e432650e81062c1967cc669829dbd29b310 Mon Sep 17 00:00:00 2001 +From: Michael Meeks <michael.meeks@suse.com> +Date: Fri, 09 Nov 2012 16:16:40 +0000 +Subject: gtk: Don't assume all GdkDisplays are GdkX11Displays: broadway/wayland + +--- +diff --git a/src/canberra-gtk-module.c b/src/canberra-gtk-module.c +index 67791f0..c1532ab 100644 +--- a/src/canberra-gtk-module.c ++++ b/src/canberra-gtk-module.c +@@ -307,6 +307,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +@@ -335,6 +340,11 @@ static gint display_get_desktop(GdkDisplay *d) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), DefaultRootWindow(GDK_DISPLAY_XDISPLAY(d)), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_CURRENT_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +@@ -365,6 +375,11 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) { + gboolean ret = FALSE; + Atom xembed; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return FALSE; ++#endif ++ + /* Gnome Panel applets are XEMBED windows. We need to make sure we + * ignore them */ + +diff --git a/src/canberra-gtk.c b/src/canberra-gtk.c +index 34446f5..08cb668 100644 +--- a/src/canberra-gtk.c ++++ b/src/canberra-gtk.c +@@ -185,6 +185,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +-- +cgit v0.9.2 diff --git a/media-libs/libcanberra-gtk3/files/libcanberra-gtk-module.sh b/media-libs/libcanberra-gtk3/files/libcanberra-gtk-module.sh new file mode 100644 index 000000000000..63c16af71861 --- /dev/null +++ b/media-libs/libcanberra-gtk3/files/libcanberra-gtk-module.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# to be sourced + +case "$SESSION" in + GNOME) + # Done by gnome-settings-daemon + ;; + *) + if [ -z "$GTK_MODULES" ] ; then + GTK_MODULES="canberra-gtk-module" + else + GTK_MODULES="$GTK_MODULES:canberra-gtk-module" + fi + export GTK_MODULES + ;; +esac diff --git a/media-libs/libcanberra-gtk3/libcanberra-gtk3-0.30.ebuild b/media-libs/libcanberra-gtk3/libcanberra-gtk3-0.30.ebuild new file mode 100644 index 000000000000..ec20d28ae8db --- /dev/null +++ b/media-libs/libcanberra-gtk3/libcanberra-gtk3-0.30.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN="libcanberra" +MY_P="libcanberra-${PV}" +inherit libtool multilib-minimal + +DESCRIPTION="GTK3 bindings for libcanberra, the portable sound event library" +HOMEPAGE="https://0pointer.de/lennart/projects/libcanberra/" +SRC_URI="https://0pointer.de/lennart/projects/${MY_PN}/${MY_P}.tar.xz" +S="${WORKDIR}/${MY_P}" + +LICENSE="LGPL-2.1+" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="gnome" + +COMMON_DEPEND=" + ~media-libs/libcanberra-${PV}[${MULTILIB_USEDEP}] + >=dev-libs/glib-2.32:2[${MULTILIB_USEDEP}] + x11-libs/gtk+:3[X,${MULTILIB_USEDEP}] + x11-libs/libX11[${MULTILIB_USEDEP}] +" +DEPEND="${COMMON_DEPEND} + dev-libs/libltdl:0[${MULTILIB_USEDEP}] + media-libs/libvorbis[${MULTILIB_USEDEP}] +" +RDEPEND="${COMMON_DEPEND} + !<media-libs/libcanberra-0.30-r8[gtk3(-)] + gnome? ( + gnome-base/dconf + gnome-base/gsettings-desktop-schemas ) +" +BDEPEND=" + app-arch/xz-utils + virtual/pkgconfig +" + +PATCHES=( + # gtk: Don't assume all GdkDisplays are GdkX11Displays: broadway/wayland (from 'master') + "${FILESDIR}/${MY_P}-wayland.patch" +) + +src_prepare() { + default + elibtoolize +} + +multilib_src_configure() { + local myeconfargs=( + --docdir="${EPREFIX}"/usr/share/doc/${PF} + --disable-alsa + --disable-oss + --disable-pulse + --disable-gstreamer + --disable-gtk + --enable-gtk3 + --disable-tdb + --disable-udev + --disable-lynx + --disable-gtk-doc + ) + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_install() { + # Disable parallel installation until bug #253862 is solved + emake DESTDIR="${D}" -j1 install + + rm "${D}"/usr/include/canberra.h \ + "${D}"/usr/lib64/libcanberra-0.30/libcanberra-{multi,null}.so \ + "${D}"/usr/lib64/libcanberra.so{,.0,.0.2.5} \ + "${D}"/usr/lib64/pkgconfig/libcanberra.pc \ + "${D}"/usr/share/vala/vapi/libcanberra.vapi \ + || die +} + +multilib_src_install_all() { + einstalldocs + find "${ED}" -type f -name '*.la' -delete || die + + # This is needed for desktops different than GNOME, bug #520550 + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/${MY_PN}-gtk-module.sh 40-${MY_PN}-gtk-module +} diff --git a/media-libs/libcanberra-gtk3/metadata.xml b/media-libs/libcanberra-gtk3/metadata.xml new file mode 100644 index 000000000000..1db67d7ed56f --- /dev/null +++ b/media-libs/libcanberra-gtk3/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>gnome@gentoo.org</email> + <name>Gentoo GNOME Desktop</name> + </maintainer> + <maintainer type="project"> + <email>sound@gentoo.org</email> + <name>Gentoo Sound project</name> + </maintainer> +</pkgmetadata> diff --git a/media-libs/libcanberra/Manifest b/media-libs/libcanberra/Manifest index 19003363cad2..fafc63b8cc52 100644 --- a/media-libs/libcanberra/Manifest +++ b/media-libs/libcanberra/Manifest @@ -2,4 +2,5 @@ AUX libcanberra-0.30-wayland.patch 2382 BLAKE2B bc2be1eb32541c80483538b8e3105f28 AUX libcanberra-gtk-module.sh 275 BLAKE2B d7f863f77983d4144035eefc7ce3abb4eb411ecc3aac5f5737b7ce0f44e42cf713b963a17c6a6afdaa95833eedaa510ccd9371056c2c6f0e805febf16c245e36 SHA512 6c945211ad9d461e5bdac209c83e0fc0c714eb194f6d57e4f18db1d904528fe845cd628572d0ab9eb4d53005c00073b376b6d718bcd0cddaeee83dc90042643d DIST libcanberra-0.30.tar.xz 318960 BLAKE2B c90c6863738b103c256eeb0907060a0f74b73ef50ac0728d2114aa558a7a1ad7cbae4184860573d3fac0032eba77327a4de94c459b99a81c3dc19da0e98adfda SHA512 f7543582122256826cd01d0f5673e1e58d979941a93906400182305463d6166855cb51f35c56d807a56dc20b7a64f7ce4391368d24990c1b70782a7d0b4429c2 EBUILD libcanberra-0.30-r7.ebuild 2498 BLAKE2B 725ac6409ec1079218ea2f15c6d18eb7e024bdd53bc58514247cfd72eb959d7a6c46df6125ddebe2b4770966ca7a5e2ddfa8483ccf17941e54ad3dc9db5ce338 SHA512 857715b1aa992baa2313188419f19f09457d8c36cf25fadf22b4918a0269856b06fcc800680b07e28602705c7816e373aacb089c57c3e34165c4387dd2538140 +EBUILD libcanberra-0.30-r8.ebuild 1811 BLAKE2B 7ab896c8febbcd4eb465d2215ac420a4cfbf1f8c5976b2018cb569b427ec1b7ce5aee5500e7f3abcfdb0456c0901fadec3c49adacda55d32177600a207efb17d SHA512 916c7c70b33e16d3a61db043e020368c520d66c3baf34d7224bf51a96ca1c2152dbede324a8eff9724330cdbf00cb6897d623845f7efd7fe2b74b8f8b61094f6 MISC metadata.xml 1744 BLAKE2B 26312a41cefdc053215cb2a6ff704a3934f806df80d340a7766f9994ffb07118ed2647ead627197ffc8810627c00e220eec683e987bcb374b626c5508c70d7f2 SHA512 423e9ad57ce8d636c2d05b802c9cb6391d2794eeb9924009ae265c7de68165af664964c3a4f6b435bb88ffe5f37cd5d4f55addc62e1ff1b9e073c75817f0ea13 diff --git a/media-libs/libcanberra/libcanberra-0.30-r8.ebuild b/media-libs/libcanberra/libcanberra-0.30-r8.ebuild new file mode 100644 index 000000000000..9e70735bd7e5 --- /dev/null +++ b/media-libs/libcanberra/libcanberra-0.30-r8.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit libtool multilib-minimal systemd + +DESCRIPTION="Portable sound event library" +HOMEPAGE="https://0pointer.de/lennart/projects/libcanberra/" +SRC_URI="https://0pointer.de/lennart/projects/${PN}/${P}.tar.xz" + +LICENSE="LGPL-2.1+" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="alsa gstreamer oss pulseaudio tdb udev" + +DEPEND=" + dev-libs/libltdl:0[${MULTILIB_USEDEP}] + media-libs/libvorbis[${MULTILIB_USEDEP}] + alsa? ( + media-libs/alsa-lib:=[${MULTILIB_USEDEP}] + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] ) ) + gstreamer? ( media-libs/gstreamer:1.0[${MULTILIB_USEDEP}] ) + pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] ) + tdb? ( sys-libs/tdb:=[${MULTILIB_USEDEP}] ) +" +RDEPEND="${DEPEND} + x11-themes/sound-theme-freedesktop" # Required for index.theme wrt #323379 +BDEPEND=" + app-arch/xz-utils + virtual/pkgconfig +" + +REQUIRED_USE="udev? ( alsa )" + +src_prepare() { + default + elibtoolize +} + +multilib_src_configure() { + local myeconfargs=( + --docdir="${EPREFIX}"/usr/share/doc/${PF} + $(use_enable alsa) + $(use_enable oss) + $(use_enable pulseaudio pulse) + $(use_enable gstreamer) + --disable-gtk + --disable-gtk3 + $(use_enable tdb) + $(use_enable udev) + --disable-lynx + --disable-gtk-doc + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" + ) + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" + + if multilib_is_native_abi; then + ln -s "${S}"/gtkdoc/html gtkdoc/html || die + fi +} + +multilib_src_install() { + # Disable parallel installation until bug #253862 is solved + emake DESTDIR="${D}" -j1 install +} + +multilib_src_install_all() { + einstalldocs + find "${ED}" -type f -name '*.la' -delete || die +} diff --git a/media-libs/libsidplayfp/Manifest b/media-libs/libsidplayfp/Manifest index 00b70035d0d7..3962dc11a012 100644 --- a/media-libs/libsidplayfp/Manifest +++ b/media-libs/libsidplayfp/Manifest @@ -1,7 +1,9 @@ DIST libsidplayfp-2.10.0.tar.gz 811416 BLAKE2B 5d81c1c74eccb5b4e176a82e1232eed7a5687bd6dd5c22b0941d414be438db54f0d303bb0c26445404beb94f9d01cf78ec57983e8a11dd265ec6f94947a71b2b SHA512 ebffc99d04e4e5ef309636c08105b42150c5b707bcb6ecd196ee6956f301ae152efdfdd86b14276e31a0936d97cc534caec4e2281249df6ba7571926a1daffeb DIST libsidplayfp-2.10.1.tar.gz 812511 BLAKE2B 7c4a8c276a0adf75f96cebaf7931f314bdc097df8e682d2894b9903b574e2a6dd5d9b6619243aceb3458e70d29041c4549aaefe45fb37bb9312333d5d03322f8 SHA512 b8a15b34b0c834b037fc35ae9c968505322f9fb4971313ca59a0a8d22e31580354e18fda530246c0086079a9f9ff40e9c54f93279831817dc377fa9c9894bb20 +DIST libsidplayfp-2.11.0.tar.gz 813488 BLAKE2B 6bb8f37e5272c166ba5fe804395c676becb366fbf2adff0831236eaa46f889811f9173f99a7b0e67f986dfbc8e58b4957b27a39c7b7da2571a7014776bc92c1b SHA512 5f8c32d6964cdd651db0718b8f02d7fcbf829c58ed15bc8fa07f5cc0a452954ec93b041f54641744b597a8e67b6c723df6031b00685231e931f6388c294ea172 DIST libsidplayfp-2.9.0.tar.gz 807772 BLAKE2B 9ec5066a69f912c4183e98c4883875b646c9f6150ab4bd3c8d9a7110a9c75529cdb6f8aeac8d379ecacf2c0ec6181a8ee13ff93bcc53f296b8900b0e6c8d5281 SHA512 3d6b0b6ab5155da3ae4cface17a2fe85deb1dd8ab8076dba60f04e5df78b10dc9b756b408734a1012e254d3d24d8cfcf15b562fdb1f28edd756a5d63719595b0 EBUILD libsidplayfp-2.10.0.ebuild 687 BLAKE2B 89257d5934cd9327850f3719e4fa316f15b3d124c722a7b026689e099a12faa3eca8ecbd8bba245043ea15603ea223aea103986df2fa495982e09a11347c23bc SHA512 faa54ae1b2098e9f988edda7fa3dcaebfe9dd1af6d44e26dbcccf228e06bc980d14a387f4c1d361c6dea462c921f789fc214a9c86f00650c747f1f382d4b7538 EBUILD libsidplayfp-2.10.1.ebuild 687 BLAKE2B 89257d5934cd9327850f3719e4fa316f15b3d124c722a7b026689e099a12faa3eca8ecbd8bba245043ea15603ea223aea103986df2fa495982e09a11347c23bc SHA512 faa54ae1b2098e9f988edda7fa3dcaebfe9dd1af6d44e26dbcccf228e06bc980d14a387f4c1d361c6dea462c921f789fc214a9c86f00650c747f1f382d4b7538 +EBUILD libsidplayfp-2.11.0.ebuild 687 BLAKE2B 89257d5934cd9327850f3719e4fa316f15b3d124c722a7b026689e099a12faa3eca8ecbd8bba245043ea15603ea223aea103986df2fa495982e09a11347c23bc SHA512 faa54ae1b2098e9f988edda7fa3dcaebfe9dd1af6d44e26dbcccf228e06bc980d14a387f4c1d361c6dea462c921f789fc214a9c86f00650c747f1f382d4b7538 EBUILD libsidplayfp-2.9.0.ebuild 685 BLAKE2B dae51274f54b5fd7a13c1ae93a7421f1c19e00c65f06e91df328db88ab33d39dc13d2eb9926e6c422827054d62db69f6be80d75e0c311f5b56ac6ece4d90f6ff SHA512 b993aa6da66d5f33c3bec51b6b1e5565bcea2b862e61cdb8021f6a1dce403fed5ae28945d260efdcbb86a81c4a84b58f3ef3b3f6601d43032241cae59a652794 MISC metadata.xml 339 BLAKE2B 79d766f101909c202affb7cc72bbefdfb8d5b44fcbf74f17f98e665351384a8110aec7ddec0c685fb328198d29ae4953ce341cda3dd4abd2a67f157d90628175 SHA512 172879da9ed0be1ff48d75d23d3b23e3070247b4ef1decb291b020f7bc1522dd033e78f92d38511eedaae7c1944edc5bb05ff763f4d20a6b7015198ebd38f16f diff --git a/media-libs/libsidplayfp/libsidplayfp-2.11.0.ebuild b/media-libs/libsidplayfp/libsidplayfp-2.11.0.ebuild new file mode 100644 index 000000000000..bc7c3460f07e --- /dev/null +++ b/media-libs/libsidplayfp/libsidplayfp-2.11.0.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Library for the sidplay2 fork with resid-fp" +HOMEPAGE="https://sourceforge.net/projects/sidplay-residfp/" +SRC_URI="https://downloads.sourceforge.net/sidplay-residfp/${PN}/$(ver_cut 1-2)/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0/6" +KEYWORDS="~amd64 ~hppa ~riscv ~x86" +IUSE="static-libs" + +src_prepare() { + default + # fix automagic. warning: modifying .ac triggers maintainer mode. + sed -i -e 's:doxygen:dIsAbLe&:' configure || die +} + +src_configure() { + econf \ + $(use_enable static-libs static) +} + +src_install() { + default + find "${D}" -name '*.la' -delete || die +} diff --git a/media-libs/nvidia-vaapi-driver/Manifest b/media-libs/nvidia-vaapi-driver/Manifest index 5fa4a2fbeea7..8908598960e2 100644 --- a/media-libs/nvidia-vaapi-driver/Manifest +++ b/media-libs/nvidia-vaapi-driver/Manifest @@ -1,3 +1,5 @@ DIST nvidia-vaapi-driver-0.0.12.tar.gz 183420 BLAKE2B bf3d2f92a0a38d209d3108893664a7b28657657b432cd43a016442b2192c10850ea4278a2a4a02dd53ba759cef38f39d36bdfa934b1fc3a229aed1ff7f7e0a55 SHA512 e586107d840fbcbce3f4f4f4397188d7df2beaeb763ec0ceaae6f4edb2a5638abed388816796e0a0b0665087cfb09fce2a4d83a3cdfd2279edf6b1be278f2ab2 +DIST nvidia-vaapi-driver-0.0.13.tar.gz 184099 BLAKE2B 73d4b6a205e05450864150b66c47fb4e7c3938e8abaac980c2ad86801d64fa6324347d6541e517b0e44dc497543bc0b97e120f4c3993e4ad8e17d9e720ea4aba SHA512 5e389d4ebc873766d138ba329503d89d4d45c668c5f20ff89a86ed094b107d3f63aee4044c49a25e78975309015c4c8da204b0131e7173d8ad7f951bb4985fcc EBUILD nvidia-vaapi-driver-0.0.12.ebuild 976 BLAKE2B 82f4c9c145456e199240ce4ab0a60147297b0e7a7d457c4840f37af9d2ed27bc05b5d81002d97e201535896221947b50c5e2f3ab73908df028c36533ef010f8b SHA512 624a23b62e4fc5fa7b027cffcd3c17090476d7429778eb1e15a1a4b0d140a0133bce00e8013a61a5b276806e9ba4a3b3797b123c5fd20d7b7b9e259e8ab270b2 +EBUILD nvidia-vaapi-driver-0.0.13.ebuild 976 BLAKE2B 82f4c9c145456e199240ce4ab0a60147297b0e7a7d457c4840f37af9d2ed27bc05b5d81002d97e201535896221947b50c5e2f3ab73908df028c36533ef010f8b SHA512 624a23b62e4fc5fa7b027cffcd3c17090476d7429778eb1e15a1a4b0d140a0133bce00e8013a61a5b276806e9ba4a3b3797b123c5fd20d7b7b9e259e8ab270b2 MISC metadata.xml 600 BLAKE2B 780e519992c02718417c1de7ca5c966c4795088bb649d862277959602ea6744c3d78589dc70e5c3eaefc989f9afd7eccded785b7e6e253fc8ae591731634c596 SHA512 5c43e6438c06d5631837711047ca2ccaccda39871af1eaef5ff997a5c35c2ec9f86a0188f44e961095c44823b11847289d04e16575e6061d4c894762a81b1c63 diff --git a/media-libs/nvidia-vaapi-driver/nvidia-vaapi-driver-0.0.13.ebuild b/media-libs/nvidia-vaapi-driver/nvidia-vaapi-driver-0.0.13.ebuild new file mode 100644 index 000000000000..24f23d496823 --- /dev/null +++ b/media-libs/nvidia-vaapi-driver/nvidia-vaapi-driver-0.0.13.ebuild @@ -0,0 +1,32 @@ +# Copyright 2023-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson-multilib + +DESCRIPTION="A VA-API implemention using NVIDIA's NVDEC" +HOMEPAGE="https://github.com/elFarto/nvidia-vaapi-driver" +SRC_URI="https://github.com/elFarto/nvidia-vaapi-driver/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND="media-libs/gst-plugins-bad + media-libs/libglvnd + >=media-libs/libva-1.8.0 + >=x11-libs/libdrm-2.4.60" +DEPEND="${RDEPEND} + >=media-libs/nv-codec-headers-11.1.5.1" +BDEPEND="virtual/pkgconfig" + +pkg_postinst() { + # Source: https://github.com/elFarto/nvidia-vaapi-driver/blob/v0.0.12/src/backend-common.c#L13 + elog "If vaapi drivers fail to load, then make sure that you are" + elog "passing the correct parameters to the kernel." + elog "nvidia_drm.modeset should be set to 1." + + elog "Check the wiki page for more information: " + elog "https://wiki.gentoo.org/wiki/VAAPI" +} diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest index a503aae64047..98591a2e5b16 100644 --- a/media-libs/opencv/Manifest +++ b/media-libs/opencv/Manifest @@ -1,6 +1,11 @@ AUX opencv-3.4.0-disable-download.patch 1050 BLAKE2B 6f39f61588d9231cc8d877624538a49654ec8cf63091f8d0251cd01cc14684f2f5264c295a149c4a5754a9336e1ad4d1760cc26471fd85a6f571404f7c8d540d SHA512 95f2043c286a7de33fb4718fc1e2ded1fd943b20a5c4cc0c3d7af84fc317e53e3aa6358a33e4781195f8a80904d6bc615171142cde5d30a83d16045d36f85826 AUX opencv-3.4.1-cuda-add-relaxed-constexpr.patch 707 BLAKE2B 743a9c259c59fc4e3017539faef0723e0a80fb9c4bbde94811f32b3e6ae271b3db39fd35487d75078cfbe9e596604c4e37fb5c6c18619ed524c52683219dd8af SHA512 b37ce78495a3bbc439f203d9db81d9bff3e7f980c01ef5187dee537dd9c1025c5163ec3760b48d91a099a2fafb60526c9fe83f7183fc605fb3cc0f5c7a65f6bf AUX opencv-4.1.2-opencl-license.patch 519 BLAKE2B 6dcdf809c3c75a39d0e44f02e157a0c0ee074fd15144565ed51ade7e7849cb313c084100f499cc1240424f4647a2ff73c8d5e61cbdf6d0499846db61b8a30729 SHA512 2874a5140ef5028eb6c64f36325904000edd722560cf876fc49d63b040633bcfea01cae27c156b18191564805cafd2986f26eea322b1376af4f2982d66ed7653 +AUX opencv-4.10.0-26234.patch 2791 BLAKE2B b55dd5fe4d554a0be48cabd7009d476fd47aa63bb4142ebb2f5681a2cdf17d530bffcec31e795a3ec7dc3524b3a9496562f83ea2fa9939d431d8d794458a2e9f SHA512 55f767366ab478cad5c2a1b89ccb38a0dbe66fc2c3e04d2cef767bb8dd2c672c6c523eba2b4fb67c73001f1a223c2c1b831f1b951c45b48fc5d649686c1a4cdf +AUX opencv-4.10.0-cuda-fp16.patch 7482 BLAKE2B a38b32ccb262ba316e733f7464b279f006d44da7d3bac1f91ab10c844022979bff0aa509ec259d448bc2cc976a3a59ed03b18a163518e77ec72fe1010935a605 SHA512 57248a1296edb4b126fa5767c3c7251d4c11bceb8d73d7a8e3860d07679d782dceeca6277cbbf1573741ac948a0fba4eced94e978689cab1a145dff90e04932c +AUX opencv-4.10.0-cudnn-9.patch 1890 BLAKE2B 08c9fd05bc3eb41e5ad2e74e17acb9d5d8fd8707106b2ceb581eef9b03d3e550acd91263807eaf1a730eb66a0246a7c4c02d84c56962fb8df1be82c9ed1c4e69 SHA512 79fa74ac37dfe6af3fb6a9417881cd42f5caeb31745e0144d0ea58b6da1250fd741f2e1b554e2bdd990cd25887601247eb537efdbab32a26930fe07bc1784c7d +AUX opencv-4.10.0-dnn-explicitly-include-abseil-cpp.patch 1281 BLAKE2B e518599fd704c0551954af607ec76413fd599774994e347be3a723ca27f7c88ff669b3f61f841e9b614e22edb220ce844dc9b8d8c7484cd9c95ac4008ae07347 SHA512 9707e279358576270d24c0bc7e7e2d027c92a1897c9918a90b8b7641be2aaf8d4912dfd2bfa6c6c4fbf429dc3d6dde8b5cf1a6ed40d01154272d5f993e358463 +AUX opencv-4.10.0-tbb-detection.patch 1086 BLAKE2B bf24938e203dce880386e1f567ac02f42cc216e5955a6af57e7cfbfc4cb93bcc3759f32c0977464ab0d403426a40ae4be4e23a11960dd6b290fb4c7424098a62 SHA512 081aee59a9bac25538eba1cf9e95c2bf5d30cee535af55e0b9f51169025b20244fd370133b8bac0f6166d1a939ac806c1ff372d07d0fe1d067b7edf3f324ccc0 AUX opencv-4.4.0-disable-native-cpuflag-detect.patch 1218 BLAKE2B 06569f6b7d33eccb11cae74624a2cc7d7e1eb788145813509220dc8436d2380892392be8c4af03fec845f3eade74b6277985cf80e38785317b15f17890bcaa4c SHA512 3be60f7ee28e3b001ef0c791e3ce1c849ff6fa9fdb70731716668b2698eed9abb24ee3aead1dbc857ed68fc46a645c70a1e3831e8a3e5a5b1791aa06bd2f9ee1 AUX opencv-4.5.0-link-with-cblas-for-lapack.patch 726 BLAKE2B adbffd961c88229bf810e13fe20705352ff506a653c1d55bb0687c03d8daf9e05aed0f2ba9cd6e306c625837d6ddf64eeb99dc6cbf2b15fae833f4a7eea6aad0 SHA512 4c3108e304721c2cd78eb82f5d7bccc18831db5f47bc628a98ae6a37da389deef30e7e9b6dc5644e3bc0e0fafdd907dc37822a58a25555999698527d2ac364b0 AUX opencv-4.8.1-use-system-flatbuffers.patch 1522 BLAKE2B a9000e3269266cf9e85b6ba247fd977eb1c2e0bf771d0ba1432ba1f56802f72062402e55e7327e91085be870338e452ac08ec8a958d3cf51fdd9a8daf0cfee76 SHA512 50d7ee7de6513ea56974c598641c2d9edb7679f273f6313c1dd7e68ba667688ad50fd61691661702fab75ddfa1165cd96a52ebebd19c8c09116612c90c8b11d3 @@ -8,18 +13,24 @@ AUX opencv-4.8.1-use-system-opencl.patch 933 BLAKE2B 557448d74771f6b9fc8b2fa5af7 AUX opencv-4.9.0-ade-0.1.2d.tar.gz.patch 652 BLAKE2B 80b3d810e31a16413b67a0c0d64991c7fe699240ae67a50ecc7d926af33359eccb6aef52facbba1bea56723698e775f293c8cae57b504e76ec1e287d2c21b810 SHA512 dc88386c96ea882848a18d9336541e525a926d9c9d75c3e9d4dc667e03ea8fe85109f360a310c8ea602c643fcc4e4317b3af81c0f4e50f9057ee0588d433b020 AUX opencv-4.9.0-cmake-cleanup.patch 1298 BLAKE2B 22dd3a47a26bab6545956d24c685792fa2071678db5090377348bdfb6e70dde003db0354fdc6d0dd32f30d5db0cd5df3270080678257590ec7f84f309cd09f95 SHA512 14bea3b5711f66b08b34b9dc1246744ae6385b7ecaadab057e5702769049e8fb318cbed11390517899933c760c42a2f4b25d90d6eeafe11977274a1fef4bf62e AUX opencv-4.9.0-drop-python2-detection.patch 3270 BLAKE2B bbb4021592e61d1ca99b7c6182d89e7d1adfff7e3ebdb1e810ce7b957001111559968d244416deca4baca44463cef86148d0d0d48b1fd44d91dc9c17b40f5692 SHA512 2386169151d8b8242245f66e4aeb6445bc4dcfc0ff31768417dbc32c8dee0b94e935d1d00d0b40acaad448ef816643b5df563e0a01016913be90a2a0c8b4e7c0 +AUX opencv_contrib-4.10.0-CUDA-12.6-tuple_size.patch 2348 BLAKE2B 347c194b26d177ea7e7465e51e9bd362e4f5f23c48fa2eff363a3895a6f45d80a09218ac25ec293a496c56156572a9b000583fe3788b94510a26986c8ba8ebce SHA512 0eb0db58e9fdab8e6cc4415a6430c1b80ed338a6dea8dfe21bd965eadcab9de2098b2ba094496784fc90d1648713f1af721cb7e849c049793a5159799fc128d6 AUX opencv_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch 1158 BLAKE2B c4b139198ac5c33974d6c4fac8ebcf288f15d9edf09e55b30e47071931abdf8924dc51c2d8cb27103edb3b815ba9f7e5ea334cfb1849be7b59ff4cd076f6771a SHA512 03d4442af9b98115126473cca0a9f581bd0c0e983b8d5b7f34fdd0ea7455d4a73163f853c80438f4390c5da4c7cc419c59c24643529df9eb4222915c80e654fe AUX opencv_contrib-4.8.1-rgbd.patch 477 BLAKE2B 0120e631199d7099bae437d459f0c950c3cbd11e5f0a900d687ca5aedf1d7602f7faa3be5ba1a9b3e0758f3fd70574450f97bd7429e447df7440d58326ceb99b SHA512 6fe2ef40bf26d40e4f52d84b17183f6e536b2fe51bf65266be6a59865def0b9c074aa5eff58a60d673afec776a7ba03acaba667c917b78751950b77f68759d96 AUX opencv_contrib-4.9.0-cuda-12.4.patch 2397 BLAKE2B 7333533f0818b04f5ec89b593f9bf7710aba496a2ba7a1688043818d4249d4a3d3e3f17c42456d2e5e0aaae728f0b9726f3943ce732f7307b0126adc68147da0 SHA512 442c97b3fbf48f0b5c1176a10b1bbcf7fccad369070b6be2a0e3e6dd2ccba88f0a7662360b108fc4d55b766d0563d5f7eef5a2fb7afa5212aac8cab73e9ad43c DIST NVIDIAOpticalFlowSDK-edb50da3cf849840d680249aa6dbef248ebce2ca.tar.gz 8771 BLAKE2B f579960448bdaf57fbefd5e88002d8f6f4dbb828429b0f3a0112916c03039d4e4de65263eb8464a4d62924c1b77f0a61c2d93b7307657439bfbf7d59785f1533 SHA512 85dfdc52260f54f62c980508f4b6ab384e44200bd1c13761c4947f9a898c08f0faed2d734a85a4ba7a46f8788ed58ee89f12f61cee97881b69ba626bbd04f655 DIST ade-0.1.2d.tar.gz 117027 BLAKE2B c544b769c7b289342a469950ed047fa13719bafba29aa41167b588cf4f24ed6e596159ec19b65e61e09519a461a5e82ac07d63e2ea493279ee182fe658810abb SHA512 46f2feee28d732a6940a5a95944f3283bde1b8c8e05466a8ca1c576623c54d1bed875ce2b24a941111d8976cb0c6ba5a4ac8408f042f5765debf1badf7d43348 +DIST opencv-4.10.0.tar.gz 94993429 BLAKE2B f16de226337ce1dabda4a52ae03257b0570af0e6212102c483dce61f2bcee1549150d0016b6ea20bae5d8c838e12db3d54bcb9c2ec5d3164639cdd56818f0b1b SHA512 b4f7248f89f1cd146dbbae7860a17131cd29bd3cb81db1e678abfcfbf2d8fa4a7633bfd0edbf50afae7b838c8700e8c0d0bb05828139d5cb5662df6bbf3eb92c DIST opencv-4.9.0.tar.gz 92788647 BLAKE2B 257478b0f5e19abca5b3676767dacd40765c645eb455080160b8b9dc54e66fba4880200b483829fc9050bc3f9b3e815f8ee784d7b41261877784536778fe3c96 SHA512 1598ae59849e7805b3cbec5260bb501006f26edff452343b366b9262a0f48a6e09f4b2e760209cb677f2a64a7b22f4e70bc6195c104bcea74cc9fe04031d0292 DIST opencv_3rdparty-34e4206aef44d50e6bbcd0ab06354b52e7466d26.tar.gz 397901 BLAKE2B 9adbe14ee3a2c90b890be694aa80d65b67e23a23f47ccabee4564e31eb9857d717b5a751df32004cfa5d6a53a9e1d8ea8d8943b705a0eaea5ca741169e2222f6 SHA512 8a92555aed2ac8752818586ab9762dd96ec128c5465cb87e402f15b15d16f7d371b3de045ef7295526e9ef99ec817766bb685a21d24dba29c650cf44e384a4e3 DIST opencv_3rdparty-8afa57abc8229d611c4937165d20e2a2d9fc5a12.tar.gz 63301261 BLAKE2B 923dc944edfda4c292d42207290bee414bfe21998f6ffe341ea3b38b6f2f581f3a243653e2c1fd3fa86084068ad6e7acd5ca73ab43094aa15f124d379833a5d8 SHA512 68cce870da0846cbd12a093ec7896b510e34590dad2b91699be1df5d4f72d343f9789d54c45c1b801784f7e57e0e80b19ba65dd99855225da99b4193dae97aaa DIST opencv_3rdparty-a8b69ccc738421293254aec5ddb38bd523503252.tar.gz 920403 BLAKE2B 5f834e8ccef9d88d0650f8ae5d215a2d07d0a356aaad4de1622068e0b2a7def88fccc84bc4397f0182732e836fcd6e363ae25a2cdeaa4d458a7d8ef9afc81da5 SHA512 5611b9db40477759213ab35320570c198f1f224f92ca801ca3accd1f7620faf3d44f306e44abefd10be118acee9b56da643ca82abaa7c4d2102fe92e5b298a6e DIST opencv_3rdparty-b2bfc75f6aea5b1f834ff0f0b865a7c18ff1459f.tar.gz 10036903 BLAKE2B c13559569808db24105049e2081bc466c0e8b6dab58bcc69001e49ff82e03ec4701e25648b5e542b7df2c8e522abfbd82c9825e66c37d6a673847b41bf6effae SHA512 3fc44f12802aa1dad0b12372d53242ae2134a2d74ca0b6d8e4639551623426106781a41d77ebfce79ac625a49aec26b0d7425e0d31f09bab6a15e3d43caef8bc DIST opencv_3rdparty-fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d.tar.gz 1470898 BLAKE2B f1794cc8f8684501f670db3d720c02f35c57ebe91f276cc21dea1f1c1426740d03569143fec74380e941703b5086db5f013ca913fb296eda99559115fd53ca30 SHA512 07118b9d688bf0ff34a6e4ca1548006124d80d11e7b48f08c9e1910b64249b1dad0ace460f50adda0ecb69b90871fc59cc25f451570c63f7c6d6ba2b92d8801c +DIST opencv_contrib-4.10.0-3607.patch 29870 BLAKE2B cf43afbd24d0b32817e908c55ac3bf0d5da8b82b2c459bc04ef31414e16285eefe334c46eeee730bd3cad2bbec062f5bc212a82bd7f2ac83baca231d711545d4 SHA512 3fdd08cee6d7da8edf36411f30c8d6230ebd86a1c896a08f1dc86d3a0982e1f1f99797066722bc51ce4b1a60a2db55853c348441b3e6edc0d318fcb7bd5cf944 +DIST opencv_contrib-4.10.0.tar.gz 55387316 BLAKE2B 5d6f884817b6d45b86833fcab1e31cd0fd7be19885698e0aefe300fa570f93c446d7f564567cc08099d559a98a65e9c3dd0fd35ceeca7e0e9a1e56edc74a0fe9 SHA512 480df862250692a97ce6431cba00dbecb70332307a19c1c04aa9d7444e6e74ab4f8c798548dce76d2319a9877624b82e361fb22a71df14b996087ade448be501 DIST opencv_contrib-4.9.0.tar.gz 59803362 BLAKE2B e6b90e9bd462f96ef010490d45105d7125622d6c49912653c0d387568ae7109b1cbcac4cc0f52c1f997a45ed75923caea90bf4ad9336e689a56742b029789038 SHA512 ebaee3b88bd7ae246727e65a98d9fbc1d9772a4181a1926f3af742410b78dc87d2386bcd96ac67d7fb1a3020c3717a2cdebdcf9304d6dfd9ea494004791cf043 +DIST opencv_extra-4.10.0.tar.gz 504349887 BLAKE2B 6e76860beb95cf00698980a19cfd2894e5bfe0d477d94352cbb2ff98688acbc1c404953cbc3baa95453588e7b9063175a067f24006c5d2719a6c75d15f2ef891 SHA512 1a581dad61bc1e5075af5afed2dd3d67793232a9e1219408448d08c518ae714cf0c4d5fec2c25791351a49a0d265fe051ea142b2170f82843e19e82f65abc8c6 DIST opencv_extra-4.9.0.tar.gz 502141517 BLAKE2B ed7351f29c6fb80d56d5ef383af68322fa805c7689132f7ca9bb43c9a1319c5876ce6d5c40d583c955eb255dd82b876c94ed42625cd71b13830ec94b2cc75dc2 SHA512 f05c1eaed491d15107c858af5b33d0d5856070dcb6f94491ba33a172b2f0caf34905eb5d1787e1247bc888626478647fce0db7f3ccbc6d6faba0ee43fd6b6bfa -EBUILD opencv-4.9.0-r2.ebuild 35013 BLAKE2B 596d4d9cc5cc9fca76ad546cd63a6e02e1145d8fee02ea1a85686154e5cba3dca1e72724d75872db2df64550d16252a53eb53d5630c731c922bad691dac719fc SHA512 47289e69a3287d9380f0e669eb6d3f7936b32e752eefb7d59a71cb0417602f3e12b9ccde68bb276d6ac947eed64e62de1c5ead5fd3d1b8b8f1c144f6cf423b65 -MISC metadata.xml 3718 BLAKE2B 44b00ff4bc94a19f6a1b68cfefb29ce9f1a4ee21ee999b72a258268893ede5274d863d3a6faa325e6f0522c078c6afae53c6de4c46d6ed5a083888e195f34276 SHA512 b6c2f0a27b84afcb576209a3bdc641e81323c01bcac9617086d79821e723ea3c9698e8f3c5db837d46da68e48b6d9d08bdd05977e22d58d6c7ad30fa7b965b52 +EBUILD opencv-4.10.0.ebuild 43018 BLAKE2B 4ce9ffe0eb35067d65bdb67b4418c7e2c68509d12eef121bd22d61ed9386ace3987f3bbb40a7939d922c722b192022b94fcc7829270082cc6a217fe2b5ba1d86 SHA512 f231ca3339184935c09e15bfd071caab69fc7241e9193e433358d2c5e1c60bee8a61a39c7840376c10b93a2786c9de3fab995dfddddcc5ff02ec637360cc31b0 +EBUILD opencv-4.9.0-r2.ebuild 35017 BLAKE2B 841ae35a9a3b47a6d2ec7391f006fc8ae66ecdcd60e06a6e403efe3e9cb10b9f84ca50c299e152c2b1049fb3c9dc636deebfc3a8221f44a6aa00a5ef7b223175 SHA512 fe00ee7cfc840716aa2555c7da8f57230fcd2175db2c6b3051444304e906f73d36c3050694d145b74c1f5b96835f10164ad829d322ed5c402afff585e5e75ffc +MISC metadata.xml 3921 BLAKE2B 92f38794e008f13866e797ab3eeb3dbeffbba81412523f9c9590d3768e046565f651cf0c0b223c1a8b04a9ba38732dfecfeebc79b75a7c722af20cab03e22bd3 SHA512 088ea0cbfab7cdd3fa53fa1fd1907487e785159b5d443e4258a0470123587554c57eb4fb4cbebbb6fe610c03b002c5c45c1758f85ca699d6df97872a6e826e35 diff --git a/media-libs/opencv/files/opencv-4.10.0-26234.patch b/media-libs/opencv/files/opencv-4.10.0-26234.patch new file mode 100644 index 000000000000..fb155302af28 --- /dev/null +++ b/media-libs/opencv/files/opencv-4.10.0-26234.patch @@ -0,0 +1,73 @@ +https://github.com/opencv/opencv/pull/26234 +From 6a4be763b2db5f26684204ddc7d06c02325c3917 Mon Sep 17 00:00:00 2001 +From: Zach Lowry <zachlowry@canvas-inc.com> +Date: Tue, 1 Oct 2024 14:16:54 -0500 +Subject: [PATCH 1/2] move the gcc6 compatibility check to occur on a + per-directory basis, rather than exclude all include paths when the list of + paths contains /usr/include + +--- + cmake/OpenCVUtils.cmake | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake +index 94f87d9a1200..bb20a22f0606 100644 +--- a/cmake/OpenCVUtils.cmake ++++ b/cmake/OpenCVUtils.cmake +@@ -353,23 +353,23 @@ function(ocv_target_include_directories target) + #ocv_debug_message("ocv_target_include_directories(${target} ${ARGN})") + _ocv_fix_target(target) + set(__params "") +- if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND +- ";${ARGN};" MATCHES "/usr/include;") +- return() # workaround for GCC 6.x bug +- endif() +- set(__params "") + set(__system_params "") + set(__var_name __params) + foreach(dir ${ARGN}) + if("${dir}" STREQUAL "SYSTEM") + set(__var_name __system_params) + else() +- get_filename_component(__abs_dir "${dir}" ABSOLUTE) +- ocv_is_opencv_directory(__is_opencv_dir "${dir}") +- if(__is_opencv_dir) +- list(APPEND ${__var_name} "${__abs_dir}") ++ if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND ++ "${dir}" MATCHES "/usr/include$") ++ # workaround for GCC 6.x bug + else() +- list(APPEND ${__var_name} "${dir}") ++ get_filename_component(__abs_dir "${dir}" ABSOLUTE) ++ ocv_is_opencv_directory(__is_opencv_dir "${dir}") ++ if(__is_opencv_dir) ++ list(APPEND ${__var_name} "${__abs_dir}") ++ else() ++ list(APPEND ${__var_name} "${dir}") ++ endif() + endif() + endif() + endforeach() + +From fc01b270ee657e7afc2657b7a9e15766aa36faf0 Mon Sep 17 00:00:00 2001 +From: Zach Lowry <zachlowry@canvas-inc.com> +Date: Wed, 2 Oct 2024 13:28:57 -0500 +Subject: [PATCH 2/2] use `dir MATCHES ...` without variable unpacking + +--- + cmake/OpenCVUtils.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake +index bb20a22f0606..5886f4f3cb33 100644 +--- a/cmake/OpenCVUtils.cmake ++++ b/cmake/OpenCVUtils.cmake +@@ -360,7 +360,7 @@ function(ocv_target_include_directories target) + set(__var_name __system_params) + else() + if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND +- "${dir}" MATCHES "/usr/include$") ++ dir MATCHES "/usr/include$") + # workaround for GCC 6.x bug + else() + get_filename_component(__abs_dir "${dir}" ABSOLUTE) diff --git a/media-libs/opencv/files/opencv-4.10.0-cuda-fp16.patch b/media-libs/opencv/files/opencv-4.10.0-cuda-fp16.patch new file mode 100644 index 000000000000..ed0f128b99c5 --- /dev/null +++ b/media-libs/opencv/files/opencv-4.10.0-cuda-fp16.patch @@ -0,0 +1,226 @@ +https://github.com/opencv/opencv/issues/25711 +https://github.com/opencv/opencv/pull/25880 + +From 5115dc62f8af616c6e75e4b3df3eb8f201298432 Mon Sep 17 00:00:00 2001 +From: Aliaksei Urbanski <aliaksei.urbanski@gmail.com> +Date: Tue, 9 Jul 2024 01:46:12 +0300 +Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20Fix=20CUDA=20for=20old=20GPU?= + =?UTF-8?q?s=20without=20FP16=20support?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- a/modules/dnn/src/cuda4dnn/init.hpp ++++ b/modules/dnn/src/cuda4dnn/init.hpp +@@ -15,7 +15,7 @@ + + namespace cv { namespace dnn { namespace cuda4dnn { + +- void checkVersions() ++ inline void checkVersions() + { + // https://docs.nvidia.com/deeplearning/cudnn/developer-guide/index.html#programming-model + // cuDNN API Compatibility +@@ -44,19 +44,19 @@ namespace cv { namespace dnn { namespace cuda4dnn { + } + } + +- int getDeviceCount() ++ inline int getDeviceCount() + { + return cuda::getCudaEnabledDeviceCount(); + } + +- int getDevice() ++ inline int getDevice() + { + int device_id = -1; + CUDA4DNN_CHECK_CUDA(cudaGetDevice(&device_id)); + return device_id; + } + +- bool isDeviceCompatible() ++ inline bool isDeviceCompatible() + { + int device_id = getDevice(); + if (device_id < 0) +@@ -76,7 +76,7 @@ namespace cv { namespace dnn { namespace cuda4dnn { + return false; + } + +- bool doesDeviceSupportFP16() ++ inline bool doesDeviceSupportFP16() + { + int device_id = getDevice(); + if (device_id < 0) +--- a/modules/dnn/src/registry.cpp ++++ b/modules/dnn/src/registry.cpp +@@ -18,6 +18,10 @@ + #include "backend.hpp" + #include "factory.hpp" + ++#ifdef HAVE_CUDA ++#include "cuda4dnn/init.hpp" ++#endif ++ + namespace cv { + namespace dnn { + CV__DNN_INLINE_NS_BEGIN +@@ -121,7 +125,8 @@ class BackendRegistry + if (haveCUDA()) + { + backends.push_back(std::make_pair(DNN_BACKEND_CUDA, DNN_TARGET_CUDA)); +- backends.push_back(std::make_pair(DNN_BACKEND_CUDA, DNN_TARGET_CUDA_FP16)); ++ if (cuda4dnn::doesDeviceSupportFP16()) ++ backends.push_back(std::make_pair(DNN_BACKEND_CUDA, DNN_TARGET_CUDA_FP16)); + } + #endif + + +From cfb2bc34acd7699707110523f067a7452a404206 Mon Sep 17 00:00:00 2001 +From: Alexander Smorkalov <alexander.smorkalov@xperience.ai> +Date: Tue, 9 Jul 2024 11:21:58 +0300 +Subject: [PATCH 2/3] Added CUDA FP16 availability check for target management. + +--- a/modules/dnn/src/cuda4dnn/init.hpp ++++ b/modules/dnn/src/cuda4dnn/init.hpp +@@ -56,9 +56,11 @@ namespace cv { namespace dnn { namespace cuda4dnn { + return device_id; + } + +- inline bool isDeviceCompatible() ++ inline bool isDeviceCompatible(int device_id = -1) + { +- int device_id = getDevice(); ++ if (device_id < 0) ++ device_id = getDevice(); ++ + if (device_id < 0) + return false; + +@@ -76,9 +78,11 @@ namespace cv { namespace dnn { namespace cuda4dnn { + return false; + } + +- inline bool doesDeviceSupportFP16() ++ inline bool doesDeviceSupportFP16(int device_id = -1) + { +- int device_id = getDevice(); ++ if (device_id < 0) ++ device_id = getDevice(); ++ + if (device_id < 0) + return false; + +@@ -87,9 +91,7 @@ namespace cv { namespace dnn { namespace cuda4dnn { + CUDA4DNN_CHECK_CUDA(cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, device_id)); + + int version = major * 10 + minor; +- if (version < 53) +- return false; +- return true; ++ return (version >= 53); + } + + }}} /* namespace cv::dnn::cuda4dnn */ +--- a/modules/dnn/src/net_impl_backend.cpp ++++ b/modules/dnn/src/net_impl_backend.cpp +@@ -10,6 +10,10 @@ + #include "backend.hpp" + #include "factory.hpp" + ++#ifdef HAVE_CUDA ++#include "cuda4dnn/init.hpp" ++#endif ++ + namespace cv { + namespace dnn { + CV__DNN_INLINE_NS_BEGIN +@@ -242,6 +246,16 @@ void Net::Impl::setPreferableTarget(int targetId) + #endif + } + ++ if (IS_DNN_CUDA_TARGET(targetId)) ++ { ++ preferableTarget = DNN_TARGET_CPU; ++#ifdef HAVE_CUDA ++ if (cuda4dnn::doesDeviceSupportFP16() && targetId == DNN_TARGET_CUDA_FP16) ++ preferableTarget = DNN_TARGET_CUDA_FP16; ++ else ++ preferableTarget = DNN_TARGET_CUDA; ++#endif ++ } + #if !defined(__arm64__) || !__arm64__ + if (targetId == DNN_TARGET_CPU_FP16) + { +--- a/modules/dnn/src/registry.cpp ++++ b/modules/dnn/src/registry.cpp +@@ -122,10 +122,24 @@ class BackendRegistry + #endif + + #ifdef HAVE_CUDA +- if (haveCUDA()) ++ cuda4dnn::checkVersions(); ++ ++ bool hasCudaCompatible = false; ++ bool hasCudaFP16 = false; ++ for (int i = 0; i < cuda4dnn::getDeviceCount(); i++) ++ { ++ if (cuda4dnn::isDeviceCompatible(i)) ++ { ++ hasCudaCompatible = true; ++ if (cuda4dnn::doesDeviceSupportFP16(i)) ++ hasCudaFP16 = true; ++ } ++ } ++ ++ if (hasCudaCompatible) + { + backends.push_back(std::make_pair(DNN_BACKEND_CUDA, DNN_TARGET_CUDA)); +- if (cuda4dnn::doesDeviceSupportFP16()) ++ if (hasCudaFP16) + backends.push_back(std::make_pair(DNN_BACKEND_CUDA, DNN_TARGET_CUDA_FP16)); + } + #endif +--- a/modules/dnn/test/test_common.hpp ++++ b/modules/dnn/test/test_common.hpp +@@ -211,7 +211,7 @@ class DNNTestLayer : public TestWithParam<tuple<Backend, Target> > + if ((!l->supportBackend(backend) || l->preferableTarget != target) && !fused) + { + hasFallbacks = true; +- std::cout << "FALLBACK: Layer [" << l->type << "]:[" << l->name << "] is expected to has backend implementation" << endl; ++ std::cout << "FALLBACK: Layer [" << l->type << "]:[" << l->name << "] is expected to have backend implementation" << endl; + } + } + if (hasFallbacks && raiseError) +--- a/modules/dnn/test/test_onnx_conformance.cpp ++++ b/modules/dnn/test/test_onnx_conformance.cpp +@@ -1008,7 +1008,7 @@ class Test_ONNX_conformance : public TestWithParam<ONNXConfParams> + if ((!l->supportBackend(backend) || l->preferableTarget != target) && !fused) + { + hasFallbacks = true; +- std::cout << "FALLBACK: Layer [" << l->type << "]:[" << l->name << "] is expected to has backend implementation" << endl; ++ std::cout << "FALLBACK: Layer [" << l->type << "]:[" << l->name << "] is expected to have backend implementation" << endl; + } + } + return hasFallbacks; + +From cc9178903daff229bc396db718bf347c4eafd33b Mon Sep 17 00:00:00 2001 +From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> +Date: Wed, 10 Jul 2024 09:06:09 +0300 +Subject: [PATCH 3/3] Update modules/dnn/src/registry.cpp + +Co-authored-by: Aliaksei Urbanski <aliaksei.urbanski@gmail.com> +--- a/modules/dnn/src/registry.cpp ++++ b/modules/dnn/src/registry.cpp +@@ -132,7 +132,10 @@ class BackendRegistry + { + hasCudaCompatible = true; + if (cuda4dnn::doesDeviceSupportFP16(i)) ++ { + hasCudaFP16 = true; ++ break; // we already have all we need here ++ } + } + } + diff --git a/media-libs/opencv/files/opencv-4.10.0-cudnn-9.patch b/media-libs/opencv/files/opencv-4.10.0-cudnn-9.patch new file mode 100644 index 000000000000..78ac162bef2d --- /dev/null +++ b/media-libs/opencv/files/opencv-4.10.0-cudnn-9.patch @@ -0,0 +1,32 @@ +https://github.com/opencv/opencv/issues/25711 +https://github.com/opencv/opencv/pull/25841 + +From 3d74d646d8c4c48e400e650fef9463f174414b96 Mon Sep 17 00:00:00 2001 +From: Alexander Smorkalov <alexander.smorkalov@xperience.ai> +Date: Mon, 1 Jul 2024 17:33:24 +0300 +Subject: [PATCH] Fixed CuDNN runtime version check for CuDNN 9+. + +--- a/modules/dnn/src/cuda4dnn/init.hpp ++++ b/modules/dnn/src/cuda4dnn/init.hpp +@@ -23,8 +23,19 @@ namespace cv { namespace dnn { namespace cuda4dnn { + // Any patch release x.y.z is forward or backward-compatible with applications built against another cuDNN patch release x.y.w (meaning, of the same major and minor version number, but having w!=z). + // cuDNN minor releases beginning with cuDNN 7 are binary backward-compatible with applications built against the same or earlier patch release (meaning, an application built against cuDNN 7.x is binary compatible with cuDNN library 7.y, where y>=x). + // Applications compiled with a cuDNN version 7.y are not guaranteed to work with 7.x release when y > x. +- auto cudnn_bversion = cudnnGetVersion(); +- auto cudnn_major_bversion = cudnn_bversion / 1000, cudnn_minor_bversion = cudnn_bversion % 1000 / 100; ++ int cudnn_bversion = cudnnGetVersion(); ++ int cudnn_major_bversion = 0, cudnn_minor_bversion = 0; ++ // CuDNN changed major version multiplier in 9.0 ++ if (cudnn_bversion >= 9*10000) ++ { ++ cudnn_major_bversion = cudnn_bversion / 10000; ++ cudnn_minor_bversion = cudnn_bversion % 10000 / 100; ++ } ++ else ++ { ++ cudnn_major_bversion = cudnn_bversion / 1000; ++ cudnn_minor_bversion = cudnn_bversion % 1000 / 100; ++ } + if (cudnn_major_bversion != CUDNN_MAJOR || cudnn_minor_bversion < CUDNN_MINOR) + { + std::ostringstream oss; diff --git a/media-libs/opencv/files/opencv-4.10.0-dnn-explicitly-include-abseil-cpp.patch b/media-libs/opencv/files/opencv-4.10.0-dnn-explicitly-include-abseil-cpp.patch new file mode 100644 index 000000000000..ca63bea5e46b --- /dev/null +++ b/media-libs/opencv/files/opencv-4.10.0-dnn-explicitly-include-abseil-cpp.patch @@ -0,0 +1,39 @@ +From 980dd32e52da10901094a7f8a5dbe5287a62a602 Mon Sep 17 00:00:00 2001 +From: Paul Zander <negril.nx+gentoo@gmail.com> +Date: Thu, 5 Sep 2024 15:53:36 +0200 +Subject: [PATCH] dnn: explicitly include abseil-cpp + +Linking against abseil-cpp depended on protobuf exporting all abseil-cpp +libraries via protobuf::libprotobuf public libraries. + +Explcitly finding abseil ourselves removes the need for that. + +Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> + +diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake +index 9228b04..7d9f315 100644 +--- a/cmake/OpenCVFindProtobuf.cmake ++++ b/cmake/OpenCVFindProtobuf.cmake +@@ -32,6 +32,7 @@ else() + # we still need this for command PROTOBUF_GENERATE_CPP. + set(protobuf_MODULE_COMPATIBLE ON) + ++ find_package(absl CONFIG REQUIRED) + unset(Protobuf_VERSION CACHE) + find_package(Protobuf QUIET CONFIG) + if(NOT Protobuf_FOUND) +diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt +index 562b144..052c4f8 100644 +--- a/modules/dnn/CMakeLists.txt ++++ b/modules/dnn/CMakeLists.txt +@@ -144,6 +144,7 @@ list(APPEND libs ${Protobuf_LIBRARIES}) + if(NOT BUILD_PROTOBUF) + list(APPEND include_dirs ${Protobuf_INCLUDE_DIRS}) + endif() ++list(APPEND libs absl::check) + + set(sources_options "") + +-- +2.46.0 + diff --git a/media-libs/opencv/files/opencv-4.10.0-tbb-detection.patch b/media-libs/opencv/files/opencv-4.10.0-tbb-detection.patch new file mode 100644 index 000000000000..e808aec04547 --- /dev/null +++ b/media-libs/opencv/files/opencv-4.10.0-tbb-detection.patch @@ -0,0 +1,28 @@ +From 460bf0927fcc09e8c7a21d5bb48044fc923a8ee7 Mon Sep 17 00:00:00 2001 +From: Paul Zander <negril.nx+gentoo@gmail.com> +Date: Tue, 8 Oct 2024 00:31:52 +0200 +Subject: [PATCH] Fix tbb detection + +Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> + +diff --git a/cmake/OpenCVDetectTBB.cmake b/cmake/OpenCVDetectTBB.cmake +index c9ecc02..3db3ae0 100644 +--- a/cmake/OpenCVDetectTBB.cmake ++++ b/cmake/OpenCVDetectTBB.cmake +@@ -25,7 +25,12 @@ function(ocv_tbb_cmake_guess _found) + message(WARNING "No TBB::tbb target found!") + return() + endif() +- get_target_property(_lib TBB::tbb IMPORTED_LOCATION_RELEASE) ++ ++ # Get installed configuration of tbb ++ get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS) ++ list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF) ++ ++ get_target_property(_lib TBB::tbb IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF}) + message(STATUS "Found TBB (cmake): ${_lib}") + get_target_property(_inc TBB::tbb INTERFACE_INCLUDE_DIRECTORIES) + add_library(tbb INTERFACE IMPORTED) +-- +2.46.2 + diff --git a/media-libs/opencv/files/opencv_contrib-4.10.0-CUDA-12.6-tuple_size.patch b/media-libs/opencv/files/opencv_contrib-4.10.0-CUDA-12.6-tuple_size.patch new file mode 100644 index 000000000000..252ecdee6cb6 --- /dev/null +++ b/media-libs/opencv/files/opencv_contrib-4.10.0-CUDA-12.6-tuple_size.patch @@ -0,0 +1,53 @@ +https://github.com/opencv/opencv_contrib/pull/3785 +From 09eb618804588f77026924096d848800630c8d6f Mon Sep 17 00:00:00 2001 +From: Alexander Smorkalov <alexander.smorkalov@xperience.ai> +Date: Tue, 3 Sep 2024 13:47:48 +0300 +Subject: [PATCH] Workaround for CUDA 12.6 tuple_size issue #3773. + +--- + modules/cudaarithm/src/cuda/polar_cart.cu | 20 +++++--------------- + 1 file changed, 5 insertions(+), 15 deletions(-) + +diff --git a/modules/cudaarithm/src/cuda/polar_cart.cu b/modules/cudaarithm/src/cuda/polar_cart.cu +index 725f5741d8..c65b894bf6 100644 +--- a/modules/cudaarithm/src/cuda/polar_cart.cu ++++ b/modules/cudaarithm/src/cuda/polar_cart.cu +@@ -159,25 +159,15 @@ void cv::cuda::cartToPolar(InputArray _xy, OutputArray _mag, OutputArray _angle, + GpuMat_<float> magc(mag); + GpuMat_<float> anglec(angle); + ++ gridTransformUnary(globPtr<float2>(xy), globPtr<float>(magc), magnitude_interleaved_func<float2>(), stream); ++ + if (angleInDegrees) + { +- auto f1 = magnitude_interleaved_func<float2>(); +- auto f2 = direction_interleaved_func<float2, true>(); +- cv::cudev::tuple<decltype(f1), decltype(f2)> f12 = cv::cudev::make_tuple(f1, f2); +- gridTransformTuple(globPtr<float2>(xy), +- tie(magc, anglec), +- f12, +- stream); ++ gridTransformUnary(globPtr<float2>(xy), globPtr<float>(anglec), direction_interleaved_func<float2, true>(), stream); + } + else + { +- auto f1 = magnitude_interleaved_func<float2>(); +- auto f2 = direction_interleaved_func<float2, false>(); +- cv::cudev::tuple<decltype(f1), decltype(f2)> f12 = cv::cudev::make_tuple(f1, f2); +- gridTransformTuple(globPtr<float2>(xy), +- tie(magc, anglec), +- f12, +- stream); ++ gridTransformUnary(globPtr<float2>(xy), globPtr<float>(anglec), direction_interleaved_func<float2, false>(), stream); + } + + syncOutput(mag, _mag, stream); +@@ -191,7 +181,7 @@ void cv::cuda::cartToPolar(InputArray _xy, OutputArray _magAngle, bool angleInDe + CV_Assert( xy.type() == CV_32FC2 ); + + GpuMat magAngle = getOutputMat(_magAngle, xy.size(), CV_32FC2, stream); +- ++ + if (angleInDegrees) + { + gridTransformUnary(globPtr<float2>(xy), diff --git a/media-libs/opencv/metadata.xml b/media-libs/opencv/metadata.xml index 5979caa25015..b23fac5f689f 100644 --- a/media-libs/opencv/metadata.xml +++ b/media-libs/opencv/metadata.xml @@ -42,10 +42,13 @@ <flag name="tbb">Enable multithreading with the Intel Threads Building Block (<pkg>dev-cpp/tbb</pkg>)</flag> <flag name="tesseract">Use Google's OCR Engine</flag> <flag name="testprograms">Build and install programs for testing OpenCV (performance)</flag> + <flag name="truetype">Enable <pkg>media-libs/freetype</pkg> support for gapi module</flag> <flag name="video_cards_intel">Enable Video Acceleration API for hardware decoding for Intel cards</flag> <flag name="vtk">Build new 3D visualization module viz based on <pkg>sci-libs/vtk</pkg></flag> </use> <upstream> + <changelog>https://github.com/opencv/opencv/wiki/ChangeLog</changelog> + <doc>https://docs.opencv.org</doc> <remote-id type="cpe">cpe:/a:opencv:opencv</remote-id> <remote-id type="github">opencv/opencv</remote-id> <remote-id type="github">opencv/opencv_contrib</remote-id> diff --git a/media-libs/opencv/opencv-4.10.0.ebuild b/media-libs/opencv/opencv-4.10.0.ebuild new file mode 100644 index 000000000000..ea1242c5e0b7 --- /dev/null +++ b/media-libs/opencv/opencv-4.10.0.ebuild @@ -0,0 +1,1316 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) +inherit cuda java-pkg-opt-2 cmake-multilib flag-o-matic multilib multiprocessing python-r1 toolchain-funcs virtualx + +DESCRIPTION="A collection of algorithms and sample code for various computer vision problems" +HOMEPAGE="https://opencv.org" + +# TODO +# - dnn: move module from opencv_contrib +# https://github.com/opencv/opencv/commit/93729784bb1c4e544e07ec27a43ef57c4f456cec + +if [[ ${PV} = *9999* ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/${PN}/${PN}.git" +else + # branch master + ADE_PV="0.1.2d" + # branch wechat_qrcode_20210119 + QRCODE_COMMIT="a8b69ccc738421293254aec5ddb38bd523503252" + # branch dnn_samples_face_detector_20170830 + DNN_SAMPLES_FACE_DETECTOR_COMMIT="b2bfc75f6aea5b1f834ff0f0b865a7c18ff1459f" + # branch contrib_xfeatures2d_boostdesc_20161012 + XFEATURES2D_BOOSTDESC_COMMIT="34e4206aef44d50e6bbcd0ab06354b52e7466d26" + # branch contrib_xfeatures2d_vgg_20160317 + XFEATURES2D_VGG_COMMIT="fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" + # branch contrib_face_alignment_20170818 + FACE_ALIGNMENT_COMMIT="8afa57abc8229d611c4937165d20e2a2d9fc5a12" + # branch nvof_2_0_bsd + NVIDIA_OPTICAL_FLOW_COMMIT="edb50da3cf849840d680249aa6dbef248ebce2ca" + + SRC_URI=" + https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz + https://github.com/opencv/ade/archive/v${ADE_PV}.tar.gz -> ade-${ADE_PV}.tar.gz + contrib? ( + https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${PN}_contrib-${PV}.tar.gz + dnnsamples? ( + https://github.com/${PN}/${PN}_3rdparty/archive/${QRCODE_COMMIT}.tar.gz -> ${PN}_3rdparty-${QRCODE_COMMIT}.tar.gz + https://github.com/${PN}/${PN}_3rdparty/archive/${DNN_SAMPLES_FACE_DETECTOR_COMMIT}.tar.gz + -> ${PN}_3rdparty-${DNN_SAMPLES_FACE_DETECTOR_COMMIT}.tar.gz + ) + contribxfeatures2d? ( + https://github.com/${PN}/${PN}_3rdparty/archive/${XFEATURES2D_BOOSTDESC_COMMIT}.tar.gz + -> ${PN}_3rdparty-${XFEATURES2D_BOOSTDESC_COMMIT}.tar.gz + https://github.com/${PN}/${PN}_3rdparty/archive/${XFEATURES2D_VGG_COMMIT}.tar.gz + -> ${PN}_3rdparty-${XFEATURES2D_VGG_COMMIT}.tar.gz + ) + contribdnn? ( + https://github.com/${PN}/${PN}_3rdparty/archive/${FACE_ALIGNMENT_COMMIT}.tar.gz + -> ${PN}_3rdparty-${FACE_ALIGNMENT_COMMIT}.tar.gz + ) + cuda? ( + https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/${NVIDIA_OPTICAL_FLOW_COMMIT}.tar.gz + -> NVIDIAOpticalFlowSDK-${NVIDIA_OPTICAL_FLOW_COMMIT}.tar.gz + ) + https://github.com/${PN}/${PN}_contrib/commit/667a66ee0e99f3f3263c1ef2de1b90d9244b7bd4.patch + -> ${PN}_contrib-4.10.0-3607.patch + ) + test? ( + https://github.com/${PN}/${PN}_extra/archive/refs/tags/${PV}.tar.gz -> ${PN}_extra-${PV}.tar.gz + ) + " + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" +fi + +LICENSE="Apache-2.0" +SLOT="0/${PV}" # subslot = libopencv* soname version + +# general options +IUSE="debug doc +eigen gflags glog java non-free opencvapps python test testprograms" + +# modules +IUSE+=" contrib contribcvv contribdnn contribfreetype contribhdf contribovis contribsfm contribxfeatures2d dnnsamples examples +features2d" +# hardware +IUSE+=" cuda cudnn opencl video_cards_intel" +# video +IUSE+=" +ffmpeg gstreamer xine vaapi v4l gphoto2 ieee1394" +# image +IUSE+=" avif gdal jasper jpeg jpeg2k openexr png quirc tesseract tiff webp" +# gui +IUSE+=" gtk3 qt6 opengl truetype vtk" +# parallel +IUSE+=" openmp tbb" +# lapack options +IUSE+=" atlas lapack mkl" + +# from cmake/OpenCVCompilerOptimizations.cmake +# TODO make this only relevant for binhost +CPU_FEATURES_MAP=( + cpu_flags_arm_neon:NEON + cpu_flags_arm_vfpv3:VFPV3 + + # cpu_flags_arm_fp:FP16 + + cpu_flags_arm_asimddp:NEON_DOTPROD + # cpu_flags_arm_neon_fp16:NEON_FP16 + # cpu_flags_arm_neon_bf16:NEON_BF16 + + # cpu_flags_loong_lsx:LSX + # cpu_flags_loong_lasx:LASX + + # cpu_flags_mips_msa:MSA + + cpu_flags_ppc_vsx:VSX # (always available on Power8) + cpu_flags_ppc_vsx3:VSX3 # (always available on Power9) + + # cpu_flags_riscv_rvv:RVV + + cpu_flags_x86_sse:SSE # (always available on 64-bit CPUs) + cpu_flags_x86_sse2:SSE2 # (always available on 64-bit CPUs) + + cpu_flags_x86_sse3:SSE3 + cpu_flags_x86_ssse3:SSSE3 + + cpu_flags_x86_sse4_1:SSE4_1 + cpu_flags_x86_popcnt:POPCNT + cpu_flags_x86_sse4_2:SSE4_2 + + cpu_flags_x86_f16c:FP16 + cpu_flags_x86_fma3:FMA3 + cpu_flags_x86_avx:AVX + cpu_flags_x86_avx2:AVX2 + cpu_flags_x86_avx512_bitalg:AVX_512BITALG + cpu_flags_x86_avx512_vbmi2:AVX_512VBMI2 + cpu_flags_x86_avx512_vnni:AVX_512VNNI + cpu_flags_x86_avx512_vpopcntdq:AVX_512VPOPCNTDQ + cpu_flags_x86_avx512bw:AVX_512BW + cpu_flags_x86_avx512cd:AVX_512CD + cpu_flags_x86_avx512dq:AVX_512DQ + cpu_flags_x86_avx512f:AVX_512F + cpu_flags_x86_avx512ifma:AVX_512IFMA + cpu_flags_x86_avx512vbmi:AVX_512VBMI + cpu_flags_x86_avx512vl:AVX_512VL + + # AVX512_KNL_EXTRA + cpu_flags_x86_avx512er:AVX_512ER + cpu_flags_x86_avx512pf:AVX_512PF + # AVX512_KNM_EXTRA + cpu_flags_x86_avx512_4fmaps:AVX_5124FMAPS + cpu_flags_x86_avx512_4vnniw:AVX_5124VNNIW + +) +IUSE+=" ${CPU_FEATURES_MAP[*]%:*}" + +REQUIRED_USE=" + amd64? ( + cpu_flags_x86_sse + cpu_flags_x86_sse2 + cpu_flags_x86_avx2? ( cpu_flags_x86_f16c ) + cpu_flags_x86_f16c? ( cpu_flags_x86_avx ) + cpu_flags_x86_avx512er? ( cpu_flags_x86_avx512pf ) + cpu_flags_x86_avx512pf? ( cpu_flags_x86_avx512er ) + cpu_flags_x86_avx512_4fmaps? ( cpu_flags_x86_avx512_4fmaps ) + cpu_flags_x86_avx512_4vnniw? ( cpu_flags_x86_avx512_4vnniw ) + ) + cuda? ( + contrib + ) + cudnn? ( cuda ) + dnnsamples? ( examples ) + gflags? ( contrib ) + glog? ( contrib ) + contribcvv? ( contrib qt6 ) + contribdnn? ( contrib ) + contribfreetype? ( contrib ) + contribhdf? ( contrib ) + contribovis? ( contrib ) + contribsfm? ( contrib eigen gflags glog ) + contribxfeatures2d? ( contrib ) + java? ( python ) + opengl? ( qt6 ) + jasper? ( !abi_x86_32 ) + python? ( ${PYTHON_REQUIRED_USE} ) + tesseract? ( contrib ) + ?? ( gtk3 qt6 ) + testprograms? ( test ) + test? ( || ( ffmpeg gstreamer ) jpeg png tiff features2d ) +" + +RESTRICT="!test? ( test )" + +COMMON_DEPEND=" + app-arch/bzip2[${MULTILIB_USEDEP}] + dev-libs/protobuf:=[${MULTILIB_USEDEP}] + sys-libs/zlib[${MULTILIB_USEDEP}] + avif? ( media-libs/libavif:=[${MULTILIB_USEDEP}] ) + cuda? ( dev-util/nvidia-cuda-toolkit:= ) + cudnn? ( + dev-cpp/abseil-cpp:= + dev-libs/cudnn:= + ) + contribdnn? ( dev-libs/flatbuffers:= ) + contribhdf? ( sci-libs/hdf5:= ) + contribfreetype? ( + media-libs/freetype:2[${MULTILIB_USEDEP}] + media-libs/harfbuzz:=[${MULTILIB_USEDEP}] + ) + contribovis? ( >=dev-games/ogre-1.12:= ) + ffmpeg? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] ) + truetype? ( media-libs/freetype:2[${MULTILIB_USEDEP}] ) + gdal? ( sci-libs/gdal:= ) + gflags? ( dev-cpp/gflags:=[${MULTILIB_USEDEP}] ) + glog? ( dev-cpp/glog:=[${MULTILIB_USEDEP}] ) + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] ) + gstreamer? ( + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}] + media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}] + ) + gtk3? ( + dev-libs/glib:2[${MULTILIB_USEDEP}] + x11-libs/gtk+:3[${MULTILIB_USEDEP}] + ) + ieee1394? ( + media-libs/libdc1394:=[${MULTILIB_USEDEP}] + sys-libs/libraw1394[${MULTILIB_USEDEP}] + ) + jpeg? ( media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}] ) + jpeg2k? ( + jasper? ( media-libs/jasper:= ) + !jasper? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] ) + ) + lapack? ( + atlas? ( sci-libs/atlas ) + mkl? ( sci-libs/mkl ) + !atlas? ( + !mkl? ( + virtual/cblas + >=virtual/lapack-3.10 + virtual/lapacke + ) + ) + ) + opencl? ( + virtual/opencl[${MULTILIB_USEDEP}] + dev-util/opencl-headers + ) + openexr? ( + dev-libs/imath:= + media-libs/openexr:= + ) + opengl? ( + virtual/opengl[${MULTILIB_USEDEP}] + virtual/glu[${MULTILIB_USEDEP}] + ) + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] ) + python? ( + ${PYTHON_DEPS} + dev-python/numpy:=[${PYTHON_USEDEP}] + ) + qt6? ( + dev-qt/qtbase:6[gui,widgets,concurrent,opengl?] + ) + quirc? ( media-libs/quirc ) + tesseract? ( app-text/tesseract[${MULTILIB_USEDEP}] ) + tbb? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] ) + tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] ) + v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] ) + vaapi? ( media-libs/libva[${MULTILIB_USEDEP}] ) + vtk? ( + sci-libs/vtk:=[rendering,cuda=] + || ( + ( + sci-libs/vtk[opencascade(+)] + sci-libs/opencascade[-ffmpeg] + ) + sci-libs/vtk[-opencascade(-)] + ) + ) + webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] ) + xine? ( media-libs/xine-lib ) +" +GST_TEST_DEPEND=" + media-plugins/gst-plugins-aom[${MULTILIB_USEDEP}] + media-plugins/gst-plugins-mpeg2enc[${MULTILIB_USEDEP}] + media-plugins/gst-plugins-openh264[${MULTILIB_USEDEP}] +" +DEPEND=" + ${COMMON_DEPEND} + eigen? ( >=dev-cpp/eigen-3.3.8-r1:3 ) + java? ( >=virtual/jdk-1.8:* ) + test? ( + gstreamer? ( + amd64? ( ${GST_TEST_DEPEND} ) + arm64? ( ${GST_TEST_DEPEND} ) + x86? ( ${GST_TEST_DEPEND} ) + arm? ( media-plugins/gst-plugins-openh264[${MULTILIB_USEDEP}] ) + media-plugins/gst-plugins-jpeg[${MULTILIB_USEDEP}] + media-plugins/gst-plugins-libav[${MULTILIB_USEDEP}] + media-plugins/gst-plugins-mpeg2dec[${MULTILIB_USEDEP}] + media-plugins/gst-plugins-mpg123[${MULTILIB_USEDEP}] + media-plugins/gst-plugins-x264[${MULTILIB_USEDEP}] + !ppc? ( !ppc64? ( + media-plugins/gst-plugins-vpx[${MULTILIB_USEDEP}] + ) ) + ) + ) +" +RDEPEND=" + ${COMMON_DEPEND} + java? ( >=virtual/jre-1.8:* ) +" +unset COMMON_DEPEND + +BDEPEND=" + virtual/pkgconfig + cuda? ( dev-util/nvidia-cuda-toolkit:= ) + doc? ( + app-text/doxygen[dot] + python? ( + dev-python/beautifulsoup4[${PYTHON_USEDEP}] + ) + ) + java? ( >=dev-java/ant-1.10.14-r3 ) +" + +PATCHES=( + "${FILESDIR}/${PN}-3.4.1-cuda-add-relaxed-constexpr.patch" + "${FILESDIR}/${PN}-4.1.2-opencl-license.patch" + "${FILESDIR}/${PN}-4.4.0-disable-native-cpuflag-detect.patch" + "${FILESDIR}/${PN}-4.5.0-link-with-cblas-for-lapack.patch" + + "${FILESDIR}/${PN}-4.8.1-use-system-flatbuffers.patch" + "${FILESDIR}/${PN}-4.8.1-use-system-opencl.patch" + + "${FILESDIR}/${PN}-4.9.0-drop-python2-detection.patch" + "${FILESDIR}/${PN}-4.9.0-ade-0.1.2d.tar.gz.patch" + "${FILESDIR}/${PN}-4.9.0-cmake-cleanup.patch" + + "${FILESDIR}/${PN}-4.10.0-dnn-explicitly-include-abseil-cpp.patch" + "${FILESDIR}/${PN}-4.10.0-cudnn-9.patch" # 25841 + "${FILESDIR}/${PN}-4.10.0-cuda-fp16.patch" # 25880 + "${FILESDIR}/${PN}-4.10.0-26234.patch" # 26234 + "${FILESDIR}/${PN}-4.10.0-tbb-detection.patch" + + # TODO applied in src_prepare + # "${FILESDIR}/${PN}_contrib-4.8.1-rgbd.patch" + + # "${FILESDIR}/${PN}_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch" + + # "${FILESDIR}/${PN}_contrib-4.10.0-CUDA-12.6-tuple_size.patch" # 3785 +) + +cuda_get_host_compiler() { + if [[ -n "${NVCC_CCBIN}" ]]; then + echo "${NVCC_CCBIN}" + return + fi + + if [[ -n "${CUDAHOSTCXX}" ]]; then + echo "${CUDAHOSTCXX}" + return + fi + + einfo "Trying to find working CUDA host compiler" + + if ! tc-is-gcc && ! tc-is-clang; then + die "$(tc-get-compiler-type) compiler is not supported" + fi + + local compiler compiler_type compiler_version + local package package_version + local -x NVCC_CCBIN + local NVCC_CCBIN_default + + compiler_type="$(tc-get-compiler-type)" + compiler_version="$("${compiler_type}-major-version")" + + # try the default compiler first + NVCC_CCBIN="$(tc-getCXX)" + NVCC_CCBIN_default="${NVCC_CCBIN}-${compiler_version}" + + compiler="${NVCC_CCBIN/%-${compiler_version}}" + + # store the package so we can re-use it later + package="sys-devel/${compiler_type}" + package_version="${package}" + + ebegin "testing ${NVCC_CCBIN_default} (default)" + + while ! nvcc - -x cu <<<"int main(){}" &>/dev/null; do + eend 1 + + while true; do + # prepare next version + if ! package_version="<$(best_version "${package_version}")"; then + die "could not find a supported version of ${compiler}" + fi + + NVCC_CCBIN="${compiler}-$(ver_cut 1 "${package_version/#<${package}-/}")" + + [[ "${NVCC_CCBIN}" != "${NVCC_CCBIN_default}" ]] && break + done + ebegin "testing ${NVCC_CCBIN}" + done + eend $? + + echo "${NVCC_CCBIN}" + export NVCC_CCBIN +} + +cuda_get_host_native_arch() { + [[ -n ${CUDAARCHS} ]] && echo "${CUDAARCHS}" + + __nvcc_device_query || die "failed to query the native device" +} + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp + + if use cuda && [[ -z "${CUDA_GENERATION}" ]] && [[ -z "${CUDA_ARCH_BIN}" ]]; then # TODO CUDAARCHS + einfo "The target CUDA architecture can be set via one of:" + einfo " - CUDA_GENERATION set to one of Maxwell, Pascal, Volta, Turing, Ampere, Lovelace, Hopper, Auto" + einfo " - CUDA_ARCH_BIN, (and optionally CUDA_ARCH_PTX) in the form of x.y tuples." + einfo " You can specify multiple tuple separated by \";\"." + einfo "" + einfo "The CUDA architecture tuple for your device can be found at https://developer.nvidia.com/cuda-gpus." + fi + + # When building binpkgs you probably want to include all targets + if use cuda && [[ ${MERGE_TYPE} == "buildonly" ]] && [[ -n "${CUDA_GENERATION}" || -n "${CUDA_ARCH_BIN}" ]]; then + local info_message="When building a binary package it's recommended to unset CUDA_GENERATION and CUDA_ARCH_BIN" + einfo "$info_message so all available architectures are build." + fi +} + +pkg_setup() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp + + use java && java-pkg-opt-2_pkg_setup + + if use cuda && [[ ! -e /dev/nvidia-uvm ]]; then + # NOTE We try to load nvidia-uvm and nvidia-modeset here, + # so __nvcc_device_query does not fail later. + + nvidia-modprobe -m -u -c 0 || true + fi +} + +src_prepare() { + cmake_src_prepare + + # remove bundled stuff + rm -r 3rdparty || die "Removing 3rd party components failed" + sed -e '/add_subdirectory(.*3rdparty.*)/ d' \ + -i CMakeLists.txt cmake/*cmake || die + + sed \ + -e 's:truetype/wqy:wqy-microhei:g' \ + -i \ + modules/gapi/test/render/gapi_render_tests_ocv.cpp \ + modules/gapi/test/render/ftp_render_test.cpp \ + || die + + if use contrib; then + cd "${WORKDIR}/${PN}_contrib-${PV}" || die + eapply "${FILESDIR}/${PN}_contrib-4.8.1-rgbd.patch" + eapply "${FILESDIR}/${PN}_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch" + if ver_test "$(nvcc --version | tail -n 1 | cut -d '_' -f 2- | cut -d '.' -f 1-2)" -ge 12.4; then + eapply "${DISTDIR}/${PN}_contrib-4.10.0-3607.patch" + eapply "${FILESDIR}/${PN}_contrib-4.10.0-CUDA-12.6-tuple_size.patch" # 3785 + fi + + cd "${S}" || die + + ! use contribcvv && { rm -R "${WORKDIR}/${PN}_contrib-${PV}/modules/cvv" || die; } + ! use contribdnn && { rm -R "${S}/modules/dnn" || die; } + ! use contribfreetype && { rm -R "${WORKDIR}/${PN}_contrib-${PV}/modules/freetype" || die; } + ! use contribhdf && { rm -R "${WORKDIR}/${PN}_contrib-${PV}/modules/hdf" || die; } + ! use contribovis && { rm -R "${WORKDIR}/${PN}_contrib-${PV}/modules/ovis" || die; } + ! use contribsfm && { rm -R "${WORKDIR}/${PN}_contrib-${PV}/modules/sfm" || die; } + ! use contribxfeatures2d && { rm -R "${WORKDIR}/${PN}_contrib-${PV}/modules/xfeatures2d" || die; } + fi + + mkdir -p "${S}/.cache/ade" || die + cp \ + "${DISTDIR}/ade-${ADE_PV}.tar.gz" \ + "${S}/.cache/ade/$(md5sum "${DISTDIR}/ade-${ADE_PV}.tar.gz" | cut -f 1 -d " ")-v${ADE_PV}.tar.gz" || die + + if use dnnsamples; then + mkdir -p "${S}/.cache/wechat_qrcode" || die + for file in "detect.caffemodel" "detect.prototxt" "sr.prototxt" "sr.caffemodel"; do + mv \ + "${WORKDIR}/${PN}_3rdparty-${QRCODE_COMMIT}/${file}" \ + "${S}/.cache/wechat_qrcode/$( \ + md5sum "${WORKDIR}/${PN}_3rdparty-${QRCODE_COMMIT}/${file}" | cut -f 1 -d " " \ + )-${file}" || die + done + + mv \ + "${WORKDIR}/${PN}_3rdparty-${DNN_SAMPLES_FACE_DETECTOR_COMMIT}/res10_300x300_ssd_iter_140000.caffemodel" \ + "${S}/samples/dnn/" || die + fi + + if use contribxfeatures2d; then + cp \ + "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_BOOSTDESC_COMMIT}/"*.i \ + "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die + mkdir -p "${S}/.cache/xfeatures2d/boostdesc" || die + for file in "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_BOOSTDESC_COMMIT}/"*.i; do + mv \ + "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_BOOSTDESC_COMMIT}/$(basename "${file}")" \ + "${S}/.cache/xfeatures2d/boostdesc/$( \ + md5sum "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_BOOSTDESC_COMMIT}/$(basename "${file}")" | cut -f 1 -d " " \ + )-$(basename "${file}")" || die + done + + cp \ + "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_VGG_COMMIT}/"*.i \ + "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die + mkdir -p "${S}/.cache/xfeatures2d/vgg" || die + for file in "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_VGG_COMMIT}/"*.i; do + mv \ + "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_VGG_COMMIT}/$(basename "${file}")" \ + "${S}/.cache/xfeatures2d/vgg/$( \ + md5sum "${WORKDIR}/${PN}_3rdparty-${XFEATURES2D_VGG_COMMIT}/$(basename "${file}")" | cut -f 1 -d " " \ + )-$(basename "${file}")" || die + done + fi + + if use contribdnn; then + mkdir -p "${S}/.cache/data" || die + mkdir -p "${WORKDIR}/${PN}_extra-${PV}/testdata/cv/face/" || die + file="face_landmark_model.dat" + cp \ + "${WORKDIR}/${PN}_3rdparty-${FACE_ALIGNMENT_COMMIT}/${file}" \ + "${WORKDIR}/${PN}_extra-${PV}/testdata/cv/face/" \ + || die + mv \ + "${WORKDIR}/${PN}_3rdparty-${FACE_ALIGNMENT_COMMIT}/${file}" \ + "${S}/.cache/data/$( \ + md5sum "${WORKDIR}/${PN}_3rdparty-${FACE_ALIGNMENT_COMMIT}/${file}" | cut -f 1 -d " " \ + )-${file}" || die + fi + + if use cuda; then + mkdir -p "${S}/.cache/nvidia_optical_flow" + cp \ + "${DISTDIR}/NVIDIAOpticalFlowSDK-${NVIDIA_OPTICAL_FLOW_COMMIT}.tar.gz" \ + "${S}/.cache/nvidia_optical_flow/$( \ + md5sum "${DISTDIR}/NVIDIAOpticalFlowSDK-${NVIDIA_OPTICAL_FLOW_COMMIT}.tar.gz" | cut -f 1 -d " " \ + )-${NVIDIA_OPTICAL_FLOW_COMMIT}.tar.gz" || die + fi + + if use java; then + java-pkg-opt-2_src_prepare + + # set encoding so even this cmake build will pick it up. + ANT_OPTS+=" -Dfile.encoding=iso-8859-1" + ANT_OPTS+=" -Dant.build.javac.source=$(java-pkg_get-source)" + ANT_OPTS+=" -Dant.build.javac.target=$(java-pkg_get-target)" + fi + + if multilib_native_use testprograms; then + sed \ + -e 's:share/OpenCV/testdata:@OPENCV_TEST_DATA_INSTALL_PATH@:g' \ + -i "${S}/cmake/templates/opencv_run_all_tests_unix.sh.in" || die + fi +} + +multilib_src_configure() { + # bug #919101 and https://github.com/opencv/opencv/issues/19020 + filter-lto + + if tc-is-gcc && [[ $(gcc-major-version) -ge 15 ]] && use contribdnn; then + append-cxxflags "-fno-tree-vectorize" + fi + + # please don't sort here, order is the same as in CMakeLists.txt + local mycmakeargs=( + -DMIN_VER_CMAKE=3.26 + + -DCMAKE_POLICY_DEFAULT_CMP0148="OLD" # FindPythonInterp + + # for protobuf + -DCMAKE_CXX_STANDARD=17 + + # Optional 3rd party components + # =================================================== + -DOPENCV_ENABLE_NONFREE="$(usex non-free)" + -DWITH_QUIRC="$(usex quirc)" + -DWITH_FLATBUFFERS="$(multilib_native_usex contribdnn)" + -DWITH_1394="$(usex ieee1394)" + # -DWITH_AVFOUNDATION="no" # IOS + -DWITH_VTK="$(multilib_native_usex vtk)" + -DWITH_EIGEN="$(usex eigen)" + -DWITH_VFW="no" # Video windows support + -DWITH_FFMPEG="$(usex ffmpeg)" + -DWITH_GSTREAMER="$(usex gstreamer)" + -DWITH_GTK="$(usex gtk3)" + -DWITH_GTK_2_X="no" # only want gtk3 nowadays + -DWITH_IPP="no" + -DWITH_JASPER="$(usex jpeg2k "$(multilib_native_usex jasper)")" + -DWITH_JPEG="$(usex jpeg)" + -DWITH_OPENJPEG="$(usex jpeg2k "$(multilib_native_usex !jasper)")" + -DWITH_WEBP="$(usex webp)" + -DWITH_OPENEXR="$(multilib_native_usex openexr)" + -DWITH_OPENGL="$(usex opengl)" + -DOpenGL_GL_PREFERENCE="GLVND" + -DWITH_OPENVX="no" + -DWITH_OPENNI="no" # Not packaged + -DWITH_OPENNI2="no" # Not packaged + -DWITH_PNG="$(usex png)" + -DWITH_GDCM="no" + -DWITH_PVAPI="no" + -DWITH_GIGEAPI="no" + -DWITH_ARAVIS="no" + -DWITH_WIN32UI="no" # Windows only + # -DWITH_QUICKTIME="no" + # -DWITH_QTKIT="no" + -DWITH_TBB="$(usex tbb)" + -DWITH_OPENMP="$(usex openmp)" + -DWITH_PTHREADS_PF="yes" + -DWITH_TIFF="$(usex tiff)" + -DWITH_UNICAP="no" # Not packaged + -DWITH_V4L="$(usex v4l)" + -DWITH_LIBV4L="$(usex v4l)" + # -DWITH_DSHOW="yes" # direct show supp + -DWITH_MSMF="no" + -DWITH_XIMEA="no" # Windows only + -DWITH_XINE="$(multilib_native_usex xine)" + -DWITH_CLP="no" + -DWITH_OPENCL="$(usex opencl)" + -DWITH_OPENCL_SVM="no" # "$(usex opencl)" + -DWITH_DIRECTX="no" + -DWITH_INTELPERC="no" + -DWITH_IPP_A="no" + -DWITH_MATLAB="no" + -DWITH_VA="$(usex vaapi)" + -DWITH_VA_INTEL="$(usex vaapi "$(usex video_cards_intel)")" + -DWITH_GDAL="$(multilib_native_usex gdal)" + -DWITH_GPHOTO2="$(usex gphoto2)" + -DWITH_LAPACK="$(multilib_native_usex lapack)" + -DWITH_ITT="no" # 3dparty libs itt_notify + + -DWITH_AVIF="$(usex avif)" + -DWITH_FREETYPE="$(usex truetype)" + # =================================================== + # CUDA build components: nvidia-cuda-toolkit + # =================================================== + -DWITH_CUDA="$(multilib_native_usex cuda)" + -DWITH_CUBLAS="$(multilib_native_usex cuda)" + -DWITH_CUFFT="$(multilib_native_usex cuda)" + -DWITH_CUDNN="$(multilib_native_usex cudnn)" + # NOTE set this via MYCMAKEARGS if needed + -DWITH_NVCUVID="no" # TODO needs NVIDIA Video Codec SDK + -DWITH_NVCUVENC="no" # TODO needs NVIDIA Video Codec SDK + -DCUDA_NPP_LIBRARY_ROOT_DIR="$(usex cuda "${CUDA_PATH:=${EPREFIX}/opt/cuda}" "")" + # =================================================== + # OpenCV build components + # =================================================== + -DBUILD_SHARED_LIBS="yes" + -DBUILD_JAVA="$(multilib_native_usex java)" # Ant needed, no compile flag + -DBUILD_ANDROID_EXAMPLES="no" + -DBUILD_opencv_apps="$(usex opencvapps)" + -DBUILD_DOCS="$(usex doc)" # Doesn't install anyways. + -DBUILD_EXAMPLES="$(multilib_native_usex examples)" + -DBUILD_TESTS="$(multilib_native_usex test "yes" "$(multilib_native_usex testprograms)")" + -DBUILD_PERF_TESTS="no" + + # -DBUILD_WITH_STATIC_CRT="no" + -DBUILD_WITH_DYNAMIC_IPP="no" + -DBUILD_FAT_JAVA_LIB="no" + # -DBUILD_ANDROID_SERVICE="no" + -DBUILD_CUDA_STUBS="$(multilib_native_usex cuda)" + -DOPENCV_EXTRA_MODULES_PATH="$(usex contrib "${WORKDIR}/${PN}_contrib-${PV}/modules" "")" + # =================================================== + # OpenCV installation options + # =================================================== + -DINSTALL_CREATE_DISTRIB="no" + -DINSTALL_BIN_EXAMPLES="$(multilib_native_usex examples)" + -DINSTALL_C_EXAMPLES="$(multilib_native_usex examples)" + -DINSTALL_TESTS="$(multilib_native_usex testprograms)" + # -DINSTALL_ANDROID_EXAMPLES="no" + -DINSTALL_TO_MANGLED_PATHS="no" + -DOPENCV_GENERATE_PKGCONFIG="yes" + # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX} + # to set its destination libdir + -DLIB_SUFFIX= + # =================================================== + # OpenCV build options + # =================================================== + -DENABLE_CCACHE="no" + # bug 733796, but PCH is a risky game in CMake anyway + -DBUILD_USE_SYMLINKS="yes" + -DENABLE_PRECOMPILED_HEADERS="no" + -DENABLE_SOLUTION_FOLDERS="no" + -DENABLE_PROFILING="no" + -DENABLE_COVERAGE="no" + -DOPENCV_DOWNLOAD_TRIES_LIST="0" + + -DHAVE_opencv_java="$(multilib_native_usex java)" + + -DBUILD_WITH_DEBUG_INFO="$(usex debug)" + -DOPENCV_ENABLE_MEMORY_SANITIZER="$(usex debug)" + -DCV_TRACE="$(usex debug)" + -DENABLE_NOISY_WARNINGS="$(usex debug)" + -DOPENCV_WARNINGS_ARE_ERRORS="no" + -DENABLE_IMPL_COLLECTION="no" + -DENABLE_INSTRUMENTATION="no" + -DGENERATE_ABI_DESCRIPTOR="no" + # =================================================== + # things we want to be hard off or not yet figured out + # =================================================== + -DBUILD_PACKAGE="no" + # =================================================== + # Not building protobuf but update files bug #631418 + # =================================================== + -DWITH_PROTOBUF="yes" + -DBUILD_PROTOBUF="no" + -DPROTOBUF_UPDATE_FILES="yes" + -DProtobuf_MODULE_COMPATIBLE="yes" + # =================================================== + # things we want to be hard enabled not worth useflag + # =================================================== + -DOPENCV_DOC_INSTALL_PATH="share/doc/${PF}" + -DOPENCV_SAMPLES_BIN_INSTALL_PATH="libexec/${PN}/bin/samples" + + -DBUILD_IPP_IW="no" + -DBUILD_ITT="no" + + # =================================================== + # configure modules to be build + # =================================================== + -DBUILD_opencv_gapi="$(usex ffmpeg yes "$(usex gstreamer)")" + -DBUILD_opencv_features2d="$(usex features2d)" + -DBUILD_opencv_java_bindings_generator="$(usex java)" + -DBUILD_opencv_js="no" + -DBUILD_opencv_js_bindings_generator="no" + -DBUILD_opencv_objc_bindings_generator="no" + -DBUILD_opencv_python2="no" + -DBUILD_opencv_ts="$(usex test)" + -DBUILD_opencv_video="$(usex ffmpeg yes "$(usex gstreamer)")" + -DBUILD_opencv_videoio="$(usex ffmpeg yes "$(usex gstreamer)")" + + -DBUILD_opencv_cudalegacy="no" + + # -DBUILD_opencv_world="yes" + + -DOPENCV_PLUGIN_VERSION=".$(ver_rs 1-2 '' "$(ver_cut 1-2)")" + -DOPENCV_PLUGIN_ARCH=".${ARCH}" + + -DDNN_PLUGIN_LIST="all" + -DHIGHGUI_ENABLE_PLUGINS="no" + ) + + local VIDEOIO_PLUGIN_LIST=() + if use ffmpeg; then + VIDEOIO_PLUGIN_LIST+=("ffmpeg") + fi + if use gstreamer; then + VIDEOIO_PLUGIN_LIST+=("gstreamer") + fi + + mycmakeargs+=( + -DVIDEOIO_PLUGIN_LIST="$(IFS=';'; echo "${VIDEOIO_PLUGIN_LIST[*]}")" + ) + + if use qt6; then + mycmakeargs+=( + -DWITH_QT="$(multilib_native_usex qt6)" + -DCMAKE_DISABLE_FIND_PACKAGE_Qt5="yes" + ) + else + mycmakeargs+=( + -DWITH_QT="no" + -DCMAKE_DISABLE_FIND_PACKAGE_Qt5="yes" + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6="yes" + ) + fi + + # ================================================== + # cpu flags, should solve 633900 + #=================================================== + # TODO binhost https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options + + local CPU_BASELINE="" + for i in "${CPU_FEATURES_MAP[@]}" ; do + if [[ ${ABI} != x86 || ${i%:*} != "cpu_flags_x86_avx2" ]]; then # workaround for Bug 747163 + local value + # These are merged into one flag internally + if [[ ${ABI} == amd64 ]]; then + case "${i%:*}" in + cpu_flags_x86_avx512er|cpu_flags_x86_avx512pf) + value="AVX512_KNL_EXTRA" + ;; + cpu_flags_x86_avx512_4fmaps|cpu_flags_x86_avx512_4vnniw) + value="AVX512_KNM_EXTRA" + ;; + *) + value="${i#*:}" + ;; + esac + else + value=${i#*:} + fi + + use "${i%:*}" && CPU_BASELINE="${CPU_BASELINE}${value};" + fi + done + unset CPU_FEATURES_MAP + + mycmakeargs+=( + -DCPU_BASELINE="${CPU_BASELINE}" + ) + if [[ ${MERGE_TYPE} != "buildonly" ]]; then + mycmakeargs+=( + -DOPENCV_CPU_OPT_IMPLIES_IGNORE="yes" + -DCPU_DISPATCH= + ) + fi + + # =================================================== + # OpenCV Contrib Modules + # =================================================== + # NOTE + # we remove unused modules, + # so we shouldn't need to disable options for unused modules + if use contrib; then + mycmakeargs+=( + -DBUILD_opencv_cvv="$(usex contribcvv)" + -DBUILD_opencv_dnn="$(usex contribdnn)" + -DOPENCV_DNN_OPENCL="$(usex opencl)" + -DOPENCV_DNN_CUDA="$(multilib_native_usex cudnn)" + + -DBUILD_opencv_freetype="$(usex contribfreetype)" + -DBUILD_opencv_hdf="$(multilib_native_usex contribhdf)" + -DBUILD_opencv_ovis="$(usex contribovis)" + -DBUILD_opencv_sfm="$(usex contribsfm)" + -DBUILD_opencv_xfeatures2d="$(usex contribxfeatures2d)" + ) + + if ! multilib_native_use tesseract; then + mycmakeargs+=( + -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract="yes" + ) + fi + fi + + # workaround for bug 413429 + tc-export CC CXX + + if multilib_native_use cuda; then + cuda_add_sandbox -w + addwrite "/proc/self/task" + + if ! test -w /dev/nvidiactl; then + # eqawarn "Can't access the GPU at /dev/nvidiactl." + # eqawarn "User $(id -nu) is not in the group \"video\"." + if [[ -z "${CUDA_GENERATION}" ]] && [[ -z "${CUDA_ARCH_BIN}" ]]; then + # build all targets + mycmakeargs+=( + -DCUDA_GENERATION="" + ) + fi + else + local -x CUDAARCHS + : "${CUDAARCHS:="$(cuda_get_host_native_arch)"}" + fi + + local -x CUDAHOSTCXX CUDAHOSTLD + CUDAHOSTCXX="$(cuda_get_host_compiler)" + CUDAHOSTLD="$(tc-getCXX)" + + if tc-is-gcc; then + # Filter out IMPLICIT_LINK_DIRECTORIES picked up by CMAKE_DETERMINE_COMPILER_ABI(CUDA) + # See /usr/share/cmake/Help/variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES.rst + CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES_EXCLUDE=$( + "${CUDAHOSTLD}" -E -v - <<<"int main(){}" |& \ + grep LIBRARY_PATH | cut -d '=' -f 2 | cut -d ':' -f 1 + ) + fi + + mycmakeargs+=( + -DENABLE_CUDA_FIRST_CLASS_LANGUAGE="yes" + ) + fi + + if use ffmpeg; then + mycmakeargs+=( + -DOPENCV_GAPI_GSTREAMER="no" + -DOPENCV_FFMPEG_DISABLE_MEDIASDK="yes" + ) + fi + + # according to modules/java/jar/CMakeLists.txt:23-26 + if use java; then + mycmakeargs+=( + -DOPENCV_JAVA_SOURCE_VERSION="$(java-pkg_get-source)" + -DOPENCV_JAVA_TARGET_VERSION="$(java-pkg_get-target)" + ) + fi + + if use mkl; then + mycmakeargs+=( + -DLAPACK_IMPL="MKL" + -DMKL_WITH_OPENMP="$(usex openmp)" + -DMKL_WITH_TBB="$(usex tbb)" + ) + fi + + # NOTE set this via MYCMAKEARGS if needed + if use opencl; then + if has_version sci-libs/clfft; then + mycmakeargs+=( -DWITH_OPENCLAMDFFT="yes" ) + else + mycmakeargs+=( -DWITH_OPENCLAMDFFT="no" ) + fi + if has_version sci-libs/clblas; then + mycmakeargs+=( -DWITH_OPENCLAMDBLAS="yes" ) + else + mycmakeargs+=( -DWITH_OPENCLAMDBLAS="no" ) + fi + else + mycmakeargs+=( + -DWITH_OPENCLAMDFFT="no" + -DWITH_OPENCLAMDBLAS="no" + ) + fi + + # NOTE due to multilib we can't do + # if multilib_native_use test; then + if use test; then + # opencv tests assume to be build in Release mode + local -x CMAKE_BUILD_TYPE="Release" + mycmakeargs+=( + -DOPENCV_TEST_DATA_PATH="${WORKDIR}/${PN}_extra-${PV}/testdata" + ) + if use vtk; then + mycmakeargs+=( + -DVTK_MPI_NUMPROCS="$(makeopts_jobs)" # TODO + ) + fi + fi + + if multilib_native_use testprograms; then + # NOTE do this so testprograms do not fail + mycmakeargs+=( + -DOPENCV_TEST_INSTALL_PATH="libexec/${PN}/bin/test" + ) + fi + + if multilib_native_use python; then + python_configure() { + # Set all python variables to load the correct Gentoo paths + local mycmakeargs=( + "${mycmakeargs[@]}" + # python_setup alters PATH and sets this as wrapper + # to the correct interpreter we are building for + -DBUILD_opencv_python3="yes" + -DBUILD_opencv_python_bindings_generator="yes" + -DBUILD_opencv_python_tests="$(usex test)" + -DPYTHON_DEFAULT_EXECUTABLE="${EPYTHON}" + -DINSTALL_PYTHON_EXAMPLES="$(usex examples)" + ) + cmake_src_configure + } + + python_foreach_impl python_configure + else + mycmakeargs+=( + -DPYTHON_EXECUTABLE="no" + -DINSTALL_PYTHON_EXAMPLES="no" + -DBUILD_opencv_python3="no" + -DBUILD_opencv_python_bindings_generator="no" + -DBUILD_opencv_python_tests="no" + ) + cmake_src_configure + fi +} + +multilib_src_compile() { + if multilib_native_use python; then + python_foreach_impl cmake_src_compile + else + cmake_src_compile + fi +} + +multilib_src_test() { + # no tests on ABI_X86_32 + ! multilib_is_native_abi && return + + # NOTE we don't run the tests + use testprograms && return + + declare -xA OPENCV_SKIP_TESTS + + local -x OPENCV_SKIP_TESTS_core=( + 'hal_intrin128.*32x4_CPP_EMULATOR' + 'hal_intrin128.*64x2_CPP_EMULATOR' + ) + + local -x OPENCV_SKIP_TESTS_gapi=( + 'AsyncAPICancelation/cancel/*.basic' + ) + + local -x OPENCV_SKIP_TESTS_videoio=( + '*mfx*' + 'videoio/videoio_bunny.frame_count/12' + ) + + local -x OPENCV_SKIP_TESTS_video=( + 'GOTURN.accuracy' + 'DaSiamRPN.accuracy' + 'NanoTrack.accuracy_NanoTrack_V1' + 'NanoTrack.accuracy_NanoTrack_V2' + 'Tracking/DistanceAndOverlap.GOTURN*' + ) + + if ! use gtk3 && ! use qt6; then + local -x OPENCV_SKIP_TESTS_highgui=( + 'Highgui_GUI.*' + ) + else + addpredict /dev/fuse + fi + + if multilib_native_use cuda; then + local -x OPENCV_SKIP_TESTS_cudaoptflow=( + 'CUDA_OptFlow/BroxOpticalFlow.Regression/0' + 'CUDA_OptFlow/BroxOpticalFlow.OpticalFlowNan/0' + 'CUDA_OptFlow/NvidiaOpticalFlow_1_0.Regression/0' + 'CUDA_OptFlow/NvidiaOpticalFlow_2_0.Regression/0' + ) + if use opengl; then + local -x OPENCV_SKIP_TESTS_cudaarithm=( + 'OpenGL/Buffer.MapDevice/*' + 'OpenGL/*Gpu*' + ) + fi + fi + + if use contribdnn; then + local -x OPENCV_SKIP_TESTS_dnn=( + 'Test_ONNX_layers.LSTM_cell_forward/*' + 'Test_ONNX_layers.LSTM_cell_bidirectional/*' + 'Test_TensorFlow_layers.Convolution3D/*' + 'Test_TensorFlow_layers.concat_3d/*' + ) + local -x OPENCV_SKIP_TESTS_objdetect=( + 'Objdetect_face_detection.regression' + 'Objdetect_face_recognition.regression' 'Objdetect_QRCode_Encode_Decode_Structured_Append.regression' + ) + else + local -x OPENCV_SKIP_TESTS_objdetect=( + 'Objdetect_face_detection.regression' + 'Objdetect_face_recognition.regression' + ) + + OPENCV_SKIP_TESTS_video+=( + 'vittrack.accuracy_vittrack' + ) + fi + if use dnnsamples; then + local -x OPENCV_SKIP_TESTS_wechat_qrcode=( + 'Objdetect_QRCode_points_position.rotate45' + 'Objdetect_QRCode_Big.regression' + 'Objdetect_QRCode_Tiny.regression' + 'Objdetect_QRCode_Multi.regression/*' + 'Objdetect_QRCode_Easy_Multi.regression/1' + ) + fi + + if multilib_native_use cuda; then + if ! SANDBOX_WRITE=/dev/nvidiactl test -w /dev/nvidiactl ; then + eerror "Can't access the GPU at /dev/nvidiactl." + eerror "User $(id -nu) is not in the group \"video\"." + local -x TEST_CUDA="false" + # local -x OPENCV_PARALLEL_BACKEND="threads" + # local -x DNN_BACKEND_OPENCV="cuda" + + local -x OPENCV_SKIP_TESTS_photo=( "CUDA_*" ) + local -x OPENCV_SKIP_TESTS_stitching=( "CUDA_*" ) + OPENCV_SKIP_TESTS_video+=( "CUDA_*" ) + else + cuda_add_sandbox -w + addwrite "/dev/dri/" + [[ -e /dev/udmabuf ]] && addwrite /dev/udmabuf + fi + fi + + opencv_test() { + cd "${BUILD_DIR}" || die + + # directories to search for _core_ plugins + local -x OPENCV_CORE_PLUGIN_PATH="${BUILD_DIR}/lib" + # directories to search for _dnn_ plugins + local -x OPENCV_DNN_PLUGIN_PATH="${BUILD_DIR}/lib" + # directories to search for _videoio_ plugins + local -x OPENCV_VIDEOIO_PLUGIN_PATH="${BUILD_DIR}/lib" + # # path to extra OpenVINO plugins + # local -x OPENCV_DNN_IE_EXTRA_PLUGIN_PATH="${BUILD_DIR}/lib" + + local -x OPENCV_TEMP_PATH="${T}" + + local -x OPENCV_TEST_DATA_PATH="${WORKDIR}/${PN}_extra-${PV}/testdata" + + local test_opts_base=( + --skip_unstable=1 + --test_threads="$(makeopts_jobs)" + ) + + local results=() + + local tests + readarray -t tests <<< "$(find "${BUILD_DIR}/bin" -name 'opencv_test_*')" + + for test in "${tests[@]}" ; do + + if [[ ${TEST_CUDA} == "false" && ${test} = *opencv_test_cu* ]] ; then + eqawarn "Skipping test ${test}" + continue + fi + + local test_opts=( + --gtest_color=yes + --gtest_output="json:${BUILD_DIR}/test-reports/$(basename "${test}").json" + ) + + local testname + testname="OPENCV_SKIP_TESTS_$(basename "${test//opencv_test_/}")[*]" + if [[ -n "${!testname}" ]]; then + test_opts+=( + --gtest_filter="-$(IFS=':'; echo "${!testname}")" + ) + fi + + einfo "${test} ${test_opts_base[*]} ${test_opts[*]}" + if ! "${test}" "${test_opts_base[@]}" "${test_opts[@]}"; then + results+=( "$(basename "${test}")" ) + + if [[ -z "${OPENCV_TEST_CONTINUE_ON_FAIL}" ]]; then + eerror "${results[*]} failed" + die + fi + fi + done + + if [[ -n "${results[*]}" ]]; then + eerror "failed: ${results[*]}" + die "${results[*]}" + fi + } + + if multilib_native_use python; then + python_foreach_impl virtx opencv_test + else + virtx opencv_test + fi +} + +multilib_src_install() { + if use abi_x86_64 && use abi_x86_32; then + MULTILIB_WRAPPED_HEADERS=( # {{{ + # [opencv4] + /usr/include/opencv4/opencv2/cvconfig.h + /usr/include/opencv4/opencv2/opencv_modules.hpp + + /usr/include/opencv4/opencv2/core_detect.hpp + + /usr/include/opencv4/opencv2/cudaarithm.hpp + /usr/include/opencv4/opencv2/cudabgsegm.hpp + /usr/include/opencv4/opencv2/cudacodec.hpp + /usr/include/opencv4/opencv2/cudafeatures2d.hpp + /usr/include/opencv4/opencv2/cudafilters.hpp + /usr/include/opencv4/opencv2/cudaimgproc.hpp + /usr/include/opencv4/opencv2/cudalegacy.hpp + /usr/include/opencv4/opencv2/cudalegacy/NCV.hpp + /usr/include/opencv4/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp + /usr/include/opencv4/opencv2/cudalegacy/NCVHaarObjectDetection.hpp + /usr/include/opencv4/opencv2/cudalegacy/NCVPyramid.hpp + /usr/include/opencv4/opencv2/cudalegacy/NPP_staging.hpp + /usr/include/opencv4/opencv2/cudaobjdetect.hpp + /usr/include/opencv4/opencv2/cudaoptflow.hpp + /usr/include/opencv4/opencv2/cudastereo.hpp + /usr/include/opencv4/opencv2/cudawarping.hpp + # [cudev] + /usr/include/opencv4/opencv2/cudev.hpp + /usr/include/opencv4/opencv2/cudev/block/block.hpp + /usr/include/opencv4/opencv2/cudev/block/detail/reduce.hpp + /usr/include/opencv4/opencv2/cudev/block/detail/reduce_key_val.hpp + /usr/include/opencv4/opencv2/cudev/block/dynamic_smem.hpp + /usr/include/opencv4/opencv2/cudev/block/reduce.hpp + /usr/include/opencv4/opencv2/cudev/block/scan.hpp + /usr/include/opencv4/opencv2/cudev/block/vec_distance.hpp + /usr/include/opencv4/opencv2/cudev/common.hpp + /usr/include/opencv4/opencv2/cudev/expr/binary_func.hpp + /usr/include/opencv4/opencv2/cudev/expr/binary_op.hpp + /usr/include/opencv4/opencv2/cudev/expr/color.hpp + /usr/include/opencv4/opencv2/cudev/expr/deriv.hpp + /usr/include/opencv4/opencv2/cudev/expr/expr.hpp + /usr/include/opencv4/opencv2/cudev/expr/per_element_func.hpp + /usr/include/opencv4/opencv2/cudev/expr/reduction.hpp + /usr/include/opencv4/opencv2/cudev/expr/unary_func.hpp + /usr/include/opencv4/opencv2/cudev/expr/unary_op.hpp + /usr/include/opencv4/opencv2/cudev/expr/warping.hpp + /usr/include/opencv4/opencv2/cudev/functional/color_cvt.hpp + /usr/include/opencv4/opencv2/cudev/functional/detail/color_cvt.hpp + /usr/include/opencv4/opencv2/cudev/functional/functional.hpp + /usr/include/opencv4/opencv2/cudev/functional/tuple_adapter.hpp + /usr/include/opencv4/opencv2/cudev/grid/copy.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/copy.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/histogram.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/integral.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/minmaxloc.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_down.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_up.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/reduce.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_column.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_row.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/split_merge.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/transform.hpp + /usr/include/opencv4/opencv2/cudev/grid/detail/transpose.hpp + /usr/include/opencv4/opencv2/cudev/grid/histogram.hpp + /usr/include/opencv4/opencv2/cudev/grid/integral.hpp + /usr/include/opencv4/opencv2/cudev/grid/pyramids.hpp + /usr/include/opencv4/opencv2/cudev/grid/reduce.hpp + /usr/include/opencv4/opencv2/cudev/grid/reduce_to_vec.hpp + /usr/include/opencv4/opencv2/cudev/grid/split_merge.hpp + /usr/include/opencv4/opencv2/cudev/grid/transform.hpp + /usr/include/opencv4/opencv2/cudev/grid/transpose.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/constant.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/deriv.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/detail/gpumat.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/extrapolation.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/glob.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/gpumat.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/interpolation.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/lut.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/mask.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/remap.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/resize.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/texture.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/traits.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/transform.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/warping.hpp + /usr/include/opencv4/opencv2/cudev/ptr2d/zip.hpp + /usr/include/opencv4/opencv2/cudev/util/atomic.hpp + /usr/include/opencv4/opencv2/cudev/util/detail/tuple.hpp + /usr/include/opencv4/opencv2/cudev/util/detail/type_traits.hpp + /usr/include/opencv4/opencv2/cudev/util/limits.hpp + /usr/include/opencv4/opencv2/cudev/util/saturate_cast.hpp + /usr/include/opencv4/opencv2/cudev/util/simd_functions.hpp + /usr/include/opencv4/opencv2/cudev/util/tuple.hpp + /usr/include/opencv4/opencv2/cudev/util/type_traits.hpp + /usr/include/opencv4/opencv2/cudev/util/vec_math.hpp + /usr/include/opencv4/opencv2/cudev/util/vec_traits.hpp + /usr/include/opencv4/opencv2/cudev/warp/detail/reduce.hpp + /usr/include/opencv4/opencv2/cudev/warp/detail/reduce_key_val.hpp + /usr/include/opencv4/opencv2/cudev/warp/reduce.hpp + /usr/include/opencv4/opencv2/cudev/warp/scan.hpp + /usr/include/opencv4/opencv2/cudev/warp/shuffle.hpp + /usr/include/opencv4/opencv2/cudev/warp/warp.hpp + # [contribcvv] + /usr/include/opencv4/opencv2/cvv.hpp + /usr/include/opencv4/opencv2/cvv/call_meta_data.hpp + /usr/include/opencv4/opencv2/cvv/cvv.hpp + /usr/include/opencv4/opencv2/cvv/debug_mode.hpp + /usr/include/opencv4/opencv2/cvv/dmatch.hpp + /usr/include/opencv4/opencv2/cvv/filter.hpp + /usr/include/opencv4/opencv2/cvv/final_show.hpp + /usr/include/opencv4/opencv2/cvv/show_image.hpp + # [contribdnn] + /usr/include/opencv4/opencv2/dnn.hpp + /usr/include/opencv4/opencv2/dnn/all_layers.hpp + /usr/include/opencv4/opencv2/dnn/dict.hpp + /usr/include/opencv4/opencv2/dnn/dnn.hpp + /usr/include/opencv4/opencv2/dnn/dnn.inl.hpp + /usr/include/opencv4/opencv2/dnn/layer.details.hpp + /usr/include/opencv4/opencv2/dnn/layer.hpp + /usr/include/opencv4/opencv2/dnn/shape_utils.hpp + /usr/include/opencv4/opencv2/dnn/utils/debug_utils.hpp + /usr/include/opencv4/opencv2/dnn/utils/inference_engine.hpp + /usr/include/opencv4/opencv2/dnn/version.hpp + /usr/include/opencv4/opencv2/dnn_superres.hpp + # [contribhdf] + /usr/include/opencv4/opencv2/hdf.hpp + /usr/include/opencv4/opencv2/hdf/hdf5.hpp + + /usr/include/opencv4/opencv2/mcc.hpp + /usr/include/opencv4/opencv2/mcc/ccm.hpp + /usr/include/opencv4/opencv2/mcc/checker_detector.hpp + /usr/include/opencv4/opencv2/mcc/checker_model.hpp + + /usr/include/opencv4/opencv2/text.hpp + /usr/include/opencv4/opencv2/text/erfilter.hpp + /usr/include/opencv4/opencv2/text/ocr.hpp + /usr/include/opencv4/opencv2/text/swt_text_detection.hpp + /usr/include/opencv4/opencv2/text/textDetector.hpp + + # [qt6] + /usr/include/opencv4/opencv2/viz.hpp + /usr/include/opencv4/opencv2/viz/types.hpp + /usr/include/opencv4/opencv2/viz/viz3d.hpp + /usr/include/opencv4/opencv2/viz/vizcore.hpp + /usr/include/opencv4/opencv2/viz/widget_accessor.hpp + /usr/include/opencv4/opencv2/viz/widgets.hpp + + /usr/include/opencv4/opencv2/wechat_qrcode.hpp + ) # }}} + fi + + if multilib_native_use python; then + python_foreach_impl cmake_src_install + python_foreach_impl python_optimize + else + cmake_src_install + fi + + for plugin in "${ED}/usr/$(get_libdir)/libopencv_"*".$(ver_rs 1-2 '' "$(ver_cut 1-2)").${ARCH}"* ; do + patchelf --set-soname "$(basename "${plugin}" ".$(get_libname)")" "${plugin}" + done +} diff --git a/media-libs/opencv/opencv-4.9.0-r2.ebuild b/media-libs/opencv/opencv-4.9.0-r2.ebuild index eb231630bdf3..4a0fbf062b69 100644 --- a/media-libs/opencv/opencv-4.9.0-r2.ebuild +++ b/media-libs/opencv/opencv-4.9.0-r2.ebuild @@ -218,7 +218,7 @@ COMMON_DEPEND=" ) ) quirc? ( media-libs/quirc ) - tesseract? ( app-text/tesseract[opencl=,${MULTILIB_USEDEP}] ) + tesseract? ( app-text/tesseract[opencl(+)=,${MULTILIB_USEDEP}] ) tbb? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] ) tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] ) v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] ) @@ -804,7 +804,7 @@ multilib_src_test() { 'AsyncAPICancelation/cancel*basic' ) - if ! use gtk && ! use qt5 && ! use qt6; then + if ! use gtk3 && ! use qt5 && ! use qt6; then CMAKE_SKIP_TESTS+=( # these fail with parallism '^Highgui_*' diff --git a/media-libs/plotutils/Manifest b/media-libs/plotutils/Manifest index 2c86e55d38bb..a92ef0e7ea2f 100644 --- a/media-libs/plotutils/Manifest +++ b/media-libs/plotutils/Manifest @@ -7,5 +7,5 @@ AUX plotutils-2.6-libxmi.patch 5076 BLAKE2B ca028895b5af74e38176b3fe43747196033d AUX plotutils-2.6-makefile.patch 2921 BLAKE2B db41feef6b6f25cd5fe3b9e2329c142805d8cc2b3698042846f91275eb968f1eea797c482dd153f97ab63d0a0f937d3efa4fc01a52e97d0f72cf05614a403cb3 SHA512 ac98f183d19d36c4380d0bbb25a2f86569d79136729a6c265cbc51ce4aa7ad1fc279f9ae7c0ac1db7b4e49325032bbf082db900eb740f394d890ecca57f19a84 DIST plotutils-2.6.tar.gz 3657562 BLAKE2B d77d62ba4e632001d056da7333d1300b2e3d7966029a130e6836fa88545a1749e15b5dc7322d03575432fc5e1342c839f4769ed821962f711848c2d8523904fb SHA512 4e5982605e5c1fbdb7325069c3ab2edd736e37a2eb30a1ec01fdc3541fcee6ed49937d4814c6baf79dab5b6fa42f909e4800c851d0ace3c7cf6d5a8681d0f0e7 EBUILD plotutils-2.6-r2.ebuild 1951 BLAKE2B 61b359ceee3fd071ce8697dda0d1adf5a49557c5a44c233bc5b624d8d2a9c8534c408956484b18447aaa5018d2305c7b9b0f67eb3ae69b59697e30e8f1d59be6 SHA512 e7ba267bfd35da25de1cdee136b866d241214ed8ec6c4b7630cd4750ebb6146fddacc02c5a7bdaa7f4e61ae0f5b680493408d2b7f9e89c42e193c84f8c1b1d00 -EBUILD plotutils-2.6-r3.ebuild 2047 BLAKE2B 19896804956f214be18b5123006ca003983a19a0d2ed59ac49046d4434b0e0d20be5990c7aa3b28c65243f25a01111099a677568ee6469d3b8a884bed8fc938f SHA512 87b4cdc17ed9dd68cfe37d55c2e7fb57dc393a1370ec57db6d6f99c1ef2fbc69bdc4c3c5e4e46defb93595888629063e3992a1d9a717b11714e5ad33600715f7 +EBUILD plotutils-2.6-r3.ebuild 2046 BLAKE2B 6df62493a2cf7466bff10bb601d0dcc337d1d32c6d95c4cf521fe5f11fc1c8d535cdc2c2fb41699866328201bec01142e37513d3af065cf14be54611557f42b0 SHA512 9c141df892f4f3490e5764a5f68b2563c464eb16973c80e043e37fdf779ba75370594866c8a422c529b7e86697efd4711b5904fcb70f8100f9d61dd647918556 MISC metadata.xml 266 BLAKE2B 8dc7c8e41cf8c2190d095f43854e0572b406aafcddb65f5edd577a97f2d1c83174e6eb3552785d95a4a2d064f22794427cbbec5809e25409aa3ada141284ba7c SHA512 6cc6a0d81ad8a450f5fea7ed8977424c16376dd2026223c98c77847785418a7401a4c755ee16fb1a8629fd985957afd57194e8e6a99a8dbe46d50ca16806e5db diff --git a/media-libs/plotutils/plotutils-2.6-r3.ebuild b/media-libs/plotutils/plotutils-2.6-r3.ebuild index ec3ce7efeac6..9e99519f5a2f 100644 --- a/media-libs/plotutils/plotutils-2.6-r3.ebuild +++ b/media-libs/plotutils/plotutils-2.6-r3.ebuild @@ -11,7 +11,7 @@ SRC_URI="mirror://gnu/plotutils/${P}.tar.gz" LICENSE="GPL-2+" SLOT="0" -KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux" IUSE="+png X" DEPEND=" diff --git a/media-libs/vips/Manifest b/media-libs/vips/Manifest index 8307855a4f51..582aad4c6805 100644 --- a/media-libs/vips/Manifest +++ b/media-libs/vips/Manifest @@ -1,7 +1,5 @@ DIST vips-8.15.2.tar.xz 18653840 BLAKE2B fa46d58d77ec835cbb7036764bcc40554a72c2d6a854adee31905d04cb189de131340f990b432293935bc8563236816d14fa45c08ba858de6b1be5ee3ea148ec SHA512 f746e4590f0105cb40dbb4ee35fe4b177acbf09d7fc4202f623812018030b9cfdfcbe585742724b35f40ef9b68717ebd015243f3db293086621d9eac3d89a5b2 -DIST vips-8.15.4.tar.xz 18655032 BLAKE2B ea4bb5af7bf34bda688ea937456ec6c1cff0dfa21e87fd843611cd8b3fb16df8fd1793d8327d40bbf937995466a4cfd417d9fe68f02010e260cf6b68f8c725c5 SHA512 b44fb3d57e356f3f0c4177f8385c0a6e5932ac22af8bd4ef312961d98bec4336bd3fb914a659a51a83a9da8b3bceb1593492a45e433b45a21cc6094aada6f1ac DIST vips-8.15.5.tar.xz 18652672 BLAKE2B bebd8078cb6cedffb4aee98aab17f62538439f81378b4953085ec0cd6e9ce2c6fb17831e77113980bc91c0ed4355d765c2008232b1cf64246467a9cd936e2245 SHA512 d8f87292fa395e108f36769accc64b67ea49aadbea4a6bd97fc457f340c0f78c0365a43ae4b14ac5f154e696a8b2abc100078a8c5ac58aae2dd1b04347fbf4d8 EBUILD vips-8.15.2.ebuild 4183 BLAKE2B e071640ea63ca130ef7d7c173d431d984c6f343a287ddfe4d3655a274de63bc23bf62cbab4d7d6007c86db334cbfc21abf4dcb21ddff81cf4c8d525b2373b195 SHA512 fa65617455189c2ccc9b76f423f3dea374f5237f12622fac05977818c70d027f2dfbe02ff110cfe53b621feb1e928ddf4d16b24e6d638adc2f3d0f2a7a15b728 -EBUILD vips-8.15.4.ebuild 4141 BLAKE2B 9d5c23e2ec824d9d0e690ac9c1faa5e56a2599bbe920c68ea8a2cad0144ae8964a6d7b5af776773687e1afae1404975b4bdca33242de7c8f0708fbfb04182623 SHA512 973ea74c070f6a9fc3abfd3b4800375295a1c130b6ceefcf1c0a47a66668f4eb88466ea14a50e3ec3908885bb94d9c4a03f3063f23d7a799f49492bdc8bc7562 EBUILD vips-8.15.5.ebuild 4147 BLAKE2B fe0c41018b3c7f94b559ebe05084dc987bb4c8a88de3f56aab365e46bb91650813e8eae7a33724594878388c9160f6c7d44a9e22bedf6e9da152790ee1a1c4ab SHA512 7514160a4d6237d5d2d7edb19ab78b492947b5e6beb71e6ddf43ca1632803b5591b8ec4a4307b841ea2866814945c1c29655b328dd86b2552b65dfbbd2e459b8 MISC metadata.xml 1040 BLAKE2B c8af14c5f65716cb6dfa16319ac8411cde2151f846c9fe7ab8ac0484a032d4c9d11e03e0ab82c1817f26e70194df7b88f5fad2e7b8998c951238449ff8f1e9e2 SHA512 d00ecc6c916d40a2b3ac3fd64ce2089afa75261f8c388d65cd6c12ad72c327e8c56df26f0d46285ed39088fb457447970ca8d16141adb4febfd8057755f30f76 diff --git a/media-libs/vips/vips-8.15.4.ebuild b/media-libs/vips/vips-8.15.4.ebuild deleted file mode 100644 index 1a70de46d0d2..000000000000 --- a/media-libs/vips/vips-8.15.4.ebuild +++ /dev/null @@ -1,167 +0,0 @@ -# Copyright 2023-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..13} ) -inherit flag-o-matic meson python-single-r1 toolchain-funcs vala - -DESCRIPTION="VIPS Image Processing Library" -HOMEPAGE="https://libvips.github.io/libvips/" -SRC_URI="https://github.com/libvips/libvips/releases/download/v${PV}/${P}.tar.xz" - -LICENSE="LGPL-2.1+ MIT" -SLOT="0/${PV}" -KEYWORDS="~amd64 ~arm64 ~x86" -IUSE=" - archive deprecated doc exif fftw fits fontconfig graphicsmagick - gtk-doc heif +highway imagemagick imagequant +introspection +jpeg - jpeg2k jpegxl lcms matio openexr orc pango pdf +png python svg - test tiff vala webp -" -REQUIRED_USE=" - fontconfig? ( pango ) - graphicsmagick? ( imagemagick ) - python? ( ${PYTHON_REQUIRED_USE} ) - test? ( jpeg png webp ) - vala? ( introspection ) -" -RESTRICT="!test? ( test )" - -RDEPEND=" - dev-libs/glib:2 - dev-libs/expat - virtual/libintl - archive? ( app-arch/libarchive:= ) - exif? ( media-libs/libexif ) - fftw? ( sci-libs/fftw:3.0= ) - fits? ( sci-libs/cfitsio:= ) - fontconfig? ( media-libs/fontconfig ) - heif? ( media-libs/libheif:= ) - highway? ( >=dev-cpp/highway-1.0.5 ) - !highway? ( - orc? ( dev-lang/orc ) - ) - imagemagick? ( - graphicsmagick? ( media-gfx/graphicsmagick:= ) - !graphicsmagick? ( media-gfx/imagemagick:= ) - ) - imagequant? ( media-gfx/libimagequant ) - introspection? ( dev-libs/gobject-introspection ) - jpeg? ( media-libs/libjpeg-turbo:= ) - jpeg2k? ( media-libs/openjpeg:= ) - jpegxl? ( media-libs/libjxl:= ) - lcms? ( media-libs/lcms:2 ) - matio? ( sci-libs/matio:= ) - openexr? ( media-libs/openexr:= ) - pango? ( - x11-libs/cairo - x11-libs/pango - ) - pdf? ( - app-text/poppler[cairo] - x11-libs/cairo - ) - png? ( media-libs/libpng:= ) - python? ( - ${PYTHON_DEPS} - $(python_gen_cond_dep 'dev-python/pycairo[${PYTHON_USEDEP}]') - ) - svg? ( - gnome-base/librsvg:2 - sys-libs/zlib:= - x11-libs/cairo - ) - tiff? ( media-libs/tiff:= ) - webp? ( media-libs/libwebp:= ) -" -DEPEND=" - ${RDEPEND} - pango? ( x11-base/xorg-proto ) - pdf? ( x11-base/xorg-proto ) - svg? ( x11-base/xorg-proto ) - test? ( - tiff? ( media-libs/tiff[jpeg] ) - ) -" -BDEPEND=" - dev-util/glib-utils - sys-devel/gettext - doc? ( - app-text/doxygen - media-gfx/graphviz - ) - gtk-doc? ( dev-util/gtk-doc ) - python? ( ${PYTHON_DEPS} ) - vala? ( $(vala_depend) ) -" - -pkg_setup() { - use python && python-single-r1_pkg_setup -} - -src_prepare() { - default - - use vala && vala_setup - - sed -i "s/'vips-doc'/'${PF}'/" cplusplus/meson.build || die - - sed -i "/subdir('fuzz')/d" meson.build || die -} - -src_configure() { - # workaround for bug in lld (bug #921728) - tc-ld-is-lld && filter-lto - - local emesonargs=( - $(meson_use deprecated) - $(meson_use doc doxygen) - -Dexamples=false - $(meson_use gtk-doc gtk_doc) - $(meson_use vala vapi) - -Dcgif=disabled # not packaged, and not used to view gif (only saving) - $(meson_feature archive) - $(meson_feature exif) - $(meson_feature fftw) - $(meson_feature fits cfitsio) - $(meson_feature fontconfig) - $(meson_feature heif) - $(meson_feature highway) - $(meson_feature imagemagick magick) - -Dmagick-package=$(usex graphicsmagick GraphicsMagick MagickCore) - $(meson_feature imagequant) - $(meson_feature introspection) - $(meson_feature jpeg) - $(meson_feature jpeg2k openjpeg) - $(meson_feature jpegxl jpeg-xl) - $(meson_feature lcms) - $(meson_feature matio) - -Dnifti=disabled # not packaged - $(meson_feature openexr) - -Dopenslide=disabled # not packaged - $(meson_feature orc) # no-op if USE=highway is set - $(meson_feature pango pangocairo) - -Dpdfium=disabled # not packaged, can use poppler instead - $(meson_feature png) - $(meson_feature pdf poppler) - -Dquantizr=disabled # not packaged, can use imagequant instead - -Dspng=disabled # not packaged, can use libpng instead - $(meson_feature svg rsvg) - $(meson_feature tiff) - $(meson_feature webp) - $(meson_feature svg zlib) # zlib is currently only used by svgload.c - ) - - meson_src_configure -} - -src_install() { - meson_src_install - - if use python; then - python_fix_shebang "${ED}"/usr/bin/vipsprofile - else - rm -- "${ED}"/usr/{bin/vipsprofile,share/man/man1/vipsprofile.1} || die - fi -} |