Bug 210533

Summary: update net/libvncserver to 0.9.10 fails in port
Product: Ports & Packages Reporter: Walter Schwarzenfeld <w.schwarzenfeld>
Component: Individual Port(s)Assignee: Ben Woods <woodsb02>
Status: Closed FIXED    
Severity: Affects Only Me CC: cpm, woodsb02
Priority: --- Flags: woodsb02: merge-quarterly-
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://reviews.freebsd.org/D6974
Attachments:
Description Flags
patch-libvncclient_h264.c none

Description Walter Schwarzenfeld freebsd_triage 2016-06-24 17:59:26 UTC
The update of net/libvncserver to 0.9.10 succeds with poudriere but fails in the port with:

in file included from rfbproto.c:2406:
./h264.c:253:108: error: too few arguments to function call, expected 8, have 6
    va_status = vaCreateSurfaces(va_dpy, width, height, VA_RT_FORMAT_YUV420, SURFACE_NUM, &va_surface_id[0]);
~~~~~~~~~~~~~~~~ ^
/usr/local/include/va/va.h:945:1: note: 'vaCreateSurfaces' declared here
VAStatus
^ 

I made a "testpatch" to eliminate "too few arguments to function call, expected 8, have 6".
(I don't attach this patch, cause it is surely wrong).

After this it compiled,but shows error message like this:

In file included from gtkvncviewer.c:27:
In file included from /usr/local/include/gtk-2.0/gdk/gdkx.h:33:
In file included from /usr/local/include/X11/Xutil.h:54:
In file included from /usr/local/include/X11/keysym.h:73:
/usr/local/include/X11/keysymdef.h:1332:9: warning: 'XK_Greek_omega' macro redefined
#define XK_Greek_omega                   0x07f9  /* U+03C9 GREEK SMALL LETTER OMEGA */

so I guess it don't uses the headers from the port, it use the system headers - and this seems wrong.

(10.3-RELEASE-p5 amd64).

Port is unmaintained.
Comment 1 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-06-24 20:04:35 UTC
Yes, it fails to build with libva support.

As a workaround you can disable it.

Add this line

CONFIGURE_ARGS= --without-libva

to libvcnserver/Makefile
Comment 2 Walter Schwarzenfeld freebsd_triage 2016-06-24 20:15:19 UTC
Thanks! That works!
Comment 3 Ben Woods freebsd_committer freebsd_triage 2016-06-24 21:39:25 UTC
As Carlos said, I believe this is because the environment you are building in has libva and GTK installed (perhaps the former only after adding it to LIB_DEPENDS). A poudriere build uses a clean environment which does not have either of these, so when they are checked for in the configure and not found, the configure is disabling the build for the H.264 encodings and the GTK+ vnc viewer example respectively.

It seems like perhaps we need to either add LIBVA and GTK as options or dependencies, and if they are enabled we will run into the compile problems you are experiencing.
Comment 4 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-06-24 22:43:00 UTC
Created attachment 171765 [details]
patch-libvncclient_h264.c

The following patch fix the issue.
Comment 5 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-06-24 22:47:50 UTC
This patch makes h264.c compile with recent libva version by including va_compat.h
Comment 6 Ben Woods freebsd_committer freebsd_triage 2016-06-26 22:22:53 UTC
Thanks for reporting this Walter, and Carlos thanks very much for the patch.

A fix for this bug is being prepared here:
https://reviews.freebsd.org/D6974
Comment 7 Ben Woods freebsd_committer freebsd_triage 2016-06-26 22:26:23 UTC
Committed. Thanks again to Walter and Carlos.
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-06-26 22:26:35 UTC
A commit references this bug:

Author: woodsb02
Date: Sun Jun 26 22:25:52 UTC 2016
New revision: 417620
URL: https://svnweb.freebsd.org/changeset/ports/417620

Log:
  net/libvncserver: Fix build with libva
  - Add new option to select whether to compile with VAAPI support,
    so that if multimedia/libva is already installed on the system
    during the build process, it is not linked to unless desired.
  - Add patch to allow h.264 support to build using libva deprecated API

  PR:		210533
  Submitted by:	cpm
  Reported by:	Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
  Approved by:	adamw (mentor)
  Differential Revision:	https://reviews.freebsd.org/D6974

Changes:
  head/net/libvncserver/Makefile
  head/net/libvncserver/files/
  head/net/libvncserver/files/patch-libvncclient_h264.c
Comment 9 Kubilay Kocak freebsd_committer freebsd_triage 2016-06-27 01:35:02 UTC
Should the quarterly branch receive this bug fix?
Comment 10 Ben Woods freebsd_committer freebsd_triage 2016-06-27 07:32:13 UTC
(In reply to Kubilay Kocak from comment #9)
> Should the quarterly branch receive this bug fix?

No, because the bug was only introduced during the recent update of net/libvncserver to 0.9.10 on 24th June 2016.