From 7f9851ec77412ae3c7f0f416fe5962d5787bf235 Mon Sep 17 00:00:00 2001 From: Martin Bångens Date: Sat, 2 Jul 2022 09:32:18 +0700 Subject: libraries/function2: Added (drop-in replacement to std::function). Signed-off-by: Willy Sudiarto Raharjo --- libraries/function2/README | 20 +++++++ libraries/function2/function2.SlackBuild | 89 ++++++++++++++++++++++++++++++++ libraries/function2/function2.info | 10 ++++ libraries/function2/slack-desc | 19 +++++++ 4 files changed, 138 insertions(+) create mode 100644 libraries/function2/README create mode 100644 libraries/function2/function2.SlackBuild create mode 100644 libraries/function2/function2.info create mode 100644 libraries/function2/slack-desc (limited to 'libraries') diff --git a/libraries/function2/README b/libraries/function2/README new file mode 100644 index 0000000000..c2155162db --- /dev/null +++ b/libraries/function2/README @@ -0,0 +1,20 @@ +function2 improved and configurable drop-in replacement header to +std::function that supports move only types, multiple overloads +and more + +benefits and improvements over std::function: + + * const, volatile, reference and noexcept correct (qualifiers are part + of the operator() signature) + * convertible to and from std::function as well as other callable + types + * adaptable through fu2::function_base (internal capacity, + copyable and exception guarantees) + * overloadable with an arbitrary count of signatures + (fu2::function) + * full allocator support in contrast to std::function, which doesn't + provide support anymore + * covered by many unit tests and continuous integration services + (GCC, Clang and MSVC) + * header only, just copy and include function.hpp in your project + * permissively licensed under the boost license diff --git a/libraries/function2/function2.SlackBuild b/libraries/function2/function2.SlackBuild new file mode 100644 index 0000000000..543e88f691 --- /dev/null +++ b/libraries/function2/function2.SlackBuild @@ -0,0 +1,89 @@ +#!/bin/bash + +# Slackware build script for function2 + +# Copyright 2022 Martin Bångens Sweden +# 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=function2 +VERSION=${VERSION:-4.2.0} +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} + +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 {} \; + +sed -i 's|"${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/src/gtest-all.cc"|"/usr/src/googletest/src/gtest-all.cc"|g' test/CMakeLists.txt +sed -i 's|"${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/src/gtest_main.cc")|"/usr/src/googletest/src/gtest_main.cc")|g' test/CMakeLists.txt +sed -i 's|"${CMAKE_CURRENT_LIST_DIR}/googletest/googletest"|"/usr/src/googletest"|g' test/CMakeLists.txt +sed -i 's|"${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include")|"/usr/include/gtest")|g' test/CMakeLists.txt + +mkdir -p build +cd build + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=None .. + make + make -k test + make install DESTDIR=$PKG +cd .. + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +mv $PKG/usr/LICENSE.txt $PKG/usr/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 diff --git a/libraries/function2/function2.info b/libraries/function2/function2.info new file mode 100644 index 0000000000..70d744f604 --- /dev/null +++ b/libraries/function2/function2.info @@ -0,0 +1,10 @@ +PRGNAM="function2" +VERSION="4.2.0" +HOMEPAGE="https://github.com/Naios/function2" +DOWNLOAD="https://github.com/Naios/function2/archive/4.2.0/function2-4.2.0.tar.gz" +MD5SUM="04b1d6adfd8757ac0c4b1fb31c98c2ed" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="gtest" +MAINTAINER="Martin Bångens" +EMAIL="marbangens@gmail.com" diff --git a/libraries/function2/slack-desc b/libraries/function2/slack-desc new file mode 100644 index 0000000000..10a01a9739 --- /dev/null +++ b/libraries/function2/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------------------------------------------------------| +function2: function2 (Improved drop-in replacement to std::function) +function2: +function2: Improved and configurable drop-in replacement header to std::function +function2: that supports move only types, multiple overloads and more. I'ts one +function2: headers only no compilation is required. +function2: +function2: +function2: +function2: +function2: +function2: -- cgit v1.2.3