Bug 234929 - net/libvncserver: Disable cmake defaults
Summary: net/libvncserver: Disable cmake defaults
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Marcelo Araujo
URL: https://github.com/LibVNC/libvncserve...
Depends on:
Blocks: 213019
  Show dependency treegraph
Reported: 2019-01-14 00:44 UTC by Derek Schrock
Modified: 2019-08-27 00:39 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (araujo)

Update to 0.9.12 (12.16 KB, patch)
2019-01-14 00:44 UTC, Derek Schrock
no flags Details | Diff
Build filed fix (208 bytes, patch)
2019-01-28 12:04 UTC, VVD
no flags Details | Diff
Disable projects cmake options not used at this time (1.35 KB, patch)
2019-01-28 23:46 UTC, Derek Schrock
no flags Details | Diff
fix cmake defaults add sasl support with patch (2.85 KB, application/mbox)
2019-01-30 05:08 UTC, Derek Schrock
dereks: maintainer-approval?

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Schrock 2019-01-14 00:44:24 UTC
Created attachment 201108 [details]
Update to 0.9.12

- Update to 0.9.12 [1]
- cmake is the new build system
- portlint clean up
- patch-common_md5* is now in upstream
- lzo2 is now included via a shared lib
- libva removed in 0.9.11

[1] - https://github.com/LibVNC/libvncserver/releases/tag/LibVNCServer-0.9.12

testport ok (11amd64/12amd64).
portline ok looks fine.
Comment 1 VVD 2019-01-28 12:02:36 UTC
[9/97] /usr/bin/cc -DLIBVNCSERVER_HAVE_LIBJPEG -DLIBVNCSERVER_HAVE_LIBPNG -DLIBVNCSERVER_HAVE_LIBZ -DLIBVNCSERVER_HAVE_LZO -Dvncclient_EXPORTS -I/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12 -I. -I/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncserver -I/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/common -I/usr/local/include -O2 -pipe -march=prescott  -fstack-protector -fno-strict-aliasing -O2 -pipe -march=prescott  -fstack-protector -fno-strict-aliasing -fPIC -MD -MT CMakeFiles/vncclient.dir/libvncclient/sasl.c.o -MF CMakeFiles/vncclient.dir/libvncclient/sasl.c.o.d -o CMakeFiles/vncclient.dir/libvncclient/sasl.c.o   -c /usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c
FAILED: CMakeFiles/vncclient.dir/libvncclient/sasl.c.o 
/usr/bin/cc -DLIBVNCSERVER_HAVE_LIBJPEG -DLIBVNCSERVER_HAVE_LIBPNG -DLIBVNCSERVER_HAVE_LIBZ -DLIBVNCSERVER_HAVE_LZO -Dvncclient_EXPORTS -I/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12 -I. -I/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncserver -I/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/common -I/usr/local/include -O2 -pipe -march=prescott  -fstack-protector -fno-strict-aliasing -O2 -pipe -march=prescott  -fstack-protector -fno-strict-aliasing -fPIC -MD -MT CMakeFiles/vncclient.dir/libvncclient/sasl.c.o -MF CMakeFiles/vncclient.dir/libvncclient/sasl.c.o.d -o CMakeFiles/vncclient.dir/libvncclient/sasl.c.o   -c /usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:74:34: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
    sprintf(buf, "%s;%hu", host, port);
                     ~~~         ^~~~
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:144:11: warning: passing 'unsigned char [1]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
   strcpy(lsec->data, password);
