diff --git a/components/library/cpp-httplib/Makefile b/components/library/cpp-httplib/Makefile new file mode 100644 index 00000000000..14f44cffcfe --- /dev/null +++ b/components/library/cpp-httplib/Makefile @@ -0,0 +1,61 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2024 Friedrich Kink +# + +BUILD_STYLE= cmake +include ../../../make-rules/shared-macros.mk + +COMPONENT_NAME= cpp-httplib +COMPONENT_VERSION= 0.18.3 +COMPONENT_SUMMARY= A C++ header-only HTTP/HTTPS server and client library +COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) +COMPONENT_ARCHIVE= v$(COMPONENT_VERSION).tar.gz +COMPONENT_ARCHIVE_HASH= sha256:a0567bcd6c3fe5cef1b329b96245119047f876b49e06cc129a36a7a8dffe173e +COMPONENT_ARCHIVE_URL= https://github.com/yhirose/$(COMPONENT_NAME)/archive/refs/tags/$(COMPONENT_ARCHIVE) +COMPONENT_PROJECT_URL= https://github.com/yhirose/$(COMPONENT_NAME) +COMPONENT_FMRI= library/$(COMPONENT_NAME) +COMPONENT_CLASSIFICATION=System/Libraries +COMPONENT_LICENSE= MIT +COMPONENT_LICENSE_FILE= LICENSE + +include $(WS_MAKE_RULES)/common.mk + +LDFLAGS += -lsocket + +CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Release +CMAKE_OPTIONS += -DBUILD_SHARED_LIBS=ON +CMAKE_OPTIONS += -DHTTPLIB_REQUIRE_OPENSSL=ON +CMAKE_OPTIONS += -DHTTPLIB_REQUIRE_ZLIB=ON +CMAKE_OPTIONS += -DHTTPLIB_REQUIRE_BROTLI=ON +CMAKE_OPTIONS += -DHTTPLIB_COMPILE=ON +CMAKE_OPTIONS += -DHTTPLIB_TEST=ON + +# Do not change the order of these regexp transforms. +COMPONENT_TEST_TRANSFORMS += \ + '-e "/Test /d" ' \ + '-e "/ Start/d" ' \ + '-e "/^Output/d" ' \ + '-e "/^Errors/d" ' \ + '-e "/^Use /d" ' + +# manually added packages +REQUIRED_PACKAGES += developer/googletest + +# Auto-generated dependencies +REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG) +REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG) +REQUIRED_PACKAGES += $(OPENSSL_PKG) +REQUIRED_PACKAGES += library/brotli +REQUIRED_PACKAGES += library/zlib +REQUIRED_PACKAGES += system/library diff --git a/components/library/cpp-httplib/cpp-httplib.p5m b/components/library/cpp-httplib/cpp-httplib.p5m new file mode 100644 index 00000000000..f9d88f0dfb2 --- /dev/null +++ b/components/library/cpp-httplib/cpp-httplib.p5m @@ -0,0 +1,37 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2024 Friedrich Kink +# + +set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) +set name=pkg.human-version value=$(HUMAN_VERSION) +set name=pkg.summary value="$(COMPONENT_SUMMARY)" +set name=info.classification value="$(COMPONENT_CLASSIFICATION)" +set name=info.upstream-url value=$(COMPONENT_PROJECT_URL) +set name=info.source-url value=$(COMPONENT_ARCHIVE_URL) +set name=org.opensolaris.consolidation value=$(CONSOLIDATION) + +license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)' + +file path=usr/include/httplib.h +file path=usr/lib/$(MACH64)/cmake/httplib/FindBrotli.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibConfig.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibConfigVersion.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibTargets-release.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibTargets.cmake +link path=usr/lib/$(MACH64)/libcpp-httplib.so target=libcpp-httplib.so.0.18 +file path=usr/lib/$(MACH64)/libcpp-httplib.so.$(HUMAN_VERSION) +link path=usr/lib/$(MACH64)/libcpp-httplib.so.0.18 \ + target=libcpp-httplib.so.$(HUMAN_VERSION) +file path=usr/share/doc/httplib/README.md +file path=usr/share/licenses/httplib/LICENSE diff --git a/components/library/cpp-httplib/manifests/sample-manifest.p5m b/components/library/cpp-httplib/manifests/sample-manifest.p5m new file mode 100644 index 00000000000..ffd59ecc829 --- /dev/null +++ b/components/library/cpp-httplib/manifests/sample-manifest.p5m @@ -0,0 +1,37 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2024 +# + +set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) +set name=pkg.human-version value=$(HUMAN_VERSION) +set name=pkg.summary value="$(COMPONENT_SUMMARY)" +set name=info.classification value="$(COMPONENT_CLASSIFICATION)" +set name=info.upstream-url value=$(COMPONENT_PROJECT_URL) +set name=info.source-url value=$(COMPONENT_ARCHIVE_URL) +set name=org.opensolaris.consolidation value=$(CONSOLIDATION) + +license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)' + +file path=usr/include/httplib.h +file path=usr/lib/$(MACH64)/cmake/httplib/FindBrotli.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibConfig.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibConfigVersion.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibTargets-release.cmake +file path=usr/lib/$(MACH64)/cmake/httplib/httplibTargets.cmake +link path=usr/lib/$(MACH64)/libcpp-httplib.so target=libcpp-httplib.so.0.18 +file path=usr/lib/$(MACH64)/libcpp-httplib.so.$(HUMAN_VERSION) +link path=usr/lib/$(MACH64)/libcpp-httplib.so.0.18 \ + target=libcpp-httplib.so.$(HUMAN_VERSION) +file path=usr/share/doc/httplib/README.md +file path=usr/share/licenses/httplib/LICENSE diff --git a/components/library/cpp-httplib/patches/namespace.patch b/components/library/cpp-httplib/patches/namespace.patch new file mode 100644 index 00000000000..5c41b93f511 --- /dev/null +++ b/components/library/cpp-httplib/patches/namespace.patch @@ -0,0 +1,11 @@ +--- cpp-httplib-0.18.3/test/test.cc 2024-12-03 12:33:00.000000000 +0100 ++++ cpp-httplib-0.18.3/test/test.cc.new 2024-12-08 15:42:59.644483507 +0100 +@@ -2995,7 +2995,7 @@ + t_.join(); + } + +- map persons_; ++ std::map persons_; + #ifdef CPPHTTPLIB_OPENSSL_SUPPORT + SSLClient cli_; + SSLServer svr_; diff --git a/components/library/cpp-httplib/pkg5 b/components/library/cpp-httplib/pkg5 new file mode 100644 index 00000000000..59378c6b8a9 --- /dev/null +++ b/components/library/cpp-httplib/pkg5 @@ -0,0 +1,15 @@ +{ + "dependencies": [ + "developer/googletest", + "library/brotli", + "library/security/openssl-3", + "library/zlib", + "system/library", + "system/library/g++-13-runtime", + "system/library/gcc-13-runtime" + ], + "fmris": [ + "library/cpp-httplib" + ], + "name": "cpp-httplib" +}