* [Buildroot] [PATCH 1/1] package/cpp-httplib: new package
@ 2024-09-26 12:41 Aleksandr Makarov
2024-10-26 20:52 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Aleksandr Makarov @ 2024-09-26 12:41 UTC (permalink / raw)
To: buildroot; +Cc: Eric Le Bihan, Aleksandr Makarov
Signed-off-by: Aleksandr Makarov <aleksandr.o.makarov@gmail.com>
---
package/Config.in | 1 +
package/cpp-httplib/Config.in | 21 +++++++++++++
package/cpp-httplib/cpp-httplib.hash | 3 ++
package/cpp-httplib/cpp-httplib.mk | 44 ++++++++++++++++++++++++++++
4 files changed, 69 insertions(+)
create mode 100644 package/cpp-httplib/Config.in
create mode 100644 package/cpp-httplib/cpp-httplib.hash
create mode 100644 package/cpp-httplib/cpp-httplib.mk
diff --git a/package/Config.in b/package/Config.in
index c0f4d9ece5..27f464b112 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1987,6 +1987,7 @@ menu "Networking"
source "package/bluez5_utils-headers/Config.in"
source "package/c-ares/Config.in"
source "package/cni-plugins/Config.in"
+ source "package/cpp-httplib/Config.in"
source "package/cppzmq/Config.in"
source "package/curlpp/Config.in"
source "package/czmq/Config.in"
diff --git a/package/cpp-httplib/Config.in b/package/cpp-httplib/Config.in
new file mode 100644
index 0000000000..ee24adff81
--- /dev/null
+++ b/package/cpp-httplib/Config.in
@@ -0,0 +1,21 @@
+comment "cpp-httplib needs a toolchain w/ C++, wchar, threads"
+ depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_CPP_HTTPLIB
+ bool "cpp-httplib"
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_USE_WCHAR
+ help
+ A C++ header-only HTTP/HTTPS server and client library.
+
+ https://github.com/yhirose/cpp-httplib
+
+if BR2_PACKAGE_CPP_HTTPLIB
+config BR2_PACKAGE_CPP_HTTPLIB_COMPILE
+ bool "compile"
+ select BR2_PACKAGE_HOST_PYTHON3
+ help
+ Build as library
+
+endif # BR2_PACKAGE_CPP_HTTPLIB
diff --git a/package/cpp-httplib/cpp-httplib.hash b/package/cpp-httplib/cpp-httplib.hash
new file mode 100644
index 0000000000..45c2214105
--- /dev/null
+++ b/package/cpp-httplib/cpp-httplib.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 6ed5894bbbc4a34a0f4c5e962672d0003d2ea099bbadacc66f6dee2b213ff394 cpp-httplib-0.18.0.tar.gz
+sha256 4b45cbe16d7b71b89ae6127e26e0d90a029198ca5e958ad8e3d0b8bbed364d8b LICENSE
diff --git a/package/cpp-httplib/cpp-httplib.mk b/package/cpp-httplib/cpp-httplib.mk
new file mode 100644
index 0000000000..9b66114851
--- /dev/null
+++ b/package/cpp-httplib/cpp-httplib.mk
@@ -0,0 +1,44 @@
+################################################################################
+#
+# cpp-httplib
+#
+################################################################################
+
+CPP_HTTPLIB_VERSION = 0.18.0
+CPP_HTTPLIB_SITE = $(call github,yhirose,cpp-httplib,v$(CPP_HTTPLIB_VERSION))
+CPP_HTTPLIB_LICENSE = MIT
+CPP_HTTPLIB_LICENSE_FILES = LICENSE
+CPP_HTTPLIB_CONF_OPTS = \
+ -Dcpp-httplib_test=false
+
+
+ifeq ($(BR2_PACKAGE_CPP_HTTPLIB_COMPILE),y)
+CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_compile=true
+CPP_HTTPLIB_DEPENDENCIES += host-python3
+else
+CPP_HTTPLIB_INSTALL_STAGING = YES
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_openssl=enabled
+CPP_HTTPLIB_DEPENDENCIES += openssl
+else
+CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_openssl=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_zlib=enabled
+CPP_HTTPLIB_DEPENDENCIES += zlib
+else
+CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_zlib=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_BROTLI),y)
+CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_brotli=enabled
+CPP_HTTPLIB_DEPENDENCIES += brotli
+else
+CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_brotli=disabled
+endif
+
+$(eval $(meson-package))
+
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/cpp-httplib: new package
2024-09-26 12:41 [Buildroot] [PATCH 1/1] package/cpp-httplib: new package Aleksandr Makarov
@ 2024-10-26 20:52 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-10-26 20:52 UTC (permalink / raw)
To: Aleksandr Makarov; +Cc: buildroot, Eric Le Bihan
Hello Aleksandr,
On Thu, 26 Sep 2024 15:41:31 +0300
Aleksandr Makarov <aleksandr.o.makarov@gmail.com> wrote:
> Signed-off-by: Aleksandr Makarov <aleksandr.o.makarov@gmail.com>
Thanks, I have applied your patch after doing a few tweaks.
> ---
> package/Config.in | 1 +
> package/cpp-httplib/Config.in | 21 +++++++++++++
> package/cpp-httplib/cpp-httplib.hash | 3 ++
> package/cpp-httplib/cpp-httplib.mk | 44 ++++++++++++++++++++++++++++
> 4 files changed, 69 insertions(+)
An entry in the DEVELOPERS should be added, so I did that.
> diff --git a/package/cpp-httplib/Config.in b/package/cpp-httplib/Config.in
> new file mode 100644
> index 0000000000..ee24adff81
> --- /dev/null
> +++ b/package/cpp-httplib/Config.in
> @@ -0,0 +1,21 @@
> +comment "cpp-httplib needs a toolchain w/ C++, wchar, threads"
> + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
> +
> +config BR2_PACKAGE_CPP_HTTPLIB
> + bool "cpp-httplib"
> + depends on BR2_INSTALL_LIBSTDCPP
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_USE_WCHAR
> + help
> + A C++ header-only HTTP/HTTPS server and client library.
> +
> + https://github.com/yhirose/cpp-httplib
> +
> +if BR2_PACKAGE_CPP_HTTPLIB
> +config BR2_PACKAGE_CPP_HTTPLIB_COMPILE
> + bool "compile"
"compile" was a bit short, so I changed to:
+ bool "compile as a shared library"
> diff --git a/package/cpp-httplib/cpp-httplib.mk b/package/cpp-httplib/cpp-httplib.mk
> new file mode 100644
> index 0000000000..9b66114851
> --- /dev/null
> +++ b/package/cpp-httplib/cpp-httplib.mk
> @@ -0,0 +1,44 @@
> +################################################################################
> +#
> +# cpp-httplib
> +#
> +################################################################################
> +
> +CPP_HTTPLIB_VERSION = 0.18.0
> +CPP_HTTPLIB_SITE = $(call github,yhirose,cpp-httplib,v$(CPP_HTTPLIB_VERSION))
> +CPP_HTTPLIB_LICENSE = MIT
> +CPP_HTTPLIB_LICENSE_FILES = LICENSE
> +CPP_HTTPLIB_CONF_OPTS = \
> + -Dcpp-httplib_test=false
> +
> +
One two many lines.
> +ifeq ($(BR2_PACKAGE_CPP_HTTPLIB_COMPILE),y)
> +CPP_HTTPLIB_CONF_OPTS += -Dcpp-httplib_compile=true
> +CPP_HTTPLIB_DEPENDENCIES += host-python3
> +else
> +CPP_HTTPLIB_INSTALL_STAGING = YES
You tried to do the right thing, but this wasn't the correct thing. In
fact, what was needed is:
CPP_HTTPLIB_INSTALL_STAGING = YES
unconditionally.
And
CPP_HTTPLIB_INSTALL_TARGET = NO when BR2_PACKAGE_CPP_HTTPLIB_COMPILE is
disabled.
Indeed, when BR2_PACKAGE_CPP_HTTPLIB_COMPILE is disabled, it's a header
only library. The header is needed in staging but not in tgarget.
When BR2_PACKAGE_CPP_HTTPLIB_COMPILE is enabled, you have a shared
library, it's needed both in the target and staging.
> +$(eval $(meson-package))
> +
Final empty line not needed.
Once again: I fixed those issues when applying.
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-26 20:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26 12:41 [Buildroot] [PATCH 1/1] package/cpp-httplib: new package Aleksandr Makarov
2024-10-26 20:52 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox