On 2020/05/29 15:23, Steve Williams wrote:
> On 29/05/2020 2:30 p.m., Stuart Henderson wrote:
> > On 2020/05/29 13:12, Steve Williams wrote:
> > > Hi
> > > 
> > > I am working on understanding the ports environment and at the same time,
> > > creating a port for guacamole.  I know it's not going to fully work at 
> > > this
> > > point in time because of issues with freerdp, but I'm working on freerdp 
> > > as
> > > well.  However, Stuart gave patches that I've updated to get freerdp2.1.1 
> > > to
> > > build.
> > Here's one I made earlier.. probably needs more patches, totally untested
> > beyond building.
> > 
> 
> Hi,
> 
> That's fantastic to provide me with your port after I've managed to get mine
> working!  Now I can compare and improve from the expert :)
> 
> Is it OK to ask questions on this list about the "best way" to patch?

certainly.

> For example, your port has a patch "patch-src_libguac_string_c " that just
> provides prototypes for strlcpy and strlcat.

Yes that wasn't super-clean, I think it was mentally on a "needs cleaning
sometime if I come back to the port" list which I had forgotten about :)
This was definitely meant as a work in progress rather than a finished
port.

> I looked at why the define wasn't brought in from the OpenBSD include files.
> string.h -> strlcpy et al inside a #if __BSD_VISIBLE
> 
> __BSD_VISIBLE is set in cdefs.h (included from string.h)
> #if !defined(_BSD_SOURCE) && \
>    (defined(_ANSI_SOURCE) || defined(__XPG_VISIBLE) ||
> defined(__POSIX_VISIBLE))
> # define __BSD_VISIBLE          0
> #endif
> 
> So, the approach I took was to add -D_BSD_SOURCE to the Makefile:
> CONFIGURE_ENV=  CPPFLAGS="-I${LOCALBASE}/include -D_BSD_SOURCE" \
>                 LDFLAGS="-L${LOCALBASE}/lib"
> 
> and
> CFLAGS +=               -D_BSD_SOURCE
> 
> 
> There are various other ports that took this approach.

That is definitely a better approach. Looks like only the CONFIGURE_ENV
is needed not CFLAGS.

> The big difference between my approach and yours is that I used the provided
> configure.  I used CONFIGURE_STYLE=simple whereas you used
> CONFIGURE_STYPE=autoreconf.
> 
> Is there a preferable way?

The script is generated with autoconf so it should use one of the
autoconf "family" of CONFIGURE_STYLE settings rather than "simple".
These do some extra things, like building some ports-specific
config.* files from /usr/ports/infrastructure/db/config.* based on the
list of registered dependencies, and set some standard options.
Of that family there's "CONFIGURE_STYLE=gnu" where a pre-generated
script from upstream works as-is, "...=autoconf" or "...=autoreconf"
if the input files have been modified (i.e. my initial attempt at
avoiding the __BSD_VISIBLE redefinition error by patching
configure.ac) and the script needs regenerating.


Attachment: guacamole-server.tgz
Description: application/tar-gz

Reply via email to