glslang: add package
authorDaniel Golle <daniel@makrotopia.org>
Mon, 25 Nov 2024 21:35:38 +0000 (22:35 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 5 Dec 2024 01:15:41 +0000 (01:15 +0000)
Add glslang package used by Mesa.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
libs/glslang/Makefile [new file with mode: 0644]

diff --git a/libs/glslang/Makefile b/libs/glslang/Makefile
new file mode 100644 (file)
index 0000000..f2b2c50
--- /dev/null
@@ -0,0 +1,52 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=glslang
+PKG_VERSION:=15.0.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/KhronosGroup/$(PKG_NAME)/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=c31c8c2e89af907507c0631273989526ee7d5cdf7df95ececd628fd7b811e064
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=BSD-3-Clause BSD-2-Clause MIT Apache GPL-3.0-or-later
+PKG_LICENSE_FILES:=LICENSE.txt
+
+CMAKE_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections lto
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/glslang
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GLSL/ESSL, HLSL and SPIR-V generator
+  URL:=https://github.com/KhronosGroup/glslang
+  DEPENDS:=+libstdcpp
+endef
+
+define Package/glslang/description
+Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
+endef
+
+CMAKE_OPTIONS += \
+       -DBUILD_SHARED_LIBS=ON \
+       -DBUILD_TESTING=OFF \
+       -DENABLE_OPT=0
+
+CMAKE_HOST_OPTIONS += \
+       -DBUILD_SHARED_LIBS=OFF \
+       -DBUILD_TESTING=OFF \
+       -DENABLE_OPT=0
+
+TARGET_CXXFLAGS += -fno-rtti
+
+define Package/glslang/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,glslang))
+$(eval $(call HostBuild))