diff options
Diffstat (limited to 'source/x/vulkan-sdk/vulkan-sdk.SlackBuild')
-rwxr-xr-x | source/x/vulkan-sdk/vulkan-sdk.SlackBuild | 165 |
1 files changed, 115 insertions, 50 deletions
diff --git a/source/x/vulkan-sdk/vulkan-sdk.SlackBuild b/source/x/vulkan-sdk/vulkan-sdk.SlackBuild index 1c9afe4d1..bf88a291e 100755 --- a/source/x/vulkan-sdk/vulkan-sdk.SlackBuild +++ b/source/x/vulkan-sdk/vulkan-sdk.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for vulkan-sdk -# Copyright 2016, 2017, 2018, 2020, 2021 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2016, 2017, 2018, 2020, 2021, 2022 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -27,7 +27,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=vulkan-sdk # The ./VERSION file is created by ./fetch-sources.sh: VERSION=${VERSION:-$(cat VERSION)} -BUILD=${BUILD:-3} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: MARCH=$( uname -m ) @@ -71,9 +71,9 @@ fi TMP=${TMP:-/tmp} PKG=$TMP/package-vulkan-sdk -GLSLANG_VERSION=$(echo glslang-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) -SPIRV_HEADERS_VERSION=$(echo SPIRV-Headers-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) -SPIRV_TOOLS_VERSION=$(echo SPIRV-Tools-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +GLSLANG_VERSION=$(echo glslang-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +SPIRV_HEADERS_VERSION=$(echo SPIRV-Headers-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +SPIRV_TOOLS_VERSION=$(echo SPIRV-Tools-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) VULKAN_HEADERS_VERSION=$(echo Vulkan-Headers-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) VULKAN_LOADER_VERSION=$(echo Vulkan-Loader-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) VULKAN_VALIDATIONLAYERS_VERSION=$(echo Vulkan-ValidationLayers-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) @@ -82,10 +82,11 @@ VULKAN_EXTENSIONLAYER_VERSION=$(echo Vulkan-ExtensionLayer-sdk-*.tar.?z | rev | VULKAN_TOOLS_VERSION=$(echo Vulkan-Tools-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) VULKANTOOLS_VERSION=$(echo VulkanTools-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) SHADERC_VERSION=$(echo shaderc-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) -SPIRV_CROSS_VERSION=$(echo SPIRV-Cross-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +SPIRV_CROSS_VERSION=$(echo SPIRV-Cross-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) GFXRECONSTRUCT_VERSION=$(echo gfxreconstruct-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) DXC_VERSION=$(echo DirectXShaderCompiler-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) -SPIRV_REFLECT_VERSION=$(echo SPIRV-Reflect-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +SPIRV_REFLECT_VERSION=$(echo SPIRV-Reflect-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +VULKAN_PROFILES_VERSION=$(echo Vulkan-Profiles-sdk-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) # upstream builder order: # - SPIRV-Headers @@ -101,6 +102,7 @@ SPIRV_REFLECT_VERSION=$(echo SPIRV-Reflect-*.tar.?z | rev | cut -f 3- -d . | cut # - gfxreconstruct # - DirectXShaderCompiler # - SPIRV-Reflect +# - Vulkan-Profiles rm -rf $PKG mkdir -p $TMP $PKG @@ -108,7 +110,7 @@ mkdir -p $TMP $PKG cd $TMP # Clear existing tmp sources: rm -rf SPIRV-Headers-$SPIRV_HEADERS_VERSION \ - glslang-${GLSLANG_VERSION} \ + glslang-sdk-${GLSLANG_VERSION} \ Vulkan-Headers-sdk-$VULKAN_HEADERS_VERSION \ Vulkan-Loader-sdk-$VULKAN_LOADER_VERSION \ Vulkan-ValidationLayers-sdk-$VULKAN_VALIDATIONLAYERS_VERSION \ @@ -116,10 +118,11 @@ rm -rf SPIRV-Headers-$SPIRV_HEADERS_VERSION \ Vulkan-Tools-sdk-$VULKAN_TOOLS_VERSION \ VulkanTools-sdk-$VULKANTOOLS_VERSION \ shaderc-$SHADERC_VERSION \ - SPIRV-Cross-$SPIRV_CROSS_VERSION \ + SPIRV-Cross-sdk-$SPIRV_CROSS_VERSION \ gfxreconstruct-sdk-$GFXRECONSTRUCT_VERSION \ DirectXShaderCompiler-$DXC_VERSION \ - SPIRV-Reflect-$SPIRV_REFLECT_VERSION + SPIRV-Reflect-sdk-$SPIRV_REFLECT_VERSION \ + Vulkan-Profiles-sdk-$VULKAN_PROFILES_VERSION tar xvf $CWD/SPIRV-Headers-$SPIRV_HEADERS_VERSION.tar.?z || exit 1 cd SPIRV-Headers-$SPIRV_HEADERS_VERSION @@ -144,15 +147,15 @@ make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 cd $TMP -tar xvf $CWD/glslang-${GLSLANG_VERSION}.tar.?z || exit 1 -cd glslang-$GLSLANG_VERSION/External -tar xvf $CWD/SPIRV-Tools-$SPIRV_TOOLS_VERSION.tar.?z || exit 1 -mv SPIRV-Tools-$SPIRV_TOOLS_VERSION spirv-tools +tar xvf $CWD/glslang-sdk-${GLSLANG_VERSION}.tar.?z || exit 1 +cd glslang-sdk-$GLSLANG_VERSION/External +tar xvf $CWD/SPIRV-Tools-sdk-$SPIRV_TOOLS_VERSION.tar.?z || exit 1 +mv SPIRV-Tools-sdk-$SPIRV_TOOLS_VERSION spirv-tools cd spirv-tools/external tar xvf $CWD/SPIRV-Headers-$SPIRV_HEADERS_VERSION.tar.?z || exit 1 mv SPIRV-Headers-$SPIRV_HEADERS_VERSION spirv-headers -cd $TMP/glslang-${GLSLANG_VERSION} +cd $TMP/glslang-sdk-${GLSLANG_VERSION} chown -R root:root . find . \ @@ -162,9 +165,9 @@ find . \ -exec chmod 644 {} \+ # Fix LIBDIRSUFFIX -for i in $(find . -name CMakeLists.txt); do - sed -i "s|DESTINATION lib|DESTINATION \${CMAKE_INSTALL_LIBDIR}|" "$i" -done +# for i in $(find . -name CMakeLists.txt); do +# sed -i "s|DESTINATION lib|DESTINATION \${CMAKE_INSTALL_LIBDIR}|" "$i" +# done mkdir -p build cd build @@ -228,11 +231,31 @@ cd build make install DESTDIR=$PKG || exit 1 cd $TMP -tar xvf $CWD/Vulkan-ValidationLayers-sdk-$VULKAN_VALIDATIONLAYERS_VERSION.tar.?z || exit 1 -cd $TMP/Vulkan-ValidationLayers-sdk-$VULKAN_VALIDATIONLAYERS_VERSION/external tar xvf $CWD/robin-hood-hashing-$ROBIN_HOOD_VERSION.tar.?z || exit 1 -mv robin-hood-hashing-$ROBIN_HOOD_VERSION robin-hood-hashing -cd .. +cd robin-hood-hashing-$ROBIN_HOOD_VERSION + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DRH_STANDALONE_PROJECT="OFF" \ + .. + + make $NUMJOBS || make || exit 1 + make install DESTDIR=$TMP/robin-hood-hashing-$ROBIN_HOOD_VERSION/build/install || exit 1 + +cd $TMP +tar xvf $CWD/Vulkan-ValidationLayers-sdk-$VULKAN_VALIDATIONLAYERS_VERSION.tar.?z || exit 1 +cd Vulkan-ValidationLayers-sdk-$VULKAN_VALIDATIONLAYERS_VERSION chown -R root:root . find . \ @@ -259,7 +282,7 @@ cd build -DVULKAN_HEADERS_INSTALL_DIR=$PKG/usr \ -DSPIRV_HEADERS_INSTALL_DIR=$PKG/usr \ -DBUILD_LAYER_SUPPORT_FILES=On \ - -DROBIN_HOOD_HASHING_INSTALL_DIR="$TMP/Vulkan-ValidationLayers-sdk-$VULKAN_VALIDATIONLAYERS_VERSION/external/robin-hood-hashing" \ + -DROBIN_HOOD_HASHING_INSTALL_DIR="$TMP/robin-hood-hashing-$ROBIN_HOOD_VERSION/build/install/usr" \ .. make $NUMJOBS || make || exit 1 @@ -401,8 +424,8 @@ cd build -DCMAKE_INSTALL_SYSCONFDIR=/usr/share \ -DSHADERC_SKIP_TESTS=On \ -DSHADERC_SKIP_EXAMPLES=On \ - -DSHADERC_SPIRV_TOOLS_DIR=$TMP/glslang-$GLSLANG_VERSION/External/spirv-tools \ - -DSHADERC_GLSLANG_DIR=$TMP/glslang-$GLSLANG_VERSION \ + -DSHADERC_SPIRV_TOOLS_DIR=$TMP/glslang-sdk-$GLSLANG_VERSION/External/spirv-tools \ + -DSHADERC_GLSLANG_DIR=$TMP/glslang-sdk-$GLSLANG_VERSION \ -DSKIP_GLSLANG_INSTALL=On \ -DSKIP_SPIRV_TOOLS_INSTALL=On \ -DBUILD_SHARED_LIBS=On \ @@ -415,8 +438,8 @@ cd build make install DESTDIR=$PKG || exit 1 cd $TMP -tar xvf $CWD/SPIRV-Cross-$SPIRV_CROSS_VERSION.tar.?z || exit 1 -cd $TMP/SPIRV-Cross-$SPIRV_CROSS_VERSION +tar xvf $CWD/SPIRV-Cross-sdk-$SPIRV_CROSS_VERSION.tar.?z || exit 1 +cd $TMP/SPIRV-Cross-sdk-$SPIRV_CROSS_VERSION chown -R root:root . find . \ @@ -425,9 +448,8 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ -# Set git hash -SPIRV_CROSS_SHORT_HASH=$(echo $SPIRV_CROSS_VERSION | cut -c 1-8) -sed -i "s|version \"unknown\"|version \"$SPIRV_CROSS_SHORT_HASH\"|" \ +# Set version +sed -i "s|version \"unknown\"|version \"$SPIRV_CROSS_VERSION\"|" \ CMakeLists.txt mkdir -p build @@ -450,9 +472,6 @@ cd $TMP tar xvf $CWD/gfxreconstruct-sdk-$GFXRECONSTRUCT_VERSION.tar.?z || exit 1 cd $TMP/gfxreconstruct-sdk-$GFXRECONSTRUCT_VERSION -# patch to build with glibc-2.34: -zcat $CWD/gfxreconstruct-sdk.glibc-2.35.diff.gz | patch -p1 --verbose || exit 1 - chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ @@ -464,7 +483,7 @@ mkdir -p build cd build cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-error=stringop-overflow" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-error=stringop-overflow" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ .. @@ -483,7 +502,7 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ -mkdir -p build +mkdir -p build/docs cd build cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ @@ -492,7 +511,9 @@ cd build -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_INCLUDEDIR=include/dxc \ -DLLVM_LIBDIR_SUFFIX=$LIBDIRSUFFIX \ - $(cat ../utils/cmake-predefined-config-params) \ + -DLLVM_BUILD_TOOLS="OFF" \ + -C"../cmake/caches/PredefinedParams.cmake" \ + -DHLSL_INCLUDE_TESTS="OFF" \ .. make $NUMJOBS || make || exit 1 @@ -507,9 +528,12 @@ cd build cp -P lib$LIBDIRSUFFIX/libdxcompiler.so* $PKG/usr/lib$LIBDIRSUFFIX/ cp -r ../include/dxc $PKG/usr/include/ + # Remove CMakeLists.txt files in /usr/include + find $PKG/usr/include/dxc -name "CMakeLists.txt" | xargs rm -f + cd $TMP -tar xvf $CWD/SPIRV-Reflect-$SPIRV_REFLECT_VERSION.tar.?z || exit 1 -cd $TMP/SPIRV-Reflect-$SPIRV_REFLECT_VERSION +tar xvf $CWD/SPIRV-Reflect-sdk-$SPIRV_REFLECT_VERSION.tar.?z || exit 1 +cd $TMP/SPIRV-Reflect-sdk-$SPIRV_REFLECT_VERSION chown -R root:root . find . \ @@ -537,6 +561,41 @@ cd build $PKG/usr/include/SPIRV-Reflect/include/spirv/unified1/ cd $TMP +tar xvf $CWD/Vulkan-Profiles-sdk-$VULKAN_PROFILES_VERSION.tar.?z || exit 1 +cd $TMP/Vulkan-Profiles-sdk-$VULKAN_PROFILES_VERSION + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +# Fix finding vulkan-loader on Slackware64 +sed -i "s|PATH_SUFFIXES lib|PATH_SUFFIXES lib$LIBDIRSUFFIX|" \ + CMakeLists.txt + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS -Wno-error=deprecated-declarations" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-error=deprecated-declarations" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_SYSCONFDIR=/usr/share \ + -DVULKAN_LOADER_INSTALL_DIR=$PKG/usr \ + -DVULKAN_HEADERS_INSTALL_DIR=$PKG/usr \ + -DVULKAN_HEADERS_SOURCE_DIR="$TMP/Vulkan-Headers-sdk-$VULKAN_HEADERS_VERSION" \ + -DVULKAN_VALIDATIONLAYERS_SOURCE_DIR="$TMP/Vulkan-ValidationLayers-sdk-$VULKAN_VALIDATIONLAYERS_VERSION" \ + -DPROFILES_BUILD_TESTS="OFF" \ + -DREGENERATE_JSONCPP="OFF" \ + -DREGENERATE_PROFILES="OFF" \ + .. + + make $NUMJOBS || make || exit 1 + make install DESTDIR=$PKG || exit 1 + +cd $TMP 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 @@ -556,19 +615,20 @@ mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/SPIRV-Cross mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/gfxreconstruct mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/DirectXShaderCompiler mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/SPIRV-Reflect +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/Vulkan-Profiles cp -a \ SPIRV-Headers-$SPIRV_HEADERS_VERSION/LICENSE* \ SPIRV-Headers-$SPIRV_HEADERS_VERSION/README* \ $PKG/usr/doc/$PKGNAM-$VERSION/SPIRV-Headers cp -a \ - glslang-$GLSLANG_VERSION/External/spirv-tools/LICENSE* \ - glslang-$GLSLANG_VERSION/External/spirv-tools/README* \ - glslang-$GLSLANG_VERSION/External/spirv-tools/*.md \ + glslang-sdk-$GLSLANG_VERSION/External/spirv-tools/LICENSE* \ + glslang-sdk-$GLSLANG_VERSION/External/spirv-tools/README* \ + glslang-sdk-$GLSLANG_VERSION/External/spirv-tools/*.md \ $PKG/usr/doc/$PKGNAM-$VERSION/SPIRV-Tools cp -a \ - glslang-$GLSLANG_VERSION/LICENSE* \ - glslang-$GLSLANG_VERSION/README* \ - glslang-$GLSLANG_VERSION/*.md \ + glslang-sdk-$GLSLANG_VERSION/LICENSE* \ + glslang-sdk-$GLSLANG_VERSION/README* \ + glslang-sdk-$GLSLANG_VERSION/*.md \ $PKG/usr/doc/$PKGNAM-$VERSION/glslang cp -a \ Vulkan-Headers-sdk-$VULKAN_HEADERS_VERSION/LICENSE* \ @@ -608,9 +668,9 @@ cp -a \ shaderc-$SHADERC_VERSION/*.md \ $PKG/usr/doc/$PKGNAM-$VERSION/shaderc cp -a \ - SPIRV-Cross-$SPIRV_CROSS_VERSION/LICENSE* \ - SPIRV-Cross-$SPIRV_CROSS_VERSION/README* \ - SPIRV-Cross-$SPIRV_CROSS_VERSION/*.md \ + SPIRV-Cross-sdk-$SPIRV_CROSS_VERSION/LICENSE* \ + SPIRV-Cross-sdk-$SPIRV_CROSS_VERSION/README* \ + SPIRV-Cross-sdk-$SPIRV_CROSS_VERSION/*.md \ $PKG/usr/doc/$PKGNAM-$VERSION/SPIRV-Cross cp -a \ gfxreconstruct-sdk-$GFXRECONSTRUCT_VERSION/LICENSE* \ @@ -624,10 +684,15 @@ cp -a \ DirectXShaderCompiler-$DXC_VERSION/*.md \ $PKG/usr/doc/$PKGNAM-$VERSION/DirectXShaderCompiler cp -a \ - SPIRV-Reflect-$SPIRV_REFLECT_VERSION/LICENSE* \ - SPIRV-Reflect-$SPIRV_REFLECT_VERSION/README* \ - SPIRV-Reflect-$SPIRV_REFLECT_VERSION/*.md \ + SPIRV-Reflect-sdk-$SPIRV_REFLECT_VERSION/LICENSE* \ + SPIRV-Reflect-sdk-$SPIRV_REFLECT_VERSION/README* \ + SPIRV-Reflect-sdk-$SPIRV_REFLECT_VERSION/*.md \ $PKG/usr/doc/$PKGNAM-$VERSION/SPIRV-Reflect +cp -a \ + Vulkan-Profiles-sdk-$VULKAN_PROFILES_VERSION/LICENSE* \ + Vulkan-Profiles-sdk-$VULKAN_PROFILES_VERSION/README* \ + Vulkan-Profiles-sdk-$VULKAN_PROFILES_VERSION/*.md \ + $PKG/usr/doc/$PKGNAM-$VERSION/Vulkan-Profiles mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc |