コード例 #1
0
 def validate(self):
     if tools.Version(
             self.version) <= "1.0.5" and self.options.md5 == "openssl":
         raise ConanInvalidConfiguration(
             "{0}:md5=openssl is not suppported in {0}/{1}".format(
                 self.name, self.version))
コード例 #2
0
ファイル: conanfile.py プロジェクト: akemimadoka/conan-libvpx
 def configure(self):
     del self.settings.compiler.libcxx
     del self.settings.compiler.cppstd
     del self.settings.compiler.stdcpp
     if self.settings.os == 'Windows' and self.options.shared:
         raise ConanInvalidConfiguration('Windows shared builds are not supported')
コード例 #3
0
ファイル: conanfile.py プロジェクト: frek818/conan-oatpp
 def configure(self):
     if self.settings.compiler == "Visual Studio":
         if int(str(self.settings.compiler.version)) <= 12:
             raise ConanInvalidConfiguration(
                 "Visual Studio Compiler version must be > 12")
コード例 #4
0
 def configure(self):
     del self.settings.compiler.libcxx
     del self.settings.compiler.cppstd
     if self.settings.os == 'Windows' and self.options.shared:
         raise ConanInvalidConfiguration("libpq can not be built as shared library on Windows")
コード例 #5
0
 def configure(self):
     if not self.settings.os == 'Windows':
         raise ConanInvalidConfiguration('Only Windows is supported')
     if not self.settings.arch == 'x86_64':
         raise ConanInvalidConfiguration('Only x86_x64 is supported')
コード例 #6
0
 def validate(self):
     if not self.options["libzen"].enable_unicode:
         raise ConanInvalidConfiguration(
             "This package requires libzen with unicode support")
コード例 #7
0
ファイル: conanfile.py プロジェクト: toge/conan-center-index
 def configure(self):
     if self.settings.compiler.get_safe("cppstd"):
         tools.check_min_cppstd(self, 11)
     if self.settings.compiler == "gcc" and tools.Version(
             self.settings.compiler.version) < "5":
         raise ConanInvalidConfiguration("gcc < 5 is not supported")
コード例 #8
0
 def validate(self):
     if self.settings.compiler.get_safe("cppstd"):
         tools.check_min_cppstd(self, 11)
     if self.settings.os == "Macos" and self.settings.arch == "armv8":
         raise ConanInvalidConfiguration("Macos M1 not supported (yet)")
コード例 #9
0
 def configure(self):
     if (self.options.toolset == 'cxx' or self.options.toolset
             == 'cross-cxx') and not self.options.use_cxx_env:
         raise ConanInvalidConfiguration(
             "Option toolset 'cxx' and 'cross-cxx' requires 'use_cxx_env=True'"
         )
コード例 #10
0
 def configure(self):
     if self.settings.os == "Windows":
         raise ConanInvalidConfiguration(
             "libuuid is not supported on Windows")
     del self.settings.compiler.libcxx
コード例 #11
0
 def configure(self):
     if (self.settings.compiler == "gcc"
             and self.settings.compiler.libcxx != "libstdc++11"):
         raise ConanInvalidConfiguration(
             ("gtirb-pprinter requires libstdc++11 ABI, update your "
              "conan profile"))
コード例 #12
0
 def validate(self):
     if not (self.options["hdf5"].enable_cxx and self.options["hdf5"].hl):
         raise ConanInvalidConfiguration("kealib requires hdf5 with cxx and hl enabled.")
