diff options
author | Hunter Sezen <orbea@riseup.net> | 2019-05-04 02:42:51 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2019-05-04 02:42:51 +0700 |
commit | 8cfb813ee0ec94505dfa9eb6237c90d6db13a747 (patch) | |
tree | 4132e13e943bd24abd1aac3893130934badccfd3 /graphics | |
parent | 7f5bccb21f7b2139d8197d65d771747f7df34a31 (diff) |
graphics/vulkan-sdk: Added (Vulkan).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/vulkan-sdk/README | 9 | ||||
-rw-r--r-- | graphics/vulkan-sdk/slack-desc | 19 | ||||
-rw-r--r-- | graphics/vulkan-sdk/vulkan-sdk.SlackBuild | 197 | ||||
-rw-r--r-- | graphics/vulkan-sdk/vulkan-sdk.info | 22 |
4 files changed, 247 insertions, 0 deletions
diff --git a/graphics/vulkan-sdk/README b/graphics/vulkan-sdk/README new file mode 100644 index 0000000000000..3226fd36df7db --- /dev/null +++ b/graphics/vulkan-sdk/README @@ -0,0 +1,9 @@ +Vulkan supports multiple GPUs and multiple global contexts (VkInstance). +The ICD loader is necessary to support multiple GPUs and the VkInstance +level Vulkan commands. Additionally, the loader manages inserting Vulkan +layer libraries, including validation layers between the application and +the ICD. + +This will not provide a vulkan driver which must be acquired elsewhere. + +This SlackBuild will compile vulkan-sdk from source. diff --git a/graphics/vulkan-sdk/slack-desc b/graphics/vulkan-sdk/slack-desc new file mode 100644 index 0000000000000..1d3eec170b0be --- /dev/null +++ b/graphics/vulkan-sdk/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------------------------------------------------------| +vulkan-sdk: vulkan-sdk (Vulkan ICD Loader and Validation Layers) +vulkan-sdk: +vulkan-sdk: Vulkan supports multiple GPUs and multiple global contexts +vulkan-sdk: (VkInstance). The ICD loader is necessary to support multiple GPUs +vulkan-sdk: and the VkInstance level Vulkan commands. Additionally, the loader +vulkan-sdk: manages inserting Vulkan layer libraries, including validation layers +vulkan-sdk: between the application and the ICD. +vulkan-sdk: +vulkan-sdk: Homepage: https://www.khronos.org/vulkan/ +vulkan-sdk: +vulkan-sdk: diff --git a/graphics/vulkan-sdk/vulkan-sdk.SlackBuild b/graphics/vulkan-sdk/vulkan-sdk.SlackBuild new file mode 100644 index 0000000000000..092bb5eb5ea5d --- /dev/null +++ b/graphics/vulkan-sdk/vulkan-sdk.SlackBuild @@ -0,0 +1,197 @@ +#!/bin/bash + +# Slackware build script for vulkan-sdk + +# Copyright 2016, 2017 Heinz Wiesinger, Amsterdam, The Netherlands +# Copyright 2016, 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2019 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=vulkan-sdk +VERSION=${VERSION:-1.1.106.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 +SRC=$TMP/$PRGNAM-$VERSION +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 + +GLSLANG_VERSION=${GLSLANG_VERSION:-7.11.3188} +SPIRV_HEADERS_VERSION=${SPIRV_HEADERS_VERSION:-1.3.7} +SPIRV_TOOLS_VERSION=${SPIRV_TOOLS_VERSION:-2019.2} + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +mkdir $PRGNAM-$VERSION +cd $PRGNAM-$VERSION + +( + tar xvf $CWD/glslang-$GLSLANG_VERSION.tar.gz + cd glslang-$GLSLANG_VERSION/External + tar xvf $CWD/SPIRV-Tools-$SPIRV_TOOLS_VERSION.tar.gz + mv SPIRV-Tools-$SPIRV_TOOLS_VERSION spirv-tools + cd spirv-tools/external + tar xvf $CWD/SPIRV-Headers-$SPIRV_HEADERS_VERSION.tar.gz + mv SPIRV-Headers-$SPIRV_HEADERS_VERSION spirv-headers +) + +tar xvf $CWD/Vulkan-Headers-sdk-$VERSION.tar.gz +tar xvf $CWD/Vulkan-Loader-sdk-$VERSION.tar.gz +tar xvf $CWD/Vulkan-ValidationLayers-sdk-$VERSION.tar.gz +tar xvf $CWD/Vulkan-Tools-sdk-$VERSION.tar.gz + +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 {} \; + +cd $SRC/glslang-$GLSLANG_VERSION +printf %s\\n '' "Building glslang-$GLSLANG_VERSION" '' + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \ + -DCMAKE_SKIP_RPATH=TRUE \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install DESTDIR=$PKG +cd $SRC/Vulkan-Headers-sdk-$VERSION +printf %s\\n '' "Building Vulkan-Headers-sdk-$VERSION" '' + +mkdir -p build +cd build + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr\ + -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install DESTDIR=$PKG +cd $SRC/Vulkan-Loader-sdk-$VERSION +printf %s\\n '' "Building Vulkan-Loader-sdk-$VERSION" '' + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \ + -DCMAKE_SKIP_RPATH=TRUE \ + -DBUILD_WSI_WAYLAND_SUPPORT=OFF \ + -DVULKAN_HEADERS_INSTALL_DIR=$PKG/usr \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install DESTDIR=$PKG +cd $SRC/Vulkan-ValidationLayers-sdk-$VERSION +printf %s\\n '' "Building Vulkan-ValidationLayers-sdk-$VERSION" '' + +# Disable hardcoded errors +sed -i '/-Werror/d' CMakeLists.txt + +# Workaround build error in 14.2 +sed -i '/#include <math.h>/i#include <cmath>\n' \ + layers/parameter_validation_utils.cpp + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \ + -DCMAKE_INSTALL_DATADIR=share \ + -DCMAKE_SKIP_RPATH=TRUE \ + -DBUILD_TESTS=OFF \ + -DBUILD_WSI_XLIB_SUPPORT=ON \ + -DBUILD_WSI_XCB_SUPPORT=ON \ + -DBUILD_WSI_WAYLAND_SUPPORT=OFF \ + -DGLSLANG_INSTALL_DIR=$PKG/usr \ + -DVULKAN_HEADERS_INSTALL_DIR=$PKG/usr \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install DESTDIR=$PKG +cd $SRC/Vulkan-Tools-sdk-$VERSION +printf %s\\n '' "Building Vulkan-Tools-sdk-$VERSION" '' + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \ + -DCMAKE_SKIP_RPATH=TRUE \ + -DBUILD_WSI_WAYLAND_SUPPORT=OFF \ + -DVULKAN_HEADERS_INSTALL_DIR=$PKG/usr \ + -DGLSLANG_INSTALL_DIR=$PKG/usr \ + -DVULKAN_LOADER_INSTALL_DIR=$PKG/usr \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install DESTDIR=$PKG +cd $SRC + +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 Vulkan-Loader-sdk-$VERSION/*.txt \ + Vulkan-Loader-sdk-$VERSION/loader/LoaderAndLayerInterface.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/graphics/vulkan-sdk/vulkan-sdk.info b/graphics/vulkan-sdk/vulkan-sdk.info new file mode 100644 index 0000000000000..f2903eddf8ec7 --- /dev/null +++ b/graphics/vulkan-sdk/vulkan-sdk.info @@ -0,0 +1,22 @@ +PRGNAM="vulkan-sdk" +VERSION="1.1.106.0" +HOMEPAGE="https://www.khronos.org/vulkan/" +DOWNLOAD="https://github.com/KhronosGroup/SPIRV-Headers/archive/1.3.7/SPIRV-Headers-1.3.7.tar.gz \ + https://github.com/KhronosGroup/SPIRV-Tools/archive/v2019.2/SPIRV-Tools-2019.2.tar.gz \ + https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.106.0/Vulkan-Headers-sdk-1.1.106.0.tar.gz \ + https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-1.1.106.0/Vulkan-Loader-sdk-1.1.106.0.tar.gz \ + https://github.com/KhronosGroup/Vulkan-Tools/archive/sdk-1.1.106.0/Vulkan-Tools-sdk-1.1.106.0.tar.gz \ + https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/sdk-1.1.106.0/Vulkan-ValidationLayers-sdk-1.1.106.0.tar.gz \ + https://github.com/KhronosGroup/glslang/archive/7.11.3188/glslang-7.11.3188.tar.gz" +MD5SUM="e85eb41d05f56d98b649805cc82a0751 \ + 3090d1fc1208fa661f340bc93f19217d \ + 574ab2131807852627ab81bcb8e8f016 \ + d27d2bf30b47c446404948da8fe6f557 \ + a164295dccda325afc9d915fc18cb222 \ + e6142028de77cdb00678f99cbd9935a0 \ + 10d4a3999d2a960aa453d3c180a32358" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="python3" +MAINTAINER="Hunter Sezen" +EMAIL="orbea@riseup.net" |