Re: [RFC] building postgres with meson - v13 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [RFC] building postgres with meson - v13
Date
Msg-id 20220926190600.dwq77yblf6kqeit2@awork3.anarazel.de
Whole thread Raw
In response to Re: [RFC] building postgres with meson - v13  (John Naylor <john.naylor@enterprisedb.com>)
Responses Re: [RFC] building postgres with meson - v13
List pgsql-hackers
Hi,

On 2022-09-26 15:18:29 +0700, John Naylor wrote:
> On Wed, Sep 21, 2022 at 7:11 AM Andres Freund <andres@anarazel.de> wrote:
> >
> > I added installation instructions for meson for a bunch of platforms, but
> 
> A couple more things for the wiki:
> 
> 1) /opt/homebrew/ seems to be an "Apple silicon" path?

Yea, it's /usr/local on x86-64, based on what was required to make macos CI
work. I updated the wiki page, half-blindly - it'd be nice if you could
confirm that that works?


I needed something like the below to get (nearly?) all dependencies working:

    brewpath="/usr/local"
    PKG_CONFIG_PATH="${brewpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"

    for pkg in icu4c krb5 openldap openssl zstd ; do
      pkgpath="${brewpath}/opt/${pkg}"
      PKG_CONFIG_PATH="${pkgpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
      PATH="${pkgpath}/bin:${pkgpath}/sbin:$PATH"
    done

    export PKG_CONFIG_PATH PATH

    meson setup \
      --buildtype=debug \
      -Dextra_include_dirs=${brewpath}/include \
      -Dextra_lib_dirs=${brewpath}/lib \
      -Dcassert=true \
      -Dssl=openssl -Duuid=e2fs -Ddtrace=auto \
      -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
      build

the per-package stuff is needed because some libraries aren't installed into
/usr/local (or /opt/homebrew), but only in a subdirectory within that.


> Either way it doesn't exist on this machine. I was able to get a working
> build with
> 
> /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig

Hm - what did you need this path for - I don't think that should be needed.



> (My homebrew install doesn't seem to have anything relevant for
> extra_include_dirs or extra_lib_dirs.)

I think libintl.h / libintl.dylib are only in there. With meson that's the
only need for extra_include_dirs / extra_lib_dirs I found on arm apple.


> 2) Also, "ninja -v install" has the same line count as "ninja install" --
> are there versions that do something different?

Yea, that looks like a copy-and-pasto (not even from me :)). Think I fixed it.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: First draft of the PG 15 release notes
Next
From: Wolfgang Walther
Date:
Subject: Re: has_privs_of_role vs. is_member_of_role, redux