def config_options(self): if tools.Version(self.version) < "1.2.0": del self.options.standalone_asio if tools.Version(self.version) < "2.0.0": del self.options.msgpack del self.options.nlohmann_json
def _configure_cmake(self): if self._cmake: return self._cmake self._cmake = CMake(self) self._cmake.definitions["OPENCV_CONFIG_INSTALL_PATH"] = "cmake" self._cmake.definitions["OPENCV_BIN_INSTALL_PATH"] = "bin" self._cmake.definitions["OPENCV_LIB_INSTALL_PATH"] = "lib" self._cmake.definitions["OPENCV_3P_LIB_INSTALL_PATH"] = "lib" self._cmake.definitions["OPENCV_OTHER_INSTALL_PATH"] = "res" self._cmake.definitions["OPENCV_LICENSES_INSTALL_PATH"] = "licenses" self._cmake.definitions["BUILD_CUDA_STUBS"] = False self._cmake.definitions["BUILD_DOCS"] = False self._cmake.definitions["BUILD_EXAMPLES"] = False self._cmake.definitions["BUILD_FAT_JAVA_LIB"] = False self._cmake.definitions["BUILD_IPP_IW"] = False self._cmake.definitions["BUILD_ITT"] = False self._cmake.definitions["BUILD_JASPER"] = False self._cmake.definitions["BUILD_JAVA"] = False self._cmake.definitions["BUILD_JPEG"] = False self._cmake.definitions["BUILD_OPENEXR"] = False self._cmake.definitions["BUILD_OPENJPEG"] = False self._cmake.definitions["BUILD_TESTS"] = False self._cmake.definitions["BUILD_PROTOBUF"] = False self._cmake.definitions["BUILD_PACKAGE"] = False self._cmake.definitions["BUILD_PERF_TESTS"] = False self._cmake.definitions["BUILD_USE_SYMLINKS"] = False self._cmake.definitions["BUILD_opencv_apps"] = False self._cmake.definitions["BUILD_opencv_java"] = False self._cmake.definitions["BUILD_opencv_java_bindings_gen"] = False self._cmake.definitions["BUILD_opencv_js"] = False self._cmake.definitions["BUILD_ZLIB"] = False self._cmake.definitions["BUILD_PNG"] = False self._cmake.definitions["BUILD_TIFF"] = False self._cmake.definitions["BUILD_WEBP"] = False self._cmake.definitions["BUILD_TBB"] = False self._cmake.definitions["OPENCV_FORCE_3RDPARTY_BUILD"] = False self._cmake.definitions["BUILD_opencv_python2"] = False self._cmake.definitions["BUILD_opencv_python3"] = False self._cmake.definitions["BUILD_opencv_python_bindings_g"] = False self._cmake.definitions["BUILD_opencv_python_tests"] = False self._cmake.definitions["BUILD_opencv_ts"] = False self._cmake.definitions["WITH_1394"] = False self._cmake.definitions["WITH_ADE"] = False self._cmake.definitions["WITH_ARAVIS"] = False self._cmake.definitions["WITH_CLP"] = False self._cmake.definitions["WITH_CUDA"] = False self._cmake.definitions["WITH_CUFFT"] = False self._cmake.definitions["WITH_CUBLAS"] = False self._cmake.definitions["WITH_NVCUVID"] = False self._cmake.definitions["WITH_FFMPEG"] = False self._cmake.definitions["WITH_GSTREAMER"] = False self._cmake.definitions["WITH_HALIDE"] = False self._cmake.definitions["WITH_HPX"] = False self._cmake.definitions["WITH_IMGCODEC_HDR"] = False self._cmake.definitions["WITH_IMGCODEC_PFM"] = False self._cmake.definitions["WITH_IMGCODEC_PXM"] = False self._cmake.definitions["WITH_IMGCODEC_SUNRASTER"] = False self._cmake.definitions["WITH_INF_ENGINE"] = False self._cmake.definitions["WITH_IPP"] = False self._cmake.definitions["WITH_ITT"] = False self._cmake.definitions["WITH_LIBREALSENSE"] = False self._cmake.definitions["WITH_MFX"] = False self._cmake.definitions["WITH_NGRAPH"] = False self._cmake.definitions["WITH_OPENCL"] = False self._cmake.definitions["WITH_OPENCLAMDBLAS"] = False self._cmake.definitions["WITH_OPENCLAMDFFT"] = False self._cmake.definitions["WITH_OPENCL_SVM"] = False self._cmake.definitions["WITH_OPENGL"] = False self._cmake.definitions["WITH_OPENJPEG"] = False self._cmake.definitions["WITH_OPENMP"] = False self._cmake.definitions["WITH_OPENNI"] = False self._cmake.definitions["WITH_OPENNI2"] = False self._cmake.definitions["WITH_OPENVX"] = False self._cmake.definitions["WITH_PLAIDML"] = False self._cmake.definitions["WITH_PROTOBUF"] = False self._cmake.definitions["WITH_PVAPI"] = False self._cmake.definitions["WITH_QT"] = False self._cmake.definitions["WITH_QUIRC"] = False self._cmake.definitions["WITH_V4L"] = False self._cmake.definitions["WITH_VA"] = False self._cmake.definitions["WITH_VA_INTEL"] = False self._cmake.definitions["WITH_VTK"] = False self._cmake.definitions["WITH_VULKAN"] = False self._cmake.definitions["WITH_XIMEA"] = False self._cmake.definitions["WITH_XINE"] = False self._cmake.definitions["WITH_LAPACK"] = False self._cmake.definitions["WITH_GTK"] = self.options.get_safe("with_gtk", False) self._cmake.definitions["WITH_GTK_2_X"] = self.options.get_safe("with_gtk", False) self._cmake.definitions["WITH_WEBP"] = self.options.with_webp self._cmake.definitions["WITH_JPEG"] = self.options.with_jpeg != False self._cmake.definitions["WITH_PNG"] = self.options.with_png self._cmake.definitions["WITH_TIFF"] = self.options.with_tiff self._cmake.definitions["WITH_JASPER"] = self.options.with_jpeg2000 == "jasper" self._cmake.definitions["WITH_OPENJPEG"] = self.options.with_jpeg2000 == "openjpeg" self._cmake.definitions["WITH_OPENEXR"] = self.options.with_openexr self._cmake.definitions["WITH_EIGEN"] = self.options.with_eigen self._cmake.definitions["HAVE_QUIRC"] = self.options.with_quirc # force usage of quirc requirement self._cmake.definitions["WITH_DSHOW"] = self.settings.compiler == "Visual Studio" self._cmake.definitions["WITH_MSMF"] = self.settings.compiler == "Visual Studio" self._cmake.definitions["WITH_MSMF_DXVA"] = self.settings.compiler == "Visual Studio" self._cmake.definitions["OPENCV_MODULES_PUBLIC"] = "opencv" if self.options.contrib: self._cmake.definitions['OPENCV_EXTRA_MODULES_PATH'] = os.path.join(self.build_folder, self._contrib_folder, 'modules') if self.options.with_openexr: self._cmake.definitions["OPENEXR_ROOT"] = self.deps_cpp_info["openexr"].rootpath if self.options.with_jpeg2000 == "openjpeg": openjpeg_version = tools.Version(self.deps_cpp_info["openjpeg"].version) self._cmake.definitions["OPENJPEG_MAJOR_VERSION"] = openjpeg_version.major self._cmake.definitions["OPENJPEG_MINOR_VERSION"] = openjpeg_version.minor self._cmake.definitions["OPENJPEG_BUILD_VERSION"] = openjpeg_version.patch if self.options.parallel: self._cmake.definitions["WITH_TBB"] = self.options.parallel == "tbb" self._cmake.definitions["WITH_OPENMP"] = self.options.parallel == "openmp" self._cmake.definitions["ENABLE_PIC"] = self.options.get_safe("fPIC", True) if self.settings.compiler == "Visual Studio": self._cmake.definitions["BUILD_WITH_STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) if self.settings.os == "Android": self._cmake.definitions["ANDROID_STL"] = "c++_static" self._cmake.definitions["ANDROID_NATIVE_API_LEVEL"] = self.settings.os.api_level self._cmake.definitions["ANDROID_ABI"] = tools.to_android_abi(str(self.settings.arch)) self._cmake.definitions["BUILD_ANDROID_EXAMPLES"] = False if "ANDROID_NDK_HOME" in os.environ: self._cmake.definitions["ANDROID_NDK"] = os.environ.get("ANDROID_NDK_HOME") self._cmake.configure(build_folder=self._build_subfolder) return self._cmake
def package_info(self): self.cpp_info.components["libpoppler"].libs = ["poppler"] self.cpp_info.components["libpoppler"].names["pkg_config"] = "poppler" if not self.options.shared: self.cpp_info.components["libpoppler"].defines = ["POPPLER_STATIC"] if self.settings.os == "Linux": self.cpp_info.components["libpoppler"].system_libs = ["pthread"] elif self.settings.os == "Windows": self.cpp_info.components["libpoppler"].system_libs = ["gdi32"] self.cpp_info.components["libpoppler"].requires = [ "poppler-data::poppler-data", "freetype::freetype" ] if self.options.fontconfiguration == "fontconfig": self.cpp_info.components["libpoppler"].requires.append( "fontconfig::fontconfig") if self.options.with_openjpeg: self.cpp_info.components["libpoppler"].requires.append( "openjpeg::openjpeg") if self.options.with_lcms: self.cpp_info.components["libpoppler"].requires.append( "lcms::lcms") if self.options.with_libjpeg == "libjpeg": self.cpp_info.components["libpoppler"].requires.append( "libjpeg::libjpeg") if self.options.with_png: self.cpp_info.components["libpoppler"].requires.append( "libpng::libpng") if self.options.with_nss: self.cpp_info.components["libpoppler"].requires.append("nss::nss") if self.options.with_tiff: self.cpp_info.components["libpoppler"].requires.append( "libtiff::libtiff") if self.options.with_libcurl: self.cpp_info.components["libpoppler"].requires.append( "libcurl::libcurl") if self.options.with_zlib: self.cpp_info.components["libpoppler"].requires.append( "zlib::zlib") if self.options.cpp: self.cpp_info.components["libpoppler-cpp"].libs = ["poppler-cpp"] self.cpp_info.components["libpoppler-cpp"].includedirs.append( os.path.join("include", "poppler", "cpp")) self.cpp_info.components["libpoppler-cpp"].names[ "pkg_config"] = "poppler-cpp" self.cpp_info.components["libpoppler-cpp"].requires = [ "libpoppler" ] if self.options.get_safe("with_libiconv"): self.cpp_info.components["libpoppler-cpp"].requires.append( "libiconv::libiconv") if self.options.splash: self.cpp_info.components["libpoppler-splash"].libs = [] self.cpp_info.components["libpoppler-splash"].names[ "pkg_config"] = "poppler-splash" self.cpp_info.components["libpoppler-splash"].requires = [ "libpoppler", "boost::boost" ] # FIXME: should be boost::headers, see https://github.com/conan-io/conan-center-index/pull/2097 if self.options.with_cairo: self.cpp_info.components["libpoppler-cairo"].libs = [] self.cpp_info.components["libpoppler-cairo"].names[ "pkg_config"] = "poppler-cairo" self.cpp_info.components["libpoppler-cairo"].requires = [ "libpoppler", "cairo::cairo" ] if self.options.get_safe("with_glib"): self.cpp_info.components["libpoppler-glib"].libs = ["poppler-glib"] self.cpp_info.components["libpoppler-glib"].names[ "pkg_config"] = "poppler-glib" self.cpp_info.components["libpoppler-glib"].requires = [ "libpoppler-cairo", "glib::glib" ] if self.options.get_safe("with_gtk"): self.cpp_info.components["libpoppler-glib"].requires.append( "gtk::gtk") if self.options.get_safe("with_gobject_introspection"): self.cpp_info.components["libpoppler-glib"].requires.append( "gobject-introspection::gobject-introspection") if self.options.with_qt: qt_major = tools.Version(self.deps_cpp_info["qt"].version).major self.cpp_info.components["libpoppler-qt"].libs = [ "poppler-qt{}".format(qt_major) ] self.cpp_info.components["libpoppler-qt"].names[ "pkg_config"] = "poppler-qt{}".format(qt_major) self.cpp_info.components["libpoppler-qt"].requires = [ "libpoppler", "qt::qtCore", "qt::qtGui", "qt::qtWidgets" ] datadir = self.deps_user_info["poppler-data"].datadir self.output.info("Setting POPPLER_DATADIR env var: {}".format(datadir)) self.env_info.POPPLER_DATADIR = datadir
def _patch_sources(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): tools.patch(**patch) # Remove embedded dependencies embedded_libs = [ os.path.join("alg", "internal_libqhull"), os.path.join("frmts", "gif", "giflib"), os.path.join("frmts", "jpeg", "libjpeg"), os.path.join("frmts", "png", "libpng"), os.path.join("frmts", "zlib"), # os.path.join("ogr", "ogrsf_frmts", "cad", "libopencad"), # TODO: uncomment when libopencad available os.path.join("ogr", "ogrsf_frmts", "geojson", "libjson"), ] if tools.Version(self.version) >= "3.1.0": embedded_libs.append( os.path.join("ogr", "ogrsf_frmts", "flatgeobuf", "flatbuffers")) for lib_subdir in embedded_libs: tools.rmdir(os.path.join(self._source_subfolder, lib_subdir)) # OpenCL headers tools.replace_in_file( os.path.join(self._source_subfolder, "alg", "gdalwarpkernel_opencl.h"), "#include <OpenCL/OpenCL.h>", "#include <CL/opencl.h>") # More patches for autotools build if not self._is_msvc: configure_ac = os.path.join(self._source_subfolder, "configure.ac") # Workaround for nc-config not packaged in netcdf recipe (gdal relies on it to check nc4 and hdf4 support in netcdf): if self.options.with_netcdf and self.options[ "netcdf"].netcdf4 and self.options["netcdf"].with_hdf5: tools.replace_in_file(configure_ac, "NETCDF_HAS_NC4=no", "NETCDF_HAS_NC4=yes") # Fix zlib checks and -lz injection to ensure to use external zlib and not fail others checks if self.options.get_safe("with_zlib", True): zlib_name = self.deps_cpp_info["zlib"].libs[0] tools.replace_in_file(configure_ac, "AC_CHECK_LIB(z,", "AC_CHECK_LIB({},".format(zlib_name)) tools.replace_in_file(configure_ac, "-lz ", "-l{} ".format(zlib_name)) # Workaround for autoconf 2.71 with open(os.path.join(self._source_subfolder, "config.rpath"), "w"): pass # Disable tools if not self.options.tools: # autotools gnumakefile_apps = os.path.join(self._source_subfolder, "apps", "GNUmakefile") tools.replace_in_file( gnumakefile_apps, "default: gdal-config-inst gdal-config $(BIN_LIST)", "default: gdal-config-inst gdal-config") if tools.Version(self.version) < "3.4.0": clean_pattern = "$(RM) *.o $(BIN_LIST) core gdal-config gdal-config-inst" else: clean_pattern = "$(RM) *.o $(BIN_LIST) $(NON_DEFAULT_LIST) core gdal-config gdal-config-inst" tools.replace_in_file( gnumakefile_apps, clean_pattern, "$(RM) *.o core gdal-config gdal-config-inst") tools.replace_in_file( gnumakefile_apps, "for f in $(BIN_LIST) ; do $(INSTALL) $$f $(DESTDIR)$(INST_BIN) ; done", "") # msvc vcmakefile_apps = os.path.join(self._source_subfolder, "apps", "makefile.vc") tools.replace_in_file(vcmakefile_apps, "default: ", "default: \n\nold-default: ") tools.replace_in_file(vcmakefile_apps, "copy *.exe $(BINDIR)", "")
def _configure_autotools(self): if self._autotools: return self._autotools self._autotools = AutoToolsBuildEnvironment( self, win_bash=tools.os_info.is_windows) # FIXME: set self._autotools.libs to empty array and improve patch in configure.ac, # to avoid configure errors on macOS if all shared yes_no = lambda v: "yes" if v else "no" internal_no = lambda v: "internal" if v else "no" rootpath = lambda req: tools.unix_path(self.deps_cpp_info[req].rootpath ) rootpath_no = lambda v, req: rootpath(req) if v else "no" args = [] args.append("--datarootdir={}".format( tools.unix_path(os.path.join(self.package_folder, "res")))) # Shared/Static args.extend([ "--enable-static={}".format(yes_no(not self.options.shared)), "--enable-shared={}".format(yes_no(self.options.shared)), ]) # Enable C++14 if requested in conan profile or if with_charls enabled if (self.settings.compiler.cppstd and tools.valid_min_cppstd( self, 14)) or self.options.with_charls: args.append("--with-cpp14") # Debug if self.settings.build_type == "Debug": args.append("--enable-debug") # SIMD Intrinsics simd_intrinsics = self.options.get_safe("simd_intrinsics", False) if not simd_intrinsics: args.extend(["--without-sse", "--without-ssse3", "--without-avx"]) elif simd_intrinsics == "sse": args.extend(["--with-sse", "--without-ssse3", "--without-avx"]) elif simd_intrinsics == "ssse3": args.extend(["--with-sse", "--with-ssse3", "--without-avx"]) elif simd_intrinsics == "avx": args.extend(["--with-sse", "--with-ssse3", "--with-avx"]) # LTO (disabled) args.append("--disable-lto") # Symbols args.append("--with-hide_internal_symbols") # Do not add /usr/local/lib and /usr/local/include args.append("--without-local") # Threadsafe args.append("--with-threads={}".format(yes_no( self.options.threadsafe))) # Depencencies: args.append("--with-proj=yes") # always required ! args.append("--with-libz={}".format(yes_no(self.options.with_zlib))) if self._has_with_libdeflate_option: args.append("--with-libdeflate={}".format( yes_no(self.options.with_libdeflate))) args.append("--with-libiconv-prefix={}".format( rootpath_no(self.options.with_libiconv, "libiconv"))) args.append( "--with-liblzma=no" ) # always disabled: liblzma is an optional transitive dependency of gdal (through libtiff). args.append("--with-zstd={}".format( yes_no(self.options.get_safe("with_zstd")) )) # Optional direct dependency of gdal only if lerc lib enabled if self._has_with_blosc_option: args.append("--with-blosc={}".format( yes_no(self.options.with_blosc))) if self._has_with_lz4_option: args.append("--with-lz4={}".format(yes_no(self.options.with_lz4))) # Drivers: if not (self.options.with_zlib and self.options.with_png and bool(self.options.with_jpeg)): # MRF raster driver always depends on zlib, libpng and libjpeg: https://github.com/OSGeo/gdal/issues/2581 if tools.Version(self.version) < "3.0.0": args.append("--without-mrf") else: args.append("--disable-driver-mrf") args.append("--with-pg={}".format(yes_no(self.options.with_pg))) args.extend(["--without-grass", "--without-libgrass" ]) # TODO: to implement when libgrass lib available args.append("--with-cfitsio={}".format( rootpath_no(self.options.with_cfitsio, "cfitsio"))) args.append("--with-pcraster={}".format( internal_no(self.options.with_pcraster) )) # TODO: use conan recipe when available instead of internal one args.append("--with-png={}".format( rootpath_no(self.options.with_png, "libpng"))) args.append("--with-dds={}".format( rootpath_no(self.options.with_dds, "crunch"))) args.append("--with-gta={}".format( rootpath_no(self.options.with_gta, "libgta"))) args.append("--with-pcidsk={}".format( internal_no(self.options.with_pcidsk) )) # TODO: use conan recipe when available instead of internal one args.append("--with-libtiff={}".format( rootpath("libtiff"))) # always required ! args.append("--with-geotiff={}".format( rootpath("libgeotiff"))) # always required ! if self.options.with_jpeg == "libjpeg": args.append("--with-jpeg={}".format(rootpath("libjpeg"))) elif self.options.with_jpeg == "libjpeg-turbo": args.append("--with-jpeg={}".format(rootpath("libjpeg-turbo"))) else: args.append("--without-jpeg") args.append("--without-jpeg12" ) # disabled: it requires internal libjpeg and libgeotiff args.append("--with-charls={}".format(yes_no( self.options.with_charls))) args.append("--with-gif={}".format( rootpath_no(self.options.with_gif, "giflib"))) args.append( "--without-ogdi" ) # TODO: to implement when ogdi lib available (https://sourceforge.net/projects/ogdi/) args.append("--without-fme") # commercial library args.append( "--without-sosi") # TODO: to implement when fyba lib available args.append("--without-mongocxx") # TODO: handle mongo-cxx-driver v2 args.append("--with-mongocxxv3={}".format( yes_no(self.options.with_mongocxx))) args.append("--with-hdf4={}".format(yes_no(self.options.with_hdf4))) args.append("--with-hdf5={}".format(yes_no(self.options.with_hdf5))) args.append("--with-kea={}".format(yes_no(self.options.with_kea))) args.append("--with-netcdf={}".format( rootpath_no(self.options.with_netcdf, "netcdf"))) args.append("--with-jasper={}".format( rootpath_no(self.options.with_jasper, "jasper"))) args.append("--with-openjpeg={}".format( yes_no(self.options.with_openjpeg))) args.append( "--without-fgdb" ) # TODO: to implement when file-geodatabase-api lib available args.append("--without-ecw") # commercial library args.append("--without-kakadu") # commercial library args.extend( ["--without-mrsid", "--without-jp2mrsid", "--without-mrsid_lidar"]) # commercial library args.append("--without-jp2lura") # commercial library args.append("--without-msg") # commercial library args.append("--without-oci") # TODO args.append("--with-gnm={}".format(yes_no(self.options.with_gnm))) args.append("--with-mysql={}".format(yes_no(self.options.with_mysql))) args.append("--without-ingres") # commercial library args.append("--with-xerces={}".format( rootpath_no(self.options.with_xerces, "xerces-c"))) args.append("--with-expat={}".format(yes_no(self.options.with_expat))) args.append("--with-libkml={}".format( rootpath_no(self.options.with_libkml, "libkml"))) if self.options.with_odbc: args.append("--with-odbc={}".format( "yes" if self.settings.os == "Windows" else rootpath("odbc"))) else: args.append("--without-odbc") args.append("--without-dods-root" ) # TODO: to implement when libdap lib available args.append("--with-curl={}".format(yes_no(self.options.with_curl))) args.append("--with-xml2={}".format(yes_no(self.options.with_xml2))) args.append("--without-spatialite" ) # TODO: to implement when libspatialite lib available args.append("--with-sqlite3={}".format( yes_no(self.options.get_safe("with_sqlite3")))) args.append("--without-rasterlite2" ) # TODO: to implement when rasterlite2 lib available if self._has_with_pcre2_option: args.append("--with-pcre2={}".format( yes_no(self.options.with_pcre2))) args.append("--with-pcre={}".format( yes_no(self.options.get_safe("with_pcre")))) args.append("--without-teigha") # commercial library args.append("--without-idb") # commercial library if tools.Version(self.version) < "3.2.0": args.append("--without-sde") # commercial library if tools.Version(self.version) < "3.3.0": args.append("--without-epsilon") args.append("--with-webp={}".format( rootpath_no(self.options.with_webp, "libwebp"))) args.append("--with-geos={}".format(yes_no(self.options.with_geos))) args.append( "--without-sfcgal") # TODO: to implement when sfcgal lib available args.append("--with-qhull={}".format(yes_no(self.options.with_qhull))) if self.options.with_opencl: args.extend([ "--with-opencl", "--with-opencl-include={}".format( tools.unix_path(self.deps_cpp_info["opencl-headers"]. include_paths[0])), "--with-opencl-lib=-L{}".format( tools.unix_path( self.deps_cpp_info["opencl-icd-loader"].lib_paths[0])) ]) else: args.append("--without-opencl") args.append("--with-freexl={}".format(yes_no( self.options.with_freexl))) args.append("--with-libjson-c={}".format( rootpath("json-c"))) # always required ! if self.options.without_pam: args.append("--without-pam") args.append("--with-poppler={}".format( yes_no(self.options.with_poppler))) args.append("--with-podofo={}".format( rootpath_no(self.options.with_podofo, "podofo"))) if self.options.with_podofo: args.append("--with-podofo-lib=-l{}".format(" -l".join( self._gather_libs("podofo")))) args.append( "--without-pdfium") # TODO: to implement when pdfium lib available args.append("--without-perl") args.append("--without-python") args.append("--without-java") args.append("--without-hdfs") if tools.Version(self.version) >= "3.0.0": args.append("--without-tiledb" ) # TODO: to implement when tiledb lib available args.append("--without-mdb") args.append("--without-rasdaman" ) # TODO: to implement when rasdaman lib available if self._has_with_brunsli_option: args.append("--with-brunsli={}".format( yes_no(self.options.with_brunsli))) if tools.Version(self.version) >= "3.1.0": args.append("--without-rdb") # commercial library args.append("--without-armadillo" ) # TODO: to implement when armadillo lib available args.append("--with-cryptopp={}".format( rootpath_no(self.options.with_cryptopp, "cryptopp"))) args.append("--with-crypto={}".format(yes_no( self.options.with_crypto))) if tools.Version(self.version) >= "3.3.0": args.append("--with-lerc={}".format( internal_no(not self.options.without_lerc))) else: args.append("--with-lerc={}".format( yes_no(not self.options.without_lerc))) if self.options.with_null: args.append("--with-null") if self._has_with_exr_option: args.append("--with-exr={}".format(yes_no(self.options.with_exr))) if self._has_with_heif_option: args.append("--with-heif={}".format(yes_no( self.options.with_heif))) # Inject -stdlib=libc++ for clang with libc++ env_build_vars = self._autotools.vars if self.settings.compiler == "clang" and \ self.settings.os == "Linux" and tools.stdcpp_library(self) == "c++": env_build_vars["LDFLAGS"] = "-stdlib=libc++ {}".format( env_build_vars["LDFLAGS"]) self._autotools.configure(args=args, vars=env_build_vars) return self._autotools
def _has_with_brunsli_option(self): return tools.Version(self.version) >= "3.4.0"
def _has_reentrant_qhull_support(self): return tools.Version(self.version) >= "3.4.1"
def build(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): tools.patch(**patch) if self.settings.compiler == "Visual Studio": # https://www.postgresql.org/docs/8.3/install-win32-libpq.html # https://github.com/postgres/postgres/blob/master/src/tools/msvc/README if not self.options.shared: tools.replace_in_file( os.path.join(self._source_subfolder, "src", "tools", "msvc", "MKvcbuild.pm"), "$libpq = $solution->AddProject('libpq', 'dll', 'interfaces',", "$libpq = $solution->AddProject('libpq', 'lib', 'interfaces'," ) system_libs = ", ".join([ "'{}.lib'".format(lib) for lib in self.deps_cpp_info.system_libs ]) tools.replace_in_file( os.path.join(self._source_subfolder, "src", "tools", "msvc", "Project.pm"), "libraries => [],", "libraries => [{}],".format(system_libs)) runtime = { 'MT': 'MultiThreaded', 'MTd': 'MultiThreadedDebug', 'MD': 'MultiThreadedDLL', 'MDd': 'MultiThreadedDebugDLL' }.get(str(self.settings.compiler.runtime)) msbuild_project_pm = os.path.join(self._source_subfolder, "src", "tools", "msvc", "MSBuildProject.pm") tools.replace_in_file( msbuild_project_pm, "</Link>", """</Link> <Lib> <TargetMachine>$targetmachine</TargetMachine> </Lib>""") tools.replace_in_file(msbuild_project_pm, "'MultiThreadedDebugDLL'", "'%s'" % runtime) tools.replace_in_file(msbuild_project_pm, "'MultiThreadedDLL'", "'%s'" % runtime) config_default_pl = os.path.join(self._source_subfolder, "src", "tools", "msvc", "config_default.pl") solution_pm = os.path.join(self._source_subfolder, "src", "tools", "msvc", "Solution.pm") if self.options.with_openssl: for ssl in ["VC\libssl32", "VC\libssl64", "libssl"]: tools.replace_in_file( solution_pm, "%s.lib" % ssl, "%s.lib" % self.deps_cpp_info["openssl"].libs[0]) for crypto in [ "VC\libcrypto32", "VC\libcrypto64", "libcrypto" ]: tools.replace_in_file( solution_pm, "%s.lib" % crypto, "%s.lib" % self.deps_cpp_info["openssl"].libs[1]) tools.replace_in_file( config_default_pl, "openssl => undef", "openssl => '%s'" % self.deps_cpp_info["openssl"].rootpath.replace("\\", "/")) with tools.vcvars(self.settings): config = "DEBUG" if self.settings.build_type == "Debug" else "RELEASE" with tools.environment_append({"CONFIG": config}): with tools.chdir( os.path.join(self._source_subfolder, "src", "tools", "msvc")): self.run("perl build.pl libpq") if not self.options.shared: self.run("perl build.pl libpgport") else: autotools = self._configure_autotools() with tools.chdir( os.path.join(self._source_subfolder, "src", "backend")): autotools.make(args=self._make_args, target="generated-headers") with tools.chdir( os.path.join(self._source_subfolder, "src", "common")): autotools.make(args=self._make_args) if tools.Version(self.version) >= "12": with tools.chdir( os.path.join(self._source_subfolder, "src", "port")): autotools.make(args=self._make_args) with tools.chdir( os.path.join(self._source_subfolder, "src", "include")): autotools.make(args=self._make_args) with tools.chdir( os.path.join(self._source_subfolder, "src", "interfaces", "libpq")): autotools.make(args=self._make_args) with tools.chdir( os.path.join(self._source_subfolder, "src", "bin", "pg_config")): autotools.make(args=self._make_args)
def package(self): self.copy(pattern="COPYRIGHT", dst="licenses", src=self._source_subfolder) if self.settings.compiler == "Visual Studio": self.copy("*postgres_ext.h", src=self._source_subfolder, dst="include", keep_path=False) self.copy("*pg_config.h", src=self._source_subfolder, dst="include", keep_path=False) self.copy("*pg_config_ext.h", src=self._source_subfolder, dst="include", keep_path=False) self.copy("*libpq-fe.h", src=self._source_subfolder, dst="include", keep_path=False) self.copy("*libpq-events.h", src=self._source_subfolder, dst="include", keep_path=False) self.copy("*.h", src=os.path.join(self._source_subfolder, "src", "include", "libpq"), dst=os.path.join("include", "libpq"), keep_path=False) self.copy("*genbki.h", src=self._source_subfolder, dst=os.path.join("include", "catalog"), keep_path=False) self.copy("*pg_type.h", src=self._source_subfolder, dst=os.path.join("include", "catalog"), keep_path=False) if self.options.shared: self.copy("**/libpq.dll", src=self._source_subfolder, dst="bin", keep_path=False) self.copy("**/libpq.lib", src=self._source_subfolder, dst="lib", keep_path=False) else: self.copy("*.lib", src=self._source_subfolder, dst="lib", keep_path=False) else: autotools = AutoToolsBuildEnvironment( self, win_bash=tools.os_info.is_windows ) #self._configure_autotools() with tools.chdir( os.path.join(self._source_subfolder, "src", "common")): autotools.install(args=self._make_args) with tools.chdir( os.path.join(self._source_subfolder, "src", "include")): autotools.install(args=self._make_args) with tools.chdir( os.path.join(self._source_subfolder, "src", "interfaces", "libpq")): autotools.install(args=self._make_args) if tools.Version(self.version) >= "12": with tools.chdir( os.path.join(self._source_subfolder, "src", "port")): autotools.install(args=self._make_args) with tools.chdir( os.path.join(self._source_subfolder, "src", "bin", "pg_config")): autotools.install(args=self._make_args) self._remove_unused_libraries_from_package() tools.rmdir( os.path.join(self.package_folder, "include", "postgresql", "server")) self.copy(pattern="*.h", dst=os.path.join("include", "catalog"), src=os.path.join(self._source_subfolder, "src", "include", "catalog")) self.copy(pattern="*.h", dst=os.path.join("include", "catalog"), src=os.path.join(self._source_subfolder, "src", "backend", "catalog")) tools.rmdir(os.path.join(self.package_folder, "share")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
def _requires_pegtl(self): return tools.Version(self.version) >= "1.0.0-beta.13"
def package_info(self): # FIXME model official FindImageMagick https://cmake.org/cmake/help/latest/module/FindImageMagick.html bin_path = os.path.join(self.package_folder, "bin") self.output.info( "Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) core_requires = [] if self.options.with_zlib: core_requires.append("zlib::zlib") if self.options.with_bzlib: core_requires.append("bzip2::bzip2") if self.options.with_lzma: core_requires.append("xz_utils::xz_utils") if self.options.with_lcms: core_requires.append("lcms::lcms") if self.options.with_openexr: core_requires.append("openexr::openexr") if self.options.with_heic: core_requires.append("libheif::libheif") if self.options.with_jbig: core_requires.append("jbig::jbig") if self.options.with_jpeg: core_requires.append("{0}::{0}".format(self.options.with_jpeg)) if self.options.with_openjp2: core_requires.append("openjpeg::openjpeg") if self.options.with_pango: core_requires.append("pango::pango") if self.options.with_png: core_requires.append("libpng::libpng") if self.options.with_tiff: core_requires.append("libtiff::libtiff") if self.options.with_webp: core_requires.append("libwebp::libwebp") if self.options.with_xml2: core_requires.append("libxml2::libxml2") if self.options.with_freetype: core_requires.append("freetype::freetype") if self._is_msvc: if not self.options.shared: self.cpp_info.components["MagickCore"].libs.append( self._libname("coders")) if self.settings.os == "Linux": self.cpp_info.components["MagickCore"].system_libs.append( "pthread") self.cpp_info.components["MagickCore"].defines.append( "MAGICKCORE_QUANTUM_DEPTH=%s" % self.options.quantum_depth) self.cpp_info.components["MagickCore"].defines.append( "MAGICKCORE_HDRI_ENABLE=%s" % int(bool(self.options.hdri))) self.cpp_info.components["MagickCore"].defines.append( "_MAGICKDLL_=1" if self.options.shared else "_MAGICKLIB_=1") imagemagick_include_dir = ("include/ImageMagick-%s" % tools.Version(self.version).major) self.cpp_info.components["MagickCore"].includedirs = [ imagemagick_include_dir ] self.cpp_info.components["MagickCore"].libs.append( self._libname("MagickCore")) self.cpp_info.components["MagickCore"].requires = core_requires self.cpp_info.components["MagickCore"].names["pkg_config"] = [ "MagicCore" ] self.cpp_info.components[self._libname("MagickCore")].requires = [ "MagickCore" ] self.cpp_info.components[self._libname( "MagickCore")].names["pkg_config"] = [self._libname("MagickCore")] self.cpp_info.components["MagickWand"].includedirs = [ imagemagick_include_dir + "/MagickWand" ] self.cpp_info.components["MagickWand"].libs = [ self._libname("MagickWand") ] self.cpp_info.components["MagickWand"].requires = ["MagickCore"] self.cpp_info.components["MagickWand"].names["pkg_config"] = [ "MagickWand" ] self.cpp_info.components[self._libname("MagickWand")].requires = [ "MagickWand" ] self.cpp_info.components[self._libname( "MagickWand")].names["pkg_config"] = self._libname("MagickWand") self.cpp_info.components["Magick++"].includedirs = [ imagemagick_include_dir + "/Magick++" ] self.cpp_info.components["Magick++"].libs = [self._libname("Magick++")] self.cpp_info.components["Magick++"].requires = ["MagickWand"] self.cpp_info.components["Magick++"].names["pkg_config"] = [ "Magick++", self._libname("Magick++"), ] self.cpp_info.components[self._libname("Magick++")].requires = [ "Magick++" ] self.cpp_info.components[self._libname( "Magick++")].names["pkg_config"] = self._libname("Magick++")
def _min_cppstd_required(self): return "11" if tools.Version(self.version) < "1.0.0-beta.11" else "17"
def _can_disable_rtti(self): return tools.Version(self.version) >= "3.15.4"
def _use_cmake(self): return self.settings.os == "Windows" or tools.Version( self.version) >= "4.0.0"
def _has_with_heif_option(self): return tools.Version(self.version) >= "3.2.0"
def package_info(self): self.cpp_info.names["cmake_find_package"] = "SDL2" self.cpp_info.names["cmake_find_package_multi"] = "SDL2" postfix = "d" if self.settings.build_type == "Debug" else "" # SDL2 sdl2_cmake_target = "SDL2" if self.options.shared else "SDL2-static" self.cpp_info.components["libsdl2"].names[ "cmake_find_package"] = sdl2_cmake_target self.cpp_info.components["libsdl2"].names[ "cmake_find_package_multi"] = sdl2_cmake_target self.cpp_info.components["libsdl2"].includedirs.append( os.path.join("include", "SDL2")) self.cpp_info.components["libsdl2"].libs = ["SDL2" + postfix] if self.options.iconv: self.cpp_info.components["libsdl2"].requires.append( "libiconv::libiconv") if self.settings.os == "Linux": self.cpp_info.components["libsdl2"].system_libs = [ "dl", "rt", "pthread" ] self.cpp_info.components["libsdl2"].requires.append("xorg::xorg") if self.options.alsa: self.cpp_info.components["libsdl2"].requires.append( "libalsa::libalsa") if self.options.pulse: self.cpp_info.components["libsdl2"].requires.append( "pulseaudio::pulseaudio") if self.options.opengl: self.cpp_info.components["libsdl2"].requires.append( "opengl::opengl") if self.options.jack: self._add_libraries_from_pc("jack") if self.options.sndio: self._add_libraries_from_pc("sndio") if self.options.nas: self.cpp_info.components["libsdl2"].system_libs.append("audio") if self.options.esd: self._add_libraries_from_pc("esound") if self.options.directfb: self._add_libraries_from_pc("directfb") if self.options.video_rpi: self.cpp_info.components["libsdl2"].system_libs.append( "bcm_host") self.cpp_info.components["libsdl2"].includedirs.extend([ "/opt/vc/include", "/opt/vc/include/interface/vcos/pthreads", "/opt/vc/include/interface/vmcs_host/linux" ]) self.cpp_info.components["libsdl2"].libdirs.append( "/opt/vc/lib") self.cpp_info.components["libsdl2"].sharedlinkflags.append( "-Wl,-rpath,/opt/vc/lib") self.cpp_info.components["libsdl2"].exelinkflags.append( "-Wl,-rpath,/opt/vc/lib") elif self.settings.os == "Macos": self.cpp_info.components["libsdl2"].frameworks = [ "Cocoa", "Carbon", "IOKit", "CoreVideo", "CoreAudio", "AudioToolbox", "ForceFeedback" ] if tools.Version(self.version) >= "2.0.14": self.cpp_info.components["libsdl2"].frameworks.append("Metal") elif self.settings.os == "Windows": self.cpp_info.components["libsdl2"].system_libs = [ "user32", "gdi32", "winmm", "imm32", "ole32", "oleaut32", "version", "uuid", "advapi32", "setupapi", "shell32" ] if self.settings.compiler == "gcc": self.cpp_info.components["libsdl2"].system_libs.append( "mingw32") if self.options.get_safe("libunwind"): self.cpp_info.components["libsdl2"].requires.append( "libunwind::libunwind") # SDL2main if self.options.sdl2main: self.cpp_info.components["sdl2main"].names[ "cmake_find_package"] = "SDL2main" self.cpp_info.components["sdl2main"].names[ "cmake_find_package_multi"] = "SDL2main" self.cpp_info.components["sdl2main"].libs = ["SDL2main" + postfix] self.cpp_info.components["sdl2main"].requires = ["libsdl2"]
def _has_with_lz4_option(self): return tools.Version(self.version) >= "3.4.0"
def _configure_cmake(self): if self._cmake: return self._cmake self._cmake = CMake(self) if tools.cross_building(self.settings): cmake_system_processor = { "armv8": "aarch64", "armv8.3": "aarch64", }.get(str(self.settings.arch), str(self.settings.arch)) self._cmake.definitions[ "CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor if self.settings.compiler == "Visual Studio": self._cmake.definitions["ARROW_USE_STATIC_CRT"] = "MT" in str( self.settings.compiler.runtime) self._cmake.definitions["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" self._cmake.definitions["ARROW_GANDIVA"] = self.options.gandiva self._cmake.definitions["ARROW_PARQUET"] = self.options.parquet self._cmake.definitions["ARROW_PLASMA"] = self.options.plasma self._cmake.definitions["ARROW_DATASET"] = self.options.dataset_modules self._cmake.definitions[ "ARROW_FILESYSTEM"] = self.options.filesystem_layer self._cmake.definitions[ "PARQUET_REQUIRE_ENCRYPTION"] = self.options.encryption self._cmake.definitions["ARROW_HDFS"] = self.options.hdfs_bridgs self._cmake.definitions["ARROW_VERBOSE_THIRDPARTY_BUILD"] = True self._cmake.definitions["ARROW_BUILD_SHARED"] = self.options.shared self._cmake.definitions["ARROW_BUILD_STATIC"] = not self.options.shared self._cmake.definitions[ "ARROW_NO_DEPRECATED_API"] = not self.options.deprecated self._cmake.definitions["ARROW_FLIGHT"] = self.options.with_flight_rpc self._cmake.definitions[ "ARROW_HIVESERVER2"] = self.options.with_hiveserver2 self._cmake.definitions["ARROW_COMPUTE"] = self._compute() self._cmake.definitions["ARROW_CSV"] = self.options.with_csv self._cmake.definitions["ARROW_CUDA"] = self.options.with_cuda self._cmake.definitions["ARROW_JEMALLOC"] = self._with_jemalloc() self._cmake.definitions["ARROW_JSON"] = self.options.with_json self._cmake.definitions["BOOST_SOURCE"] = "SYSTEM" self._cmake.definitions["Protobuf_SOURCE"] = "SYSTEM" if self._with_protobuf(): self._cmake.definitions[ "ARROW_PROTOBUF_USE_SHARED"] = self.options["protobuf"].shared self._cmake.definitions["gRPC_SOURCE"] = "SYSTEM" if self._with_grpc(): self._cmake.definitions["ARROW_GRPC_USE_SHARED"] = self.options[ "grpc"].shared self._cmake.definitions["ARROW_HDFS"] = self.options.hdfs_bridgs self._cmake.definitions["ARROW_USE_GLOG"] = self._with_glog() self._cmake.definitions["GLOG_SOURCE"] = "SYSTEM" self._cmake.definitions[ "ARROW_WITH_BACKTRACE"] = self.options.with_backtrace self._cmake.definitions["ARROW_WITH_BROTLI"] = self.options.with_brotli self._cmake.definitions["Brotli_SOURCE"] = "SYSTEM" if self.options.with_brotli: self._cmake.definitions["ARROW_BROTLI_USE_SHARED"] = self.options[ "brotli"].shared self._cmake.definitions["gflags_SOURCE"] = "SYSTEM" if self._with_gflags(): self._cmake.definitions["ARROW_BROTLI_USE_SHARED"] = self.options[ "gflags"].shared self._cmake.definitions["ARROW_WITH_BZ2"] = self.options.with_bz2 self._cmake.definitions["BZip2_SOURCE"] = "SYSTEM" if self.options.with_bz2: self._cmake.definitions["ARROW_BZ2_USE_SHARED"] = self.options[ "bzip2"].shared self._cmake.definitions["ARROW_WITH_LZ4"] = self.options.with_lz4 self._cmake.definitions["Lz4_SOURCE"] = "SYSTEM" if self.options.with_lz4: self._cmake.definitions["ARROW_LZ4_USE_SHARED"] = self.options[ "lz4"].shared self._cmake.definitions["ARROW_WITH_SNAPPY"] = self.options.with_snappy self._cmake.definitions["Snappy_SOURCE"] = "SYSTEM" if self.options.with_snappy: self._cmake.definitions["ARROW_SNAPPY_USE_SHARED"] = self.options[ "snappy"].shared self._cmake.definitions["ARROW_WITH_ZLIB"] = self.options.with_zlib self._cmake.definitions["RE2_SOURCE"] = "SYSTEM" self._cmake.definitions["ZLIB_SOURCE"] = "SYSTEM" self._cmake.definitions["ARROW_WITH_ZSTD"] = self.options.with_zstd if tools.Version(self.version) >= "2.0": self._cmake.definitions["zstd_SOURCE"] = "SYSTEM" self._cmake.definitions["ARROW_SIMD_LEVEL"] = str( self.options.simd_level).upper() self._cmake.definitions["ARROW_RUNTIME_SIMD_LEVEL"] = str( self.options.runtime_simd_level).upper() else: self._cmake.definitions["ZSTD_SOURCE"] = "SYSTEM" if self.options.with_zstd: self._cmake.definitions["ARROW_ZSTD_USE_SHARED"] = self.options[ "zstd"].shared self._cmake.definitions["ORC_SOURCE"] = "SYSTEM" self._cmake.definitions["ARROW_WITH_THRIFT"] = self._with_thrift() self._cmake.definitions["Thrift_SOURCE"] = "SYSTEM" self._cmake.definitions[ "THRIFT_VERSION"] = "1.0" # a recent thrift does not require boost if self._with_thrift(): self._cmake.definitions["ARROW_THRIFT_USE_SHARED"] = self.options[ "thrift"].shared self._cmake.definitions["ARROW_USE_OPENSSL"] = self._with_openssl() if self._with_openssl(): self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info[ "openssl"].rootpath.replace("\\", "/") self._cmake.definitions["ARROW_OPENSSL_USE_SHARED"] = self.options[ "openssl"].shared if self._with_boost(): self._cmake.definitions["ARROW_BOOST_USE_SHARED"] = self.options[ "boost"].shared self._cmake.definitions["ARROW_S3"] = self.options.with_s3 self._cmake.definitions["AWSSDK_SOURCE"] = "SYSTEM" self._cmake.definitions["ARROW_BUILD_UTILITIES"] = self.options.cli self._cmake.definitions["ARROW_BUILD_INTEGRATION"] = False self._cmake.definitions["ARROW_INSTALL_NAME_RPATH"] = False self._cmake.definitions["ARROW_BUILD_EXAMPLES"] = False self._cmake.definitions["ARROW_BUILD_TESTS"] = False self._cmake.definitions["ARROW_ENABLE_TIMING_TESTS"] = False self._cmake.definitions["ARROW_BUILD_BENCHMARKS"] = False self._cmake.definitions["LLVM_SOURCE"] = "SYSTEM" self._cmake.definitions["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() self._cmake.definitions["utf8proc_SOURCE"] = "SYSTEM" if self._with_utf8proc(): self._cmake.definitions[ "ARROW_UTF8PROC_USE_SHARED"] = self.options["utf8proc"].shared self._cmake.definitions["BUILD_WARNING_LEVEL"] = "PRODUCTION" if self.settings.compiler == "Visual Studio": self._cmake.definitions["ARROW_USE_STATIC_CRT"] = "MT" in str( self.settings.compiler.runtime) if self._with_llvm(): self._cmake.definitions["LLVM_DIR"] = self.deps_cpp_info[ "llvm-core"].rootpath.replace("\\", "/") self._cmake.configure() return self._cmake
def _has_with_pcre2_option(self): return tools.Version(self.version) >= "3.4.1"
def package_info(self): self.cpp_info.filenames["cmake_find_package"] = "Arrow" self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" self.cpp_info.components["libarrow"].libs = [self._lib_name("arrow")] self.cpp_info.components["libarrow"].names[ "cmake_find_package"] = "arrow" self.cpp_info.components["libarrow"].names[ "cmake_find_package_multi"] = "arrow" self.cpp_info.components["libarrow"].names["pkg_config"] = "arrow" if not self.options.shared: self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"] if self.settings.os == "Linux": self.cpp_info.components["libarrow"].system_libs = ["pthread"] if self.options.parquet: self.cpp_info.components["libparquet"].libs = [ self._lib_name("parquet") ] self.cpp_info.components["libparquet"].names[ "cmake_find_package"] = "parquet" self.cpp_info.components["libparquet"].names[ "cmake_find_package_multi"] = "parquet" self.cpp_info.components["libparquet"].names[ "pkg_config"] = "parquet" self.cpp_info.components["libparquet"].requires = ["libarrow"] if self.options.plasma: self.cpp_info.components["libplasma"].libs = [ self._lib_name("plasma") ] self.cpp_info.components["libplasma"].names[ "cmake_find_package"] = "plasma" self.cpp_info.components["libplasma"].names[ "cmake_find_package_multi"] = "plasma" self.cpp_info.components["libplasma"].names[ "pkg_config"] = "plasma" self.cpp_info.components["libplasma"].requires = ["libarrow"] if self.options.gandiva: self.cpp_info.components["libgandiva"].libs = [ self._lib_name("gandiva") ] self.cpp_info.components["libgandiva"].names[ "cmake_find_package"] = "gandiva" self.cpp_info.components["libgandiva"].names[ "cmake_find_package_multi"] = "gandiva" self.cpp_info.components["libgandiva"].names[ "pkg_config"] = "gandiva" self.cpp_info.components["libgandiva"].requires = ["libarrow"] if self.options.with_flight_rpc: self.cpp_info.components["libarrow_flight"].libs = [ self._lib_name("arrow_flight") ] self.cpp_info.components["libarrow_flight"].names[ "cmake_find_package"] = "flight_rpc" self.cpp_info.components["libarrow_flight"].names[ "cmake_find_package_multi"] = "flight_rpc" self.cpp_info.components["libarrow_flight"].names[ "pkg_config"] = "flight_rpc" self.cpp_info.components["libarrow_flight"].requires = ["libarrow"] if self.options.dataset_modules: self.cpp_info.components["dataset"].libs = ["arrow_dataset"] if self.options.cli: binpath = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH env var: {}".format(binpath)) self.env_info.PATH.append(binpath) if self._with_boost(): if self.options.gandiva: # FIXME: only filesystem component is used self.cpp_info.components["libgandiva"].requires.append( "boost::boost") if self.options.parquet and self.settings.compiler == "gcc" and self.settings.compiler.version < tools.Version( "4.9"): self.cpp_info.components["libparquet"].requires.append( "boost::boost") if tools.Version(self.version) >= "2.0": # FIXME: only headers components is used self.cpp_info.components["libarrow"].requires.append( "boost::boost") if self._with_openssl(): self.cpp_info.components["libarrow"].requires.append( "openssl::openssl") if self._with_gflags(): self.cpp_info.components["libarrow"].requires.append( "gflags::gflags") if self._with_glog(): self.cpp_info.components["libarrow"].requires.append("glog::glog") if self._with_jemalloc(): self.cpp_info.components["libarrow"].requires.append( "jemalloc::jemalloc") if self._with_re2(): self.cpp_info.components["libgandiva"].requires.append("re2::re2") if self._with_llvm(): self.cpp_info.components["libgandiva"].requires.append( "llvm-core::llvm-core") if self._with_protobuf(): self.cpp_info.components["libarrow"].requires.append( "protobuf::protobuf") if self._with_utf8proc(): self.cpp_info.components["libarrow"].requires.append( "uff8proc::uff8proc") if self._with_thrift(): self.cpp_info.components["libarrow"].requires.append( "thrift::thrift") if self.options.with_backtrace: self.cpp_info.components["libarrow"].requires.append( "libbacktrace::libbacktrace") if self.options.with_cuda: self.cpp_info.components["libarrow"].requires.append("cuda::cuda") if self.options.with_hiveserver2: self.cpp_info.components["libarrow"].requires.append( "hiveserver2::hiveserver2") if self.options.with_json: self.cpp_info.components["libarrow"].requires.append( "rapidjson::rapidjson") if self.options.with_s3: self.cpp_info.components["libarrow"].requires.append( "aws-sdk-cpp::s3") if self.options.with_orc: self.cpp_info.components["libarrow"].requires.append("orc::orc") if self.options.with_brotli: self.cpp_info.components["libarrow"].requires.append( "brotli::brotli") if self.options.with_bz2: self.cpp_info.components["libarrow"].requires.append( "bzip2::bzip2") if self.options.with_lz4: self.cpp_info.components["libarrow"].requires.append("lz4::lz4") if self.options.with_snappy: self.cpp_info.components["libarrow"].requires.append( "snappy::snappy") if self.options.get_safe( "simd_level") != None or self.options.get_safe( "runtime_simd_level") != None: self.cpp_info.components["libarrow"].requires.append( "xsimd::xsimd") if self.options.with_zlib: self.cpp_info.components["libarrow"].requires.append("zlib::zlib") if self.options.with_zstd: self.cpp_info.components["libarrow"].requires.append("zstd::zstd") if self.options.with_flight_rpc: self.cpp_info.components["libarrow_flight"].requires.append( "grpc::grpc") self.cpp_info.components["libarrow_flight"].requires.append( "protobuf::protobuf")
def requirements(self): self.requires("json-c/0.15") self.requires("libgeotiff/1.7.0") # self.requires("libopencad/0.0.2") # TODO: use conan recipe when available instead of internal one self.requires("libtiff/4.3.0") self.requires("proj/9.0.0") if tools.Version(self.version) >= "3.1.0": self.requires("flatbuffers/2.0.0") if self.options.get_safe("with_zlib", True): self.requires("zlib/1.2.11") if self.options.get_safe("with_libdeflate"): self.requires("libdeflate/1.10") if self.options.with_libiconv: self.requires("libiconv/1.16") if self.options.get_safe("with_zstd"): self.requires("zstd/1.5.2") if self.options.get_safe("with_blosc"): self.requires("c-blosc/1.21.1") if self.options.get_safe("with_lz4"): self.requires("lz4/1.9.3") if self.options.with_pg: self.requires("libpq/13.4") # if self.options.with_libgrass: # self.requires("libgrass/x.x.x") if self.options.with_cfitsio: self.requires("cfitsio/4.0.0") # if self.options.with_pcraster: # self.requires("pcraster-rasterformat/1.3.2") if self.options.get_safe("with_png", True): self.requires("libpng/1.6.37") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_gta: self.requires("libgta/1.2.1") # if self.options.with_pcidsk: # self.requires("pcidsk/x.x.x") if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9d") elif self.options.with_jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.2") if self.options.with_charls: self.requires("charls/2.2.0") if self.options.with_gif: self.requires("giflib/5.2.1") # if self.options.with_ogdi: # self.requires("ogdi/4.1.0") # if self.options.with_sosi: # self.requires("fyba/4.1.1") if self.options.with_mongocxx: self.requires("mongo-cxx-driver/3.6.6") if self.options.with_hdf4: self.requires("hdf4/4.2.15") if self.options.with_hdf5: self.requires("hdf5/1.12.0") if self.options.with_kea: self.requires("kealib/1.4.14") if self.options.with_netcdf: self.requires("netcdf/4.7.4") if self.options.with_jasper: self.requires("jasper/2.0.33") if self.options.with_openjpeg: self.requires("openjpeg/2.4.0") # if self.options.with_fgdb: # self.requires("file-geodatabase-api/x.x.x") if self.options.with_mysql == "libmysqlclient": self.requires("libmysqlclient/8.0.25") elif self.options.with_mysql == "mariadb-connector-c": self.requires("mariadb-connector-c/3.1.12") if self.options.with_xerces: self.requires("xerces-c/3.2.3") if self.options.with_expat: self.requires("expat/2.4.6") if self.options.with_libkml: self.requires("libkml/1.3.0") if self.options.with_odbc and self.settings.os != "Windows": self.requires("odbc/2.3.9") # if self.options.with_dods_root: # self.requires("libdap/3.20.6") if self.options.with_curl: self.requires("libcurl/7.80.0") if self.options.with_xml2: self.requires("libxml2/2.9.12") # if self.options.with_spatialite: # self.requires("libspatialite/4.3.0a") if self.options.get_safe("with_sqlite3"): self.requires("sqlite3/3.38.0") # if self.options.with_rasterlite2: # self.requires("rasterlite2/x.x.x") if self.options.get_safe("with_pcre"): self.requires("pcre/8.45") if self.options.get_safe("with_pcre2"): self.requires("pcre2/10.37") if self.options.with_webp: self.requires("libwebp/1.2.2") if self.options.with_geos: self.requires("geos/3.10.2") # if self.options.with_sfcgal: # self.requires("sfcgal/1.3.7") if self.options.with_qhull: self.requires("qhull/8.0.1") if self.options.with_opencl: self.requires("opencl-headers/2022.01.04") self.requires("opencl-icd-loader/2022.01.04") if self.options.with_freexl: self.requires("freexl/1.0.6") if self.options.with_poppler: self.requires("poppler/21.07.0") if self.options.with_podofo: self.requires("podofo/0.9.7") # if self.options.with_pdfium: # self.requires("pdfium/x.x.x") # if self.options.get_safe("with_tiledb"): # self.requires("tiledb/2.0.2") # if self.options.with_rasdaman: # self.requires("raslib/x.x.x") # if self.options.with_armadillo: # self.requires("armadillo/9.880.1") if self.options.with_cryptopp: self.requires("cryptopp/8.5.0") if self.options.with_crypto: self.requires("openssl/1.1.1m") # if not self.options.without_lerc: # self.requires("lerc/2.1") # TODO: use conan recipe (not possible yet because lerc API is broken for GDAL) if self.options.get_safe("with_exr"): self.requires("openexr/2.5.7") if self.options.get_safe("with_heif"): self.requires("libheif/1.12.0")
def _has_enable_math_function_option(self): return tools.Version(self.version) >= "3.35.0"
def _get_nmake_args(self): if self._nmake_args: return self._nmake_args rootpath = lambda req: self.deps_cpp_info[req].rootpath include_paths = lambda req: " -I".join(self.deps_cpp_info[req]. include_paths) version = lambda req: tools.Version(self.deps_cpp_info[req].version) args = [] args.append("GDAL_HOME=\"{}\"".format(self.package_folder)) args.append("DATADIR=\"{}\"".format( os.path.join(self.package_folder, "res", "gdal"))) if self.settings.arch == "x86_64": args.append("WIN64=1") args.append("DEBUG={}".format("1" if self.settings.build_type == "Debug" else "0")) args.append("DLLBUILD={}".format("1" if self.options.shared else "0")) args.append("PROJ_INCLUDE=\"-I{}\"".format(include_paths("proj"))) if self.options.with_libiconv: args.append("LIBICONV_INCLUDE=\"-I{}\"".format( include_paths("libiconv"))) args.append("LIBICONV_CFLAGS=\"-DICONV_CONST=\"") args.append("JPEG_EXTERNAL_LIB=1") if self.options.with_jpeg == "libjpeg": args.append("JPEGDIR=\"{}\"".format(include_paths("libjpeg"))) elif self.options.with_jpeg == "libjpeg-turbo": args.append("JPEGDIR=\"{}\"".format( include_paths("libjpeg-turbo"))) args.append("PNG_EXTERNAL_LIB=1") args.append("PNGDIR=\"{}\"".format(include_paths("libpng"))) if self.options.with_gif: args.append("GIF_SETTING=EXTERNAL") if self.options.with_pcraster: args.append("PCRASTER_SETTING=INTERNAL") args.append("TIFF_INC=\"-I{}\"".format(include_paths("libtiff"))) args.append("GEOTIFF_INC=\"-I{}\"".format(include_paths("libgeotiff"))) if self.options.with_libkml: args.append("LIBKML_DIR=\"{}\"".format(rootpath("libkml"))) if self.options.with_expat: args.append("EXPAT_DIR=\"{}\"".format(rootpath("expat"))) args.append("EXPAT_INCLUDE=\"-I{}\"".format( include_paths("expat"))) if self.options.with_xerces: args.append("XERCES_DIR=\"{}\"".format(rootpath("xerces-c"))) args.append("XERCES_INCLUDE=\"-I{}\"".format( include_paths("xerces-c"))) if self.options.with_jasper: args.append("JASPER_DIR=\"{}\"".format(rootpath("jasper"))) if self.options.with_hdf4: args.append("HDF4_DIR=\"{}\"".format(rootpath("hdf4"))) args.append("HDF4_INCLUDE=\"{}\"".format(include_paths("hdf4"))) if version("hdf4") >= "4.2.5": args.append("HDF4_HAS_MAXOPENFILES=YES") if self.options.with_hdf5: args.append("HDF5_DIR=\"{}\"".format(rootpath("hdf5"))) if self.options.with_kea: args.append("KEA_CFLAGS=\"-I{}\"".format(include_paths("kealib"))) if self.options.with_pg: args.append("PG_INC_DIR=\"{}\"".format(include_paths("libpq"))) if self.options.with_mysql == "libmysqlclient": args.append("MYSQL_INC_DIR=\"{}\"".format( include_paths("libmysqlclient"))) elif self.options.with_mysql == "mariadb-connector-c": args.append("MYSQL_INC_DIR=\"{}\"".format( include_paths("mariadb-connector-c"))) if self.options.get_safe("with_sqlite3"): args.append("SQLITE_INC=\"-I{}\"".format(include_paths("sqlite3"))) if self.options.get_safe("with_pcre2"): args.append("PCRE2_INC=\"-I{}\"".format(include_paths("pcre2"))) if self.options.get_safe("with_pcre"): args.append("PCRE_INC=\"-I{}\"".format(include_paths("pcre"))) if self.options.with_cfitsio: args.append("FITS_INC_DIR=\"{}\"".format(include_paths("cfitsio"))) if self.options.with_netcdf: args.extend([ "NETCDF_SETTING=YES", "NETCDF_INC_DIR=\"{}\"".format(include_paths("netcdf")) ]) if self.options["netcdf"].netcdf4 and self.options[ "netcdf"].with_hdf5: args.append("NETCDF_HAS_NC4=YES") if tools.Version(self.version) >= "3.3.0" and \ os.path.isfile(os.path.join(self.deps_cpp_info["netcdf"].rootpath, "include", "netcdf_mem.h")): args.append("NETCDF_HAS_NETCDF_MEM=YES") if self.options.with_curl: args.append("CURL_INC=\"-I{}\"".format(include_paths("libcurl"))) if self.options.with_geos: args.append("GEOS_CFLAGS=\"-I{} -DHAVE_GEOS\"".format( include_paths("geos"))) if self.options.with_openjpeg: args.append("OPENJPEG_ENABLED=YES") if self.options.get_safe("with_zlib", True): args.append("ZLIB_EXTERNAL_LIB=1") args.append("ZLIB_INC=\"-I{}\"".format(include_paths("zlib"))) if self.options.get_safe("with_libdeflate"): args.append("LIBDEFLATE_CFLAGS=\"-I{}\"".format( include_paths("libdeflate"))) if self.options.with_poppler: poppler_version = version("poppler") args.extend([ "POPPLER_ENABLED=YES", "POPPLER_MAJOR_VERSION={}".format(poppler_version.major), "POPPLER_MINOR_VERSION={}".format(poppler_version.minor) ]) if self.options.with_podofo: args.append("PODOFO_ENABLED=YES") if self.options.get_safe("with_zstd"): args.append("ZSTD_CFLAGS=\"-I{}\"".format(include_paths("zstd"))) if self.options.get_safe("with_blosc"): args.append("BLOSC_CFLAGS=\"-I{}\"".format( include_paths("c-blosc"))) if self.options.get_safe("with_lz4"): args.append("LZ4_CFLAGS=\"-I{}\"".format(include_paths("lz4"))) if self.options.with_webp: args.append("WEBP_ENABLED=YES") args.append("WEBP_CFLAGS=\"-I{}\"".format( include_paths("libwebp"))) if self.options.with_xml2: args.append("LIBXML2_INC=\"-I{}\"".format( include_paths("libxml2"))) if self.options.with_gta: args.append("GTA_CFLAGS=\"-I{}\"".format(include_paths("libgta"))) if self.options.with_mongocxx: args.append("MONGOCXXV3_CFLAGS=\"-I{}\"".format( include_paths("mongo-cxx-driver"))) args.append("QHULL_SETTING={}".format( "EXTERNAL" if self.options.with_qhull else "NO")) if self.options.with_qhull and self.options["qhull"].reentrant: args.append("QHULL_IS_LIBQHULL_R=1") if self.options.with_cryptopp: args.append("CRYPTOPP_INC=\"-I{}\"".format( include_paths("cryptopp"))) if self.options["cryptopp"].shared: args.append("USE_ONLY_CRYPTODLL_ALG=YES") if self.options.with_crypto: args.append("OPENSSL_INC=\"-I{}\"".format( include_paths("openssl"))) if self.options.without_lerc: args.append("HAVE_LERC=0") if self.options.get_safe("with_brunsli"): args.extend([ "BRUNSLI_DIR=\"{}\"".format(rootpath("brunsli")), "BRUNSLI_INC=\"{}\"".format(include_paths("brunsli")), ]) if self.options.with_charls: charls_version = version("charls") if charls_version >= "2.1.0": args.append("CHARLS_FLAGS=-DCHARLS_2_1") elif charls_version >= "2.0.0": args.append("CHARLS_FLAGS=-DCHARLS_2") if self.options.with_dds: args.append("CRUNCH_INC=\"-I{}\"".format(include_paths("crunch"))) if self.options.get_safe("with_exr"): args.append("EXR_INC=\"-I{}\"".format(include_paths("openexr"))) if self.options.get_safe("with_heif"): args.append("HEIF_INC=\"-I{}\"".format(include_paths("libheif"))) self._nmake_args = args return self._nmake_args
def configure(self): if self.settings.compiler == "gcc" and tools.Version( self.settings.compiler.version) < "8": raise ConanInvalidConfiguration( "Qt6 does not support GCC before 8") def _set_default_if_not_set(option_name: str, option_value: str) -> None: # let it fail if option name does not exist, it means the recipe is not up to date value = getattr(self.options, option_name) if not value or value == "None": setattr(self.options, option_name, option_value) def _set_build_type(build_type: str) -> None: if self.settings.build_type != build_type: msg = ( "The build_type '{0}' changed to '{1}'. Please check your Settings and " "Options. The used Qt options enforce '{2}' as a build_type. " .format(self.settings.build_type, build_type, build_type)) raise QtConanError(msg) self.settings.build_type = build_type def _check_mutually_exclusive_options(options: Dict[str, str]) -> None: if list(options.values()).count("yes") > 1: raise QtConanError( "These Qt options are mutually exclusive: {0}" ". Choose only one of them and try again.".format( list(options.keys()))) default_options = [ "shared", "gui", "widgets", "accessibility", "system_proxies", "ico" ] if self.settings.os == "Macos": default_options.append("framework") for item in default_options: _set_default_if_not_set(item, "yes") release = self.options.get_safe("release", default="no") debug = self.options.get_safe("debug", default="no") debug_and_release = self.options.get_safe("debug_and_release", default="no") force_debug_info = self.options.get_safe("force_debug_info", default="no") optimize_size = self.options.get_safe("optimize_size", default="no") # these options are mutually exclusive options so do a sanity check _check_mutually_exclusive_options({ "release": release, "debug": debug, "debug_and_release": debug_and_release }) # Prioritize Qt's configure options over Settings.build_type if debug_and_release == "yes": # Qt build system will build both debug and release binaries if force_debug_info == "yes": _set_build_type("RelWithDebInfo") else: _set_build_type("Release") elif release == "yes": _check_mutually_exclusive_options({ "force_debug_info": force_debug_info, "optimize_size": optimize_size }) if force_debug_info == "yes": _set_build_type("RelWithDebInfo") elif optimize_size == "yes": _set_build_type("MinSizeRel") else: _set_build_type("Release") elif debug == "yes": _set_build_type("Debug") else: # set default that mirror the configure(.bat) default values self.options.release = "yes" _set_build_type("Release")
def validate(self): if tools.Version(self.version) >= "3.0.0" and self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, 11) if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("SQLiteCpp can not be built as shared lib on Windows")
def _has_with_exr_option(self): return tools.Version(self.version) >= "3.1.0"
def _configure_cmake(self): if self._cmake: return self._cmake self._cmake = CMake(self) self._cmake.definitions["CMAKE_CXX_STANDARD"] = self._cppstd_required self._cmake.definitions["ENABLE_UNSTABLE_API_ABI_HEADERS"] = True self._cmake.definitions["BUILD_GTK_TESTS"] = False self._cmake.definitions["BUILD_QT5_TESTS"] = False self._cmake.definitions["BUILD_QT6_TESTS"] = False self._cmake.definitions["BUILD_CPP_TESTS"] = False self._cmake.definitions["ENABLE_UTILS"] = False self._cmake.definitions["ENABLE_CPP"] = self.options.cpp self._cmake.definitions["ENABLE_SPLASH"] = self.options.splash self._cmake.definitions[ "FONT_CONFIGURATION"] = self.options.fontconfiguration self._cmake.definitions["ENABLE_JPEG"] = self.options.with_libjpeg self._cmake.definitions["WITH_PNG"] = self.options.with_png self._cmake.definitions["WITH_TIFF"] = self.options.with_tiff self._cmake.definitions["WITH_NSS3"] = self.options.with_nss self._cmake.definitions["WITH_Cairo"] = self.options.with_cairo self._cmake.definitions["ENABLE_GLIB"] = self.options.get_safe( "with_glib", False) self._cmake.definitions[ "ENABLE_GOBJECT_INTROSPECTION"] = self.options.get_safe( "with_gobject_introspection", False) self._cmake.definitions["WITH_GTK"] = self.options.get_safe( "with_gtk", False) self._cmake.definitions["WITH_Iconv"] = self.options.get_safe( "with_libiconv") self._cmake.definitions["ENABLE_ZLIB"] = self.options.with_zlib self._cmake.definitions[ "ENABLE_LIBOPENJPEG"] = "openjpeg2" if self.options.with_openjpeg else "none" self._cmake.definitions[ "ENABLE_CMS"] = "lcms2" if self.options.with_lcms else "none" self._cmake.definitions["ENABLE_LIBCURL"] = self.options.with_libcurl self._cmake.definitions["POPPLER_DATADIR"] = self.deps_user_info[ "poppler-data"].datadir.replace("\\", "/") self._cmake.definitions[ "FONT_CONFIGURATION"] = self.options.fontconfiguration self._cmake.definitions["BUILD_CPP_TESTS"] = False self._cmake.definitions["ENABLE_GTK_DOC"] = False self._cmake.definitions[ "ENABLE_QT5"] = self.options.with_qt and tools.Version( self.deps_cpp_info["qt"].version).major == "5" self._cmake.definitions[ "ENABLE_QT6"] = self.options.with_qt and tools.Version( self.deps_cpp_info["qt"].version).major == "6" self._cmake.definitions[ "ENABLE_LIBOPENJPEG"] = "openjpeg2" if self.options.with_openjpeg else "none" if self.options.with_openjpeg: # FIXME: openjpeg's cmake_find_package should provide these variables self._cmake.definitions["OPENJPEG_MAJOR_VERSION"] = self.requires[ "openjpeg"].ref.version.split(".", 1)[0] self._cmake.definitions[ "ENABLE_CMS"] = "lcms2" if self.options.with_lcms else "none" self._cmake.definitions["ENABLE_DCTDECODER"] = self._dct_decoder self._cmake.definitions["USE_FLOAT"] = self.options.float self._cmake.definitions["RUN_GPERF_IF_PRESENT"] = False if self.settings.os == "Windows": self._cmake.definitions["ENABLE_RELOCATABLE"] = self.options.shared self._cmake.definitions["EXTRA_WARN"] = False self._cmake.configure(build_folder=self._build_subfolder) return self._cmake
def _has_with_libdeflate_option(self): return tools.Version(self.version) >= "3.2.0"
def _cppstd_required(self): if self.options.with_qt and tools.Version( self.deps_cpp_info["qt"].version).major == "6": return 17 else: return 14
def validate(self): if self.settings.compiler == "apple-clang" and tools.Version( self.settings.compiler.version) >= "11.0": raise ConanInvalidConfiguration( "OSX support is bugged. Check https://github.com/pybind/pybind11/issues/3081" )