Skip to contentSkip to conversation

package/oatpp:: new package

PATCH Superseded Alessandro Partesotti 3 participants 6 messages Jan 28, 2023 – Nov 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/oatpp:: new package

This package introduce oatpp in BR buildsystem. oatpp must be used as static library in $(STAGING_DIR)/usr/include/oatpp-$(OATPP_VERSION)/oatpp for user that want to build therir own application by linking oatpp in a buildroot build system.

---
 package/Config.in       |  3 +++
 package/oatpp/Config.in | 14 ++++++++++++++
 package/oatpp/oatpp.mk  | 16 ++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 package/oatpp/Config.in
 create mode 100644 package/oatpp/oatpp.mk
package/Config.in +3 -0
index 995dae2c57..481876a278 100644
@@ -1941,6 +1941,7 @@ menu "Networking"
 	source "package/nss-mdns/Config.in"
 	source "package/nss-myhostname/Config.in"
 	source "package/nss-pam-ldapd/Config.in"
+	source "package/oatpp/Config.in"
 	source "package/omniorb/Config.in"
 	source "package/open-isns/Config.in"
 	source "package/open62541/Config.in"
@@ -2702,4 +2703,6 @@ menu "Text editors and viewers"
 	source "package/vim/Config.in"
 endmenu
 
+
 endmenu
+
package/oatpp/Config.in new file +14 -0
new file mode 100644
index 0000000000..86eb4573a6
@@ -0,0 +1,14 @@
+comment "Oat++ needs a toolchain w/ C++, threads and Paranoid Unsafe Path compiler flag disabled"
+        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || BR2_COMPILER_PARANOID_UNSAFE_PATH
+
+config BR2_PACKAGE_OATPP
+	bool "Oat++"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_COMPILER_PARANOID_UNSAFE_PATH
+	help
+		Oat++ is an open-source C++ web framework for highly scalable and resource-efficient web applications.
+		It provides all the necessary components for production-grade development.
+		This package allows you to use oatpp to statically build this a project inside the staging directory.
+		See https://oatpp.io/docs/start
+
package/oatpp/oatpp.mk new file +16 -0
new file mode 100644
index 0000000000..7abdeb6de5
@@ -0,0 +1,16 @@
+################################################################################
+#
+# oatpp
+#
+################################################################################
+
+OATPP_VERSION= 1.3.0
+OATPP_SOURCE= $(OATPP_VERSION).tar.gz
+OATPP_SITE= https://github.com/oatpp/oatpp/archive/refs/tags
+#OATPP_SITE= git://github.com/oatpp/oatpp.git
+OATPP_INSTALL_STAGING= YES
+OATPP_INSTALL_TARGET= NO
+OATPP_MAKE=make
+
+$(eval $(cmake-package))
+
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Alessandro, All,

Thanks for this patc; please find my review and comments below.

On 2023-01-28 10:41 +0100, Alessandro Partesotti spake thusly:

Quoted 1 line

This package introduce oatpp in BR buildsystem. oatpp must be used as static library in $(STAGING_DIR)/usr/include/oatpp-$(OATPP_VERSION)/oatpp for user that want to build therir own application by linking oatpp in a buildroot build system.

Please, wrap your commit log to about 72 chars.

Why does it need to be a static library? Why does a shared library not work? I see tht upstream suggests that, so maybe just state so.

Quoted 5 lines
---
 package/Config.in       |  3 +++
 package/oatpp/Config.in | 14 ++++++++++++++
 package/oatpp/oatpp.mk  | 16 ++++++++++++++++

You are missing a hash file, which contains the hashes for the source archive and the license file(s). See below.

Quoted 13 lines
package/Config.in +1 -0
index 995dae2c57..481876a278 100644
@@ -1941,6 +1941,7 @@ menu "Networking"
 	source "package/nss-mdns/Config.in"
 	source "package/nss-myhostname/Config.in"
 	source "package/nss-pam-ldapd/Config.in"
