From 3c17cdb0e9400bf1b20c7da54ab694b17a756913 Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Mon, 25 Oct 2021 08:07:52 -0700 Subject: [PATCH 1/8] conan-io#7646 add source for newer releases of draco --- recipes/draco/all/conandata.yml | 9 +++++++++ recipes/draco/config.yml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/recipes/draco/all/conandata.yml b/recipes/draco/all/conandata.yml index e6fb7418138c2..8df7918db2c69 100644 --- a/recipes/draco/all/conandata.yml +++ b/recipes/draco/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.4.3": + url: "https://github.com/google/draco/archive/1.4.3.tar.gz" + sha256: "02a620a7ff8388c57d6f6e0941eecc10d0c23ab47c45942fb52f64a6245c44f5" + "1.4.1": + url: "https://github.com/google/draco/archive/1.4.1.tar.gz" + sha256: "83aa5637d36a835103a61f96af7ff04c6d6528e643909466595d51ee715417a9" + "1.4.0": + url: "https://github.com/google/draco/archive/1.4.0.tar.gz" + sha256: "a5e0e923e6ddc087f6a4487499eadb9014d1e32ed4495bb10b663b9216495fab" "1.3.6": url: "https://github.com/google/draco/archive/1.3.6.tar.gz" sha256: "80eaa54ef5fc687c9aeebb9bd24d936d3e6d2c6048f358be8b83fa088ef4b2cb" diff --git a/recipes/draco/config.yml b/recipes/draco/config.yml index 10d3a845bf8c7..ea4afa0c820a1 100644 --- a/recipes/draco/config.yml +++ b/recipes/draco/config.yml @@ -1,4 +1,10 @@ versions: + "1.4.3": + folder: all + "1.4.1": + folder: all + "1.4.0": + folder: all "1.3.6": folder: all "1.3.5": From 5cb3fc9d55c2307188422179cedeba0994ad68db Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Mon, 25 Oct 2021 08:17:22 -0700 Subject: [PATCH 2/8] conan-io#7646 bring some changes in from gcc-11 work --- recipes/draco/all/conanfile.py | 31 ++++++++++++++------- recipes/draco/all/test_package/conanfile.py | 3 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/recipes/draco/all/conanfile.py b/recipes/draco/all/conanfile.py index 075c76ea7c9ae..fb15ff84d76d3 100644 --- a/recipes/draco/all/conanfile.py +++ b/recipes/draco/all/conanfile.py @@ -1,6 +1,8 @@ +from conans import ConanFile, CMake, tools import os -from conans import ConanFile, CMake, tools +required_conan_version = ">=1.33.0" + class DracoConan(ConanFile): name = "draco" @@ -8,7 +10,8 @@ class DracoConan(ConanFile): "geometric meshes and point clouds. It is intended to " \ "improve the storage and transmission of 3D graphics." license = "Apache-2.0" - topics = ("conan", "draco", "3d", "graphics", "mesh", "compression", "decompression") + topics = ("draco", "3d", "graphics", "mesh", + "compression", "decompression") homepage = "https://google.github.io/draco/" url = "https://github.com/conan-io/conan-center-index" exports_sources = ["CMakeLists.txt", "patches/**"] @@ -54,10 +57,12 @@ def configure(self): if not self.options.enable_mesh_compression: del self.options.enable_standard_edgebreaker del self.options.enable_predictive_edgebreaker + if self.options.shared: + del self.options.fPIC def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) def build(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): @@ -113,16 +118,22 @@ def _get_target(self): def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "src")) - self.copy(pattern="*.h", dst=os.path.join("include", "draco"), src=os.path.join(self._build_subfolder, "draco")) + self.copy(pattern="*.h", dst="include", + src=os.path.join(self._source_subfolder, "src")) + self.copy(pattern="*.h", dst=os.path.join("include", "draco"), + src=os.path.join(self._build_subfolder, "draco")) build_lib_dir = os.path.join(self._build_subfolder, "lib") build_bin_dir = os.path.join(self._build_subfolder, "bin") self.copy(pattern="*.a", dst="lib", src=build_lib_dir, keep_path=False) - self.copy(pattern="*.lib", dst="lib", src=build_lib_dir, keep_path=False) - self.copy(pattern="*.dylib", dst="lib", src=build_lib_dir, keep_path=False) - self.copy(pattern="*.so*", dst="lib", src=build_lib_dir, keep_path=False, symlinks=True) - self.copy(pattern="*.dll", dst="bin", src=build_bin_dir, keep_path=False) + self.copy(pattern="*.lib", dst="lib", + src=build_lib_dir, keep_path=False) + self.copy(pattern="*.dylib", dst="lib", + src=build_lib_dir, keep_path=False) + self.copy(pattern="*.so*", dst="lib", src=build_lib_dir, + keep_path=False, symlinks=True) + self.copy(pattern="*.dll", dst="bin", + src=build_bin_dir, keep_path=False) def package_info(self): self.cpp_info.names["cmake_find_package"] = "Draco" diff --git a/recipes/draco/all/test_package/conanfile.py b/recipes/draco/all/test_package/conanfile.py index ea57a464900be..4dea15a1318e1 100644 --- a/recipes/draco/all/test_package/conanfile.py +++ b/recipes/draco/all/test_package/conanfile.py @@ -2,6 +2,7 @@ from conans import ConanFile, CMake, tools + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" @@ -12,6 +13,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): + if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) From 84eed5e42f58a5c02e59e63bb31c6e6e17e3cd6f Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Mon, 25 Oct 2021 09:05:09 -0700 Subject: [PATCH 3/8] conan-io#7646 make draco build latest version --- recipes/draco/all/conanfile.py | 118 ++++++++++++++++++++++----------- 1 file changed, 80 insertions(+), 38 deletions(-) diff --git a/recipes/draco/all/conanfile.py b/recipes/draco/all/conanfile.py index fb15ff84d76d3..08a274ca2b9e1 100644 --- a/recipes/draco/all/conanfile.py +++ b/recipes/draco/all/conanfile.py @@ -21,7 +21,7 @@ class DracoConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "target": ["encode_and_decode", "encode_only", "decode_only"], + "target": ["draco", "draco_static", "encode_and_decode", "encode_only", "decode_only"], "enable_point_cloud_compression": [True, False], "enable_mesh_compression": [True, False], "enable_standard_edgebreaker": [True, False], @@ -70,50 +70,92 @@ def build(self): cmake = self._configure_cmake() cmake.build(target=self._get_target()) + def _version_conversion(self): + return list(map(int, self.version.split('.'))) + def _configure_cmake(self): + # use different cmake definitions based on package version + print("DEBUG: self.version: {}", self.version) + + major_version, minor_version, sub_version = self._version_conversion() + cmake = CMake(self) - cmake.definitions["ENABLE_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression - cmake.definitions["ENABLE_MESH_COMPRESSION"] = self.options.enable_mesh_compression - if self.options.enable_mesh_compression: - cmake.definitions["ENABLE_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker - cmake.definitions["ENABLE_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker - cmake.definitions["ENABLE_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility - - # BUILD_FOR_GLTF is not needed, it is equivalent to: - # - enable_point_cloud_compression=False - # - enable_mesh_compression=True - # - enable_standard_edgebreaker=True - # - enable_predictive_edgebreaker=False - # - enable_backwards_compatibility=False - cmake.definitions["BUILD_FOR_GLTF"] = False - - cmake.definitions["BUILD_UNITY_PLUGIN"] = False - cmake.definitions["BUILD_MAYA_PLUGIN"] = False - cmake.definitions["BUILD_USD_PLUGIN"] = False - - cmake.definitions["ENABLE_CCACHE"] = False - cmake.definitions["ENABLE_DISTCC"] = False - cmake.definitions["ENABLE_EXTRA_SPEED"] = False - cmake.definitions["ENABLE_EXTRA_WARNINGS"] = False - cmake.definitions["ENABLE_GOMA"] = False - cmake.definitions["ENABLE_JS_GLUE"] = False - cmake.definitions["ENABLE_DECODER_ATTRIBUTE_DEDUPLICATION"] = False - cmake.definitions["ENABLE_TESTS"] = False - cmake.definitions["ENABLE_WASM"] = False - cmake.definitions["ENABLE_WERROR"] = False - cmake.definitions["ENABLE_WEXTRA"] = False - cmake.definitions["IGNORE_EMPTY_BUILD_TYPE"] = False - cmake.definitions["BUILD_ANIMATION_ENCODING"] = False + + if major_version <= 1 and minor_version < 4: + cmake.definitions["ENABLE_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression + cmake.definitions["ENABLE_MESH_COMPRESSION"] = self.options.enable_mesh_compression + if self.options.enable_mesh_compression: + cmake.definitions["ENABLE_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker + cmake.definitions["ENABLE_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker + cmake.definitions["ENABLE_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility + + # BUILD_FOR_GLTF is not needed, it is equivalent to: + # - enable_point_cloud_compression=False + # - enable_mesh_compression=True + # - enable_standard_edgebreaker=True + # - enable_predictive_edgebreaker=False + # - enable_backwards_compatibility=False + cmake.definitions["BUILD_FOR_GLTF"] = False + + cmake.definitions["BUILD_UNITY_PLUGIN"] = False + cmake.definitions["BUILD_MAYA_PLUGIN"] = False + cmake.definitions["BUILD_USD_PLUGIN"] = False + + cmake.definitions["ENABLE_CCACHE"] = False + cmake.definitions["ENABLE_DISTCC"] = False + cmake.definitions["ENABLE_EXTRA_SPEED"] = False + cmake.definitions["ENABLE_EXTRA_WARNINGS"] = False + cmake.definitions["ENABLE_GOMA"] = False + cmake.definitions["ENABLE_JS_GLUE"] = False + cmake.definitions["ENABLE_DECODER_ATTRIBUTE_DEDUPLICATION"] = False + cmake.definitions["ENABLE_TESTS"] = False + cmake.definitions["ENABLE_WASM"] = False + cmake.definitions["ENABLE_WERROR"] = False + cmake.definitions["ENABLE_WEXTRA"] = False + cmake.definitions["IGNORE_EMPTY_BUILD_TYPE"] = False + cmake.definitions["BUILD_ANIMATION_ENCODING"] = False + else: + cmake.definitions["DRACO_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression + cmake.definitions["DRACO_MESH_COMPRESSION"] = self.options.enable_mesh_compression + if self.options.enable_mesh_compression: + cmake.definitions["DRACO_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker + cmake.definitions["DRACO_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker + cmake.definitions["DRACO_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility + + # DRACO_GLTF is not needed, it is equivalent to: + # - enable_point_cloud_compression=False + # - enable_mesh_compression=True + # - enable_standard_edgebreaker=True + # - enable_predictive_edgebreaker=False + # - enable_backwards_compatibility=False + cmake.definitions["DRACO_GLTF"] = False + + cmake.definitions["DRACO_UNITY_PLUGIN"] = False + cmake.definitions["DRACO_MAYA_PLUGIN"] = False + cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared + + cmake.definitions["DRACO_FAST"] = False + cmake.definitions["DRACO_JS_GLUE"] = False + cmake.definitions["DRACO_DECODER_ATTRIBUTE_DEDUPLICATION"] = False + cmake.definitions["DRACO_TESTS"] = False + cmake.definitions["DRACO_WASM"] = False + cmake.definitions["DRACO_ANIMATION_ENCODING"] = False cmake.configure(build_folder=self._build_subfolder) return cmake def _get_target(self): - return { - "encode_and_decode": "draco", - "encode_only": "dracoenc", - "decode_only": "dracodec" - }.get(str(self.options.target)) + major_version, minor_version, sub_version = self._version_conversion() + + if major_version <=1 and minor_version < 4: + return { + "encode_and_decode": "draco", + "encode_only": "dracoenc", + "decode_only": "dracodec" + }.get(str(self.options.target)) + if self.options.shared: + return "draco_shared" + return "draco_static" def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) From 4c3795b4277d0f8219488f21e8ab5a189a9dfcab Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Tue, 26 Oct 2021 08:40:00 -0700 Subject: [PATCH 4/8] conan-io#7646 some clean up of conanfile for draco --- recipes/draco/all/conanfile.py | 55 +++++++++++++--------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/recipes/draco/all/conanfile.py b/recipes/draco/all/conanfile.py index 08a274ca2b9e1..b8e38954038e6 100644 --- a/recipes/draco/all/conanfile.py +++ b/recipes/draco/all/conanfile.py @@ -21,7 +21,7 @@ class DracoConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "target": ["draco", "draco_static", "encode_and_decode", "encode_only", "decode_only"], + "target": ["draco", "encode_and_decode", "encode_only", "decode_only"], "enable_point_cloud_compression": [True, False], "enable_mesh_compression": [True, False], "enable_standard_edgebreaker": [True, False], @@ -31,7 +31,7 @@ class DracoConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "target": "encode_and_decode", + "target": "draco", "enable_point_cloud_compression": True, "enable_mesh_compression": True, "enable_standard_edgebreaker": True, @@ -70,25 +70,18 @@ def build(self): cmake = self._configure_cmake() cmake.build(target=self._get_target()) - def _version_conversion(self): - return list(map(int, self.version.split('.'))) - def _configure_cmake(self): - # use different cmake definitions based on package version - print("DEBUG: self.version: {}", self.version) - - major_version, minor_version, sub_version = self._version_conversion() - cmake = CMake(self) - if major_version <= 1 and minor_version < 4: + # use different cmake definitions based on package version + if tools.Version(self.version) < "1.4.0": cmake.definitions["ENABLE_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression cmake.definitions["ENABLE_MESH_COMPRESSION"] = self.options.enable_mesh_compression if self.options.enable_mesh_compression: cmake.definitions["ENABLE_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker cmake.definitions["ENABLE_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker cmake.definitions["ENABLE_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility - + # BUILD_FOR_GLTF is not needed, it is equivalent to: # - enable_point_cloud_compression=False # - enable_mesh_compression=True @@ -96,11 +89,11 @@ def _configure_cmake(self): # - enable_predictive_edgebreaker=False # - enable_backwards_compatibility=False cmake.definitions["BUILD_FOR_GLTF"] = False - + cmake.definitions["BUILD_UNITY_PLUGIN"] = False cmake.definitions["BUILD_MAYA_PLUGIN"] = False cmake.definitions["BUILD_USD_PLUGIN"] = False - + cmake.definitions["ENABLE_CCACHE"] = False cmake.definitions["ENABLE_DISTCC"] = False cmake.definitions["ENABLE_EXTRA_SPEED"] = False @@ -120,38 +113,32 @@ def _configure_cmake(self): if self.options.enable_mesh_compression: cmake.definitions["DRACO_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker cmake.definitions["DRACO_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker - cmake.definitions["DRACO_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility - - # DRACO_GLTF is not needed, it is equivalent to: - # - enable_point_cloud_compression=False - # - enable_mesh_compression=True - # - enable_standard_edgebreaker=True - # - enable_predictive_edgebreaker=False - # - enable_backwards_compatibility=False - cmake.definitions["DRACO_GLTF"] = False - - cmake.definitions["DRACO_UNITY_PLUGIN"] = False - cmake.definitions["DRACO_MAYA_PLUGIN"] = False cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared - + cmake.definitions["DRACO_ANIMATION_ENCODING"] = False + cmake.definitions["DRACO_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility + cmake.definitions["DRACO_DECODER_ATTRIBUTE_DEDUPLICATION"] = False cmake.definitions["DRACO_FAST"] = False + # DRACO_GLTF True overrides options by enabling + # DRACO_MESH_COMPRESSION_SUPPORTED, + # DRACO_NORMAL_ENCODING_SUPPORTED, + # DRACO_STANDARD_EDGEBREAKER_SUPPORTED + cmake.definitions["DRACO_GLTF"] = False cmake.definitions["DRACO_JS_GLUE"] = False - cmake.definitions["DRACO_DECODER_ATTRIBUTE_DEDUPLICATION"] = False + cmake.definitions["DRACO_MAYA_PLUGIN"] = False cmake.definitions["DRACO_TESTS"] = False + cmake.definitions["DRACO_UNITY_PLUGIN"] = False cmake.definitions["DRACO_WASM"] = False - cmake.definitions["DRACO_ANIMATION_ENCODING"] = False cmake.configure(build_folder=self._build_subfolder) return cmake def _get_target(self): - major_version, minor_version, sub_version = self._version_conversion() - - if major_version <=1 and minor_version < 4: + if tools.Version(self.version) < "1.4.0": return { + "decode_only": "dracodec", + "draco": "draco", "encode_and_decode": "draco", - "encode_only": "dracoenc", - "decode_only": "dracodec" + "encode_only": "dracoenc" }.get(str(self.options.target)) if self.options.shared: return "draco_shared" From 8abf3fa582bfed45c94b9c8323be114bd6eccb02 Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Tue, 26 Oct 2021 08:50:28 -0700 Subject: [PATCH 5/8] conan-io#7646 clean up imports in draco test_package/conanfile.py --- recipes/draco/all/test_package/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/draco/all/test_package/conanfile.py b/recipes/draco/all/test_package/conanfile.py index 4dea15a1318e1..d4128b0450777 100644 --- a/recipes/draco/all/test_package/conanfile.py +++ b/recipes/draco/all/test_package/conanfile.py @@ -1,6 +1,5 @@ -import os - from conans import ConanFile, CMake, tools +import os class TestPackageConan(ConanFile): From f15f15b2efe94f300197b0021957653af69f62ab Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Tue, 26 Oct 2021 13:49:02 -0700 Subject: [PATCH 6/8] conan-io#7646 empty commit due to unknown error in ci/cd From a46359caf5c0c797b24dfa6a27d5b0e07997b098 Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Wed, 27 Oct 2021 08:21:46 -0700 Subject: [PATCH 7/8] conan-io#7646 remove support for draco/1.4.0 and draco/1.4.0 --- recipes/draco/all/conandata.yml | 6 ------ recipes/draco/config.yml | 4 ---- 2 files changed, 10 deletions(-) diff --git a/recipes/draco/all/conandata.yml b/recipes/draco/all/conandata.yml index 9df0f138e5194..93dce7b2db439 100644 --- a/recipes/draco/all/conandata.yml +++ b/recipes/draco/all/conandata.yml @@ -2,12 +2,6 @@ sources: "1.4.3": url: "https://github.com/google/draco/archive/1.4.3.tar.gz" sha256: "02a620a7ff8388c57d6f6e0941eecc10d0c23ab47c45942fb52f64a6245c44f5" - "1.4.1": - url: "https://github.com/google/draco/archive/1.4.1.tar.gz" - sha256: "83aa5637d36a835103a61f96af7ff04c6d6528e643909466595d51ee715417a9" - "1.4.0": - url: "https://github.com/google/draco/archive/1.4.0.tar.gz" - sha256: "a5e0e923e6ddc087f6a4487499eadb9014d1e32ed4495bb10b663b9216495fab" "1.3.6": url: "https://github.com/google/draco/archive/1.3.6.tar.gz" sha256: "80eaa54ef5fc687c9aeebb9bd24d936d3e6d2c6048f358be8b83fa088ef4b2cb" diff --git a/recipes/draco/config.yml b/recipes/draco/config.yml index ea4afa0c820a1..d8a8747cda6b5 100644 --- a/recipes/draco/config.yml +++ b/recipes/draco/config.yml @@ -1,10 +1,6 @@ versions: "1.4.3": folder: all - "1.4.1": - folder: all - "1.4.0": - folder: all "1.3.6": folder: all "1.3.5": From 7c8bb948b56d3175b9a097263be3a6df6fcff965 Mon Sep 17 00:00:00 2001 From: Nicholas Lederer Date: Wed, 27 Oct 2021 23:27:15 -0700 Subject: [PATCH 8/8] conan-io#7646 specify the build target correctly on windows. --- recipes/draco/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/draco/all/conanfile.py b/recipes/draco/all/conanfile.py index b8e38954038e6..0d9c5872c7b8b 100644 --- a/recipes/draco/all/conanfile.py +++ b/recipes/draco/all/conanfile.py @@ -140,8 +140,13 @@ def _get_target(self): "encode_and_decode": "draco", "encode_only": "dracoenc" }.get(str(self.options.target)) + + if self.settings.os == "Windows": + return "draco" + if self.options.shared: return "draco_shared" + return "draco_static" def package(self):