Skip to content

Commit

Permalink
Merge pull request #2 from conan-io/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
PRSoluções authored Jan 9, 2020
2 parents 0a364cb + 55c9b63 commit aa8d768
Show file tree
Hide file tree
Showing 223 changed files with 4,728 additions and 111 deletions.
13 changes: 1 addition & 12 deletions recipes/7zip/19.00/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
sources:
"19.00":
url: https://www.7-zip.org/a/7z1900-src.7z
filename: 7zip.7z

checksum:
"19.00":
file_path: 7zip.7z
signature: 9ba70a5e8485cf9061b30a2a84fe741de5aeb8dd271aab8889da0e9b3bf1868e

externals:
lzma:
url: https://www.7-zip.org/a/lzma920.tar.bz2
destination: lzma920
sha256: 8ac221acdca8b6f6dd110120763af42b3707363752fc04e63c7bbff76774a445
sha256: "9ba70a5e8485cf9061b30a2a84fe741de5aeb8dd271aab8889da0e9b3bf1868e"
24 changes: 12 additions & 12 deletions recipes/7zip/19.00/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import os
from conans import ConanFile, tools, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment
from conans.errors import ConanInvalidConfiguration
Expand All @@ -10,7 +9,6 @@ class Package7Zip(ConanFile):
url = "https://github.com/conan-io/conan-center-index"
description = "7-Zip is a file archiver with a high compression ratio"
license = ("LGPL-2.1", "BSD-3-Clause", "Unrar")
author = "Conan Community"
homepage = "https://www.7-zip.org"
topics = ("conan", "7zip", "zip", "compression", "decompression")
settings = "os_build", "arch_build", "compiler"
Expand All @@ -22,18 +20,20 @@ def configure(self):
raise ConanInvalidConfiguration("Unsupported architecture")

def source(self):
tools.download(**self.conan_data["sources"][self.version])
tools.check_sha256(**self.conan_data["checksum"][self.version])
self._uncompress_7z(self.conan_data["sources"][self.version]["filename"])
from six.moves.urllib.parse import urlparse
url = self.conan_data["sources"][self.version]["url"]
filename = os.path.basename(urlparse(url).path)
sha256 = self.conan_data["sources"][self.version]["sha256"]
tools.download(url, filename)
tools.check_sha256(filename, sha256)
self._uncompress_7z(filename)

def build_requirements(self):
if not tools.which("7zr"):
self.build_requires("lzma_sdk/9.20")

def _uncompress_7z(self, filename):
""" We need 7z itself to uncompress the file, we have two options:
* download an executable and run it
* booststrap using a previous version (7zip/9.22) where sources are in .tar.bz2. Right
now it would we a loop in the Conan graph
"""
tools.get(**self.conan_data["externals"]["lzma"])
self.run("lzma920\\7zr.exe x {}".format(filename))
self.run("7zr x {}".format(filename))

_msvc_platforms = {
'x86_64': 'x64',
Expand Down
10 changes: 10 additions & 0 deletions recipes/assimp/5.0.0/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.1.0)

project(cmake_wrapper)

set(CMAKE_VERBOSE_MAKEFILE TRUE)

include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory("source_subfolder")
4 changes: 4 additions & 0 deletions recipes/assimp/5.0.0/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"5.0.0":
sha256: 0c81f2d6c2b18272c98727e21846a9a8a203b15e8957c2ff7a6e76a1c52af2d3
url: https://github.com/assimp/assimp/archive/v5.0.0.zip
146 changes: 146 additions & 0 deletions recipes/assimp/5.0.0/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
import os
from conans import ConanFile, CMake, tools


class Assimp(ConanFile):
name = "assimp"
version = "5.0.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/assimp/assimp"
description = "A library to import and export various 3d-model-formats including scene-post-processing to generate missing render data."
topics = ("conan", "assimp", "3d")
license = "BSD-3-Clause"

requires = "zlib/1.2.11", "irrxml/1.2"

exports_sources = ["CMakeLists.txt"]

generators = "cmake"

settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"double_precision": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"double_precision": False,
"fPIC": True,
}

