Re: open62541 ns0 flavor

2021-07-29 Thread Stuart Henderson
On 2021/07/29 20:07, Alexander Bluhm wrote:
> Hi,
> 
> The open62541 library may be compiled with full namespace zero.
> This is neccessary for my use case.
> 
> For that I need an additional external package from the OPC UA
> foundation.  To build the full library, the compiler needs 8 MB
> stack limit.  And the package size grows from 4 to 10 MB.
> 
> So I created a ns0_full flavor that is not built by default.
> Is this the correct approach?

I prefer to have all flavours linked to the build, so we can notice
if there's breakage. Bulk build machines have high limits anyway.

OK.



open62541 ns0 flavor

2021-07-29 Thread Alexander Bluhm
Hi,

The open62541 library may be compiled with full namespace zero.
This is neccessary for my use case.

For that I need an additional external package from the OPC UA
foundation.  To build the full library, the compiler needs 8 MB
stack limit.  And the package size grows from 4 to 10 MB.

So I created a ns0_full flavor that is not built by default.
Is this the correct approach?

bluhm

Index: misc/open62541/Makefile
===
RCS file: /data/mirror/openbsd/cvs/ports/misc/open62541/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- misc/open62541/Makefile 29 Jul 2021 15:05:43 -  1.10
+++ misc/open62541/Makefile 29 Jul 2021 17:48:59 -
@@ -3,6 +3,7 @@
 COMMENT =  library implementation of OPC UA
 
 VERSION =  1.0.3
+REVISION = 0
 DISTNAME = open62541-${VERSION}
 PKGNAME =  open62541-${VERSION}
 
@@ -20,7 +21,9 @@ PERMIT_PACKAGE =  Yes
 WANTLIB =  c m mbedcrypto mbedtls mbedx509 pthread
 
 MASTER_SITES = https://github.com/open62541/open62541/
-DISTFILES =open62541-{archive/refs/tags/v}${VERSION}.tar.gz
+MASTER_SITES0 =
https://github.com/OPCFoundation/UA-Nodeset/archive/
+DISTFILES =open62541-{archive/refs/tags/v}${VERSION}.tar.gz \
+   UA-1.04.5-2020-03-06.tar.gz:0
 
 MODULES =  devel/cmake
 
@@ -39,7 +42,6 @@ CONFIGURE_ARGS =  -DCMAKE_BUILD_TYPE=RelW
-DOPEN62541_VERSION=v${VERSION} \
-DBUILD_SHARED_LIBS=ON \
-DUA_ENABLE_ENCRYPTION=ON \
-   -DUA_NAMESPACE_ZERO=REDUCED \
-DUA_ENABLE_AMALGAMATION=OFF \
-DUA_PACK_DEBIAN=ON \
-DUA_BUILD_TOOLS=ON \
@@ -48,5 +50,21 @@ CONFIGURE_ARGS = -DCMAKE_BUILD_TYPE=RelW
 DEBUG_PACKAGES =   ${BUILD_PACKAGES}
 
 ALL_TARGET =   all doc_pdf
+
+FLAVORS =  ns0_full
+FLAVOR ?=
+
+.if ${FLAVOR:Mns0_full}
+CONFIGURE_ARGS +=  -DUA_NAMESPACE_ZERO=FULL \
+   -DUA_ENABLE_MICRO_EMB_DEV_PROFILE=ON
+.else
+CONFIGURE_ARGS +=  -DUA_NAMESPACE_ZERO=REDUCED
+.endif
+
+.if ${FLAVOR:Mns0_full}
+post-extract:
+   rmdir ${WRKSRC}/deps/ua-nodeset/
+   mv ${WRKDIR}/UA-Nodeset-UA-*/ ${WRKSRC}/deps/ua-nodeset/
+.endif
 
 .include 
Index: misc/open62541/distinfo
===
RCS file: /data/mirror/openbsd/cvs/ports/misc/open62541/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- misc/open62541/distinfo 29 Jul 2021 15:05:43 -  1.3
+++ misc/open62541/distinfo 29 Jul 2021 15:46:41 -
@@ -1,2 +1,4 @@
+SHA256 (UA-1.04.5-2020-03-06.tar.gz) = 
KIty/GA+zomK1fXUBLBP7+EN5Puzx1apbXzINCtRgFM=
 SHA256 (open62541-1.0.3.tar.gz) = PkyTnXAtBtifMqHK/iuZLH89gcj4V54JOpctS8T7PVA=
+SIZE (UA-1.04.5-2020-03-06.tar.gz) = 4053334
 SIZE (open62541-1.0.3.tar.gz) = 2691597
Index: misc/open62541/pkg/PFRAG.ns0_full
===
RCS file: misc/open62541/pkg/PFRAG.ns0_full
diff -N misc/open62541/pkg/PFRAG.ns0_full
--- /dev/null   1 Jan 1970 00:00:00 -
+++ misc/open62541/pkg/PFRAG.ns0_full   29 Jul 2021 17:43:52 -
@@ -0,0 +1,220 @@
+@comment $OpenBSD: PFRAG.ns0_full,v$
+share/open62541/tools/ua-nodeset/ADI/
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.Classes.cs
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.Constants.cs
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.DataTypes.cs
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.PredefinedNodes.uanodes
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.PredefinedNodes.xml
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd
+share/open62541/tools/ua-nodeset/ADI/Opc.Ua.Adi.Types.xsd
+share/open62541/tools/ua-nodeset/ADI/OpcUaAdiModel.csv
+share/open62541/tools/ua-nodeset/ADI/OpcUaAdiModel.xml
+share/open62541/tools/ua-nodeset/AML/
+share/open62541/tools/ua-nodeset/AML/Opc.Ua.AMLBaseTypes.NodeSet2.xml
+share/open62541/tools/ua-nodeset/AML/Opc.Ua.AMLLibraries.NodeSet2.xml
+share/open62541/tools/ua-nodeset/AML/Topology.aml
+share/open62541/tools/ua-nodeset/AML/Topology.xml
+share/open62541/tools/ua-nodeset/AnsiC/
+share/open62541/tools/ua-nodeset/AnsiC/Opc.Ua.Endpoints.wsdl
+share/open62541/tools/ua-nodeset/AnsiC/Opc.Ua.Services.wsdl
+share/open62541/tools/ua-nodeset/AnsiC/opcua_attributes.h
+share/open62541/tools/ua-nodeset/AnsiC/opcua_browsenames.h
+share/open62541/tools/ua-nodeset/AnsiC/opcua_clientapi.c
+share/open62541/tools/ua-nodeset/AnsiC/opcua_clientapi.h
+share/open62541/tools/ua-nodeset/AnsiC/opcua_exclusions.h
+share/open62541/tools/ua-nodeset/AnsiC/opcua_identifiers.h
+share/open62541/tools/ua-nodeset/AnsiC/opcua_serverapi.c
+share/open62541/tools/ua-nodeset/AnsiC/opcua_serverapi.h