Bug 187923 - [patch] graphics/zbar fails with V4L enabled
Summary: [patch] graphics/zbar fails with V4L enabled
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-25 09:00 UTC by kamikaze
Modified: 2014-06-29 08:00 UTC (History)
3 users (show)

See Also:


Attachments
file.diff (422 bytes, patch)
2014-03-25 09:00 UTC, kamikaze
no flags Details | Diff
Fix CPP include path (322 bytes, patch)
2014-06-10 14:49 UTC, Josh C
no flags Details | Diff
Fix build and staging for all OPTIONS (2.05 KB, patch)
2014-06-28 10:34 UTC, Thomas Zander
riggs: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kamikaze 2014-03-25 09:00:00 UTC
The configure script only looks in /usr/include for linux kernel headers, so it doesn't find them in /usr/local/include:

..
checking linux/videodev.h usability... no
checking linux/videodev.h presence... no
checking for linux/videodev.h... no
configure: error: in `/tmp/obj/usr/ports/graphics/zbar/work/zbar-0.10':
configure: error: test for video support failed!
rebuild your kernel to include video4linux support or
configure --disable-video to skip building video support.
See `config.log' for more details.
===>  Script "configure" failed unexpectedly.
..

Fix: Patch attached with submission follows:
How-To-Repeat: # cd /usr/ports/graphics/zbar
# make PORT_OPTIONS=V4L
Comment 1 Edwin Groothuis freebsd_committer 2014-03-25 09:00:02 UTC
Maintainer of graphics/zbar,

Please note that PR ports/187923 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/187923

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer 2014-03-25 09:00:03 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Oliver Heesakkers 2014-03-29 19:52:58 UTC
Looks good to me. Feel free to commit.
Comment 4 Oliver Heesakkers 2014-06-10 09:34:16 UTC
Update: I've started stagifying this and working through some issues that are thrown up by portlint and the various make checks.
Comment 5 Josh C 2014-06-10 14:49:10 UTC
Created attachment 143624 [details]
Fix CPP include path

This issue impacts more than just V4L for zbar; under FreeBSD 10.0, the port fails to build since libjpeg cannot be found as the local include dir (normally /usr/local/include) is not passed to CPPFLAGS.

This results in the following build failure when the libjpeg.h header can't be found:

/bin/sh ./libtool --tag=CC   --mode=compile cc -DHAVE_CONFIG_H -I. -I./include  -I./zbar -I./include   -DLIBICONV_PLUG -Wall -Wno-parentheses -O2 -pipe -DLIBICONV_PLUG -fno-strict-aliasing -MT zbar/zbar_libzbar_la-jpeg.lo -MD -MP -MF zbar/.deps/zbar_libzbar_la-jpeg.Tpo -c -o zbar/zbar_libzbar_la-jpeg.lo `test -f 'zbar/jpeg.c' || echo './'`zbar/jpeg.c
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I./include -I./zbar -I./include -DLIBICONV_PLUG -Wall -Wno-parentheses -O2 -pipe -DLIBICONV_PLUG -fno-strict-aliasing -MT zbar/zbar_libzbar_la-jpeg.lo -MD -MP -MF zbar/.deps/zbar_libzbar_la-jpeg.Tpo -c zbar/jpeg.c  -fPIC -DPIC -o zbar/.libs/zbar_libzbar_la-jpeg.o
zbar/jpeg.c:25:10: fatal error: 'jpeglib.h' file not found
#include <jpeglib.h>
         ^
1 error generated.

The new zbar-cpp-includes.patch alters the logic of the earlier patch by moving the CPPFLAGS definition to the body of the Makefile. There's no reason to conditionally add this as the configure arg --with-jpeg=yes is always set.

With this patch applied, the build completes normally for me, and should also resolve the V4L build issue.
Comment 6 Thomas Zander freebsd_committer 2014-06-28 10:34:51 UTC
Created attachment 144216 [details]
Fix build and staging for all OPTIONS

- Fix build/staging for all permutations of OPTIONS
- Fix pkg-plist
- Bump PORTREVISION

@Maintainer: Please verify and approve if patch is correct
Comment 7 Thomas Zander freebsd_committer 2014-06-28 10:37:38 UTC
Also, added USES= libtool in attachment 144216 [details]
Comment 8 Oliver Heesakkers 2014-06-28 18:58:41 UTC
This patch looks good. I approve of it and many, many thanks to Thomas for doing this.

I'm puzzled though by the june 17th commit. It modifies LIB_DEPENDS for ImageMagick to:

    LIB_DEPENDS+= libMagick++-6.Q*.so:${PORTSDIR}/graphics/ImageMagick

Which apparently ImageMagick-nox11 from the repository can't satisfy.

When I rewrite to:

    LIB_DEPENDS+= libMagick++.so:${PORTSDIR}/graphics/ImageMagick

all is well again and zbarimg works fine.

Do you need a new patch for this, a new PR perhaps, or is there good reason to keep it as is?
Comment 9 Thomas Zander freebsd_committer 2014-06-29 07:33:28 UTC
The June 17 commit was probably necessary because 16BIT_PIXEL option has been made default for ImageMagick. This means by default ImageMagick will build shared libs named libMagick++-6.Q(8|16).(a|so).

I just double-checked this in a fresh jail with default OPTIONS (both on 10.0 and 9.2 with both ImageMagick and ImageMagick-nox11), and indeed no libMagick++.so gets installed, instead we get libMagick++-6.Q16.so.

The LIB_DEPENDS line is correct; changing it back would now break building zbar from ports from scratch. Once ImageMagick-nox11 is rebuilt on the cluster, the necessary shared libs will be provided.
Comment 10 commit-hook freebsd_committer 2014-06-29 07:58:44 UTC
A commit references this bug:

Author: riggs
Date: Sun Jun 29 07:58:03 UTC 2014
New revision: 359739
URL: http://svnweb.freebsd.org/changeset/ports/359739

Log:
  - Fix build/staging of graphics/zbar for all permutations of OPTIONS
    - CPPFLAGS
    - Get rid of MAN1
  - Fix pkg-plist
  - Introduce USES=libtool
  - Bump PORTREVISION including dependent ports that need rebuild

  PR:		187923
  Submitted by:	kamikaze@bsdforen.de
  Reviewed by:	Oliver Heesakkers <dev2@heesakkers.info> (maintainer)
  Approved by:	maintainer, mentors (implicit)

Changes:
  head/graphics/gstreamer1-plugins-zbar/Makefile
  head/graphics/zbar/Makefile
  head/graphics/zbar/pkg-plist
Comment 11 Thomas Zander freebsd_committer 2014-06-29 08:00:50 UTC
Committed, thank you!