Bug 180159 - Mk/Uses/jpeg.mk: Used to add dependancy on either jpeg or libjpeg-turbo ports
Summary: Mk/Uses/jpeg.mk: Used to add dependancy on either jpeg or libjpeg-turbo ports
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 179236 180175
  Show dependency treegraph
 
Reported: 2013-07-01 10:20 UTC by Scot Hetzel
Modified: 2015-07-16 11:08 UTC (History)
3 users (show)

See Also:


Attachments
file.txt (1.71 KB, patch)
2013-07-01 10:20 UTC, Scot Hetzel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scot Hetzel 2013-07-01 10:20:00 UTC
Currently, there are 2 versions of JPEG (graphics/jpeg and libjpeg-turbo) that supply their own version of the jpeg library.

When attempting to build packages for ports that can use either port, the package fails to build due to one of the dependencies only has:

LIB_DEPENDS= jpeg:${PORTSDIR}/graphics/jpeg

Fix: The attached patch adds a new USES feature for jpeg allowing the appropriate jpeg port to be selected.

USES+= jpeg:[build,run,lib]
- if ${PREFIX}/include/turbojpeg.h is found
  use graphics/libjpeg-turbo, otherwise use graphics/jpeg

USES+= jpeg:[build,run,lib]:jpeg
- uses graphics/jpeg

USES+= jpeg:[build,run,lib]:turbo
- uses graphics/libjpeg-turbo

Ports can use this new feature by adding HPJPG to OPTIONS_DEFINE and the following description:

HPJPG_DESC= Build with High-Performance JPEG support

Then below the '.include <bsd.port.options.mk>' line add the following:

.if ${PORT_OPTIONS:MHPJPG}
USES+= jpeg[:lib]:turbo
.else
USES+= jpeg[:lib]
.endif

NOTE:
1. the 'lib' arg is optional, as that is the default.
2. HPJPG was taken from the net/tigervnc port

Patch attached with submission follows:
How-To-Repeat: Try to build /usr/ports/net/tigervnc with the HPJPG option enabled.  It will fail to build due to one of the indirect dependencies graphics/jasper (built with the graphics/jpeg port) causes a conflict between graphics/jpeg and graphics/libjpeg-turbo as both ports install the same files.

See ports/179236
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-07-01 10:20:09 UTC
Maintainer of Mk/Uses,

Please note that PR ports/180159 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/180159

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-07-01 10:20:10 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Scot Hetzel 2013-07-01 19:45:24 UTC
A patch for graphics/jasper that uses this feature is in:

http://www.freebsd.org/cgi/query-pr.cgi?pr=180175

-- 
DISCLAIMER:

No electrons were maimed while sending this message. Only slightly bruised.
Comment 4 Baptiste Daroussin freebsd_committer freebsd_triage 2014-06-16 23:12:43 UTC
Can you attach again the patch to this bug, somehow it seems the previously added one is messed up
Comment 5 John Marino freebsd_committer freebsd_triage 2014-06-19 10:53:36 UTC
Bapt, it's not a patch, it's complete replacement.
Right now both affected ports PRs have been rejected, but I suppose they could be reopened if jpeg.mk is updated.

Scot,
I suspect if you don't supply an actual patch then this PR will be rejected too.
Comment 6 John Marino freebsd_committer freebsd_triage 2014-08-07 15:27:22 UTC
submitter timed out, closing.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2015-07-16 11:08:17 UTC
antoine added preliminary support in ports r390308 and according to review D1582 plans to switch consumers en masse to jpeg-turbo. And bapt seems to work on adding flavour support to both ports infrastructure and pkg(8).

The approach here fails to account package-only users that may have jpeg consumers installed that depend on both -turbo and IJG variants. Also, partially obsolete by ports r365789 which moved turbojpeg library with different API/ABI into a separate port but kept the confusing name while net/tigervnc with HPJPG=on was left to depend on libturbojpeg even though it doesn't use tj* symbols.