makedepends=( libsodium asciidoc xmlto libunwind)

description="Fast messaging system built on sockets.  C and C++ bindings.  aka 0MQ, ZMQ"
url="http://www.zeromq.org"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=zeromq
version=4.3.5

PKGMK_KEEP_SOURCES='no'

source=(https://github.com/$name/libzmq/releases/download/v$version/$name-$version.tar.gz
        https://github.com/zeromq/cppzmq/archive/v4.7.1.tar.gz)

build() {
  cd $name-$version

  sed -i 's/libzmq_werror="yes"/libzmq_werror="no"/' configure configure.ac

  sed -i 's/openpgm-5.1/openpgm-5.3/' configure configure.ac
  sed -i 's/CXXFLAGS="-Wno-long-long/CXXFLAGS="-Wno-unused-function -Wno-long-long/' configure configure.ac

  autoreconf -fiv

  ./configure prefix=/usr \
              --with-libsodium \
              --with-documentation \
              --disable-Werror \
              --disable-static

  make -Wno-unused-function -Wnoerror=unused-function
  make DESTDIR=$PKG install

  cd ../cppzmq-4.7.1
  install -Dm644 zmq.hpp $PKG/usr/include/zmq.hpp
  install -Dm644 zmq_addon.hpp "$PKG/usr/include/zmq_addon.hpp"
}
