mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
libraries/libdraco: Added (3D data compression).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
493b28cbb1
commit
8a225ddfed
6 changed files with 194 additions and 0 deletions
12
libraries/libdraco/README
Normal file
12
libraries/libdraco/README
Normal file
|
@ -0,0 +1,12 @@
|
|||
Draco is a library for compressing and decompressing 3D geometric
|
||||
meshes and point clouds. It is intended to improve the storage and
|
||||
transmission of 3D graphics.
|
||||
|
||||
Draco was designed and built for compression efficiency and speed. The
|
||||
code supports compressing points, connectivity information, texture
|
||||
coordinates, color information, normals, and any other generic
|
||||
attributes associated with geometry.
|
||||
|
||||
Draco is supported as optional dependency by applications that can take
|
||||
advantage by strong compression of 3D graphics (Blender, qgis, pdal,
|
||||
for example).
|
23
libraries/libdraco/gltf_decoder_cc.patch
Normal file
23
libraries/libdraco/gltf_decoder_cc.patch
Normal file
|
@ -0,0 +1,23 @@
|
|||
--- ./src/draco/io/gltf_decoder.cc
|
||||
+++ ./src/draco/io/gltf_decoder.cc
|
||||
@@ -427,6 +427,12 @@
|
||||
return WriteBufferToFile(contents.data(), contents.size(), filepath);
|
||||
}
|
||||
|
||||
+bool GetFileSizeInBytes(size_t *out, std::string * /*err*/,
|
||||
+ const std::string &filepath, void * /*user_data*/) {
|
||||
+ *out = GetFileSize(filepath);
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
|
||||
GltfDecoder::GltfDecoder()
|
||||
@@ -486,6 +492,7 @@
|
||||
// TinyGLTF's ExpandFilePath does not do filesystem i/o, so it's safe to
|
||||
// use in all environments.
|
||||
&tinygltf::ExpandFilePath, &ReadWholeFile, &WriteWholeFile,
|
||||
+ &GetFileSizeInBytes,
|
||||
reinterpret_cast<void *>(input_files)};
|
||||
|
||||
loader.SetFsCallbacks(fs_callbacks);
|
10
libraries/libdraco/gltf_utils_h.patch
Normal file
10
libraries/libdraco/gltf_utils_h.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- ./src/draco/io/gltf_utils.h 2023-02-07 18:30:00.000000000 +0100
|
||||
+++ ./src/draco/io/gltf_utils.h 2023-11-10 19:04:39.726881566 +0100
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
+#include <cstdint>
|
||||
|
||||
namespace draco {
|
||||
|
120
libraries/libdraco/libdraco.SlackBuild
Normal file
120
libraries/libdraco/libdraco.SlackBuild
Normal file
|
@ -0,0 +1,120 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Slackware build script for libdraco
|
||||
|
||||
# Copyright 2023 Giancarlo Dessì, Cagliari, IT
|
||||
# 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.
|
||||
|
||||
cd $(dirname $0) ; CWD=$(pwd)
|
||||
|
||||
PRGNAM=libdraco
|
||||
SRCNAM=draco
|
||||
VERSION=${VERSION:-1.5.6}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
PKGTYPE=${PKGTYPE:-tgz}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i586 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
||||
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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 $SRCNAM-$VERSION
|
||||
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
|
||||
cd $SRCNAM-$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 {} \;
|
||||
|
||||
sed -i -e 's:FindPythonInterp:FindPython3:g' CMakeLists.txt
|
||||
|
||||
# Fix build errors in the source against gltf so allow the support to
|
||||
# TRANSCODER. Thanks to Timo Röhling maintainer of draco package for Ubuntu
|
||||
# https://answers.launchpad.net/ubuntu/+source/draco/1.5.6+dfsg-3
|
||||
patch -p1 < $CWD/gltf_decoder_cc.patch
|
||||
|
||||
# Fix build errors with gcc 13 on Slackware current,
|
||||
# not needed on Slackware 15.0
|
||||
if [ -f /usr/bin/gcc-13* ]; then
|
||||
patch -p1 < $CWD/gltf_utils_h.patch
|
||||
fi
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake \
|
||||
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
||||
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DDRACO_TRANSCODER_SUPPORTED=ON \
|
||||
-DDRACO_EIGEN_PATH=/usr/include/eigen3 \
|
||||
-DDRACO_FILESYSTEM_PATH=/usr/include \
|
||||
-DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
make install/strip DESTDIR=$PKG
|
||||
cd ..
|
||||
|
||||
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
|
||||
|
||||
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
|
||||
cp -a AUTHORS CONTRIBUTING.md README.md LICENSE $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
|
10
libraries/libdraco/libdraco.info
Normal file
10
libraries/libdraco/libdraco.info
Normal file
|
@ -0,0 +1,10 @@
|
|||
PRGNAM="libdraco"
|
||||
VERSION="1.5.6"
|
||||
HOMEPAGE="https://google.github.io/draco/"
|
||||
DOWNLOAD="https://github.com/google/draco/archive/1.5.6/draco-1.5.6.tar.gz"
|
||||
MD5SUM="dbe3a9e286ee5b79016470349d78b2a3"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES="ghc_filesystem tinygltf"
|
||||
MAINTAINER="Giancarlo Dessi"
|
||||
EMAIL="slack@giand.it"
|
19
libraries/libdraco/slack-desc
Normal file
19
libraries/libdraco/slack-desc
Normal file
|
@ -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------------------------------------------------------|
|
||||
libdraco: libdraco (3D graphics data compression)
|
||||
libdraco:
|
||||
libdraco: Draco is a library for compressing and decompressing 3D geometric
|
||||
libdraco: meshes and point clouds. It is intended to improve the storage
|
||||
libdraco: and transmission of 3D graphics.
|
||||
libdraco:
|
||||
libdraco: Home page: https://google.github.io/draco/
|
||||
libdraco:
|
||||
libdraco:
|
||||
libdraco:
|
||||
libdraco:
|
Loading…
Reference in a new issue