From 7f91dde05f081ed1e02fa88b0cc331329d7b2d5e Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Thu, 16 Sep 2021 17:31:45 +0200 Subject: [PATCH 01/22] feat: add files and env-variables for ua-nodeset --- recipes/open62541/all/conanfile.py | 26 +++++++++++++++++++++-- recipes/ua-nodeset/all/conanfile.py | 32 +++++++++++++++++++++++++++++ recipes/ua-nodeset/config.yml | 3 +++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 recipes/ua-nodeset/all/conanfile.py create mode 100644 recipes/ua-nodeset/config.yml diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 58344841b7b96..e31874b347c82 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -322,10 +322,18 @@ def _configure_cmake(self): def build(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + tools.patch(**patch) cmake = self._configure_cmake() cmake.build() + @property + def _tools_subfolder(self): + return os.path.join(self._source_subfolder, "tools") + + # @property + # def _deps_subfolder(self): + # return os.path.join(self._source_subfolder, "deps") + def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) self.copy("LICENSE-CC0", dst="licenses", src=self._source_subfolder) @@ -342,7 +350,10 @@ def package(self): os.remove(cmake_file) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "share")) - + self.copy("generate_*.py", dst="share/tools", src=self._tools_subfolder) + self.copy("nodeset_compiler/*", dst="share/tools", src=self._tools_subfolder) + #use local local ua-nodeset instead of the OPC Founation files (NOT RECOMMENDED) Use the UA-Nodeset package instead + #self.copy("ua-nodeset/*", dst="share", src=self._deps_subfolder) @property def _module_subfolder(self): return os.path.join("lib", "cmake", "open62541") @@ -351,6 +362,11 @@ def _module_subfolder(self): def _module_file_rel_path(self): return os.path.join(self._module_subfolder, "open62541Macros.cmake") + @staticmethod + def _chmod_plus_x(filename): + if os.name == 'posix': + os.chmod(filename, os.stat(filename).st_mode | 0o111) + def package_info(self): self.cpp_info.names["cmake_find_package"] = "open62541" self.cpp_info.names["cmake_find_package_multi"] = "open62541" @@ -361,6 +377,12 @@ def package_info(self): os.path.join("include", "plugin") ] + #required for creating servers from ua nodesets + self.env_info.open62541_TOOLS_DIR = os.path.join(self.package_folder, "share", "tools") + self._chmod_plus_x(os.path.join(self.package_folder, "share", "tools", "generate_nodeid_header.py")) + #use local local ua-nodeset instead of the OPC Founation files (NOT RECOMMENDED) Use the UA-Nodeset package instead + #self.env_info.open62541_NODESET_DIR = os.path.join(self.package_folder, "share", "ua-nodeset") + if self.options.single_header: self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") if self.settings.os == "Windows": diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py new file mode 100644 index 0000000000000..d0449688ac929 --- /dev/null +++ b/recipes/ua-nodeset/all/conanfile.py @@ -0,0 +1,32 @@ +from conans import ConanFile, CMake, tools +import os + + +class UaNodeSetConan(ConanFile): + name = "UA-Nodeset" + license = "" + author = 'OPCFoundation' + description = "This repository contains UANodeSets and other normative files which are released with a specification" + url = 'https://github.com/OPCFoundation/UA-Nodeset' + default_user = "ar" + default_channel = "thirdparty" + generators = "cmake", "virtualenv" + settings = 'os' + + + def source(self): + git = tools.Git() + git.clone( + url="https://github.com/OPCFoundation/UA-Nodeset.git", + branch="v{}".format(self.version)) + + def build(self): + pass + + + def package(self): + self.copy("*", dst="ua-nodeset", src="") + + + def package_info(self): + self.env_info.open62541_NODESET_DIR = os.path.join(self.package_folder, "ua-nodeset") diff --git a/recipes/ua-nodeset/config.yml b/recipes/ua-nodeset/config.yml new file mode 100644 index 0000000000000..1377c34a62746 --- /dev/null +++ b/recipes/ua-nodeset/config.yml @@ -0,0 +1,3 @@ +versions: + "1.04": + folder: all From 71779d1ce6131ee277e323943837905b24771abb Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Thu, 16 Sep 2021 18:42:49 +0200 Subject: [PATCH 02/22] fix: use tarballs instead of git --- recipes/ua-nodeset/all/conandata.yml | 4 ++++ recipes/ua-nodeset/all/conanfile.py | 23 ++++++++++------------- recipes/ua-nodeset/config.yml | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 recipes/ua-nodeset/all/conandata.yml diff --git a/recipes/ua-nodeset/all/conandata.yml b/recipes/ua-nodeset/all/conandata.yml new file mode 100644 index 0000000000000..7cbd34b6af348 --- /dev/null +++ b/recipes/ua-nodeset/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.02": + url: https://github.com/OPCFoundation/UA-Nodeset/archive/refs/tags/PADIM-1.02-2021-07-21.tar.gz + sha256: 05c83369ea82cd275d47ccc46a6d919c81392e2d0b7444a3e538ee3ba482dbee diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index d0449688ac929..149f8039031a7 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -4,29 +4,26 @@ class UaNodeSetConan(ConanFile): name = "UA-Nodeset" - license = "" - author = 'OPCFoundation' + license = "UNKNOWN" # https://github.com/OPCFoundation/UA-Nodeset/issues/79 description = "This repository contains UANodeSets and other normative files which are released with a specification" - url = 'https://github.com/OPCFoundation/UA-Nodeset' - default_user = "ar" - default_channel = "thirdparty" - generators = "cmake", "virtualenv" - settings = 'os' + homepage = "https://github.com/OPCFoundation/UA-Nodeset" + url = "https://www.github.com/conan-io/conan-center-index" + + no_copy_source = True def source(self): - git = tools.Git() - git.clone( - url="https://github.com/OPCFoundation/UA-Nodeset.git", - branch="v{}".format(self.version)) + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) def build(self): pass def package(self): - self.copy("*", dst="ua-nodeset", src="") + self.copy("*", dst="res") def package_info(self): - self.env_info.open62541_NODESET_DIR = os.path.join(self.package_folder, "ua-nodeset") + self.cpp_info.libdirs = [] + self.user_info.nodeset_path = os.path.join(self.package_folder, "res") diff --git a/recipes/ua-nodeset/config.yml b/recipes/ua-nodeset/config.yml index 1377c34a62746..eb7a068e37a6d 100644 --- a/recipes/ua-nodeset/config.yml +++ b/recipes/ua-nodeset/config.yml @@ -1,3 +1,3 @@ versions: - "1.04": + "1.02": folder: all From 4943e8d2e78af432c8766bb46d4cd4ea184a9fc1 Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Thu, 16 Sep 2021 18:49:29 +0200 Subject: [PATCH 03/22] fix: undo changes to open62541 --- recipes/open62541/all/conanfile.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index e31874b347c82..def48bdc1ff53 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -322,18 +322,10 @@ def _configure_cmake(self): def build(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + tools.patch(**patch) cmake = self._configure_cmake() cmake.build() - @property - def _tools_subfolder(self): - return os.path.join(self._source_subfolder, "tools") - - # @property - # def _deps_subfolder(self): - # return os.path.join(self._source_subfolder, "deps") - def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) self.copy("LICENSE-CC0", dst="licenses", src=self._source_subfolder) @@ -350,10 +342,7 @@ def package(self): os.remove(cmake_file) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "share")) - self.copy("generate_*.py", dst="share/tools", src=self._tools_subfolder) - self.copy("nodeset_compiler/*", dst="share/tools", src=self._tools_subfolder) - #use local local ua-nodeset instead of the OPC Founation files (NOT RECOMMENDED) Use the UA-Nodeset package instead - #self.copy("ua-nodeset/*", dst="share", src=self._deps_subfolder) + @property def _module_subfolder(self): return os.path.join("lib", "cmake", "open62541") @@ -362,11 +351,6 @@ def _module_subfolder(self): def _module_file_rel_path(self): return os.path.join(self._module_subfolder, "open62541Macros.cmake") - @staticmethod - def _chmod_plus_x(filename): - if os.name == 'posix': - os.chmod(filename, os.stat(filename).st_mode | 0o111) - def package_info(self): self.cpp_info.names["cmake_find_package"] = "open62541" self.cpp_info.names["cmake_find_package_multi"] = "open62541" @@ -377,12 +361,6 @@ def package_info(self): os.path.join("include", "plugin") ] - #required for creating servers from ua nodesets - self.env_info.open62541_TOOLS_DIR = os.path.join(self.package_folder, "share", "tools") - self._chmod_plus_x(os.path.join(self.package_folder, "share", "tools", "generate_nodeid_header.py")) - #use local local ua-nodeset instead of the OPC Founation files (NOT RECOMMENDED) Use the UA-Nodeset package instead - #self.env_info.open62541_NODESET_DIR = os.path.join(self.package_folder, "share", "ua-nodeset") - if self.options.single_header: self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") if self.settings.os == "Windows": @@ -391,4 +369,4 @@ def package_info(self): else: self.cpp_info.includedirs.append(os.path.join("include", "posix")) self.cpp_info.builddirs.append(self._module_subfolder) - self.cpp_info.build_modules = [self._module_file_rel_path] + self.cpp_info.build_modules = [self._module_file_rel_path] \ No newline at end of file From 436166e623cc8c2d348baa70dbc40fcb30096946 Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Thu, 16 Sep 2021 20:23:26 +0200 Subject: [PATCH 04/22] fix: change path variable to env variable --- recipes/ua-nodeset/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 149f8039031a7..dbec462234bde 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -26,4 +26,4 @@ def package(self): def package_info(self): self.cpp_info.libdirs = [] - self.user_info.nodeset_path = os.path.join(self.package_folder, "res") + self.env_info.nodeset_path = os.path.join(self.package_folder, "res") From 029882b1197385bec4adae8ead1a5e842ed74541 Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Thu, 16 Sep 2021 20:29:24 +0200 Subject: [PATCH 05/22] formating: add newline --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index def48bdc1ff53..58344841b7b96 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -369,4 +369,4 @@ def package_info(self): else: self.cpp_info.includedirs.append(os.path.join("include", "posix")) self.cpp_info.builddirs.append(self._module_subfolder) - self.cpp_info.build_modules = [self._module_file_rel_path] \ No newline at end of file + self.cpp_info.build_modules = [self._module_file_rel_path] From 20d1b525586667f50e3af4dece6e9551fcadd6a5 Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Fri, 17 Sep 2021 11:27:25 +0200 Subject: [PATCH 06/22] fix: use user.info variable and add test_package --- recipes/ua-nodeset/all/conanfile.py | 7 +++++-- recipes/ua-nodeset/all/test_package/conanfile.py | 13 +++++++++++++ recipes/ua-nodeset/config.yml | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 recipes/ua-nodeset/all/test_package/conanfile.py diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index dbec462234bde..02809b9b172c8 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -1,11 +1,13 @@ from conans import ConanFile, CMake, tools import os +required_conan_version = ">=1.33.0" + class UaNodeSetConan(ConanFile): name = "UA-Nodeset" license = "UNKNOWN" # https://github.com/OPCFoundation/UA-Nodeset/issues/79 - description = "This repository contains UANodeSets and other normative files which are released with a specification" + description = "UANodeSets and other normative files which are released with a specification" homepage = "https://github.com/OPCFoundation/UA-Nodeset" url = "https://www.github.com/conan-io/conan-center-index" @@ -26,4 +28,5 @@ def package(self): def package_info(self): self.cpp_info.libdirs = [] - self.env_info.nodeset_path = os.path.join(self.package_folder, "res") + self.cpp_info.resdirs = ["res"] + self.user_info.nodeset_path = os.path.join(self.package_folder, "res") diff --git a/recipes/ua-nodeset/all/test_package/conanfile.py b/recipes/ua-nodeset/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9d6b450f701ae --- /dev/null +++ b/recipes/ua-nodeset/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +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_path, "PLCopen")) + diff --git a/recipes/ua-nodeset/config.yml b/recipes/ua-nodeset/config.yml index eb7a068e37a6d..88067bf2fd48a 100644 --- a/recipes/ua-nodeset/config.yml +++ b/recipes/ua-nodeset/config.yml @@ -1,3 +1,3 @@ versions: - "1.02": + "1.02-2021-07-21": folder: all From 941df8721808e405e3321116aca132bad831c5f3 Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Fri, 17 Sep 2021 12:25:56 +0200 Subject: [PATCH 07/22] fix: change package name to all smallcase --- recipes/ua-nodeset/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 02809b9b172c8..9cbfc5dd8bfac 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -5,7 +5,7 @@ class UaNodeSetConan(ConanFile): - name = "UA-Nodeset" + name = "ua-nodeset" license = "UNKNOWN" # https://github.com/OPCFoundation/UA-Nodeset/issues/79 description = "UANodeSets and other normative files which are released with a specification" homepage = "https://github.com/OPCFoundation/UA-Nodeset" From d09c96ae1b90027eb62d5a678fd23a646c679666 Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Fri, 17 Sep 2021 14:12:59 +0200 Subject: [PATCH 08/22] fix: correct rename --- recipes/ua-nodeset/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 9cbfc5dd8bfac..155d663ea5fac 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -16,14 +16,14 @@ class UaNodeSetConan(ConanFile): def source(self): tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) + os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), "source_subfolder") def build(self): pass def package(self): - self.copy("*", dst="res") + self.copy("*", dst="res", src="source_subfolder") def package_info(self): From b1f2bebda6d3ace3f1a107047ef39bc16237042a Mon Sep 17 00:00:00 2001 From: "m.tayseer" Date: Fri, 17 Sep 2021 16:48:44 +0200 Subject: [PATCH 09/22] fix: correct the version, remove unwanted imports --- recipes/ua-nodeset/all/conandata.yml | 2 +- recipes/ua-nodeset/all/test_package/conanfile.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/ua-nodeset/all/conandata.yml b/recipes/ua-nodeset/all/conandata.yml index 7cbd34b6af348..5506990f474c4 100644 --- a/recipes/ua-nodeset/all/conandata.yml +++ b/recipes/ua-nodeset/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "1.02": + "1.02-2021-07-21": url: https://github.com/OPCFoundation/UA-Nodeset/archive/refs/tags/PADIM-1.02-2021-07-21.tar.gz sha256: 05c83369ea82cd275d47ccc46a6d919c81392e2d0b7444a3e538ee3ba482dbee diff --git a/recipes/ua-nodeset/all/test_package/conanfile.py b/recipes/ua-nodeset/all/test_package/conanfile.py index 9d6b450f701ae..0a86b887eb931 100644 --- a/recipes/ua-nodeset/all/test_package/conanfile.py +++ b/recipes/ua-nodeset/all/test_package/conanfile.py @@ -1,5 +1,4 @@ from conans import ConanFile, CMake, tools -from conans.errors import ConanException import os From 79fd9edff4094a695054d43cff23af68152cbb9d Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Tue, 21 Sep 2021 10:57:05 +0200 Subject: [PATCH 10/22] fix: rename nodeset_path to nodeset_dir --- recipes/ua-nodeset/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 155d663ea5fac..3d72be9900936 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -29,4 +29,4 @@ def package(self): def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.resdirs = ["res"] - self.user_info.nodeset_path = os.path.join(self.package_folder, "res") + self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") From 9decffa449d5e42c32da4a3cb284a5a872279f70 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Tue, 21 Sep 2021 11:04:19 +0200 Subject: [PATCH 11/22] fix: minor issues in conanfile --- recipes/ua-nodeset/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 3d72be9900936..bbba6994239fa 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -9,7 +9,11 @@ class UaNodeSetConan(ConanFile): license = "UNKNOWN" # https://github.com/OPCFoundation/UA-Nodeset/issues/79 description = "UANodeSets and other normative files which are released with a specification" homepage = "https://github.com/OPCFoundation/UA-Nodeset" - url = "https://www.github.com/conan-io/conan-center-index" + url = "https://github.com/conan-io/conan-center-index" + topics = ( + "OPC UA", "open62541", "iec-62541", + "industrial automation", "nodeset" + ) no_copy_source = True From 4e2471faf80fe4c901600c787093122aaaca0d92 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Tue, 21 Sep 2021 11:16:24 +0200 Subject: [PATCH 12/22] Add missing license file --- recipes/ua-nodeset/all/LICENSE | 31 +++++++++++++++++++++++++++++ recipes/ua-nodeset/all/conanfile.py | 8 +++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 recipes/ua-nodeset/all/LICENSE diff --git a/recipes/ua-nodeset/all/LICENSE b/recipes/ua-nodeset/all/LICENSE new file mode 100644 index 0000000000000..89bd126bff955 --- /dev/null +++ b/recipes/ua-nodeset/all/LICENSE @@ -0,0 +1,31 @@ +Note: This file is copied from one of the NodeSet2.xml files. +The UA-NodeSet repo does not come with a LICENSE file itself. + +----------------------- + +Copyright (c) 2005-2021 The OPC Foundation, Inc. All rights reserved. + +OPC Foundation MIT License 1.00 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +The complete license agreement can be found here: +http://opcfoundation.org/License/MIT/1.00/ diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index bbba6994239fa..252d82fdd551f 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -6,7 +6,7 @@ class UaNodeSetConan(ConanFile): name = "ua-nodeset" - license = "UNKNOWN" # https://github.com/OPCFoundation/UA-Nodeset/issues/79 + 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" @@ -14,7 +14,8 @@ class UaNodeSetConan(ConanFile): "OPC UA", "open62541", "iec-62541", "industrial automation", "nodeset" ) - + + exports_sources = ["LICENSE"] no_copy_source = True @@ -24,10 +25,11 @@ def source(self): def build(self): pass - + def package(self): self.copy("*", dst="res", src="source_subfolder") + self.copy("LICENSE", dst="licenses") def package_info(self): From 3a11220aa4685ec5274e77b4a2053c2715288fc1 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Tue, 21 Sep 2021 11:21:31 +0200 Subject: [PATCH 13/22] Fix: do not copy license file --- recipes/ua-nodeset/all/LICENSE | 31 ----------------------------- recipes/ua-nodeset/all/conanfile.py | 8 ++++++-- 2 files changed, 6 insertions(+), 33 deletions(-) delete mode 100644 recipes/ua-nodeset/all/LICENSE diff --git a/recipes/ua-nodeset/all/LICENSE b/recipes/ua-nodeset/all/LICENSE deleted file mode 100644 index 89bd126bff955..0000000000000 --- a/recipes/ua-nodeset/all/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Note: This file is copied from one of the NodeSet2.xml files. -The UA-NodeSet repo does not come with a LICENSE file itself. - ------------------------ - -Copyright (c) 2005-2021 The OPC Foundation, Inc. All rights reserved. - -OPC Foundation MIT License 1.00 - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -The complete license agreement can be found here: -http://opcfoundation.org/License/MIT/1.00/ diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 252d82fdd551f..b23397f3b3391 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -6,7 +6,7 @@ class UaNodeSetConan(ConanFile): name = "ua-nodeset" - license = "MIT" + license = "UNKNOWN" # https://github.com/OPCFoundation/UA-Nodeset/issues/79 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" @@ -15,7 +15,6 @@ class UaNodeSetConan(ConanFile): "industrial automation", "nodeset" ) - exports_sources = ["LICENSE"] no_copy_source = True @@ -23,6 +22,11 @@ def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), "source_subfolder") + license_file = "Note: The license for each file can be found in the file's header." + with open("LICENSE", "w") as text_file: + text_file.write(license_file) + + def build(self): pass From 9ab696f3f95186bb6802997362f6010030f50b91 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Tue, 21 Sep 2021 12:02:47 +0200 Subject: [PATCH 14/22] fix test_package to use nodeset_dir --- recipes/ua-nodeset/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ua-nodeset/all/test_package/conanfile.py b/recipes/ua-nodeset/all/test_package/conanfile.py index 0a86b887eb931..872e7a1f2874d 100644 --- a/recipes/ua-nodeset/all/test_package/conanfile.py +++ b/recipes/ua-nodeset/all/test_package/conanfile.py @@ -8,5 +8,5 @@ def build(self): pass def test(self): - assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_path, "PLCopen")) + assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) From 7dc143f06c80c65213877c5e2afc621aa783025f Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Wed, 22 Sep 2021 09:59:15 +0200 Subject: [PATCH 15/22] Apply suggestions from code review Apply license fixes Co-authored-by: Uilian Ries --- recipes/ua-nodeset/all/conanfile.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index b23397f3b3391..2f4458b2ca4e6 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -6,14 +6,11 @@ class UaNodeSetConan(ConanFile): name = "ua-nodeset" - license = "UNKNOWN" # https://github.com/OPCFoundation/UA-Nodeset/issues/79 + 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", "open62541", "iec-62541", - "industrial automation", "nodeset" - ) + topics = ("opc-ua-specifications", "uanodeset", "normative-files", "companion-specification") no_copy_source = True @@ -22,9 +19,10 @@ def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), "source_subfolder") - license_file = "Note: The license for each file can be found in the file's header." - with open("LICENSE", "w") as text_file: - text_file.write(license_file) + def _extract_license(self): + content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "UA-Nodeset", "AnsiC", "opcua_clientapi.c")) + license_contents = content[2:content.find("*/", 1)] + tools.save("LICENSE", license_contents) def build(self): From 3723652651ffa0a56ca2ebf1368ed68d5010a2f0 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Wed, 22 Sep 2021 10:09:58 +0200 Subject: [PATCH 16/22] fix: minor fixes for license file --- recipes/ua-nodeset/all/conanfile.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 2f4458b2ca4e6..90a08038fc2c5 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -14,15 +14,20 @@ class UaNodeSetConan(ConanFile): 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]) - os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), "source_subfolder") + os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), self._source_subfolder) + self._extract_license() - def _extract_license(self): - content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "UA-Nodeset", "AnsiC", "opcua_clientapi.c")) - license_contents = content[2:content.find("*/", 1)] - tools.save("LICENSE", license_contents) def build(self): @@ -30,7 +35,7 @@ def build(self): def package(self): - self.copy("*", dst="res", src="source_subfolder") + self.copy("*", dst="res", src=self._source_subfolder) self.copy("LICENSE", dst="licenses") From aa96f30d93bad1d9760862d9af9ec984e40feceb Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Wed, 22 Sep 2021 20:59:51 +0200 Subject: [PATCH 17/22] Apply suggestions from code review Co-authored-by: Uilian Ries --- recipes/ua-nodeset/all/conanfile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 90a08038fc2c5..2c6610386d575 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -26,15 +26,13 @@ def _extract_license(self): def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), self._source_subfolder) - self._extract_license() - - def build(self): pass def package(self): + self._extract_license() self.copy("*", dst="res", src=self._source_subfolder) self.copy("LICENSE", dst="licenses") From 094027bca0d91a08918ccd5e715a3dc0f581b987 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Wed, 22 Sep 2021 22:11:27 +0200 Subject: [PATCH 18/22] Update recipes/ua-nodeset/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/ua-nodeset/all/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 2c6610386d575..c3469484fddd6 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -24,8 +24,7 @@ def _extract_license(self): tools.save("LICENSE", license_contents) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), self._source_subfolder) + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def build(self): pass From fafc3b6efdea1476b8340c0740ec552d51ccd649 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Thu, 23 Sep 2021 08:25:51 +0200 Subject: [PATCH 19/22] fix: use correct version --- recipes/ua-nodeset/all/conandata.yml | 3 ++- recipes/ua-nodeset/config.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/ua-nodeset/all/conandata.yml b/recipes/ua-nodeset/all/conandata.yml index 5506990f474c4..ba50a41722204 100644 --- a/recipes/ua-nodeset/all/conandata.yml +++ b/recipes/ua-nodeset/all/conandata.yml @@ -1,4 +1,5 @@ sources: - "1.02-2021-07-21": + "1.04-2021-09-15": + # 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 diff --git a/recipes/ua-nodeset/config.yml b/recipes/ua-nodeset/config.yml index 88067bf2fd48a..3fbfec3f744e9 100644 --- a/recipes/ua-nodeset/config.yml +++ b/recipes/ua-nodeset/config.yml @@ -1,3 +1,3 @@ versions: - "1.02-2021-07-21": + "1.04-2021-09-15": folder: all From 1aff707773ec64d32311b94f9748cd02423c48ac Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Thu, 23 Sep 2021 15:29:08 +0200 Subject: [PATCH 20/22] fix: retrigger build --- recipes/ua-nodeset/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index c3469484fddd6..0414764f76035 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -40,3 +40,4 @@ 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") + From b063d0e8ee40f7865e1b071dbeaba0fcd01b3e0f Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Sat, 25 Sep 2021 17:27:09 +0200 Subject: [PATCH 21/22] fix: change version to `PADIM-1.02-2021-07-21` --- recipes/ua-nodeset/all/conandata.yml | 2 +- recipes/ua-nodeset/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/ua-nodeset/all/conandata.yml b/recipes/ua-nodeset/all/conandata.yml index ba50a41722204..0cf107121801d 100644 --- a/recipes/ua-nodeset/all/conandata.yml +++ b/recipes/ua-nodeset/all/conandata.yml @@ -1,5 +1,5 @@ sources: - "1.04-2021-09-15": + "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 diff --git a/recipes/ua-nodeset/config.yml b/recipes/ua-nodeset/config.yml index 3fbfec3f744e9..fd65508406103 100644 --- a/recipes/ua-nodeset/config.yml +++ b/recipes/ua-nodeset/config.yml @@ -1,3 +1,3 @@ versions: - "1.04-2021-09-15": + "PADIM-1.02-2021-07-21": folder: all From 49b808d2f06ad9a6fa1750f8a413303814ec6d1b Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Sat, 25 Sep 2021 17:30:59 +0200 Subject: [PATCH 22/22] fix: lowercase version --- recipes/ua-nodeset/all/conandata.yml | 2 +- recipes/ua-nodeset/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/ua-nodeset/all/conandata.yml b/recipes/ua-nodeset/all/conandata.yml index 0cf107121801d..53a56121e6682 100644 --- a/recipes/ua-nodeset/all/conandata.yml +++ b/recipes/ua-nodeset/all/conandata.yml @@ -1,5 +1,5 @@ sources: - "PADIM-1.02-2021-07-21": + "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 diff --git a/recipes/ua-nodeset/config.yml b/recipes/ua-nodeset/config.yml index fd65508406103..aa2c76941582c 100644 --- a/recipes/ua-nodeset/config.yml +++ b/recipes/ua-nodeset/config.yml @@ -1,3 +1,3 @@ versions: - "PADIM-1.02-2021-07-21": + "padim-1.02-2021-07-21": folder: all