From 828b79cb9e62eb57f618e089e9d5a98c24870ac3 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 9 May 2026 12:54:42 +0100 Subject: [PATCH] gcem: new package GCE-Math (Generalized Constant Expression Math) is a templated C++ library enabling compile-time computation of mathematical functions. It is a header-only library, so this package is BUILDONLY:=1; the headers and CMake config files land in staging_dir for consumers to pick up via find_package(GCEM). Needed as a build dependency for fluidsynth >= 2.5, whose upstream build expects gcem at configure time and (absent a system copy) falls back to a CMake-time download from GitHub - which breaks in offline / restricted-network build environments such as the OpenWrt CI. Pinned to commit 012ae73c (2024-04-28), the revision referenced by fluidsynth 2.5.x's bundled FindGCEM.cmake / git submodule. CMAKE_POLICY_VERSION_MINIMUM=3.5 is set because upstream's CMakeLists.txt declares cmake_minimum_required(VERSION 3.1), which trips current CMake's deprecated-policy guard. Link: https://github.com/kthohr/gcem Signed-off-by: Daniel Golle --- libs/gcem/Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 libs/gcem/Makefile diff --git a/libs/gcem/Makefile b/libs/gcem/Makefile new file mode 100644 index 0000000000..d143cf6896 --- /dev/null +++ b/libs/gcem/Makefile @@ -0,0 +1,55 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gcem +PKG_RELEASE:=1 + +# gcem upstream tags only sporadically; pin to the commit that fluidsynth +# 2.5.x's FindGCEM.cmake / submodule references. Update in lockstep with +# the consumer's expected revision. +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/kthohr/gcem.git +PKG_SOURCE_DATE:=2024-04-28 +PKG_SOURCE_VERSION:=012ae73c6d0a2cb09ffe86475f5c6fba3926e200 +PKG_MIRROR_HASH:=70df878c9d85281c6816c231cbb320a9eccb4fb73ef32612cf8948b17716fc49 + +PKG_MAINTAINER:=Daniel Golle +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +# upstream CMakeLists.txt declares cmake_minimum_required(VERSION 3.1), +# which trips modern CMake's deprecated-policy guard. +CMAKE_OPTIONS += \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + +define Package/gcem + SECTION:=libs + CATEGORY:=Libraries + TITLE:=GCE-Math header-only constexpr math library + URL:=https://github.com/kthohr/gcem + BUILDONLY:=1 +endef + +define Package/gcem/description +GCE-Math (Generalized Constant Expression Math) is a templated C++ +library enabling compile-time computation of mathematical functions. +Header-only; consumed at build time only. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/gcem.hpp $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/gcem_incl $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/cmake/gcem + $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/gcem/* $(1)/usr/lib/cmake/gcem/ +endef + +define Package/gcem/install + : +endef + +$(eval $(call BuildPackage,gcem))