diff options
author | Hunter Sezen <orbea@riseup.net> | 2020-11-07 01:11:53 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-11-07 14:02:28 +0700 |
commit | f9a1184d72b9c6dff4e398b56bee13a204a544d7 (patch) | |
tree | 54e06c223067c630e16b2546d2da445029732b15 /libraries | |
parent | e32acb210cfcdcb9bce50a3ff11601093b23899b (diff) |
libraries/libdispatch: Added (Grand Central Dispatch)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/libdispatch/README | 2 | ||||
-rw-r--r-- | libraries/libdispatch/cmake.patch | 32 | ||||
-rw-r--r-- | libraries/libdispatch/libdispatch.SlackBuild | 114 | ||||
-rw-r--r-- | libraries/libdispatch/libdispatch.info | 10 | ||||
-rw-r--r-- | libraries/libdispatch/slack-desc | 19 |
5 files changed, 177 insertions, 0 deletions
diff --git a/libraries/libdispatch/README b/libraries/libdispatch/README new file mode 100644 index 0000000000000..200d007986fb2 --- /dev/null +++ b/libraries/libdispatch/README @@ -0,0 +1,2 @@ +Grand Central Dispatch (GCD or libdispatch) provides comprehensive +support for concurrent code execution on multicore hardware. diff --git a/libraries/libdispatch/cmake.patch b/libraries/libdispatch/cmake.patch new file mode 100644 index 0000000000000..e14b03898ad5e --- /dev/null +++ b/libraries/libdispatch/cmake.patch @@ -0,0 +1,32 @@ +--- CMakeLists.txt.orig 2020-11-03 14:54:48.786455348 -0800 ++++ CMakeLists.txt 2020-11-03 15:00:16.067445503 -0800 +@@ -197,7 +197,7 @@ + check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY) + check_symbol_exists(program_invocation_name "errno.h" HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME) + if (HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME) +- add_compile_definitions($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:_GNU_SOURCE=1>) ++ add_definitions(-D_GNU_SOURCE=1) + endif() + check_symbol_exists(__printflike "bsd/sys/cdefs.h" HAVE_PRINTFLIKE) + +@@ -217,9 +217,9 @@ + endif() + + if(dtrace_EXECUTABLE) +- add_compile_definitions($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:DISPATCH_USE_DTRACE=1>) ++ add_definitions(-DDISPATCH_USE_DTRACE=1) + else() +- add_compile_definitions($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:DISPATCH_USE_DTRACE=0>) ++ add_definitions(-DDISPATCH_USE_DTRACE=0) + endif() + + find_program(leaks_EXECUTABLE leaks) +@@ -252,7 +252,7 @@ + + configure_file("${PROJECT_SOURCE_DIR}/cmake/config.h.in" + "${PROJECT_BINARY_DIR}/config/config_ac.h") +-add_compile_definitions($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:HAVE_CONFIG_H>) ++add_definitions(-DHAVE_CONFIG_H) + + + if(ENABLE_SWIFT) diff --git a/libraries/libdispatch/libdispatch.SlackBuild b/libraries/libdispatch/libdispatch.SlackBuild new file mode 100644 index 0000000000000..6fd02fff4259b --- /dev/null +++ b/libraries/libdispatch/libdispatch.SlackBuild @@ -0,0 +1,114 @@ +#!/bin/sh + +# Slackware build script for libdispatch + +# Copyright 2020 Hunter Sezen California, USA +# 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=libdispatch +VERSION=${VERSION:-5.3} +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 -eu + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf swift-corelibs-$PRGNAM-swift-$VERSION-RELEASE +tar xvf $CWD/swift-corelibs-$PRGNAM-swift-$VERSION-RELEASE.tar.gz +cd swift-corelibs-$PRGNAM-swift-$VERSION-RELEASE +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 {} \; + +# Disable -Werror. +sed -i 's/-Werror//' src/CMakeLists.txt +sed -i '/-Werror/d' cmake/modules/DispatchCompilerWarnings.cmake + +# Require an older cmake version. +sed -i 's/3.15.1/3.5.2/' CMakeLists.txt + +# cmake 3.5.2 does not have the add_compile_definitions command +patch -p0 < $CWD/cmake.patch + +# apple software really wants clang + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \ + -DCMAKE_INSTALL_MANDIR=man \ + -DCMAKE_SKIP_RPATH=TRUE \ + -DCMAKE_BUILD_TYPE=Release .. + 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 + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a CONTRIBUTING.md LICENSE 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/libdispatch/libdispatch.info b/libraries/libdispatch/libdispatch.info new file mode 100644 index 0000000000000..093ad12ad4ebc --- /dev/null +++ b/libraries/libdispatch/libdispatch.info @@ -0,0 +1,10 @@ +PRGNAM="libdispatch" +VERSION="5.3" +HOMEPAGE="https://apple.github.io/swift-corelibs-libdispatch/" +DOWNLOAD="https://github.com/apple/swift-corelibs-libdispatch/archive/swift-5.3-RELEASE/swift-corelibs-libdispatch-swift-5.3-RELEASE.tar.gz" +MD5SUM="6ab94f19f3b29fe1970fd8471109f184" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Hunter Sezen" +EMAIL="orbea@riseup.net" diff --git a/libraries/libdispatch/slack-desc b/libraries/libdispatch/slack-desc new file mode 100644 index 0000000000000..338d4380e29e9 --- /dev/null +++ b/libraries/libdispatch/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------------------------------------------------------| +libdispatch: libdispatch (Grand Central Dispatch) +libdispatch: +libdispatch: Grand Central Dispatch (GCD or libdispatch) provides comprehensive +libdispatch: support for concurrent code execution on multicore hardware. +libdispatch: +libdispatch: Homepage: https://apple.github.io/swift-corelibs-libdispatch/ +libdispatch: +libdispatch: +libdispatch: +libdispatch: +libdispatch: |