description="An efficient cross platform serialization library for C++, with support for Java, C-sharp and Go"
url="https://google.github.io/flatbuffers/"

packager="tnut <tnut@nutyx.org>"
contributors="Pierre Bi, Rems"

makedepends=(cmake)

name=flatbuffers
version=1.11.0

PKGMK_KEEP_SOURCES="no"

source=(https://github.com/google/$name/archive/v$version.tar.gz)

build() {
cd $name-$version

mkdir -pv build
sed -i 's/-Werror=/-W/g;s/-Werror//g' CMakeLists.txt
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
         -DCMAKE_INSTALL_LIBDIR=lib \
         -DFLATBUFFERS_BUILD_FLATLIB=OFF \
         -DFLATBUFFERS_BUILD_SHAREDLIB=ON

make
make DESTDIR=$PKG install
install -Dm755 flatc -t $PKG/usr/bin
}
