Opened 5 years ago

Last modified 5 months ago

#38907 new enhancement

Resolving libjpeg-turbo + jpeg Port conflicts

Reported by: davidfavor (David Favor) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: vergus@…, ryandesign (Ryan Schmidt), devernay (Frédéric Devernay), floodkoff (Misha Fludkov)
Port: libjpeg-turbo

Description (last modified by ryandesign (Ryan Schmidt))

Since libjpeg-turbo released there are many Ports that could benefit from it's use, except dependencies in these Ports are for the jpeg Port which conflicts with libjpeg-turbo.

Currently there appears to be no way to specify an "OR dependency"... like...

depends_lib port:jpeg || port:libjpeg-turbo

So is the correct way to fix this to change...

depends_lib port:jpeg


depends_lib path:lib/libjpeg.dylib

which would then pass the dependency check for any Port that installed this library.

Let me know if this is the correct fix.


Change History (10)

comment:2 Changed 5 years ago by davidfavor (David Favor)

Looks like this won't work for libjpeg-turbo, because jpeg9 breaks API/ABI compatibility with jpeg8 and libjpeg-turbo uses the jpeg8 API.


Let me know if this is the correct way to resolve this type of conflict, for possible future work.


comment:3 Changed 5 years ago by ryandesign (Ryan Schmidt)

  • Cc openmaintainer removed
  • Description modified (diff)
  • Owner changed from macports-tickets@… to rmstonecipher@…
  • Port libjpeg-turbo added; ffmpeg removed
  • Type changed from request to enhancement

If libjpeg-turbo were a drop-in compatible replacement for jpeg (which I thought it was, but which you've pointed out as of jpeg 9 it isn't anymore) then yes the solution would be to change all port:jpeg dependencies in all ports to path:lib/libjpeg.dylib:jpeg.

comment:4 Changed 4 years ago by rmstonecipher@…

Ryan, David,
The libjpeg-turbo commentary on jpeg 9, SmartScale, etc. gives me the impression that the changes to ijg jpeg are non-standard, academic in nature, and not widely-adopted.
Could we not modify the path dependency to depend on libjpeg-turbo by default and let jpeg 9, which seems to be drifting away from standards-compliance, be the alternative library?
Could Portfile voodoo be used to force systems upgrading jpeg-dependent packages to deactivate jpeg 9, install libjpeg-turbo, and rebuild against it?

comment:5 Changed 3 years ago by mf2k (Frank Schima)

  • Owner changed from rmstonecipher@… to macports-tickets@…
  • Version 2.1.3 deleted

comment:6 Changed 3 years ago by vergus@…

  • Cc vergus@… added

Cc Me!

comment:7 Changed 3 years ago by tim.bruylants@…

Please do not support libjpeg9! The comment and link that was posted in comment 4 is 100% correct.

Libjpeg9 not only has a changed ABI/API, but it also diverts from the official JPEG standard. Thus, it potentially generates conflicting, and non-standard JPEG files. As far as I know, most of the larger Linux distros also dropped libjpeg9 in favor of libjpeg-turbo.

I, myself, was surprised to find that MacPorts relies on libjpeg9. I am removing this lib from my system as we speak, and suggest everyone from not using it.

Kind regards, Tim.

comment:8 Changed 3 years ago by ryandesign (Ryan Schmidt)

We are now discussing replacing jpeg with libjpeg-turbo on the macports-dev mailing list.

comment:9 Changed 3 years ago by ryandesign (Ryan Schmidt)

  • Cc ryandesign@… added

Cc Me!

comment:10 Changed 7 months ago by devernay (Frédéric Devernay)

  • Cc devernay added

comment:11 Changed 5 months ago by floodkoff (Misha Fludkov)

  • Cc floodkoff added
Note: See TracTickets for help on using tickets.