diff options
author | Leo <thinkabit.ukim@gmail.com> | 2020-02-27 09:41:18 -0300 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-02-27 12:52:52 -0300 |
commit | 2af25057f488b2210845463dd80b9d31388430a4 (patch) | |
tree | ec70db411e877f7233bf54822dd762d5bbdff308 /main/glslang | |
parent | 5d6ab56facbe13952a7ffc2efc00b1cfb358b660 (diff) | |
download | aports-2af25057f488b2210845463dd80b9d31388430a4.tar.bz2 aports-2af25057f488b2210845463dd80b9d31388430a4.tar.xz |
main/glslang: use git release with Vulkan 1.2 support
Diffstat (limited to 'main/glslang')
-rw-r--r-- | main/glslang/APKBUILD | 54 | ||||
-rw-r--r-- | main/glslang/pkgconfig.patch | 143 | ||||
-rw-r--r-- | main/glslang/static.patch | 10 |
3 files changed, 191 insertions, 16 deletions
diff --git a/main/glslang/APKBUILD b/main/glslang/APKBUILD index 187dd25aef..29023caa6a 100644 --- a/main/glslang/APKBUILD +++ b/main/glslang/APKBUILD @@ -2,36 +2,58 @@ # Maintainer: Leo <thinkabit.ukim@gmail.com> pkgname=glslang pkgver=8.13.3559 -pkgrel=3 +pkgrel=4 +_commit=07e1a0a67aee5b21561bd6b93d73c8d87e010d98 pkgdesc="Khronos reference front-end for GLSL, ESSL, and sample SPIR-V generator" options="!check" # Requires git checkout of gmock url="https://github.com/KhronosGroup/glslang" arch="all" license="BSD-3-Clause" depends_dev="$pkgname" -makedepends="cmake samurai python3 bison" +makedepends="cmake samurai python3 bison spirv-tools-dev" subpackages="$pkgname-static $pkgname-dev" -source="$pkgname-$pkgver.tar.gz::https://github.com/KhronosGroup/glslang/archive/$pkgver.tar.gz" +source="$pkgname-$_commit.tar.gz::https://github.com/KhronosGroup/glslang/archive/$_commit.tar.gz + pkgconfig.patch + static.patch + " +builddir="$srcdir/glslang-$_commit" build() { if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi - cmake \ - -GNinja \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=lib \ - -DBUILD_SHARED_LIBS=True \ - -DCMAKE_BUILD_TYPE=None \ - -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ - -DCMAKE_C_FLAGS="$CFLAGS" \ - -DBUILD_SHARED_LIBS=ON \ - ${CMAKE_CROSSOPTS} . - ninja + mkdir -p build-shared build-static + (cd build-shared + cmake \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DBUILD_SHARED_LIBS=ON \ + ${CMAKE_CROSSOPTS} .. + ninja + ) + (cd build-static + cmake \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DBUILD_SHARED_LIBS=OFF \ + ${CMAKE_CROSSOPTS} .. + ninja + ) } package() { - DESTDIR="$pkgdir" ninja install + DESTDIR="$pkgdir" ninja -C build-shared install + DESTDIR="$pkgdir" ninja -C build-static install } -sha512sums="d2f09888dd1b6edb4f324502627aeca0c78411f61ab50e672fa2a6d9ae46611849e1d13b9c6069b77f31092d843abcf3d74ed7cfc3c9144ced80e65876f4b781 glslang-8.13.3559.tar.gz" +sha512sums="7d5cdf232b8f8f05c2546d030d28529d6943dff478ae27b53de0e54719663a254c104f6d7af51444a908a65925edf75c93d5d8886340f33212fb21da15d885fb glslang-07e1a0a67aee5b21561bd6b93d73c8d87e010d98.tar.gz +9490ed637a8f4a032fb0e0d266843b4ffccedce5983de1f16f96348c7b8340d4d8791f3a6a247f53ef5ea256deecf674d8cf0030d77b7d7d396091aed5bbb404 pkgconfig.patch +842bd3bea38ccfb211c6f478ce0cb3f5f36de807e56d70dcfdcd606a52a230c9afa80d63d26e98900d33fd9fdb9228f1f61eeb9d02415bf355f28c505edce859 static.patch" diff --git a/main/glslang/pkgconfig.patch b/main/glslang/pkgconfig.patch new file mode 100644 index 0000000000..bd280475ef --- /dev/null +++ b/main/glslang/pkgconfig.patch @@ -0,0 +1,143 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a80cd5f..0fd15ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -87,6 +87,13 @@ endmacro(glslang_pch) + + project(glslang) + ++# using pkg-config to configure include paths and link libraries ++include(FindPkgConfig) ++pkg_check_modules(SPIRV_TOOLS REQUIRED SPIRV-Tools>=2019.2.1) ++if(BUILD_SHARED_LIBS) ++ pkg_check_modules(SPIRV_TOOLS_SHARED REQUIRED SPIRV-Tools-shared>=2019.2.1) ++endif(BUILD_SHARED_LIBS) ++ + if(ENABLE_CTEST) + include(CTest) + endif() +@@ -175,11 +182,7 @@ if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External) + add_subdirectory(External) + endif() + +-if(NOT TARGET SPIRV-Tools-opt) +- set(ENABLE_OPT OFF) +-endif() +- +-if(ENABLE_OPT) ++if(${SPIRV_TOOLS_FOUND} EQUAL 1) + message(STATUS "optimizer enabled") + add_definitions(-DENABLE_OPT=1) + else() +diff --git a/External/CMakeLists.txt b/External/CMakeLists.txt +index 6ff4f47..cfb48bd 100644 +--- a/External/CMakeLists.txt ++++ b/External/CMakeLists.txt +@@ -35,10 +35,3 @@ if(BUILD_TESTING) + endif() + endif() + +-if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt) +- if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools) +- set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests") +- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools) +- endif() +-endif() +- +diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt +index 439b991..494e21f 100755 +--- a/SPIRV/CMakeLists.txt ++++ b/SPIRV/CMakeLists.txt +@@ -40,6 +40,10 @@ target_include_directories(SPIRV PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + ++ ++set(SPIRV_NAME spirv) ++set(SPIRV_VERSION 1.5.1) ++ + if (ENABLE_SPVREMAPPER) + add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) + set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) +@@ -53,15 +57,21 @@ if(WIN32 AND BUILD_SHARED_LIBS) + endif() + endif() + ++target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS}) ++target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_CFLAGS_OTHER}) ++target_link_libraries(SPIRV ${SPIRV_TOOLS_LIBRARIES}) ++if(BUILD_SHARED_LIBS) ++ target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS}) ++ target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_CFLAGS_OTHER}) ++ target_link_libraries(SPIRV ${SPIRV_TOOLS_SHARED_LIBRARIES}) ++endif(BUILD_SHARED_LIBS) ++ + if(ENABLE_OPT) + target_include_directories(SPIRV + PRIVATE ${spirv-tools_SOURCE_DIR}/include + PRIVATE ${spirv-tools_SOURCE_DIR}/source + ) +- target_link_libraries(SPIRV glslang SPIRV-Tools-opt) +- target_include_directories(SPIRV PUBLIC +- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External> +- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>) ++ target_link_libraries(SPIRV glslang) + else() + target_link_libraries(SPIRV glslang) + endif(ENABLE_OPT) +diff --git a/SPIRV/SpvTools.cpp b/SPIRV/SpvTools.cpp +index 97bd4e7..098cb84 100644 +--- a/SPIRV/SpvTools.cpp ++++ b/SPIRV/SpvTools.cpp +@@ -43,8 +43,8 @@ + #include <iostream> + + #include "SpvTools.h" +-#include "spirv-tools/optimizer.hpp" +-#include "spirv-tools/libspirv.h" ++#include <spirv-tools/optimizer.hpp> ++#include <spirv-tools/libspirv.h> + + namespace glslang { + +diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt +index 2cf2899..c981c0a 100644 +--- a/StandAlone/CMakeLists.txt ++++ b/StandAlone/CMakeLists.txt +@@ -23,6 +23,14 @@ if(ENABLE_SPVREMAPPER) + set(LIBRARIES ${LIBRARIES} SPVRemapper) + endif() + ++if(BUILD_SHARED_LIBS) ++ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_SHARED_LIBRARIES}) ++ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS}) ++else() ++ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_LIBRARIES}) ++ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS}) ++endif(BUILD_SHARED_LIBS) ++ + if(WIN32) + set(LIBRARIES ${LIBRARIES} psapi) + elseif(UNIX) +@@ -32,9 +40,6 @@ elseif(UNIX) + endif(WIN32) + + target_link_libraries(glslangValidator ${LIBRARIES}) +-target_include_directories(glslangValidator PUBLIC +- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External> +- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>) + + if(ENABLE_SPVREMAPPER) + set(REMAPPER_SOURCES spirv-remap.cpp) +diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt +index a0259a3..dab067d 100644 +--- a/glslang/CMakeLists.txt ++++ b/glslang/CMakeLists.txt +@@ -80,6 +80,7 @@ set(HEADERS + MachineIndependent/preprocessor/PpContext.h + MachineIndependent/preprocessor/PpTokens.h) + ++set(VERSION 8.13.3559) + glslang_pch(SOURCES MachineIndependent/pch.cpp) + + add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) diff --git a/main/glslang/static.patch b/main/glslang/static.patch new file mode 100644 index 0000000000..085bd27352 --- /dev/null +++ b/main/glslang/static.patch @@ -0,0 +1,10 @@ +--- a/StandAlone/CMakeLists.txt ++++ b/StandAlone/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_library(glslang-default-resource-limits ++add_library(glslang-default-resource-limits STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp) + set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang) + set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON) + + |