+	source "package/oatpp/Config.in"
 	source "package/omniorb/Config.in"
 	source "package/open-isns/Config.in"
 	source "package/open62541/Config.in"

package/Config.in menu "Text editors and viewers" · line 2708

Quoted 6 lines
package/Config.in +2 -0
@@ -2702,4 +2703,6 @@ menu "Text editors and viewers"
 	source "package/vim/Config.in"
 endmenu
 
+
 endmenu
+

Two spurious empty lines added.

package/oatpp/Config.in line 2

Quoted 8 lines
package/oatpp/Config.in new file +2 -0
new file mode 100644
index 0000000000..86eb4573a6
@@ -0,0 +1,14 @@
+comment "Oat++ needs a toolchain w/ C++, threads and Paranoid Unsafe Path compiler flag disabled"
+        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || BR2_COMPILER_PARANOID_UNSAFE_PATH

If the paranoid unsafe paths check triggers, it means that the target build is using headers (or libraries) from the host, and that is definitely not correct, as those are not suitable to generate target code.

Instead, the package must be fixed.

Long-term, we may even make that check mandatory and not configurable, see:

    http://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

package/oatpp/Config.in line 13

Quoted 10 lines
package/oatpp/Config.in new file +10 -0
+config BR2_PACKAGE_OATPP
+	bool "Oat++"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_COMPILER_PARANOID_UNSAFE_PATH
+	help
+		Oat++ is an open-source C++ web framework for highly scalable and resource-efficient web applications.
+		It provides all the necessary components for production-grade development.
+		This package allows you to use oatpp to statically build this a project inside the staging directory.
+		See https://oatpp.io/docs/start

Help text should be indented with a TAB and two spaces, and wrapped at 72 chars; running "make check-package" will point to coding style issues.

package/oatpp/oatpp.mk line 7

Quoted 13 lines
package/oatpp/oatpp.mk new file +7 -0
new file mode 100644
index 0000000000..7abdeb6de5
@@ -0,0 +1,16 @@
+################################################################################
+#
+# oatpp
+#
+################################################################################
+
+OATPP_VERSION= 1.3.0

Spaces around the equal sign; "make check-package" points to it too.

package/oatpp/oatpp.mk line 10

Quoted 3 lines
package/oatpp/oatpp.mk new file +3 -0
+OATPP_SOURCE= $(OATPP_VERSION).tar.gz
+OATPP_SITE= https://github.com/oatpp/oatpp/archive/refs/tags
+#OATPP_SITE= git://github.com/oatpp/oatpp.git

Don't keep commented-out code; just remove it.

For github, we have two options:
- if the package has been "released" by upstream, then they pushed a

    tarball and we must use it;

- otherwise, we have a macro that assembles a proper URL.

In this case, there is no archive published by upstream, so we must use the macro:

    OATPP_VERSION = 1.3.0
    OATPP_SITE = $(call github,oatpp,oatpp,$(OATPP_VERSION))

And that's all (no _SOURCE, no _SITE_METHOD).

https://buildroot.org/downloads/manual/manual.html#github-download-url

You are also missing the license declaration:
OATPP_LICENSE = Apache-2.0
OATPP_LICENSE_FILES = LICENSE

package/oatpp/oatpp.mk line 12

Quoted 2 lines
package/oatpp/oatpp.mk new file +2 -0
+OATPP_INSTALL_STAGING= YES
+OATPP_INSTALL_TARGET= NO

Shy no installation in target? Ah, yes, it's a static lib. Usually, we like a small reminder about that:

# Only builds a static lib:
OATPP_INSTALL_TARGET= NO

package/oatpp/oatpp.mk line 13

Quoted 1 line
package/oatpp/oatpp.mk new file +1 -0
+OATPP_MAKE=make

Why do you need to force make? If that's because of a parallel build issue, then use $(MAKE1) instead, and explain it in the commit message.

As it is supposed to be a static-only lib (as per upstream suggestion), you probably also need to tell cmake to not build shared libs, which is otherwise what Buildroot enforces:

