From c90449a2b4977afe280da23e134e78c096ade67a Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 01:30:00 +0000 Subject: [PATCH 01/22] start skeleton data for vigra --- recipes/vigra/all/conandata.yml | 4 ++++ recipes/vigra/config.yml | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 recipes/vigra/all/conandata.yml create mode 100644 recipes/vigra/config.yml diff --git a/recipes/vigra/all/conandata.yml b/recipes/vigra/all/conandata.yml new file mode 100644 index 0000000000000..ef2e4ddaf09bc --- /dev/null +++ b/recipes/vigra/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.11.2": + url: "https://github.com/ukoethe/vigra/archive/refs/tags/Version-1-11-2.tar.gz" + sha256: "4841936f5c3c137611ec782e293d961df29d3b5b70ade8cb711374de0f4cb5d3" diff --git a/recipes/vigra/config.yml b/recipes/vigra/config.yml new file mode 100644 index 0000000000000..68804c58d126a --- /dev/null +++ b/recipes/vigra/config.yml @@ -0,0 +1,3 @@ +versions: + "1.11.2": + folder: all From 76a493e1b6a647c49cb0830b881de17504d74c1f Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 01:48:26 +0000 Subject: [PATCH 02/22] start on conanfile for vigra --- recipes/vigra/all/conanfile.py | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 recipes/vigra/all/conanfile.py diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py new file mode 100644 index 0000000000000..2af2af06da13c --- /dev/null +++ b/recipes/vigra/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get + +class VigraConan(ConanFile): + name = "vigra" + description = "A generic C++ library for image analysis" + license = "MIT" + url = "https://github.com/ukoethe/vigra" + homepage = "http://ukoethe.github.io/vigra/" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared" : [True, False], + "with_hdf5" : [True, False], + "with_openexr" : [True, False], + "with_boost_graph" : [True, False] + } + + default_options = {"shared" : False, + "with_hdf5": True, + "with_openexr" : True, + "with_boost_graph" : True} + + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libtiff/4.6.0") + self.requires("libpng/1.6.43") + self.requires("fftw/3.3.10") + + if self.options.with_hdf5: + self.requires("hdf5/1.14.3") + + if self.options.with_openexr: + self.requires("openexr/3.2.3") + + if self.options.with_boost_graph: + self.requires("boost/1.84.0") + + #override since current openexr breaks this + self.requires("libdeflate/1.19", override=True) + + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["WITH_VIGRANUMPY"] = False + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cm = CMake(self) + cm.configure() + + cm.build() + From 6a3cb44b9f785484c4ffecb94b3efcaa92e0ca1d Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 02:54:01 +0000 Subject: [PATCH 03/22] now seems to build locally --- recipes/vigra/all/conandata.yml | 6 ++++ recipes/vigra/all/conanfile.py | 34 ++++++++++++++++--- .../1.11.2-001-disable_doc_build.patch | 13 +++++++ recipes/vigra/all/test_package/CMakeLists.txt | 7 ++++ recipes/vigra/all/test_package/conanfile.py | 25 ++++++++++++++ recipes/vigra/all/test_package/main.cpp | 23 +++++++++++++ 6 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch create mode 100644 recipes/vigra/all/test_package/CMakeLists.txt create mode 100644 recipes/vigra/all/test_package/conanfile.py create mode 100644 recipes/vigra/all/test_package/main.cpp diff --git a/recipes/vigra/all/conandata.yml b/recipes/vigra/all/conandata.yml index ef2e4ddaf09bc..8ff2ed15b019a 100644 --- a/recipes/vigra/all/conandata.yml +++ b/recipes/vigra/all/conandata.yml @@ -2,3 +2,9 @@ sources: "1.11.2": url: "https://github.com/ukoethe/vigra/archive/refs/tags/Version-1-11-2.tar.gz" sha256: "4841936f5c3c137611ec782e293d961df29d3b5b70ade8cb711374de0f4cb5d3" +patches: + "1.11.2": + - patch_file: "patches/1.11.2-001-disable_doc_build.patch" + patch_description: "enable build to proceed when documentation is disabled" + patch_type: "conan" + diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 2af2af06da13c..adb27c9ca2b02 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout -from conan.tools.files import get +from conan.tools.files import get, apply_conandata_patches, rm, collect_libs +import pathlib class VigraConan(ConanFile): name = "vigra" @@ -13,19 +14,24 @@ class VigraConan(ConanFile): "shared" : [True, False], "with_hdf5" : [True, False], "with_openexr" : [True, False], - "with_boost_graph" : [True, False] + "with_boost_graph" : [True, False], + "with_lemon" : [True, False] } default_options = {"shared" : False, "with_hdf5": True, "with_openexr" : True, - "with_boost_graph" : True} + "with_boost_graph" : True, + "with_lemon" : True} + exports_sources = "patches/*.patch" def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + apply_conandata_patches(self) + def layout(self): cmake_layout(self, src_folder="src") @@ -43,14 +49,21 @@ def requirements(self): if self.options.with_boost_graph: self.requires("boost/1.84.0") - #override since current openexr breaks this + #override since current openexr package breaks this self.requires("libdeflate/1.19", override=True) def generate(self): tc = CMakeToolchain(self) tc.cache_variables["WITH_VIGRANUMPY"] = False + tc.cache_variables["BUILD_DOCS"] = False + tc.cache_variables["BUILD_TESTS"] = False + + tc.cache_variables["WITH_OPENEXR"] = self.options.with_openexr + tc.cache_variables["WITH_BOOST_GRAPH"] = self.options.with_boost_graph + tc.cache_variables["WITH_LEMON"] = False + tc.cache_variables["VIGRA_STATIC_LIB"] = not self.options.shared tc.generate() deps = CMakeDeps(self) @@ -58,7 +71,18 @@ def generate(self): def build(self): cm = CMake(self) - cm.configure() + cm.configure() cm.build() + def package(self): + cm = CMake(self) + cm.install() + + #remove generated cmake packages + rm(self, "*.cmake", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.set_property("cmake_file_name", "Vigra") + self.cpp_info.set_property("cmake_target_name", "vigraimpex") diff --git a/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch b/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch new file mode 100644 index 0000000000000..322479285c3dd --- /dev/null +++ b/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch @@ -0,0 +1,13 @@ +Index: CMakeLists.txt +=================================================================== +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -341,7 +341,7 @@ add_custom_target(PACKAGE_SRC_TAR + COMMENT "Creating ${PROJECT_BINARY_DIR}/vigra-${vigra_version}-src.tar.gz") + + ADD_DEPENDENCIES(PACKAGE_SRC_TAR check) +-ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_cpp) ++#ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_cpp) + IF(WITH_VIGRANUMPY AND PYTHON_SPHINX) + ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_python) + ENDIF() diff --git a/recipes/vigra/all/test_package/CMakeLists.txt b/recipes/vigra/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..57677d56579a4 --- /dev/null +++ b/recipes/vigra/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +project(vigra_conan_test) +cmake_minimum_required(VERSION 3.20) + +find_package(Vigra REQUIRED) + +add_executable(test_package main.cpp) +target_link_libraries(test_package vigraimpex) diff --git a/recipes/vigra/all/test_package/conanfile.py b/recipes/vigra/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38e592dc559ba --- /dev/null +++ b/recipes/vigra/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import pathlib + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cm = CMake(self) + cm.configure() + cm.build() + + def test(self): + if can_run(self): + bin_path = pathlib.Path(self.build_folder) / "test_package" + print(str(bin_path)) + self.run(bin_path, env="conanrun") diff --git a/recipes/vigra/all/test_package/main.cpp b/recipes/vigra/all/test_package/main.cpp new file mode 100644 index 0000000000000..5c166c70d3448 --- /dev/null +++ b/recipes/vigra/all/test_package/main.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + + +using std::cout; +using std::endl; + +using namespace vigra; + +int main() +{ + cout << "creating a fixed size vigra array.." << endl; + + vigra::TinyVector arr = {1.1, 2.2, 3.3, 4.4, 5.5}; + + + cout << "formats supported: " << endl; + impexListFormats(); + + cout << endl; + +} From cf599b86ab27d0518ee1c5e69a8046a8ce4a499a Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 02:58:27 +0000 Subject: [PATCH 04/22] fix yaml lint error --- recipes/vigra/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vigra/all/conandata.yml b/recipes/vigra/all/conandata.yml index 8ff2ed15b019a..af23eb77c8052 100644 --- a/recipes/vigra/all/conandata.yml +++ b/recipes/vigra/all/conandata.yml @@ -7,4 +7,4 @@ patches: - patch_file: "patches/1.11.2-001-disable_doc_build.patch" patch_description: "enable build to proceed when documentation is disabled" patch_type: "conan" - + From 02c45c64661f0c0ac16a22cfc17ac513dbd3edef Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 03:00:10 +0000 Subject: [PATCH 05/22] remove trailing line in yaml --- recipes/vigra/all/conandata.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/vigra/all/conandata.yml b/recipes/vigra/all/conandata.yml index af23eb77c8052..1d74fa25b7f22 100644 --- a/recipes/vigra/all/conandata.yml +++ b/recipes/vigra/all/conandata.yml @@ -7,4 +7,3 @@ patches: - patch_file: "patches/1.11.2-001-disable_doc_build.patch" patch_description: "enable build to proceed when documentation is disabled" patch_type: "conan" - From 0793186e06d899937a3dda625f10b424e3405f3f Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 03:15:01 +0000 Subject: [PATCH 06/22] add option for LEMON --- recipes/vigra/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index adb27c9ca2b02..38a16eed356eb 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -49,6 +49,9 @@ def requirements(self): if self.options.with_boost_graph: self.requires("boost/1.84.0") + if self.options.with_lemon: + self.requires("coin-lemon/1.3.1") + #override since current openexr package breaks this self.requires("libdeflate/1.19", override=True) @@ -61,7 +64,7 @@ def generate(self): tc.cache_variables["WITH_OPENEXR"] = self.options.with_openexr tc.cache_variables["WITH_BOOST_GRAPH"] = self.options.with_boost_graph - tc.cache_variables["WITH_LEMON"] = False + tc.cache_variables["WITH_LEMON"] = self.options.with_lemon tc.cache_variables["VIGRA_STATIC_LIB"] = not self.options.shared tc.generate() From 100a2d318cf4d0f5935d0a441ed60b30ed34b59e Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 03:18:54 +0000 Subject: [PATCH 07/22] silence some lint errors --- recipes/vigra/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 38a16eed356eb..46a6270336498 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -10,8 +10,10 @@ class VigraConan(ConanFile): url = "https://github.com/ukoethe/vigra" homepage = "http://ukoethe.github.io/vigra/" settings = "os", "arch", "compiler", "build_type" + topics = "image-processing", "computer-vision" options = { "shared" : [True, False], + "fPIC" : [True, False], "with_hdf5" : [True, False], "with_openexr" : [True, False], "with_boost_graph" : [True, False], From 1dacf59cc9d9c880ad254c5bb18f4b9f9e83e4d4 Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 03:19:24 +0000 Subject: [PATCH 08/22] fix linter error on cmake --- recipes/vigra/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vigra/all/test_package/CMakeLists.txt b/recipes/vigra/all/test_package/CMakeLists.txt index 57677d56579a4..98af0cc5bbf42 100644 --- a/recipes/vigra/all/test_package/CMakeLists.txt +++ b/recipes/vigra/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ +cmake_minimum_required(VERSION 3.6) project(vigra_conan_test) -cmake_minimum_required(VERSION 3.20) find_package(Vigra REQUIRED) From f53bea9b5c1fa49477099ed96f4f9f7059ae19bd Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 03:25:18 +0000 Subject: [PATCH 09/22] remove override stuff --- recipes/vigra/all/conanfile.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 46a6270336498..34aef4aa367bf 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -21,6 +21,7 @@ class VigraConan(ConanFile): } default_options = {"shared" : False, + "fPIC" : True, "with_hdf5": True, "with_openexr" : True, "with_boost_graph" : True, @@ -37,6 +38,14 @@ def source(self): def layout(self): cmake_layout(self, src_folder="src") + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + def requirements(self): self.requires("libtiff/4.6.0") self.requires("libpng/1.6.43") @@ -54,10 +63,6 @@ def requirements(self): if self.options.with_lemon: self.requires("coin-lemon/1.3.1") - #override since current openexr package breaks this - self.requires("libdeflate/1.19", override=True) - - def generate(self): tc = CMakeToolchain(self) tc.cache_variables["WITH_VIGRANUMPY"] = False From 8f710f8d8101169bdd5a80f7f7218e9b68e71292 Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 03:26:56 +0000 Subject: [PATCH 10/22] fix url to point to CCI --- recipes/vigra/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 34aef4aa367bf..40b822ab0d8be 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -7,7 +7,7 @@ class VigraConan(ConanFile): name = "vigra" description = "A generic C++ library for image analysis" license = "MIT" - url = "https://github.com/ukoethe/vigra" + url = "https://github.com/conan-io/conan-center-index" homepage = "http://ukoethe.github.io/vigra/" settings = "os", "arch", "compiler", "build_type" topics = "image-processing", "computer-vision" From 692278992571baaada0fb002ffa9d9d599727210 Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Mar 2024 03:29:14 +0000 Subject: [PATCH 11/22] fix test to actually display impex formats --- recipes/vigra/all/test_package/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/vigra/all/test_package/main.cpp b/recipes/vigra/all/test_package/main.cpp index 5c166c70d3448..a91dfe04621a5 100644 --- a/recipes/vigra/all/test_package/main.cpp +++ b/recipes/vigra/all/test_package/main.cpp @@ -16,8 +16,7 @@ int main() cout << "formats supported: " << endl; - impexListFormats(); + cout << impexListFormats() << endl; - cout << endl; } From 2ecd1d6e1c649fd3dab8ddd5946db830a36fb238 Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 6 Jun 2024 18:45:06 +0200 Subject: [PATCH 12/22] some fixes --- recipes/vigra/all/conanfile.py | 62 ++++++++++--------- recipes/vigra/all/test_package/CMakeLists.txt | 2 +- recipes/vigra/all/test_package/conanfile.py | 1 + recipes/vigra/all/test_package/main.cpp | 12 ++-- 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 40b822ab0d8be..97e1ab6f45193 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout -from conan.tools.files import get, apply_conandata_patches, rm, collect_libs -import pathlib +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, collect_libs + class VigraConan(ConanFile): name = "vigra" @@ -9,25 +9,30 @@ class VigraConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "http://ukoethe.github.io/vigra/" + package_type = "library" settings = "os", "arch", "compiler", "build_type" topics = "image-processing", "computer-vision" + options = { - "shared" : [True, False], - "fPIC" : [True, False], - "with_hdf5" : [True, False], - "with_openexr" : [True, False], - "with_boost_graph" : [True, False], - "with_lemon" : [True, False] - } - - default_options = {"shared" : False, - "fPIC" : True, - "with_hdf5": True, - "with_openexr" : True, - "with_boost_graph" : True, - "with_lemon" : True} - - exports_sources = "patches/*.patch" + "shared": [True, False], + "fPIC": [True, False], + "with_hdf5": [True, False], + "with_openexr": [True, False], + "with_boost_graph": [True, False], + "with_lemon": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "with_hdf5": True, + "with_openexr": True, + "with_boost_graph": True, + "with_lemon": True, + } + + def export_sources(self): + export_conandata_patches(self) def source(self): get(self, **self.conan_data["sources"][self.version], @@ -41,24 +46,26 @@ def layout(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - + def configure(self): if self.options.shared: - del self.options.fPIC - + self.options.rm_safe("fPIC") + def requirements(self): self.requires("libtiff/4.6.0") self.requires("libpng/1.6.43") self.requires("fftw/3.3.10") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libjpeg/9e") if self.options.with_hdf5: self.requires("hdf5/1.14.3") if self.options.with_openexr: - self.requires("openexr/3.2.3") + self.requires("openexr/3.2.4") if self.options.with_boost_graph: - self.requires("boost/1.84.0") + self.requires("boost/1.85.0") if self.options.with_lemon: self.requires("coin-lemon/1.3.1") @@ -80,16 +87,13 @@ def generate(self): deps.generate() def build(self): - cm = CMake(self) - - cm.configure() - cm.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): cm = CMake(self) cm.install() - - #remove generated cmake packages rm(self, "*.cmake", self.package_folder, recursive=True) def package_info(self): diff --git a/recipes/vigra/all/test_package/CMakeLists.txt b/recipes/vigra/all/test_package/CMakeLists.txt index 98af0cc5bbf42..b7e6698d55b1b 100644 --- a/recipes/vigra/all/test_package/CMakeLists.txt +++ b/recipes/vigra/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(vigra_conan_test) find_package(Vigra REQUIRED) diff --git a/recipes/vigra/all/test_package/conanfile.py b/recipes/vigra/all/test_package/conanfile.py index 38e592dc559ba..648246ef04729 100644 --- a/recipes/vigra/all/test_package/conanfile.py +++ b/recipes/vigra/all/test_package/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.cmake import CMake, cmake_layout import pathlib + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" diff --git a/recipes/vigra/all/test_package/main.cpp b/recipes/vigra/all/test_package/main.cpp index a91dfe04621a5..84b2dc0869089 100644 --- a/recipes/vigra/all/test_package/main.cpp +++ b/recipes/vigra/all/test_package/main.cpp @@ -2,7 +2,6 @@ #include #include - using std::cout; using std::endl; @@ -10,13 +9,10 @@ using namespace vigra; int main() { - cout << "creating a fixed size vigra array.." << endl; - - vigra::TinyVector arr = {1.1, 2.2, 3.3, 4.4, 5.5}; - + cout << "creating a fixed size vigra array.." << endl; - cout << "formats supported: " << endl; - cout << impexListFormats() << endl; + vigra::TinyVector arr = {1.1, 2.2, 3.3, 4.4, 5.5}; - + cout << "formats supported: " << endl; + cout << impexListFormats() << endl; } From 51ca9ae9dffcde895f2a190263beb91f869f66cc Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 6 Jun 2024 20:14:31 +0200 Subject: [PATCH 13/22] more fixes --- recipes/vigra/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 97e1ab6f45193..231d49d6cae8c 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -1,6 +1,7 @@ +import os from conan import ConanFile from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout -from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, collect_libs +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy, collect_libs class VigraConan(ConanFile): @@ -92,11 +93,12 @@ def build(self): cmake.build() def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) cm = CMake(self) cm.install() rm(self, "*.cmake", self.package_folder, recursive=True) def package_info(self): - self.cpp_info.libs = collect_libs(self) + self.cpp_info.libs = ["vigraimpex"] self.cpp_info.set_property("cmake_file_name", "Vigra") self.cpp_info.set_property("cmake_target_name", "vigraimpex") From acfed1af9822ae43a16a1a64bb1a3ea452316bc7 Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Thu, 6 Jun 2024 21:59:01 +0200 Subject: [PATCH 14/22] Update recipes/vigra/all/test_package/conanfile.py --- recipes/vigra/all/test_package/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/vigra/all/test_package/conanfile.py b/recipes/vigra/all/test_package/conanfile.py index 648246ef04729..279c72c884963 100644 --- a/recipes/vigra/all/test_package/conanfile.py +++ b/recipes/vigra/all/test_package/conanfile.py @@ -22,5 +22,4 @@ def build(self): def test(self): if can_run(self): bin_path = pathlib.Path(self.build_folder) / "test_package" - print(str(bin_path)) self.run(bin_path, env="conanrun") From 8a9fe41cb5cc45507f5f121ac8b3e84e99471e45 Mon Sep 17 00:00:00 2001 From: czoido Date: Fri, 7 Jun 2024 06:38:31 +0200 Subject: [PATCH 15/22] add min cppstd, improve test package --- recipes/vigra/all/conanfile.py | 5 +++++ recipes/vigra/all/test_package/CMakeLists.txt | 9 +++++---- .../all/test_package/{main.cpp => test_package.cpp} | 0 3 files changed, 10 insertions(+), 4 deletions(-) rename recipes/vigra/all/test_package/{main.cpp => test_package.cpp} (100%) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 231d49d6cae8c..648b7c68838ae 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -1,5 +1,6 @@ import os from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy, collect_libs @@ -71,6 +72,10 @@ def requirements(self): if self.options.with_lemon: self.requires("coin-lemon/1.3.1") + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + def generate(self): tc = CMakeToolchain(self) tc.cache_variables["WITH_VIGRANUMPY"] = False diff --git a/recipes/vigra/all/test_package/CMakeLists.txt b/recipes/vigra/all/test_package/CMakeLists.txt index b7e6698d55b1b..8063e47f90875 100644 --- a/recipes/vigra/all/test_package/CMakeLists.txt +++ b/recipes/vigra/all/test_package/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.15) -project(vigra_conan_test) +project(test_package LANGUAGES CXX) -find_package(Vigra REQUIRED) +find_package(Vigra REQUIRED CONFIG) -add_executable(test_package main.cpp) -target_link_libraries(test_package vigraimpex) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vigraimpex) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vigra/all/test_package/main.cpp b/recipes/vigra/all/test_package/test_package.cpp similarity index 100% rename from recipes/vigra/all/test_package/main.cpp rename to recipes/vigra/all/test_package/test_package.cpp From ed811b9e55159ba09b54a1d3114c4dcee9bc9a31 Mon Sep 17 00:00:00 2001 From: czoido Date: Fri, 7 Jun 2024 06:57:48 +0200 Subject: [PATCH 16/22] add imath requirement --- recipes/vigra/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 648b7c68838ae..c1eb4a486ce18 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -65,6 +65,7 @@ def requirements(self): if self.options.with_openexr: self.requires("openexr/3.2.4") + self.requires("imath/3.1.9") if self.options.with_boost_graph: self.requires("boost/1.85.0") From 6f6eb34b3cce15299181e7c68c2f8ac4f7c8484c Mon Sep 17 00:00:00 2001 From: czoido Date: Fri, 7 Jun 2024 15:55:55 +0200 Subject: [PATCH 17/22] fix folder --- recipes/vigra/all/test_package/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/vigra/all/test_package/conanfile.py b/recipes/vigra/all/test_package/conanfile.py index 279c72c884963..4385dcaa88926 100644 --- a/recipes/vigra/all/test_package/conanfile.py +++ b/recipes/vigra/all/test_package/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout -import pathlib +import os class TestPackageConan(ConanFile): @@ -21,5 +21,5 @@ def build(self): def test(self): if can_run(self): - bin_path = pathlib.Path(self.build_folder) / "test_package" + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") From baa01a00fa359e65fc7dd4897dde8f0e922ffab3 Mon Sep 17 00:00:00 2001 From: czoido Date: Fri, 7 Jun 2024 16:02:15 +0200 Subject: [PATCH 18/22] propagate definition to consumers --- recipes/vigra/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index c1eb4a486ce18..2360ae26cc393 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -106,5 +106,7 @@ def package(self): def package_info(self): self.cpp_info.libs = ["vigraimpex"] + if not self.options.shared: + self.cpp_info.defines = ["VIGRA_STATIC_LIB"] self.cpp_info.set_property("cmake_file_name", "Vigra") self.cpp_info.set_property("cmake_target_name", "vigraimpex") From b6fa7a5644605e63d489e29c7212c84e619d94b8 Mon Sep 17 00:00:00 2001 From: czoido Date: Fri, 7 Jun 2024 16:03:52 +0200 Subject: [PATCH 19/22] clean --- recipes/vigra/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 2360ae26cc393..4a8a827373c5f 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -2,7 +2,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout -from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy, collect_libs +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy class VigraConan(ConanFile): From baa49f8c5d0c4cb483346bde9831bfa7feb3b7bb Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Fri, 7 Jun 2024 16:05:50 +0200 Subject: [PATCH 20/22] Update recipes/vigra/all/conanfile.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rubén Rincón Blanco --- recipes/vigra/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 4a8a827373c5f..7d9c980f692f6 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -55,7 +55,7 @@ def configure(self): def requirements(self): self.requires("libtiff/4.6.0") - self.requires("libpng/1.6.43") + self.requires("libpng/[>=1.6 <2]") self.requires("fftw/3.3.10") self.requires("zlib/[>=1.2.11 <2]") self.requires("libjpeg/9e") From e4174c53c4c24a830ff34b707121dd3902a37ace Mon Sep 17 00:00:00 2001 From: czoido Date: Mon, 10 Jun 2024 08:03:00 +0200 Subject: [PATCH 21/22] add windows system_libs --- recipes/vigra/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 4a8a827373c5f..0f32fee076db5 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -105,8 +105,12 @@ def package(self): rm(self, "*.cmake", self.package_folder, recursive=True) def package_info(self): - self.cpp_info.libs = ["vigraimpex"] if not self.options.shared: self.cpp_info.defines = ["VIGRA_STATIC_LIB"] + + self.cpp_info.libs = ["vigraimpex"] self.cpp_info.set_property("cmake_file_name", "Vigra") self.cpp_info.set_property("cmake_target_name", "vigraimpex") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shlwapi") From 125e1ec2e87a3915139c4980ee60e74bbece68a3 Mon Sep 17 00:00:00 2001 From: czoido Date: Mon, 17 Jun 2024 08:09:55 +0200 Subject: [PATCH 22/22] fix relocatable libs --- recipes/vigra/all/conanfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py index 9843b6e437bf9..0ac9a204a6384 100644 --- a/recipes/vigra/all/conanfile.py +++ b/recipes/vigra/all/conanfile.py @@ -2,7 +2,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout -from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy, replace_in_file class VigraConan(ConanFile): @@ -41,6 +41,12 @@ def source(self): destination=self.source_folder, strip_root=True) apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "src", "impex", "CMakeLists.txt"), + 'SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}"', + 'SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" INSTALL_NAME_DIR "@rpath"' + ) def layout(self): cmake_layout(self, src_folder="src") @@ -103,6 +109,7 @@ def package(self): cm = CMake(self) cm.install() rm(self, "*.cmake", self.package_folder, recursive=True) + #fix_apple_shared_install_name(self) def package_info(self): if not self.options.shared: