Bug 265930 - [NEW PORT] devel/open62541 - Open Source implementation of OPC UA
Summary: [NEW PORT] devel/open62541 - Open Source implementation of OPC UA
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Felix Palmen
URL: https://github.com/open62541/open62541
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-18 17:01 UTC by Nico Sonack
Modified: 2022-08-29 14:13 UTC (History)
1 user (show)

See Also:


Attachments
Git Diff for the new port (6.47 KB, patch)
2022-08-18 17:01 UTC, Nico Sonack
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Sonack 2022-08-18 17:01:08 UTC
Created attachment 235996 [details]
Git Diff for the new port

See patch attached

Open62541 is an open source implementation of ISO/IEC 62541 (aka. OPC UA)

I am already involved upstream because the current master has portability issues - which however can be resolved. See https://github.com/open62541/open62541/pull/5238 for the ongoing efforts.

Testing done with poudriere on 13.1-RELEASE-p1 amd64. I might go ahead and drag it out to arm64 too.
Comment 1 Felix Palmen freebsd_committer freebsd_triage 2022-08-23 13:45:42 UTC
Giving it a few test builds right now ... meanwhile:

You're using ${DATADIR} in your post-install, but the upstream buildsystem doesn't honor it. It could be "fixed" by adding:

post-patch:
        @${REINPLACE_CMD} 's|share/${PORTNAME}|${DATADIR_REL}|' \
                ${WRKSRC}/CMakeLists.txt

Then, we could also use %%DATADIR%% in pkg-plist instead of the hardcoded share/open62541.

Would changing the DATADIR break anything at runtime? If not, would you be fine with me adding these changes?
Comment 2 Felix Palmen freebsd_committer freebsd_triage 2022-08-23 14:11:29 UTC
BTW, this "fix" isn't really necessary, if you think it *might* break things then better leave it. I would *still* use %%DATADIR%% in pkg-plist though.
Comment 3 Felix Palmen freebsd_committer freebsd_triage 2022-08-23 15:18:03 UTC
Test builds almost done, looks good so far!

I meanwhile checked ports framework, it looks like support for overridden DATADIR is rare in practice. So, if upstream doesn't support it, I'd opt *not* to patch it. Still, I'll modify pkg-plist to use %%DATADIR%%, I hope you don't mind.
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-08-23 16:25:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c0e67da99a7ca0a49a3501d58c0ff3dd118ddf10

commit c0e67da99a7ca0a49a3501d58c0ff3dd118ddf10
Author:     Nico Sonack <nsonack@outlook.com>
AuthorDate: 2022-08-18 17:01:08 +0000
Commit:     Felix Palmen <zirias@FreeBSD.org>
CommitDate: 2022-08-23 16:24:19 +0000

    devel/open62541: Add new port

    Open62541 is an open source implementation of ISO/IEC 62541 (aka. OPC
    UA)

    PR:                     265930
    Approved by:            tcberner (mentor)
    Differential Revision:  https://reviews.freebsd.org/D36313

 devel/Makefile                  |  1 +
 devel/open62541/Makefile (new)  | 24 ++++++++++++
 devel/open62541/distinfo (new)  |  3 ++
 devel/open62541/pkg-descr (new) |  8 ++++
 devel/open62541/pkg-plist (new) | 86 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 122 insertions(+)
Comment 5 Felix Palmen freebsd_committer freebsd_triage 2022-08-23 16:28:46 UTC
Committed (with minor cosmetic changes and without the patch), thanks!
Comment 6 Nico Sonack 2022-08-29 14:13:02 UTC
Thank you. I was busy last week so I haven't had the time to respond properly.

All changes are fine with me.

One minor note: D36313 mentioned the weird patch of the CMakeLists.txt.
The problem was that the library shipped with a broken version of FindPython which made the entire thing go haywire trying to find python. By reordering the macro calls I just forced CMake to use the system provided version. Since I wasn't aware of the existance of BINARY_ALIAS it was the only plausible solution. Now I know.