コード例 #13
0
    def configure(self):

        if self.options.widgets and not self.options.gui:
            raise ConanInvalidConfiguration(
                "using option qt:widgets without option qt:gui is not possible. "
                "You can either disable qt:widgets or enable qt:gui")
        if not self.options.gui:
            del self.options.opengl
            del self.options.with_vulkan
            del self.options.with_freetype
            del self.options.with_fontconfig
            del self.options.with_harfbuzz
            del self.options.with_libjpeg
            del self.options.with_libpng

        if self.settings.os == "Android" and self.options.get_safe(
                "opengl", "no") == "desktop":
            raise ConanInvalidConfiguration(
                "OpenGL desktop is not supported on Android.")

        if self.settings.os != "Windows" and self.options.get_safe(
                "opengl", "no") == "dynamic":
            raise ConanInvalidConfiguration(
                "Dynamic OpenGL is supported only on Windows.")

        if self.options.get_safe(
                "with_fontconfig",
                False) and not self.options.get_safe("with_freetype", False):
            raise ConanInvalidConfiguration(
                "with_fontconfig cannot be enabled if with_freetype is disabled."
            )

        if self.options.multiconfiguration:
            del self.settings.build_type

        if "MT" in self.settings.get_safe("compiler.runtime",
                                          default="") and self.options.shared:
            raise ConanInvalidConfiguration(
                "Qt cannot be built as shared library with static runtime")

        config = configparser.ConfigParser()
        config.read(
            os.path.join(self.recipe_folder,
                         "qtmodules%s.conf" % self.version))
        submodules_tree = {}
        assert config.sections()
        for s in config.sections():
            section = str(s)
            assert section.startswith("submodule ")
            assert section.count('"') == 2
            modulename = section[section.find('"') + 1:section.rfind('"')]
            status = str(config.get(section, "status"))
            if status != "obsolete" and status != "ignore":
                submodules_tree[modulename] = {
                    "status": status,
                    "path": str(config.get(section, "path")),
                    "depends": []
                }
                if config.has_option(section, "depends"):
                    submodules_tree[modulename]["depends"] = [
                        str(i) for i in config.get(section, "depends").split()
                    ]

        for m in submodules_tree:
            assert (m in ["qtbase", "qtqa", "qtrepotools"]
                    or m in self._submodules)

        for m in self._submodules:
            assert (m in submodules_tree)

        def _enablemodule(mod):
            if mod != "qtbase":
                setattr(self.options, mod, True)
            for req in submodules_tree[mod]["depends"]:
                _enablemodule(req)

        for module in self._submodules:
            if self.options.get_safe(module):
                _enablemodule(module)
コード例 #14
0
 def configure(self):
     if self.settings.os != "Linux":
         raise ConanInvalidConfiguration("Linux required")
コード例 #15
0
 def _validate_dependency_graph(self):
     if self.deps_cpp_info["spirv-headers"].version != self._get_compatible_spirv_headers_version:
         raise ConanInvalidConfiguration("spirv-tools {0} requires spirv-headers {1}"
                                         .format(self.version, self._get_compatible_spirv_headers_version))
コード例 #16
0
 def validate(self):
     if self.settings.os == "Windows":
         raise ConanInvalidConfiguration("hiredis {} is not supported on Windows.".format(self.version))
コード例 #17
0
 def validate(self):
     if self.settings.compiler == "Visual Studio":
         raise ConanInvalidConfiguration("Visual Studio not supported")
コード例 #18
0
 def validate(self):
     if self.settings.os == "Windows" and self.options.shared:
         raise ConanInvalidConfiguration(
             "hash-library does not support shared builds on Windows.")