# As per upstream, oat++ is meant to be a static-only lib OATPP_CMAKE_OPTS = -DBUILD_SHARED_LIBS=OFF

Can you address those and respin an updated patch, please?

Regards,
Yann E. MORIN.

Quoted 9 lines
package/oatpp/oatpp.mk new file +2 -0
+$(eval $(cmake-package))
+
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH v2 1/1 package/oatpp:: new package

In reply to Alessandro Partesotti

This package introduce oatpp in BR buildsystem. Oatpp must be used as static library as upstreaam suggest.

---
Changes v1 -> v2
- indentation and spaces (suggested by Yann E. MORIN)
- generic macro changes (suggested by Yann E. MORIN)

---
 package/Config.in        |  1 +
 package/oatpp/Config.in  | 13 +++++++++++++
 package/oatpp/oatpp.hash |  2 ++
 package/oatpp/oatpp.mk   | 16 ++++++++++++++++
 4 files changed, 32 insertions(+)
 create mode 100644 package/oatpp/Config.in
 create mode 100644 package/oatpp/oatpp.hash
 create mode 100644 package/oatpp/oatpp.mk
package/Config.in +1 -0
index 995dae2c57..c7394ae53d 100644
@@ -1941,6 +1941,7 @@ menu "Networking"
 	source "package/nss-mdns/Config.in"
 	source "package/nss-myhostname/Config.in"
 	source "package/nss-pam-ldapd/Config.in"
+	source "package/oatpp/Config.in"
 	source "package/omniorb/Config.in"
 	source "package/open-isns/Config.in"
 	source "package/open62541/Config.in"
