-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#7312) feat: add recipe for ua-nodeset
* feat: add files and env-variables for ua-nodeset * fix: use tarballs instead of git * fix: undo changes to open62541 * fix: change path variable to env variable * formating: add newline * fix: use user.info variable and add test_package * fix: change package name to all smallcase * fix: correct rename * fix: correct the version, remove unwanted imports * fix: rename nodeset_path to nodeset_dir * fix: minor issues in conanfile * Add missing license file * Fix: do not copy license file * fix test_package to use nodeset_dir * Apply suggestions from code review Apply license fixes Co-authored-by: Uilian Ries <uilianries@gmail.com> * fix: minor fixes for license file * Apply suggestions from code review Co-authored-by: Uilian Ries <uilianries@gmail.com> * Update recipes/ua-nodeset/all/conanfile.py Co-authored-by: Uilian Ries <uilianries@gmail.com> * fix: use correct version * fix: retrigger build * fix: change version to `PADIM-1.02-2021-07-21` * fix: lowercase version Co-authored-by: Stefan Profanter <stefan.profanter@agile-robots.com> Co-authored-by: Stefan Profanter <Pro@users.noreply.github.com> Co-authored-by: Uilian Ries <uilianries@gmail.com>
- Loading branch information
1 parent
a73311d
commit 5be1ac2
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sources: | ||
"padim-1.02-2021-07-21": | ||
# This is just the latest tag on the 1.04 release branch as of 23Sep2021 | ||
url: https://github.com/OPCFoundation/UA-Nodeset/archive/refs/tags/PADIM-1.02-2021-07-21.tar.gz | ||
sha256: 05c83369ea82cd275d47ccc46a6d919c81392e2d0b7444a3e538ee3ba482dbee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
required_conan_version = ">=1.33.0" | ||
|
||
|
||
class UaNodeSetConan(ConanFile): | ||
name = "ua-nodeset" | ||
license = "MIT" | ||
description = "UANodeSets and other normative files which are released with a specification" | ||
homepage = "https://github.com/OPCFoundation/UA-Nodeset" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
topics = ("opc-ua-specifications", "uanodeset", "normative-files", "companion-specification") | ||
|
||
no_copy_source = True | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
|
||
def _extract_license(self): | ||
content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "AnsiC", "opcua_clientapi.c")) | ||
license_contents = content[2:content.find("*/", 1)] | ||
tools.save("LICENSE", license_contents) | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) | ||
|
||
def build(self): | ||
pass | ||
|
||
|
||
def package(self): | ||
self._extract_license() | ||
self.copy("*", dst="res", src=self._source_subfolder) | ||
self.copy("LICENSE", dst="licenses") | ||
|
||
|
||
def package_info(self): | ||
self.cpp_info.libdirs = [] | ||
self.cpp_info.resdirs = ["res"] | ||
self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestUaNodeSetConan(ConanFile): | ||
|
||
def build(self): | ||
pass | ||
|
||
def test(self): | ||
assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"padim-1.02-2021-07-21": | ||
folder: all |