Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

mlt: migrate to opencv3 #10782

Merged
merged 1 commit into from Apr 24, 2021
Merged

Conversation

mascguy
Copy link
Member

@mascguy mascguy commented Apr 24, 2021

Description

Migrate mlt from opencv, to opencv3

Specifically tested both the default install, as well as variant +opencv. For the latter, verified that opencv3 is being properly found during configure phase, and that binaries are linking to opencv3 shared libs.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.12.6 16G2136
Xcode 9.2 9C40b

macOS 10.13.6 17G14019
Xcode 10.1 10B61

macOS 10.14.6 18G103
Xcode 11.3.1 11C505

macOS 10.15.6 19G2021
Xcode 12.0 12A7209

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@macportsbot
Copy link

Notifying maintainers:
@RJVB for port mlt.
@ddennedy for port mlt.

@macportsbot macportsbot added the maintainer: open Affects an openmaintainer port label Apr 24, 2021
multimedia/mlt/Portfile Outdated Show resolved Hide resolved
@RJVB
Copy link
Contributor

RJVB commented Apr 24, 2021 via email

@mascguy
Copy link
Member Author

mascguy commented Apr 24, 2021

Are there implications for the OS versions supported?

Well, port opencv3 is essentially the same as opencv. Even the versions are identical. (Both are at 3.4.14.) The only difference between the two, is that opencv3 cleanly isolates everything - including the headers and libs - so that there's no conflict with opencv4. (And that isolation also allows us to create a legacy opencv2 port, which has been requested by users. That's coming eventually, when I get around to it.)

Otherwise, whatever MacOS releases are supported by opencv, are supported by opencv3. This is truly a drop-in change, that doesn't affect anything other than where the OpenCV shared libs are loaded from.

Does that make sense?

@RJVB
Copy link
Contributor

RJVB commented Apr 24, 2021 via email

@cjones051073 cjones051073 merged commit 0a9ccc4 into macports:master Apr 24, 2021
@mascguy mascguy deleted the mascguy-mlt-opencv3 branch April 24, 2021 20:44
@RJVB
Copy link
Contributor

RJVB commented Apr 26, 2021 via email

@cjones051073
Copy link
Member

I would say once all uses of if have been migrated to opencv{3,4} it should then just be obsoleted. opencv3 is 'almost' a direct replacement, as although it provides the same the files are at different locations which require specific configurations to use.

@RJVB
Copy link
Contributor

RJVB commented Apr 26, 2021 via email

@mascguy
Copy link
Member Author

mascguy commented Apr 26, 2021 via email

@mascguy
Copy link
Member Author

mascguy commented Apr 26, 2021

So out of curiosity, what's the future for port:opencv? Shouldn't it declare itself replaced-by port:opencv3, or become a shim that depends on port:opencv3 and just installs the libopencv*.3.dylib symlinks into ${prefix}/lib to keep existing dependencies happy and working? (Actually, at first glance it looks like port:opencvX could install libopencv*.X.dylib symlinks there to avoid the need for a revbump. Opencv dependents can be huge enough that you don't want to have to rebuild them for "cosmetics", if my private digiKam port is any indication!)

Well, we specifically don't want OpenCV-related headers and libraries to be found in the standard locations like ${prefix}/include and ${prefix}/lib, as that is problematic when supporting multiple versions side-by-side. (Indeed, we now support installation of OpenCV 3 and 4 simultaneously, and OpenCV 2 is coming eventually due to user request.)

So we pushed OpenCV headers and libs down a level, into ${prefix}/include/opencvX and ${prefix}/lib/opencvX. We also segregated the CMake files and pkgconfig file, to ensure ports don't inadvertently find the "wrong" version. (OpenCV 4's pkgconfig was recently stuffed back into ${prefix}/lib/pkgconfig, but I plan to fix that soon... today, if possible.)

In any case, it's all about segregation, to avoid any possible conflicts/issues. Does that make sense?

@mascguy
Copy link
Member Author

mascguy commented Apr 26, 2021

Oh, and digikam has been problematic, in terms of migrating off of opencv: Builds fail across-the-board, for every MacOS release. Making it very difficult to test. LOL

Just curious, did you make changes to get it to build successfully? Please share your secrets! ;-)

@RJVB
Copy link
Contributor

RJVB commented Apr 26, 2021 via email

@cjones051073
Copy link
Member

My digiKam port is currently at 7.1.0 , it's been a long time since I looked at digiKam4!

maybe you could submit a PR updating it, if its that out of date.. ?

@mascguy
Copy link
Member Author

mascguy commented Apr 26, 2021

My digiKam port is currently at 7.1.0 , it's been a long time since I looked at digiKam4!

maybe you could submit a PR updating it, if its that out of date.. ?

I second that idea!

@mascguy
Copy link
Member Author

mascguy commented Apr 26, 2021

Created a new ticket, covering the Digikam update (CCing you both):

62755 - digikam: update to 7.2.0

@RJVB
Copy link
Contributor

RJVB commented Apr 26, 2021 via email

@RJVB
Copy link
Contributor

RJVB commented Apr 26, 2021 via email

@mascguy
Copy link
Member Author

mascguy commented Apr 26, 2021

Oh, and digikam has been problematic, in terms of migrating off of opencv: Builds fail across-the-board, for every MacOS release. Making it very difficult to test. LOL
Is it just digiKam or is OpenCV actually designed rather poorly in its versioning? You'd expect that apps depending on libopencv_dnn.3.4.dylib would "survive" the update from OpenCV 3.4.4 to 3.4.14 but instead they require a rebuild. IOW, the *.3.4.dylib symlinks should be removed so that it becomes possible (for those who want) to keep older libopencv_foo.3.4.X libraries installed for the benefit of dependents you don't want (or cannot) rebuild immediately. A thought for upstream, evidently.

Generally, dependent ports are linked to the major.minor version of the dylibs, like libopencv_core.3.4.dylib. So the case you mention, updating from 3.4.4 to 3.4.14, won't break dependents. Ideally, though, we'd link to libopencv_core.dylib, so that we never break dependents. (Not just for this case, but all across MacPorts.)

As for Digikam, since I can't run a successful build, it's impossible to truly validate that any portfile changes work properly. That's also true for another port (orfeotoolbox), which is also failing to build across-the-board. Ticket: orfeotoolbox 4.0.0: builds failing across-the-board

I could use some thoughts/direction on how to deal with this situation, as we'd really like to eliminate the last remaining dependencies on port opencv. How would you folks handle this?

@RJVB
Copy link
Contributor

RJVB commented Apr 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer: open Affects an openmaintainer port
5 participants