makedepends=(cmake)

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

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

name=flatbuffers
version=25.12.19

PKGMK_KEEP_SOURCES="no"

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

build() {

mkdir -v build

sed -i 's/-Werror=/-W/g;s/-Werror//g' $name-$version/CMakeLists.txt

cd build
cmake ../$name-$version -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
}
