do not edit — generated by btf.
git.druid.rocksindexdruid520portsports/build-tools/pkgconf/add.sh

ports/build-tools/pkgconf/add.sh


set -e
 
git clone https://github.com/pkgconf/pkgconf.git
cd pkgconf
# --default-library=static: meson's own flag for "build the static .a
# instead of the shared .so" (meson defaults to shared-only, no static
# archive at all otherwise) -- needed so anything linking against
# libpkgconf under a static-pie policy (build-tools/muon's own build,
# which links it directly) has an actual .a to link against at all --
# without this there simply is no libpkgconf.a on the system, unlike
# zlib/libssl/libcrypto (which DO already have one, muon's own build
# just needed -Dprefer_static=true to pick it -- see muon/add.sh).
# -Dwith-pkg-config-dir: pkgconf's own meson build bakes its DEFAULT
# pkg-config search path in at configure time from --prefix (meson's own
# option default: "{prefix}/{libdir}/pkgconfig:{prefix}/{datadir}/
# pkgconfig") -- exactly right for a normal, non-ephemeral build (prefix
# now == prefix later), but wrong for an ephemeral "mp reinstall
# --inplace" build, where $MP_PREFIX during THIS build is a throwaway
# scratch prefix, not where pkgconf will actually live once merged onto
# the real root. baked in wrong, this doesn't fail loudly: pkg-config
# just silently can't find ANY .pc file ever again (a REAL, live
# ncurses.pc included) once the scratch dir it was pointed at is cleaned
# up post-merge -- hit for real: "mp install mg" failed with mg's own
# GNUmakefile insisting ncurses wasn't installed, when it plainly was
# (netbsd-curses's own ncurses.pc sitting right there in the real,
# live /lib/pkgconfig) -- pkg-config was just looking in the wrong
# place, the same class of baked-in-build-time-path bug already fixed
# for gcc/perl5/libressl/curl/git (see e.g. vcs/git/pkg.conf's own
# pkg_no_inplace comment), just never caught here since nothing had
# actually EXERCISED pkg-config against a real .pc file since the whole-
# system --inplace rebuild that (re)built pkgconf itself. MP_PREFIX_BASE
# (set by mplib::resolve's own with_sysroot_scope/ephemeral-inplace
# machinery -- see runsh.c's own doc comment) is the real, final prefix
# in exactly that case; falls back to $MP_PREFIX for a normal,
# non-ephemeral build, where the two are the same thing anyway.
realprefix="${MP_PREFIX_BASE:-$MP_PREFIX}"
meson setup --prefix=$MP_PREFIX --default-library=static \
    -Dwith-pkg-config-dir="$realprefix/lib/pkgconfig:$realprefix/share/pkgconfig" \
    $MESON_FLAGS build
ninja -C build -j$MP_JOBS
ninja -C build install
ln -sf pkgconf $MP_PREFIX/bin/pkg-config
ninja -C build -t clean
powered by btf.