2019-08-30 19:05:50 +10:00
|
|
|
# Description: OpenGL and OpenGL ES shader front end and validator
|
2019-04-28 13:03:36 +10:00
|
|
|
# URL: https://www.khronos.org/opengles/sdk/tools/Reference-Compiler
|
|
|
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
2022-05-22 20:14:42 +10:00
|
|
|
# Depends on: spirv-tools
|
2021-04-05 15:21:56 +10:00
|
|
|
# Optional: ninja
|
2019-04-28 13:03:36 +10:00
|
|
|
|
|
|
|
name=glslang
|
2022-06-05 21:40:37 +10:00
|
|
|
version=11.10.0
|
2020-06-07 17:59:41 +10:00
|
|
|
release=1
|
2021-04-05 15:21:56 +10:00
|
|
|
source=(https://github.com/KhronosGroup/glslang/archive/$version/$name-$version.tar.gz
|
2022-05-22 20:14:42 +10:00
|
|
|
glslang-default-resource-limits_staticlib.patch
|
|
|
|
0001-pkg-config-compatibility.patch)
|
2019-04-28 13:03:36 +10:00
|
|
|
|
|
|
|
build() {
|
2022-05-22 20:14:42 +10:00
|
|
|
patch -d $name-$version -p1 -i $SRC/glslang-default-resource-limits_staticlib.patch
|
2019-11-23 18:47:50 +11:00
|
|
|
|
2022-05-22 20:14:42 +10:00
|
|
|
# https://patch-diff.githubusercontent.com/raw/KhronosGroup/glslang/pull/1722.patch#/0001-pkg-config-compatibility.patch
|
|
|
|
patch -d $name-$version -p1 -i $SRC/0001-pkg-config-compatibility.patch
|
|
|
|
|
|
|
|
find $SRC -name '*.h' -or -name '*.cpp' -or -name '*.hpp'| xargs chmod a-x
|
2021-04-24 14:05:13 +10:00
|
|
|
|
2021-04-05 15:21:56 +10:00
|
|
|
prt-get isinst ninja && PKGMK_GLSLANG+=' -G Ninja'
|
2021-04-24 14:05:13 +10:00
|
|
|
prt-get isinst ccache && \
|
|
|
|
PKGMK_GLSLANG+=' -D USE_CCACHE=ON' && \
|
|
|
|
PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
|
2019-04-28 13:03:36 +10:00
|
|
|
|
2019-08-31 00:44:47 +10:00
|
|
|
local config="
|
2021-04-05 15:21:56 +10:00
|
|
|
-S $name-$version
|
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr
|
|
|
|
-D CMAKE_INSTALL_LIBDIR=lib
|
|
|
|
-D CMAKE_BUILD_TYPE=Release
|
2022-05-22 20:14:42 +10:00
|
|
|
-D CMAKE_SKIP_RPATH=yes
|
2021-04-05 15:21:56 +10:00
|
|
|
-Wno-dev"
|
|
|
|
|
|
|
|
cmake -B build-static $config $PKGMK_GLSLANG \
|
|
|
|
-D BUILD_SHARED_LIBS=OFF \
|
2022-05-22 20:14:42 +10:00
|
|
|
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -ffat-lto-objects"
|
2020-06-07 17:59:41 +10:00
|
|
|
cmake --build build-static
|
2021-04-05 15:21:56 +10:00
|
|
|
|
2020-10-24 01:56:02 +11:00
|
|
|
# https://github.com/KhronosGroup/glslang/issues/1484 -Wl,--no-undefined
|
2021-04-05 15:21:56 +10:00
|
|
|
cmake -B build-shared $config $PKGMK_GLSLANG \
|
|
|
|
-D BUILD_SHARED_LIBS=ON \
|
2022-05-22 20:14:42 +10:00
|
|
|
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -ffat-lto-objects" \
|
2021-04-05 15:21:56 +10:00
|
|
|
-D CMAKE_SHARED_LINKER_FLAGS='-Wl,--no-undefined'
|
2020-06-07 17:59:41 +10:00
|
|
|
cmake --build build-shared
|
2021-04-05 15:21:56 +10:00
|
|
|
|
2020-06-07 17:59:41 +10:00
|
|
|
DESTDIR=$PKG cmake --build build-static --target install
|
|
|
|
DESTDIR=$PKG cmake --build build-shared --target install
|
2019-04-28 13:03:36 +10:00
|
|
|
}
|