opt/glslang/Pkgfile

50 lines
1.7 KiB
Plaintext
Raw Normal View History

2019-08-30 11:05:50 +02:00
# Description: OpenGL and OpenGL ES shader front end and validator
2019-04-28 05:03:36 +02:00
# URL: https://www.khronos.org/opengles/sdk/tools/Reference-Compiler
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: spirv-tools
2021-04-05 07:21:56 +02:00
# Optional: ninja
2019-04-28 05:03:36 +02:00
name=glslang
2022-06-05 13:40:37 +02:00
version=11.10.0
2020-06-07 09:59:41 +02:00
release=1
2021-04-05 07:21:56 +02:00
source=(https://github.com/KhronosGroup/glslang/archive/$version/$name-$version.tar.gz
glslang-default-resource-limits_staticlib.patch
0001-pkg-config-compatibility.patch)
2019-04-28 05:03:36 +02:00
build() {
patch -d $name-$version -p1 -i $SRC/glslang-default-resource-limits_staticlib.patch
2019-11-23 08:47:50 +01: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 06:05:13 +02:00
2021-04-05 07:21:56 +02:00
prt-get isinst ninja && PKGMK_GLSLANG+=' -G Ninja'
2021-04-24 06:05:13 +02: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 05:03:36 +02:00
local config="
2021-04-05 07:21:56 +02:00
-S $name-$version
-D CMAKE_INSTALL_PREFIX=/usr
-D CMAKE_INSTALL_LIBDIR=lib
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_SKIP_RPATH=yes
2021-04-05 07:21:56 +02:00
-Wno-dev"
cmake -B build-static $config $PKGMK_GLSLANG \
-D BUILD_SHARED_LIBS=OFF \
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -ffat-lto-objects"
2020-06-07 09:59:41 +02:00
cmake --build build-static
2021-04-05 07:21:56 +02:00
2020-10-23 16:56:02 +02:00
# https://github.com/KhronosGroup/glslang/issues/1484 -Wl,--no-undefined
2021-04-05 07:21:56 +02:00
cmake -B build-shared $config $PKGMK_GLSLANG \
-D BUILD_SHARED_LIBS=ON \
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -ffat-lto-objects" \
2021-04-05 07:21:56 +02:00
-D CMAKE_SHARED_LINKER_FLAGS='-Wl,--no-undefined'
2020-06-07 09:59:41 +02:00
cmake --build build-shared
2021-04-05 07:21:56 +02:00
2020-06-07 09:59:41 +02:00
DESTDIR=$PKG cmake --build build-static --target install
DESTDIR=$PKG cmake --build build-shared --target install
2019-04-28 05:03:36 +02:00
}