Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new library: Vigra #23235

Merged
merged 27 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c90449a
start skeleton data for vigra
weatherhead99 Mar 25, 2024
76a493e
start on conanfile for vigra
weatherhead99 Mar 25, 2024
6a3cb44
now seems to build locally
weatherhead99 Mar 25, 2024
cf599b8
fix yaml lint error
weatherhead99 Mar 25, 2024
02c45c6
remove trailing line in yaml
weatherhead99 Mar 25, 2024
0793186
add option for LEMON
weatherhead99 Mar 25, 2024
100a2d3
silence some lint errors
weatherhead99 Mar 25, 2024
1dacf59
fix linter error on cmake
weatherhead99 Mar 25, 2024
f53bea9
remove override stuff
weatherhead99 Mar 25, 2024
8f710f8
fix url to point to CCI
weatherhead99 Mar 25, 2024
6922789
fix test to actually display impex formats
weatherhead99 Mar 25, 2024
2ecd1d6
some fixes
czoido Jun 6, 2024
51ca9ae
more fixes
czoido Jun 6, 2024
55aaecc
Merge branch 'master' into vigra
czoido Jun 6, 2024
acfed1a
Update recipes/vigra/all/test_package/conanfile.py
czoido Jun 6, 2024
8a9fe41
add min cppstd, improve test package
czoido Jun 7, 2024
ed811b9
add imath requirement
czoido Jun 7, 2024
6f6eb34
fix folder
czoido Jun 7, 2024
baa01a0
propagate definition to consumers
czoido Jun 7, 2024
b6fa7a5
clean
czoido Jun 7, 2024
035e325
Merge branch 'master' into vigra
czoido Jun 7, 2024
baa49f8
Update recipes/vigra/all/conanfile.py
czoido Jun 7, 2024
e4174c5
add windows system_libs
czoido Jun 10, 2024
7858cd7
Merge branch 'vigra' of github.com:weatherhead99/conan-center-index i…
czoido Jun 10, 2024
f2f65be
Merge branch 'master' into vigra
czoido Jun 10, 2024
125e1ec
fix relocatable libs
czoido Jun 17, 2024
d0b5324
Merge branch 'vigra' of github.com:weatherhead99/conan-center-index i…
czoido Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions recipes/vigra/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"
112 changes: 112 additions & 0 deletions recipes/vigra/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
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


class VigraConan(ConanFile):
name = "vigra"
description = "A generic C++ library for image analysis"
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,
}

def export_sources(self):
export_conandata_patches(self)

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")

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def requirements(self):
self.requires("libtiff/4.6.0")
self.requires("libpng/1.6.43")
czoido marked this conversation as resolved.
Show resolved Hide resolved
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.4")
self.requires("imath/3.1.9")

if self.options.with_boost_graph:
self.requires("boost/1.85.0")

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
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"] = self.options.with_lemon

tc.cache_variables["VIGRA_STATIC_LIB"] = not self.options.shared
tc.generate()

deps = CMakeDeps(self)
deps.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
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 = ["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")
13 changes: 13 additions & 0 deletions recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch
Original file line number Diff line number Diff line change
@@ -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()
8 changes: 8 additions & 0 deletions recipes/vigra/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)

find_package(Vigra REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE vigraimpex)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
25 changes: 25 additions & 0 deletions recipes/vigra/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os


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 = os.path.join(self.cpp.build.bindir, "test_package")
self.run(bin_path, env="conanrun")
18 changes: 18 additions & 0 deletions recipes/vigra/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <vigra/tinyvector.hxx>
#include <vigra/impex.hxx>
#include <iostream>

using std::cout;
using std::endl;

using namespace vigra;

int main()
{
cout << "creating a fixed size vigra array.." << endl;

vigra::TinyVector<double, 5> arr = {1.1, 2.2, 3.3, 4.4, 5.5};

cout << "formats supported: " << endl;
cout << impexListFormats() << endl;
}
3 changes: 3 additions & 0 deletions recipes/vigra/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"1.11.2":
folder: all
Loading