package/oatpp/Config.in new file +13 -0
new file mode 100644
index 0000000000..44f0fabed8
@@ -0,0 +1,13 @@
+comment "Oat++ needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_OATPP
+	bool "Oat++"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Oat++ is an open-source C++ web framework for highly
+	  scalable and resource-efficient web applications.
+	  It provides all the necessary components for
+	  production-grade development.
+	  See https://oatpp.io/docs/start
package/oatpp/oatpp.hash new file +2 -0
new file mode 100644
index 0000000000..fadea2a05f
@@ -0,0 +1,2 @@
+# Hash from: https://github.com/oatpp/oatpp/archive/1.3.0/oatpp-1.3.0.tar.gz
+sha512  4fe8587efe1b4ecae14554ec8edb209e5558a3e4a4e6ff49bbfaaf06d2cc12f2cc306c5edc43b8dafc465aff53098ad4bebb9971694761b91a553730d5acb59a  oatpp-1.3.0.tar.gz
package/oatpp/oatpp.mk new file +16 -0
new file mode 100644
index 0000000000..d146d05d53
@@ -0,0 +1,16 @@
+################################################################################
+#
+# oatpp
+#
+################################################################################
+
+OATPP_VERSION = 1.3.0
+OATPP_LICENSE = Apache-2.0
+OATPP_LICENSE_FILES = LICENSE
+OATPP_SITE = $(call github,oatpp,oatpp,$(OATPP_VERSION))
+OATPP_CMAKE_OPTS = -DBUILD_SHARED_LIBS=OFF
+OATPP_INSTALL_STAGING= YES
+# Only builds a static lib:
+OATPP_INSTALL_TARGET= NO
+
+$(eval $(cmake-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH v2 1/1 package/oatpp:: new package

In reply to Alessandro Partesotti

This package introduce oatpp in BR buildsystem. Oatpp must be used as static library as upstreaam suggest.

---
Changes v1 -> v2
- indentation and spaces (suggested by Yann E. MORIN)
- generic macro changes (suggested by Yann E. MORIN)

---
 DEVELOPERS               |  3 +++
 package/Config.in        |  1 +
 package/oatpp/Config.in  | 13 +++++++++++++
 package/oatpp/oatpp.hash |  2 ++
 package/oatpp/oatpp.mk   | 16 ++++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/oatpp/Config.in
 create mode 100644 package/oatpp/oatpp.hash
 create mode 100644 package/oatpp/oatpp.mk
DEVELOPERS +3 -0
index e8e0dffcd3..b2d173dc2e 100644
@@ -3149,3 +3149,6 @@ F:	package/quazip/
 F:	package/shapelib/
 F:	package/simple-mail/
 F:	package/tinc/
+
+N:      Alessandro Partesotti <[email protected]>
+F:      package/oatpp/
package/Config.in +1 -0
index 995dae2c57..c7394ae53d 100644
@@ -1941,6 +1941,7 @@ menu "Networking"
 	source "package/nss-mdns/Config.in"
 	source "package/nss-myhostname/Config.in"
 	source "package/nss-pam-ldapd/Config.in"
+	source "package/oatpp/Config.in"
 	source "package/omniorb/Config.in"
 	source "package/open-isns/Config.in"
 	source "package/open62541/Config.in"
package/oatpp/Config.in new file +13 -0
new file mode 100644
index 0000000000..44f0fabed8
@@ -0,0 +1,13 @@
+comment "Oat++ needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_OATPP
+	bool "Oat++"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Oat++ is an open-source C++ web framework for highly
+	  scalable and resource-efficient web applications.
+	  It provides all the necessary components for
+	  production-grade development.
+	  See https://oatpp.io/docs/start
package/oatpp/oatpp.hash new file +2 -0
new file mode 100644
index 0000000000..fadea2a05f
@@ -0,0 +1,2 @@
+# Hash from: https://github.com/oatpp/oatpp/archive/1.3.0/oatpp-1.3.0.tar.gz
+sha512  4fe8587efe1b4ecae14554ec8edb209e5558a3e4a4e6ff49bbfaaf06d2cc12f2cc306c5edc43b8dafc465aff53098ad4bebb9971694761b91a553730d5acb59a  oatpp-1.3.0.tar.gz
package/oatpp/oatpp.mk new file +16 -0
new file mode 100644
index 0000000000..f949a5cbc9
@@ -0,0 +1,16 @@
+################################################################################
+#
+# oatpp
+#
+################################################################################
+
+OATPP_VERSION = 1.3.0
+OATPP_LICENSE = Apache-2.0
+OATPP_LICENSE_FILES = LICENSE
+OATPP_SITE = $(call github,oatpp,oatpp,$(OATPP_VERSION))
+OATPP_CMAKE_OPTS = -DBUILD_SHARED_LIBS=OFF
+OATPP_INSTALL_STAGING = YES
+# Only builds a static lib and copy headers:
+OATPP_INSTALL_TARGET = NO
+
+$(eval $(cmake-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Hi Alessandro,

I (finally) applied your patch to master, with a whole lot of changes, see below.

Quoted 1 line · Alessandro Partesotti

This package introduce oatpp in BR buildsystem.

This sentence is redundant.

Quoted 25 lines

Oatpp must be used as static library as upstreaam suggest.

---
Changes v1 -> v2
- indentation and spaces (suggested by Yann E. MORIN)
- generic macro changes (suggested by Yann E. MORIN)

---
  DEVELOPERS               |  3 +++
  package/Config.in        |  1 +
  package/oatpp/Config.in  | 13 +++++++++++++
  package/oatpp/oatpp.hash |  2 ++
  package/oatpp/oatpp.mk   | 16 ++++++++++++++++
  5 files changed, 35 insertions(+)

create mode 100644 package/oatpp/Config.in
create mode 100644 package/oatpp/oatpp.hash
create mode 100644 package/oatpp/oatpp.mk

DEVELOPERS +0 -0
index e8e0dffcd3..b2d173dc2e 100644

DEVELOPERS F: package/quazip/ · line 3153

Quoted 5 lines
DEVELOPERS +2 -0
@@ -3149,3 +3149,6 @@ F:	package/quazip/
  F:	package/shapelib/
  F:	package/simple-mail/
  F:	package/tinc/
+
+N:      Alessandro Partesotti <[email protected]>

DEVELOPERS should be alphabetic by name, so I moved this up.

Quoted 19 lines
DEVELOPERS +1 -0
+F:      package/oatpp/
package/Config.in +1 -0
index 995dae2c57..c7394ae53d 100644
@@ -1941,6 +1941,7 @@ menu "Networking"
  	source "package/nss-mdns/Config.in"
  	source "package/nss-myhostname/Config.in"
  	source "package/nss-pam-ldapd/Config.in"
+	source "package/oatpp/Config.in"
  	source "package/omniorb/Config.in"
  	source "package/open-isns/Config.in"
  	source "package/open62541/Config.in"
package/oatpp/Config.in new file +0 -0
new file mode 100644
index 0000000000..44f0fabed8

package/oatpp/Config.in line 1

Quoted 1 line
package/oatpp/Config.in new file +1 -0
@@ -0,0 +1,13 @@
+comment "Oat++ needs a toolchain w/ C++"

This was missing threads.

package/oatpp/Config.in line 5

Quoted 4 lines
package/oatpp/Config.in new file +4 -0
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_OATPP
+	bool "Oat++"

We always use lowercase for the prompts. We also use the package name, unless
there is a _very_ good reason to not use it. In this case, upstream seems to use both oat++ and oatpp, so I changed this to oatpp.

package/oatpp/Config.in line 9

Quoted 4 lines
package/oatpp/Config.in new file +4 -0
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Oat++ is an open-source C++ web framework for highly

Now it was wrapped to short :-)

package/oatpp/Config.in line 13

Quoted 4 lines
package/oatpp/Config.in new file +4 -0
+	  scalable and resource-efficient web applications.
+	  It provides all the necessary components for
+	  production-grade development.
+	  See https://oatpp.io/docs/start

The upstream URL should be on a separate line.

package/oatpp/oatpp.hash line 1

Quoted 7 lines
package/oatpp/oatpp.hash new file +1 -0
new file mode 100644
index 0000000000..fadea2a05f
@@ -0,0 +1,2 @@
+# Hash from: https://github.com/oatpp/oatpp/archive/1.3.0/oatpp-1.3.0.tar.gz

That's not a hash, that's the tarball itself. There's no upstream hash AFAICS.
So I changed this to Locally calculated.

package/oatpp/oatpp.hash line 2

Quoted 1 line
package/oatpp/oatpp.hash new file +1 -0
+sha512  4fe8587efe1b4ecae14554ec8edb209e5558a3e4a4e6ff49bbfaaf06d2cc12f2cc306c5edc43b8dafc465aff53098ad4bebb9971694761b91a553730d5acb59a  oatpp-1.3.0.tar.gz

We use sha256 for locally calculated.

There should also be a hash for the license file.

Quoted 7 lines
package/oatpp/oatpp.mk new file +1 -0
new file mode 100644
index 0000000000..f949a5cbc9
@@ -0,0 +1,16 @@
+################################################################################

package/oatpp/oatpp.mk line 11

Quoted 10 lines
package/oatpp/oatpp.mk new file +10 -0
+#
+# oatpp
+#
+################################################################################
+
+OATPP_VERSION = 1.3.0
+OATPP_LICENSE = Apache-2.0
+OATPP_LICENSE_FILES = LICENSE
+OATPP_SITE = $(call github,oatpp,oatpp,$(OATPP_VERSION))
+OATPP_CMAKE_OPTS = -DBUILD_SHARED_LIBS=OFF

This should be OATPP_CONF_OPTS, otherwise it isn't used and it does install
shared libs...

Regards,
Arnout

package/oatpp/oatpp.mk line 16

Quoted 5 lines
package/oatpp/oatpp.mk new file +5 -0
+OATPP_INSTALL_STAGING = YES
+# Only builds a static lib and copy headers:
+OATPP_INSTALL_TARGET = NO
+
+$(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

[Buildroot] (no subject)

In reply to Alessandro Partesotti

Subject: [PATCH 1/1] package/oatpp:: new package
Hi Yann , All
I've resubmitted the patch with the requested changes. Thank you for your time
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Regards
Alesaadnro Partesotti
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot