# Copyright 2020 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2

require github [ user='Junker' ]

SUMMARY="HTTP File Upload plugin for libpurple (XMPP Protocol)"

LICENCES="GPL-3"
SLOT="0"
PLATFORMS="~amd64 ~x86"
MYOPTIONS=""

DEPENDENCIES="
    build:
        virtual/pkg-config
    build+run:
        net-im/pidgin
"

BUGS_TO="hasufell@posteo.de"

src_prepare() {
    default

    # https://github.com/Junker/purple-xmpp-http-upload/pull/14
    edo sed -i -e \
            "s/pkg-config/$(exhost --tool-prefix)pkg-config/" \
            makefile
    export CFLAGS="${CFLAGS} -fPIC"
    export LDFLAGS="${LDFLAGS} -ldl -lm -ljabber"
}