diff options
author | Andre Barboza <bmg.andre@gmail.com> | 2017-01-05 23:01:19 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-01-07 08:48:06 +0700 |
commit | 4bcd5ac115d993716656d8ac3019f7ebd625a8a4 (patch) | |
tree | 8fab5cd4cafff95555f4a309bccc08766cfd42a9 /libraries/flatbuffers | |
parent | 0d2fdb0eef5a0c3a63be7339575c14e43aa59add (diff) | |
download | slackbuilds-4bcd5ac115d993716656d8ac3019f7ebd625a8a4.tar.gz |
libraries/flatbuffers: Added (cross platform serialization library).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'libraries/flatbuffers')
-rw-r--r-- | libraries/flatbuffers/README | 26 | ||||
-rw-r--r-- | libraries/flatbuffers/flatbuffers.SlackBuild | 114 | ||||
-rw-r--r-- | libraries/flatbuffers/flatbuffers.info | 10 | ||||
-rw-r--r-- | libraries/flatbuffers/flatbuffers.patch | 19 | ||||
-rw-r--r-- | libraries/flatbuffers/slack-desc | 19 |
5 files changed, 188 insertions, 0 deletions
diff --git a/libraries/flatbuffers/README b/libraries/flatbuffers/README new file mode 100644 index 0000000000..df4703a18a --- /dev/null +++ b/libraries/flatbuffers/README @@ -0,0 +1,26 @@ +FlatBuffers is an efficient cross platform serialization +library for games and other memory constrained apps. It +allows you to directly access serialized data without +unpacking/parsing it first, while still having great +forwards/backwards compatibility. + +Features: + - Access to serialized data without parsing/unpacking + - Memory efficiency and speed. The only memory needed to + access your data is that of the buffer. + - Flexible. Optional fields provides forwards and backwards + compatibility. + - Tiny code footprint. Small amounts of generated code, and + just a single small header as the minimum dependency. + - Strongly typed. Errors happen at compile time. + - Convenient to use. Generated C++ code allows for terse + access & construction code. + - Cross platform code with no dependencies. + +Protocol Buffers is indeed relatively similar to FlatBuffers, +with the primary difference being that FlatBuffers does not +need a parsing/unpacking step to a secondary representation +before you can access data, often coupled with per-object +memory allocation. The code is an order of magnitude bigger, +too. Protocol Buffers has neither optional text import/export +nor schema language features like unions. diff --git a/libraries/flatbuffers/flatbuffers.SlackBuild b/libraries/flatbuffers/flatbuffers.SlackBuild new file mode 100644 index 0000000000..58698adcd5 --- /dev/null +++ b/libraries/flatbuffers/flatbuffers.SlackBuild @@ -0,0 +1,114 @@ +#!/bin/sh + +# Slackware build script for Google Flatbuffers + +# Copyright 2016 Andre Barboza, Belo Horizonte - Brazil +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=flatbuffers +VERSION=${VERSION:-1.5.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +patch -p1 < $CWD/flatbuffers.patch +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DFLATBUFFERS_BUILD_FLATC=ON \ + -DFLATBUFFERS_BUILD_FLATHASH=ON \ + -DFLATBUFFERS_BUILD_FLATLIB=ON \ + -DFLATBUFFERS_BUILD_GRPCTEST=OFF \ + -DFLATBUFFERS_BUILD_SHAREDLIB=ON \ + -DFLATBUFFERS_BUILD_TESTS=OFF \ + -DFLATBUFFERS_CODE_COVERAGE=OFF \ + -DFLATBUFFERS_INSTALL=ON \ + .. + make + make install DESTDIR=$PKG +cd .. + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +find docs/ -type f -exec chmod 644 {} \; +find samples/ -type f -exec chmod 644 {} \; +( cd docs/source + doxygen +) +rm docs/source/CONTRIBUTING.md +cp -rav docs/html docs/source/*.{md,txt} samples/ \ + CONTRIBUTING.md LICENSE.txt ISSUE_TEMPLATE.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +install -m644 readme.md $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/libraries/flatbuffers/flatbuffers.info b/libraries/flatbuffers/flatbuffers.info new file mode 100644 index 0000000000..8807936177 --- /dev/null +++ b/libraries/flatbuffers/flatbuffers.info @@ -0,0 +1,10 @@ +PRGNAM="flatbuffers" +VERSION="1.5.0" +HOMEPAGE="https://github.com/google/flatbuffers/" +DOWNLOAD="https://github.com/google/flatbuffers/archive/v1.5.0/flatbuffers-1.5.0.tar.gz" +MD5SUM="34df3c68712f1ce7c0ba7a77d6762d70" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Andre Barboza" +EMAIL="bmg.andre@gmail.com" diff --git a/libraries/flatbuffers/flatbuffers.patch b/libraries/flatbuffers/flatbuffers.patch new file mode 100644 index 0000000000..ffa0a99208 --- /dev/null +++ b/libraries/flatbuffers/flatbuffers.patch @@ -0,0 +1,19 @@ +diff -ur flatbuffers-1.5.0.old/CMakeLists.txt flatbuffers-1.5.0/CMakeLists.txt +--- flatbuffers-1.5.0.old/CMakeLists.txt 2017-01-03 20:56:44.000000000 -0200 ++++ flatbuffers-1.5.0/CMakeLists.txt 2017-01-05 18:41:09.742061141 -0200 +@@ -224,13 +224,13 @@ + if(FLATBUFFERS_INSTALL) + install(DIRECTORY include/flatbuffers DESTINATION include) + if(FLATBUFFERS_BUILD_FLATLIB) +- install(TARGETS flatbuffers DESTINATION lib) ++ install(TARGETS flatbuffers DESTINATION lib${LIB_SUFFIX}) + endif() + if(FLATBUFFERS_BUILD_FLATC) + install(TARGETS flatc DESTINATION bin) + endif() + if(FLATBUFFERS_BUILD_SHAREDLIB) +- install(TARGETS flatbuffers_shared DESTINATION lib) ++ install(TARGETS flatbuffers_shared DESTINATION lib${LIB_SUFFIX}) + endif() + endif() + diff --git a/libraries/flatbuffers/slack-desc b/libraries/flatbuffers/slack-desc new file mode 100644 index 0000000000..3ab4cc661f --- /dev/null +++ b/libraries/flatbuffers/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +flatbuffers: flatbuffers (Efficient cross platform serialization library) +flatbuffers: +flatbuffers: FlatBuffers is an efficient cross platform serialization library +flatbuffers: for games and other memory constrained apps. It allows you to +flatbuffers: directly access serialized data without unpacking/parsing it +flatbuffers: first, while still having great forwards/backwards compatibility. +flatbuffers: +flatbuffers: +flatbuffers: +flatbuffers: https://github.com/google/flatbuffers +flatbuffers: |