Add reference SPIR-V generator, required to build Vulkan validation
layers.

Signed-off-by: Philipp Zabel <p.za...@pengutronix.de>
---
Changes since v2:
 - fixed targetinstall to use install_copy where appropriate
 - added missing host-glslang
 - updated to 2020-01-05-g4fc7a33910fb, marked as known good in
   vulkan-validationlayers v1.1.131.
---
 rules/glslang.in        | 25 +++++++++++++
 rules/glslang.make      | 77 +++++++++++++++++++++++++++++++++++++++++
 rules/host-glslang.in   |  6 ++++
 rules/host-glslang.make | 34 ++++++++++++++++++
 4 files changed, 142 insertions(+)
 create mode 100644 rules/glslang.in
 create mode 100644 rules/glslang.make
 create mode 100644 rules/host-glslang.in
 create mode 100644 rules/host-glslang.make

diff --git a/rules/glslang.in b/rules/glslang.in
new file mode 100644
index 000000000000..c2a660243d31
--- /dev/null
+++ b/rules/glslang.in
@@ -0,0 +1,25 @@
+## SECTION=multimedia_libs
+
+menuconfig GLSLANG
+       tristate
+       prompt "glslang"
+       select HOST_CMAKE
+       help
+         Khronos-reference SPIR-V generator
+
+if GLSLANG
+
+config GLSLANG_TOOLS
+       bool
+       prompt "install tools"
+       help
+         Install glslangValidator and spirv-remap tools.
+
+config GLSLANG_LIBS
+       bool
+       prompt "install shared libraries"
+       help
+         Install libglslang, libHLSL, libSPIRV, and libSPVRemapper shared
+         libraries.
+
+endif
diff --git a/rules/glslang.make b/rules/glslang.make
new file mode 100644
index 000000000000..5d27fcb1c10e
--- /dev/null
+++ b/rules/glslang.make
@@ -0,0 +1,77 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Philipp Zabel <p.za...@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_GLSLANG) += glslang
+
+#
+# Paths and names
+#
+GLSLANG_VERSION                := 2020-01-05-g4fc7a33910fb
+GLSLANG_MD5            := 1a2f2327ba83c393525a6d20844a6169
+GLSLANG                        := glslang-$(GLSLANG_VERSION)
+GLSLANG_SUFFIX         := tar.gz
+GLSLANG_URL            := 
https://github.com/KhronosGroup/glslang/archive/$(GLSLANG_VERSION).$(GLSLANG_SUFFIX)
+GLSLANG_SOURCE         := $(SRCDIR)/$(GLSLANG).$(GLSLANG_SUFFIX)
+GLSLANG_DIR            := $(BUILDDIR)/$(GLSLANG)
+GLSLANG_LICENSE                := BSD-3-clause AND MIT AND Apple-MIT-License
+GLSLANG_LICENSE_FILES := 
file://LICENSE.txt;md5=918e668376010a04448a312fb37ae69b
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+GLSLANG_CONF_TOOL      := cmake
+GLSLANG_CONF_OPT       := \
+       $(CROSS_CMAKE_USR) \
+       -DCMAKE_BUILD_TYPE=Release \
+       -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+       -DBUILD_SHARED_LIBS=ON \
+       -DBUILD_EXTERNAL=OFF \
+       -DSKIP_GLSLANG_INSTALL=OFF \
+       -DENABLE_SPVREMAPPER=ON \
+       -DENABLE_GLSLANG_BINARIES=ON \
+       -DENABLE_GLSLANG_WEB=OFF \
+       -DENABLE_GLSLANG_WEB_DEVEL=OFF \
+       -DENABLE_OPT=ON \
+       -DENABLE_PCH=ON \
+       -DENABLE_CTEST=OFF
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/glslang.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init, glslang)
+       @$(call install_fixup, glslang, PRIORITY, optional)
+       @$(call install_fixup, glslang, SECTION, base)
+       @$(call install_fixup, glslang, AUTHOR, "Philipp Zabel 
<p.za...@pengutronix.de>")
+       @$(call install_fixup, glslang, DESCRIPTION, Khronos-reference SPIR-V 
generator)
+
+ifdef GLSLANG_TOOLS
+       @$(call install_copy, glslang, 0, 0, 0755, -, /usr/bin/glslangValidator)
+       @$(call install_copy, glslang, 0, 0, 0755, -, /usr/bin/spirv-remap)
+endif
+
+ifdef GLSLANG_LIBS
+       @$(call install_lib, glslang, 0, 0, 0644, 
libglslang-default-resource-limits)
+       @$(call install_lib, glslang, 0, 0, 0644, libglslang)
+       @$(call install_lib, glslang, 0, 0, 0644, libHLSL)
+       @$(call install_lib, glslang, 0, 0, 0644, libSPIRV)
+       @$(call install_lib, glslang, 0, 0, 0644, libSPVRemapper)
+endif
+
+       @$(call install_finish, glslang)
+
+       @$(call touch)
+
+# vim: syntax=make
diff --git a/rules/host-glslang.in b/rules/host-glslang.in
new file mode 100644
index 000000000000..69f255572c2b
--- /dev/null
+++ b/rules/host-glslang.in
@@ -0,0 +1,6 @@
+## SECTION=hosttools_noprompt
+
+config HOST_GLSLANG
+       tristate
+       default y if ALLYES
+       select HOST_CMAKE
diff --git a/rules/host-glslang.make b/rules/host-glslang.make
new file mode 100644
index 000000000000..08a0e7590604
--- /dev/null
+++ b/rules/host-glslang.make
@@ -0,0 +1,34 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Philipp Zabel <p.za...@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_GLSLANG) += host-glslang
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+HOST_GLSLANG_CONF_TOOL := cmake
+HOST_GLSLANG_CONF_OPT  := \
+       $(HOST_CMAKE_OPT) \
+       -DCMAKE_BUILD_TYPE=Release \
+       -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+       -DBUILD_SHARED_LIBS=OFF \
+       -DBUILD_EXTERNAL=OFF \
+       -DSKIP_GLSLANG_INSTALL=OFF \
+       -DENABLE_SPVREMAPPER=ON \
+       -DENABLE_GLSLANG_BINARIES=ON \
+       -DENABLE_GLSLANG_WEB=OFF \
+       -DENABLE_GLSLANG_WEB_DEVEL=OFF \
+       -DENABLE_OPT=ON \
+       -DENABLE_PCH=ON \
+       -DENABLE_CTEST=OFF
+
+# vim: syntax=make
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to