コード例 #19
0
    def package_info(self):
        if getattr(self, "settings_target", None):
            if self.settings_target.compiler != "gcc":
                raise ConanInvalidConfiguration(
                    "Only GCC is allowed as compiler.")
            if str(self.settings_target.compiler.threads) != str(
                    self.options.threads):
                raise ConanInvalidConfiguration(
                    "Build requires 'mingw' provides binaries for gcc "
                    "with threads={}, your profile:host declares "
                    "threads={}, please use the same value for both.".format(
                        self.options.threads,
                        self.settings_target.compiler.threads))
            if str(self.settings_target.compiler.exception) != str(
                    self.options.exception):
                raise ConanInvalidConfiguration(
                    "Build requires 'mingw' provides binaries for gcc "
                    "with exception={}, your profile:host declares "
                    "exception={}, please use the same value for both.".format(
                        self.options.exception,
                        self.settings_target.compiler.exception))

        bin_path = os.path.join(self.package_folder, "bin")
        self.output.info("Appending PATH env var with : {}".format(bin_path))
        self.env_info.PATH.append(bin_path)
        self.env_info.MINGW_HOME = str(self.package_folder)

        if self.settings.os == "Windows":
            self.env_info.CONAN_CMAKE_GENERATOR = "MinGW Makefiles"
            self.env_info.CXX = os.path.join(self.package_folder, "bin",
                                             "g++.exe").replace("\\", "/")
            self.env_info.CC = os.path.join(self.package_folder, "bin",
                                            "gcc.exe").replace("\\", "/")
            self.env_info.LD = os.path.join(self.package_folder, "bin",
                                            "ld.exe").replace("\\", "/")
            self.env_info.NM = os.path.join(self.package_folder, "bin",
                                            "nm.exe").replace("\\", "/")
            self.env_info.AR = os.path.join(self.package_folder, "bin",
                                            "ar.exe").replace("\\", "/")
            self.env_info.AS = os.path.join(self.package_folder, "bin",
                                            "as.exe").replace("\\", "/")
            self.env_info.STRIP = os.path.join(self.package_folder, "bin",
                                               "strip.exe").replace("\\", "/")
            self.env_info.RANLIB = os.path.join(self.package_folder, "bin",
                                                "ranlib.exe").replace(
                                                    "\\", "/")
            self.env_info.STRINGS = os.path.join(self.package_folder, "bin",
                                                 "strings.exe").replace(
                                                     "\\", "/")
            self.env_info.OBJDUMP = os.path.join(self.package_folder, "bin",
                                                 "objdump.exe").replace(
                                                     "\\", "/")
            self.env_info.GCOV = os.path.join(self.package_folder, "bin",
                                              "gcov.exe").replace("\\", "/")
        else:
            prefix = os.path.join(self.package_folder, "bin",
                                  self._target_tag + "-")
            self.env_info.CC = prefix + "gcc"
            self.env_info.CXX = prefix + "g++"
            self.env_info.CPP = prefix + "cpp"
            self.env_info.AR = prefix + "ar"
            self.env_info.AS = prefix + "as"
            self.env_info.GDB = prefix + "gdb"
            self.env_info.LD = prefix + "ld"
            self.env_info.NM = prefix + "nm"
            self.env_info.OBJCOPY = prefix + "objcopy"
            self.env_info.OBJDUMP = prefix + "objdump"
            self.env_info.RANLIB = prefix + "ranlib"
            self.env_info.SIZE = prefix + "size"
            self.env_info.STRINGS = prefix + "strings"
            self.env_info.STRIP = prefix + "strip"
            self.env_info.GCOV = prefix + "gcov"
            self.env_info.RC = prefix + "windres"
            # Symlinks cannot be created in package step, otherwise the link target is wrong.
            if not os.path.exists(os.path.join(self.package_folder, 'mingw')):
                self.run("ln -s {} {}".format(
                    os.path.join(self.package_folder, self._target_tag),
                    os.path.join(self.package_folder, 'mingw')))
            if not os.path.exists(
                    os.path.join(self.package_folder, self._target_tag,
                                 'lib64')):
                self.run("ln -s {} {}".format(
                    os.path.join(self.package_folder, self._target_tag, 'lib'),
                    os.path.join(self.package_folder, self._target_tag,
                                 'lib64')))
コード例 #20
0
 def validate(self):
     if self.settings.os == "Macos" and self.options.shared:
         raise ConanInvalidConfiguration("libpcap can not be built as shared on OSX.")
     if self.settings.os == "Windows":
         raise ConanInvalidConfiguration("libpcap is not supported on Windows.")
コード例 #21
0
ファイル: conanfile.py プロジェクト: toge/conan-center-index
 def validate(self):
     if self.options["spirv-tools"].shared:
         raise ConanInvalidConfiguration(
             "vulkan-validationlayers can't depend on shared spirv-tools")
コード例 #22
0
 def validate(self):
     if not self.options.enable_default_vfs and self.options.build_executable:
         # Need to provide custom VFS code: https://www.sqlite.org/custombuild.html
         raise ConanInvalidConfiguration(
             "build_executable=True cannot be combined with enable_default_vfs=False"
         )
