From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1jwNi7-0001yR-LQ for ptxdist@pengutronix.de; Fri, 17 Jul 2020 12:35:23 +0200 From: Philipp Zabel Date: Fri, 17 Jul 2020 12:35:23 +0200 Message-Id: <20200717103523.12388-1-p.zabel@pengutronix.de> MIME-Version: 1.0 Subject: [ptxdist] [PATCH v2] shaderc: new package List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Signed-off-by: Philipp Zabel --- Changes since v1: - fixed SHADERC_ENABLE_SPVC option - fixed libshaderc_shared targetinstall --- rules/host-shaderc.in | 7 +++ rules/host-shaderc.make | 65 +++++++++++++++++++++++ rules/shaderc.in | 41 ++++++++++++++ rules/shaderc.make | 115 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+) create mode 100644 rules/host-shaderc.in create mode 100644 rules/host-shaderc.make create mode 100644 rules/shaderc.in create mode 100644 rules/shaderc.make diff --git a/rules/host-shaderc.in b/rules/host-shaderc.in new file mode 100644 index 000000000000..2619ae5da8ce --- /dev/null +++ b/rules/host-shaderc.in @@ -0,0 +1,7 @@ +## SECTION=hosttools_noprompt + +config HOST_SHADERC + tristate + default y if ALLYES + select HOST_CMAKE + select HOST_SYSTEM_PYTHON3 diff --git a/rules/host-shaderc.make b/rules/host-shaderc.make new file mode 100644 index 000000000000..0ee834d1bab3 --- /dev/null +++ b/rules/host-shaderc.make @@ -0,0 +1,65 @@ +# -*-makefile-*- +# +# Copyright (C) 2020 by Philipp Zabel +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +HOST_PACKAGES-$(PTXCONF_HOST_SHADERC) += host-shaderc + +HOST_SHADERC_GLSLANG_MD5 := $(SHADERC_GLSLANG_MD5) +HOST_SHADERC_GLSLANG_URL := $(SHADERC_GLSLANG_URL) +HOST_SHADERC_GLSLANG_SOURCE := $(SHADERC_GLSLANG_SOURCE) +HOST_SHADERC_GLSLANG_DIR := $(HOST_SHADERC_DIR)/third_party/glslang + +HOST_SHADERC_SPIRV_TOOLS_MD5 = $(SHADERC_SPIRV_TOOLS_MD5) +HOST_SHADERC_SPIRV_TOOLS_URL = $(SHADERC_SPIRV_TOOLS_URL) +HOST_SHADERC_SPIRV_TOOLS_SOURCE = $(SHADERC_SPIRV_TOOLS_SOURCE) +HOST_SHADERC_SPIRV_TOOLS_DIR = $(HOST_SHADERC_DIR)/third_party/spirv-tools + +HOST_SHADERC_SPIRV_HEADERS_MD5 = $(SHADERC_SPIRV_HEADERS_MD5) +HOST_SHADERC_SPIRV_HEADERS_URL = $(SHADERC_SPIRV_HEADERS_URL) +HOST_SHADERC_SPIRV_HEADERS_SOURCE = $(SHADERC_SPIRV_HEADERS_SOURCE) +HOST_SHADERC_SPIRV_HEADERS_DIR = $(HOST_SHADERC_DIR)/third_party/spirv-tools/external/spirv-headers + +HOST_SHADERC_SOURCES = \ + $(HOST_SHADERC_SOURCE) \ + $(HOST_SHADERC_GLSLANG_SOURCE) \ + $(HOST_SHADERC_SPIRV_TOOLS_SOURCE) \ + $(HOST_SHADERC_SPIRV_HEADERS_SOURCE) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/host-shaderc.extract: + @$(call targetinfo) + @$(call clean, $(HOST_SHADERC_DIR)) + @$(call extract, HOST_SHADERC) + @$(call extract, HOST_SHADERC_GLSLANG) + @$(call extract, HOST_SHADERC_SPIRV_TOOLS) + @$(call extract, HOST_SHADERC_SPIRV_HEADERS) + @$(call patchin, HOST_SHADERC) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +HOST_SHADERC_CONF_TOOL := cmake +HOST_SHADERC_CONF_OPT := \ + $(HOST_CMAKE_OPT) \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DSHADERC_ENABLE_SPVC=OFF \ + -DSHADERC_SKIP_INSTALL=OFF \ + -DSHADERC_SKIP_TESTS=ON \ + -DSHADERC_SPVC_ENABLE_DIRECT_LOGGING=OFF \ + -DSHADERC_SPVC_DISABLE_CONTEXT_LOGGING=OFF \ + -DSHADERC_ENABLE_WERROR_COMPILE=ON + +# vim: syntax=make diff --git a/rules/shaderc.in b/rules/shaderc.in new file mode 100644 index 000000000000..ccb3bc538032 --- /dev/null +++ b/rules/shaderc.in @@ -0,0 +1,41 @@ +## SECTION=multimedia_libs + +menuconfig SHADERC + tristate + prompt "shaderc" + select HOST_CMAKE + select HOST_SYSTEM_PYTHON3 + help + A collection of tools, libraries and tests for shader compilation. + +if SHADERC + +config SHADERC_GLSLC + bool + prompt "install glslc" + help + Install glslc tool. + +config SHADERC_SPVC + bool + # requires SPIRV-Cross + depends on BROKEN + prompt "install spvc" + help + Install spvc tool. + +config SHADERC_LIBSHADERC + bool + prompt "install libshaderc" + help + Install libshaderc shared library. + +config SHADERC_LIBSHADERC_SPVC + bool + # requires SPIRV-Cross + depends on BROKEN + prompt "install libshaderc_spvc" + help + Install libshaderc_spvc shared library. + +endif diff --git a/rules/shaderc.make b/rules/shaderc.make new file mode 100644 index 000000000000..863df8c9824f --- /dev/null +++ b/rules/shaderc.make @@ -0,0 +1,115 @@ +# -*-makefile-*- +# +# Copyright (C) 2020 by Philipp Zabel +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_SHADERC) += shaderc + +# +# Paths and names +# +SHADERC_VERSION := v2020.1 +SHADERC_MD5 := d12155e2e15a3717a9e71468b844a9ce +SHADERC := shaderc-$(SHADERC_VERSION) +SHADERC_SUFFIX := tar.gz +SHADERC_URL := \ + https://github.com/google/shaderc/archive/$(SHADERC_VERSION).$(SHADERC_SUFFIX) +SHADERC_SOURCE := $(SRCDIR)/$(SHADERC).$(SHADERC_SUFFIX) +SHADERC_DIR := $(BUILDDIR)/$(SHADERC) +SHADERC_LICENSE := Apache-2.0 AND BSD-3-clause AND MIT AND Apple-MIT-License +SHADERC_LICENSE_FILES := \ + file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ + file://third_party/glslang/LICENSE.txt;md5=918e668376010a04448a312fb37ae69b \ + file://third_party/spirv-tools/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 + +SHADERC_GLSLANG_MD5 = $(GLSLANG_MD5) +SHADERC_GLSLANG_URL = $(GLSLANG_URL) +SHADERC_GLSLANG_SOURCE = $(GLSLANG_SOURCE) +SHADERC_GLSLANG_DIR = $(SHADERC_DIR)/third_party/glslang + +SHADERC_SPIRV_TOOLS_MD5 = $(SPIRV_TOOLS_MD5) +SHADERC_SPIRV_TOOLS_URL = $(SPIRV_TOOLS_URL) +SHADERC_SPIRV_TOOLS_SOURCE = $(SPIRV_TOOLS_SOURCE) +SHADERC_SPIRV_TOOLS_DIR = $(SHADERC_DIR)/third_party/spirv-tools + +SHADERC_SPIRV_HEADERS_MD5 = $(SPIRV_HEADERS_MD5) +SHADERC_SPIRV_HEADERS_URL = $(SPIRV_HEADERS_URL) +SHADERC_SPIRV_HEADERS_SOURCE = $(SPIRV_HEADERS_SOURCE) +SHADERC_SPIRV_HEADERS_DIR = $(SHADERC_DIR)/third_party/spirv-tools/external/spirv-headers + +SHADERC_SOURCES = \ + $(SHADERC_SOURCE) \ + $(SHADERC_GLSLANG_SOURCE) \ + $(SHADERC_SPIRV_TOOLS_SOURCE) \ + $(SHADERC_SPIRV_HEADERS_SOURCE) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/shaderc.extract: + @$(call targetinfo) + @$(call clean, $(SHADERC_DIR)) + @$(call extract, SHADERC) + @$(call extract, SHADERC_GLSLANG) + @$(call extract, SHADERC_SPIRV_TOOLS) + @$(call extract, SHADERC_SPIRV_HEADERS) + @$(call patchin, SHADERC) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +SHADERC_CONF_TOOL := cmake +SHADERC_CONF_OPT := \ + $(CROSS_CMAKE_USR) \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DSHADERC_ENABLE_SPVC=$(call ptx/onoff, PTXCONF_SHADERC_SPVC) \ + -DSHADERC_SKIP_INSTALL=OFF \ + -DSHADERC_SKIP_TESTS=ON \ + -DSHADERC_SPVC_ENABLE_DIRECT_LOGGING=OFF \ + -DSHADERC_SPVC_DISABLE_CONTEXT_LOGGING=OFF \ + -DSHADERC_ENABLE_WERROR_COMPILE=ON + +# -DSHADERC_ENABLE_SHARED_CRT=OFF + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/shaderc.targetinstall: + @$(call targetinfo) + + @$(call install_init, shaderc) + @$(call install_fixup, shaderc, PRIORITY, optional) + @$(call install_fixup, shaderc, SECTION, base) + @$(call install_fixup, shaderc, AUTHOR, "Philipp Zabel ") + @$(call install_fixup, shaderc, DESCRIPTION, A collection of tools, libraries and tests for shader compilation) + +ifdef PTXCONF_SHADERC_GLSLC + @$(call install_copy, shaderc, 0, 0, 0755, -, /usr/bin/glslc) +endif +ifdef PTXCONF_SHADERC_SPVC + @$(call install_copy, shaderc, 0, 0, 0755, -, /usr/bin/spvc) +endif + +ifdef PTXCONF_SHADERC_LIBSHADERC + @$(call install_lib, shaderc, 0, 0, 0644, libshaderc_shared) +endif +ifdef PTXCONF_SHADERC_LIBSHADERC_SPVC + @$(call install_lib, shaderc, 0, 0, 0644, libshaderc_spvc) +endif + + @$(call install_finish, shaderc) + + @$(call touch) + +# vim: syntax=make -- 2.20.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de