_format_option_map = {
"with_3d": "ASSIMP_BUILD_3D_IMPORTER",
"with_3ds": "ASSIMP_BUILD_3DS_IMPORTER",
"with_3ds_exporter": "ASSIMP_BUILD_3DS_EXPORTER",
"with_3mf": "ASSIMP_BUILD_3MF_IMPORTER",
"with_3mf_exporter": "ASSIMP_BUILD_3MF_EXPORTER",
"with_ac": "ASSIMP_BUILD_AC_IMPORTER",
"with_amf": "ASSIMP_BUILD_AMF_IMPORTER",
"with_ase": "ASSIMP_BUILD_ASE_IMPORTER",
"with_assbin": "ASSIMP_BUILD_ASSBIN_IMPORTER",
"with_assbin_exporter": "ASSIMP_BUILD_ASSBIN_EXPORTER",
"with_assxml_exporter": "ASSIMP_BUILD_ASSXML_EXPORTER",
"with_assjson_exporter": "ASSIMP_BUILD_ASSJSON_EXPORTER",
"with_b3d": "ASSIMP_BUILD_B3D_IMPORTER",
"with_blend": "ASSIMP_BUILD_BLEND_IMPORTER",
"with_bvh": "ASSIMP_BUILD_BVH_IMPORTER",
"with_ms3d": "ASSIMP_BUILD_MS3D_IMPORTER",
"with_cob": "ASSIMP_BUILD_COB_IMPORTER",
"with_collada": "ASSIMP_BUILD_COLLADA_IMPORTER",
"with_collada_exporter": "ASSIMP_BUILD_COLLADA_EXPORTER",
"with_csm": "ASSIMP_BUILD_CSM_IMPORTER",
"with_dxf": "ASSIMP_BUILD_DXF_IMPORTER",
"with_fbx": "ASSIMP_BUILD_FBX_IMPORTER",
"with_fbx_exporter": "ASSIMP_BUILD_FBX_EXPORTER",
"with_gltf": "ASSIMP_BUILD_GLTF_IMPORTER",
"with_gltf_exporter": "ASSIMP_BUILD_GLTF_EXPORTER",
"with_hmp": "ASSIMP_BUILD_HMP_IMPORTER",
"with_ifc": "ASSIMP_BUILD_IFC_IMPORTER",
"with_irr": "ASSIMP_BUILD_IRR_IMPORTER",
"with_irrmesh": "ASSIMP_BUILD_IRRMESH_IMPORTER",
"with_lwo": "ASSIMP_BUILD_LWO_IMPORTER",
"with_lws": "ASSIMP_BUILD_LWS_IMPORTER",
"with_md2": "ASSIMP_BUILD_MD2_IMPORTER",
"with_md3": "ASSIMP_BUILD_MD3_IMPORTER",
"with_md5": "ASSIMP_BUILD_MD5_IMPORTER",
"with_mdc": "ASSIMP_BUILD_MDC_IMPORTER",
"with_mdl": "ASSIMP_BUILD_MDL_IMPORTER",
"with_mmd": "ASSIMP_BUILD_MMD_IMPORTER",
"with_ndo": "ASSIMP_BUILD_NDO_IMPORTER",
"with_nff": "ASSIMP_BUILD_NFF_IMPORTER",
"with_obj": "ASSIMP_BUILD_OBJ_IMPORTER",
"with_obj_exporter": "ASSIMP_BUILD_OBJ_EXPORTER",
"with_off": "ASSIMP_BUILD_OFF_IMPORTER",
"with_ogre": "ASSIMP_BUILD_OGRE_IMPORTER",
"with_opengex": "ASSIMP_BUILD_OPENGEX_IMPORTER",
"with_opengex_exporter": "ASSIMP_BUILD_OPENGEX_EXPORTER",
"with_ply": "ASSIMP_BUILD_PLY_IMPORTER",
"with_ply_exporter": "ASSIMP_BUILD_PLY_EXPORTER",
"with_q3bsp": "ASSIMP_BUILD_Q3BSP_IMPORTER",
"with_q3d": "ASSIMP_BUILD_Q3D_IMPORTER",
"with_raw": "ASSIMP_BUILD_RAW_IMPORTER",
"with_sib": "ASSIMP_BUILD_SIB_IMPORTER",
"with_smd": "ASSIMP_BUILD_SMD_IMPORTER",
"with_step": "ASSIMP_BUILD_STEP_IMPORTER",
"with_step_exporter": "ASSIMP_BUILD_STEP_EXPORTER",
"with_stl": "ASSIMP_BUILD_STL_IMPORTER",
"with_stl_exporter": "ASSIMP_BUILD_STL_EXPORTER",
"with_terragen": "ASSIMP_BUILD_TERRAGEN_IMPORTER",
"with_x": "ASSIMP_BUILD_X_IMPORTER",
"with_x_exporter": "ASSIMP_BUILD_X_EXPORTER",
"with_x3d": "ASSIMP_BUILD_X3D_IMPORTER",
"with_x3d_exporter": "ASSIMP_BUILD_X3D_EXPORTER",
"with_xgl": "ASSIMP_BUILD_XGL_IMPORTER",
}
options.update(dict.fromkeys(_format_option_map, [True, False]))
default_options.update(dict.fromkeys(_format_option_map, True))