コード例 #23
0
    def configure(self):
        if self.settings.compiler in ["gcc", "clang"]:
            if tools.Version(self.settings.compiler.version) < "5.0":
                raise ConanInvalidConfiguration(
                    "qt 5.15.1 is not support on GCC or clang before 5.0")
        if conan_version < Version("1.20.0"):
            raise ConanInvalidConfiguration(
                "This recipe needs at least conan 1.20.0, please upgrade.")
        if self.settings.os != 'Linux':
            #     self.options.with_libiconv = False
            self.options.with_fontconfig = False
        if self.settings.compiler == "gcc" and Version(
                self.settings.compiler.version.value) < "5.3":
            self.options.with_mysql = False
        if self.settings.os == "Windows":
            self.options.with_mysql = False
            if not self.options.shared and self.options.with_icu:
                raise ConanInvalidConfiguration(
                    "icu option is not supported on windows in static build. see QTBUG-77120."
                )

        if self.options.widgets and not self.options.GUI:
            raise ConanInvalidConfiguration(
                "using option qt:widgets without option qt:GUI is not possible. "
                "You can either disable qt:widgets or enable qt:GUI")
        if not self.options.GUI:
            self.options.opengl = "no"
            self.options.with_vulkan = False
            self.options.with_freetype = False
            self.options.with_fontconfig = False
            self.options.with_harfbuzz = False
            self.options.with_libjpeg = False
            self.options.with_libpng = False

        if not self.options.qtgamepad:
            self.options.with_sdl2 = False

        if not self.options.qtmultimedia:
            self.options.with_libalsa = False
            self.options.with_openal = False

        if self.options.qtmultimedia and not self.options.GUI:
            raise ConanInvalidConfiguration(
                "Qt multimedia cannot be used without GUI")

        if self.settings.os != "Linux":
            self.options.with_libalsa = False

        if self.options.qtwebengine:
            if not self.options.shared:
                raise ConanInvalidConfiguration(
                    "Static builds of Qt Webengine are not supported")

            if tools.cross_building(self.settings, skip_x64_x86=True):
                raise ConanInvalidConfiguration(
                    "Cross compiling Qt WebEngine is not supported")

            if self.settings.compiler == "gcc" and tools.Version(
                    self.settings.compiler.version) < "5":
                raise ConanInvalidConfiguration(
                    "Compiling Qt WebEngine with gcc < 5 is not supported")

        if self.settings.os == "Android" and self.options.opengl == "desktop":
            raise ConanInvalidConfiguration(
                "OpenGL desktop is not supported on Android. Consider using OpenGL es2"
            )

        if self.settings.os != "Windows" and self.options.opengl == "dynamic":
            raise ConanInvalidConfiguration(
                "Dynamic OpenGL is supported only on Windows.")

        if self.options.with_fontconfig and not self.options.with_freetype:
            raise ConanInvalidConfiguration(
                "with_fontconfig cannot be enabled if with_freetype is disabled."
            )

        if self.settings.os == "Macos":
            del self.settings.os.version

        if self.options.multiconfiguration:
            del self.settings.build_type

        if not self.options.with_doubleconversion and str(
                self.settings.compiler.libcxx) != "libc++":
            raise ConanInvalidConfiguration(
                'Qt without libc++ needs qt:with_doubleconversion. '
                'Either enable qt:with_doubleconversion or switch to libc++')

        if tools.os_info.is_linux:
            if self.options.qtwebengine:
                self.options.with_fontconfig = True

        assert self.version == self._submodules['qtbase']['branch']

        def _enablemodule(mod):
            if mod != 'qtbase':
                setattr(self.options, mod, True)
            for req in self._submodules[mod]["depends"]:
                _enablemodule(req)

        for module in self._submodules:
            if module != 'qtbase' and getattr(self.options, module):
                _enablemodule(module)
コード例 #24
0
 def validate(self):
     if not self.options.shared and tools.Version(self.version) < "1.3.4":
         raise ConanInvalidConfiguration("{}/{} does not support static linking".format(self.name, self.version))
コード例 #25
0
 def configure(self):
     if self.settings.os != "Linux":
         raise ConanInvalidConfiguration(
             "Linux Kernel SCTP Tools is only supported for Linux.")
     del self.settings.compiler.libcxx
     del self.settings.compiler.cppstd
コード例 #26
0
 def configure(self):
     if self.settings.compiler.get_safe("cppstd"):
         tools.check_min_cppstd(self, "17")
     elif not self._supports_cpp17():
         raise ConanInvalidConfiguration("Absent requires C++17 support")
コード例 #27
0
 def configure(self):
     if self.settings.os_build != "Windows":
         raise ConanInvalidConfiguration("Only Windows supported")
     if self.settings.arch_build not in ("x86", "x86_64"):
         raise ConanInvalidConfiguration("Unsupported architecture")
コード例 #28
0
    def configure(self):
        del self.settings.compiler.libcxx
        del self.settings.compiler.cppstd

        if self.options.with_expat and self.options.with_libxml2:
            raise ConanInvalidConfiguration("libxml2 and expat options are exclusive. They cannot be used together as XML engine")
コード例 #29
0
 def configure(self):
     if not tools.is_apple_os(self.settings.os):
         raise ConanInvalidConfiguration(
             "This package only supports Apple operating systems")
コード例 #30
0
 def validate(self):
     if self.options.shared and self.settings.os == "Windows":
         raise ConanInvalidConfiguration("Shared inih is not supported")
     if hasattr(self, "settings_build") and cross_building(self):
         raise ConanInvalidConfiguration("Cross-building not implemented")