[haiku-commits] Re: haiku: hrev46812 - src/build/libgnuregex

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-commits@xxxxxxxxxxxxx" <haiku-commits@xxxxxxxxxxxxx>
  • Date: Mon, 3 Feb 2014 18:49:59 -0500

On Mon, Feb 3, 2014 at 6:11 PM, François Revol <revol@xxxxxxx> wrote:
> On 03/02/2014 18:27, js-haiku-commits@xxxxxxxxxxx wrote:
>>   This is required on OS X and other systems which do not have the glibc
>>   extensions for regular expressions (FreeBSD is not one of them as it
>>   already includes gnuregex in /usr). With this there are no hardcoded
>>   non-standard paths for OS X anymore.
>>
>>   regex.c and regex.h are from the official gnuregex 0.12 distribution,
>>   the only modification is that I added __BEGIN_DECLS and __END_DECLS to
>>   regex.h.
>
> Can't we just document it as part of the build dependencies and let
> people just install it themselves?
>
> https://trac.macports.org/browser/trunk/dports/sysutils/gnuregex/Portfile

When I saw this commit I had a feeling someone would make this
comment, and I take issue with you using the word "just" here, it
minimizes the very real complications involved. The simple answer to
your question is "no", the more complex answer is as follows:

While gnuregex is in MacPorts, it's not in Homebrew which is
increasingly becoming the more relevant and useful package manager on
OS X. Gnuregex is a non-standard extension to glibc used by few apps
which apparently makes it less likely not to be included by the
homebrew guys. In my article:
http://www.haiku-os.org/articles/2012-05-08_building_haiku_mac_os_x_106_or_107_homebrew
I explained how to create a gnuregex recipe and install it using
homebrew.

Also MacPorts installs in /opt and homebrew installs in /usr/local.
Since /opt isn't in your include path on OS X we have to hack up our
build script to find the library. You can see this in the line:

HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
HOST_STATIC_LIBROOT += /opt/local/lib/libgnuregex.dylib ;

If we wanted to support Homebrew as well as MacPorts we'd have to add
/usr/local/lib/gnuregex.dylib to the as well. By including the files
in the source and building them as part of the build system this
problem is mitigated.

So, unless we only want to support MacPorts going forward, which isn't
reasonable, we need to either document how to build and install the
gnuregex recipe from Homebrew and also add the necessary paths to
HOST_LIBROOT and HOST_STATIC_LIBROOT, or, we do as js did in this
commit and include the files and build them as part of the default
install.

Of course you could build your own gnuregex too. In that case you'd
have to create a symlink in one of the locations Haiku's build system
is setup to look for.

Other related posts: