PKGNAME=pcp
PKGSEC=util
PKGDEP="avahi chan hdrhistogram-c inetutils jsonpointer libmicrohttpd libnsl2 \
        libpfm libuv libvarlink libwww-perl lxml openpyxl perl perl-dbd-mysql \
        perl-file-slurp perl-json perl-net-snmp perl-xml-libxml \
        perl-yaml-libyaml procps psycopg2 python-3 requests six systemtap"
BUILDDEP="libvirt-python qt-5"
PKGDES="System performance and analysis framework"

ABTYPE=autotools
# Note: Not specifying --with-64bit, "turn on 64 bit compilation mode (default
# is platform dependent).
#
# Note: Disabling all Qt and X related features.
#
# FIXME: Build fails with BPF support enabled.
AUTOTOOLS_AFTER=(
    '--enable-ssp'
    '--enable-pie'
    '--disable-visibility'
    '--with-optimization'
    '--without-gperftools'
    '--without-sanitizer'
    '--with-threads'
    '--with-secure-sockets'
    '--with-static-probes'
    '--with-infiniband'
    '--with-user=pcp'
    '--with-group=pcp'
    '--with-systemd'
    '--without-selinux'
    '--without-qt'
    '--without-qt3d'
    '--with-perl'
    '--with-python3'
    '--with-dstat-symlink'
    '--with-perfevent'
    '--with-pmdastatsd'
    '--without-pmdabpf'
    '--without-pmdabpftrace'
    '--with-pmdajson'
    '--with-pmdamongodb'
    '--with-pmdanutcracker'
    '--with-pmdasnmp'
    '--with-make'
    '--with-tar'
    '--with-zip'
    '--with-transparent-decompression'
    '--without-x'
)

# FIXME: Hard-coded "./VERSION.pcp" path.
ABSHADOW=0

# FIXME: NNO_CHOWN=true, do not perform chown based on user/group names during
# installation.
#
# Note: Only the install_pcp target (not install?!) can handle DIST_ROOT.
MAKE_AFTER=(
    'install_pcp'
    'NO_CHOWN=true'
    "DIST_ROOT=$PKGDIR"
)

# FIXME:
#
# AF.o: AF_lock: Warning: exceptioned symbol (AF_lock) no longer present
# AF.o: afid: Warning: exceptioned symbol (afid) no longer present
# AF.o: block: Warning: exceptioned symbol (block) no longer present
# AF.o: root: Warning: exceptioned symbol (root) no longer present
# AF.o: gc: Warning: exceptioned symbol (gc) no longer present
# AF.o: B __gnu_lto_slim : Error: additional symbol
NOLTO=1