_source_subfolder = "source_subfolder"
_build_subfolder = "build_subfolder"

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

def source(self):
tools.get(**self.conan_data["sources"][self.version])
os.rename("assimp-%s" % self.version, self._source_subfolder)

def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["SYSTEM_IRRXML"] = True
cmake.definitions["ASSIMP_DOUBLE_PRECISION"] = self.options.double_precision
cmake.definitions["ASSIMP_NO_EXPORT"] = False
cmake.definitions["ASSIMP_BUILD_ASSIMP_TOOLS"] = False
cmake.definitions["ASSIMP_BUILD_TESTS"] = False
cmake.definitions["ASSIMP_BUILD_SAMPLES"] = False
cmake.definitions["ASSIMP_INSTALL_PDB"] = False

cmake.definitions["ASSIMP_ANDROID_JNIIOSYSTEM"] = False

cmake.definitions["ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT"] = False
cmake.definitions["ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT"] = False
for option, definition in self._format_option_map.items():
cmake.definitions[definition] = bool(getattr(self.options, option))

cmake.configure(build_folder=self._build_subfolder)
return cmake

def build(self):
for before, after in [("-fPIC", ""), ("-g ", ""), ('SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob2 /DEBUG:FULL /Zi")', "")]:
tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), before, after)
cmake = self._configure_cmake()
cmake.build()

def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))

def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
if self.settings.os == "Linux":
self.cpp_info.system_libs = ["rt", "m", "pthread"]
11 changes: 11 additions & 0 deletions recipes/assimp/5.0.0/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 2.8.11)
project(test_package CXX)

set(CMAKE_VERBOSE_MAKEFILE TRUE)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
16 changes: 16 additions & 0 deletions recipes/assimp/5.0.0/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
from conans import ConanFile, CMake


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
8 changes: 8 additions & 0 deletions recipes/assimp/5.0.0/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <iostream>
#include "assimp/version.h"
#include "assimp/Importer.hpp"

int main() {
Assimp::Importer importer;
std::cout << "Assimp version " << aiGetVersionMajor() << "." << aiGetVersionMinor() << "." << aiGetVersionRevision() << std::endl;
}
4 changes: 4 additions & 0 deletions recipes/assimp/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
versions:
"5.0.0":
folder: "5.0.0"
3 changes: 3 additions & 0 deletions recipes/b2/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ sources:
"4.0.1":
sha256: 9ea9edb115fa0b0a82eaf4f00a4e348df9c3b1b891c3db32823ae5e27f284c07
url: https://github.com/boostorg/build/archive/4.0.1.tar.gz
"4.1.0":
sha256: e1513cf8ad83e7343f8c21207b3f4cb6c2e4561685d66fe80c4fc612a1c5a55a
url: https://github.com/boostorg/build/archive/4.1.0.tar.gz
2 changes: 2 additions & 0 deletions recipes/b2/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ versions:
folder: all
"4.0.1":
folder: all
"4.1.0":
folder: all
11 changes: 11 additions & 0 deletions recipes/backward-cpp/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 2.8.12)
project(cmake_wrapper)

if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
else()
include(conanbuildinfo.cmake)
endif()
conan_basic_setup()

add_subdirectory("source_subfolder")
14 changes: 14 additions & 0 deletions recipes/backward-cpp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sources:
"1.4":
url: "https://github.com/bombela/backward-cpp/archive/v1.4.tar.gz"
sha256: "ad73be31c5cfcbffbde7d34dba18158a42043a109e7f41946f0b0abd589ed55e"
patches:
"1.4":
- patch_file: "patches/backward-cpp-1.4.patch"
base_path: "source_subfolder"
# https://github.com/bombela/backward-cpp/commit/7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch
- patch_file: "patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch"
base_path: "source_subfolder"
# https://github.com/bombela/backward-cpp/commit/b7ffd640ec48ada93045f8c46fc65f823490819b.patch
- patch_file: "patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch"
base_path: "source_subfolder"
Loading

0 comments on commit aa8d768

Please sign in to comment.