/usr/include/string.h:84:31: note: passing argument to parameter here
char    *strcpy(char * __restrict, const char * __restrict);
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:206:9: warning: implicit declaration of function 'getsockname' is invalid in C99 [-Wimplicit-function-declaration]
    if (getsockname(client->sock, (struct sockaddr*)&localAddress, &addressLength)) {
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:211:35: error: use of undeclared identifier 'AF_INET'
    if (localAddress.ss_family == AF_INET) {
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:213:19: error: use of undeclared identifier 'AF_INET'
        inet_ntop(AF_INET, &(sa_in->sin_addr), buf, INET_ADDRSTRLEN);
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:216:42: error: use of undeclared identifier 'AF_INET6'
    } else if (localAddress.ss_family == AF_INET6) {
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:218:19: error: use of undeclared identifier 'AF_INET6'
        inet_ntop(AF_INET6, &(sa_in->sin6_addr), buf, INET6_ADDRSTRLEN);
/usr/obj/usr/ports/net/libvncserver/work/libvncserver-LibVNCServer-0.9.12/libvncclient/sasl.c:541:15: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration]
        ret = read(client->sock, encoded, encodedLen);
4 warnings and 4 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1
Comment 2 VVD 2019-01-28 12:04:00 UTC
Created attachment 201478 [details]
Build filed fix
Comment 3 VVD 2019-01-28 12:29:31 UTC
BTW, is https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213019 fixed in 0.9.12?
Comment 4 Derek Schrock 2019-01-28 22:51:58 UTC
(In reply to VVD from comment #3)


I think I know why that build is failing for you.  Need to disable some defaults in the cmake build options.
Comment 5 Derek Schrock 2019-01-28 23:46:05 UTC
Created attachment 201492 [details]
Disable projects cmake options not used at this time

Disable LibVNC/libvncserver cmake default options

All cmake options default to YES so When building on a host system with
non-option or non-DEPENDS libs installed it's possible cmake will find
these and build parts of libvncserver that are not supported at this

Disable all non-option and non-DEPENDS cmake options for now.
Enable cmake options that don't have ports options from USES= or that
can be found in the base system.
Comment 6 Derek Schrock 2019-01-28 23:48:03 UTC
(In reply to VVD from comment #2)

Sorry I didn't realize this was applied to the ports tree.

Can you try this new patch with 0.9.12
Comment 7 VVD 2019-01-29 02:48:21 UTC
(In reply to Derek Schrock from comment #4)
> (In reply to VVD from comment #3)
>> BTW, is https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213019 fixed in 0.9.12?
> Yes.
This one: https://github.com/LibVNC/libvncserver/issues/211 ?

Compiled fine with your patch. VirtualBox didn't tested yet.
Comment 8 Derek Schrock 2019-01-29 03:08:24 UTC
Yes, that one.

I can confirm vbox vnc is fixed with 0.9.12
Comment 9 rkoberman 2019-01-29 07:46:45 UTC
(In reply to VVD from comment #2)
This fixed it for me. 12.0-STABLE r343501 amd64.
Comment 10 John Hein 2019-01-29 16:37:57 UTC
Explicitly specifying supported options (Derek's patch in comment 5 to set CMAKE_ON/OFF explicitly) is good (and maybe should be turned into port OPTIONS in some cases - e.g, the FILETRANSFER option?).

But VVD's patch (comment 2) is also appropriate, I think (except I would patch sasl.c, not sasl.h).  And it should be suggested upstream.  The code in question that references AF_INET should include a more appropriate header file for portability on non-linux systems (sys/socket.h is probably better than arpa/inet.h).  Can someone open an issue on the libvncserver github page for this (and add a reference in this thread)?

If you could not tell, I hit the 'undeclared AF_INET' build error for libvncserver, too.
Comment 11 VVD 2019-01-29 17:00:21 UTC
(In reply to Derek Schrock from comment #8)
> I can confirm vbox vnc is fixed with 0.9.12
Tested - VirtualBox's bug fixed for me too.
Comment 12 VVD 2019-01-29 17:03:29 UTC
(In reply to John Hein from comment #10)
You better know what to write in bugreport. [-:
Comment 13 Derek Schrock 2019-01-30 05:08:07 UTC
Created attachment 201520 [details]
fix cmake defaults add sasl support with patch

This will bring back functionality that was there before 0.9.12.
Add SASL support with a patch to fix build issue from comment 1
Comment 14 VVD 2019-01-30 11:57:58 UTC
(In reply to Derek Schrock from comment #13)
> Created attachment 201520 [details]
In this patch WITH_SDL 2 times:
Comment 15 commit-hook freebsd_committer 2019-01-31 01:47:54 UTC
A commit references this bug:

Author: araujo
Date: Thu Jan 31 01:47:02 UTC 2019
New revision: 491673
URL: https://svnweb.freebsd.org/changeset/ports/491673

  - Add CMAKE options properly.

  PR:		234929 and 235302
  Submitted by:	Derek Schrock <dereks@lifeofadishwasher.com>,
  		O. Hartmann <ohartmann@walstatt.org>,
  		Chad Jacob Milios <milios@ccsys.com>
  Tested by:	many
  Differential Revision:	https://reviews.freebsd.org/D19009

Comment 16 VVD 2019-01-31 07:27:55 UTC
(In reply to commit-hook from comment #15)
Why 2 times?
Comment 17 devnull 2019-02-01 00:46:50 UTC
Confirmed it fixed the VirtualBox/VNC crash for me (re: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213019).

Thanks everyone for your efforts.
Comment 18 VVD 2019-03-11 10:53:16 UTC
Thanks to danfe: https://svnweb.freebsd.org/changeset/ports/495345
Comment 19 Walter Schwarzenfeld freebsd_triage 2019-08-27 00:39:42 UTC
*** Bug 213019 has been marked as a duplicate of this bug. ***