def source(self): if True: # if running from own customized version (needed due to exports renaming) git=tools.Git(folder="gumbo-parser") git.clone("https://github.com/pietermessely/gumbo-parser") else: git=tools.Git(folder="libgumbo-parser") git.clone("https://github.com/google/gumbo-parser") os.rename("gumbo-parser", self.source_subfolder)
def source(self): tools.Git(folder="cppTango")\ .clone("https://github.com/tango-controls/cppTango.git", branch="refs/tags/9.3.3", shallow=True) idl = tools.Git(folder="tango-idl") idl.clone("https://github.com/tango-controls/tango-idl") idl.checkout("1e5edb84d966814ad367f2674ac9a5658b6724ac")
def source(self): if True: # if running from own customized version (needed due to exports renaming) git=tools.Git(folder="libnfs") git.clone("https://github.com/pietermessely/libnfs.git") else: git=tools.Git(folder="libnfs") git.clone("https://github.com/sahlberg/libnfs.git") os.rename("libnfs", self.source_subfolder)
def source(self): git = tools.Git(folder="11zip") git.clone("https://github.com/Sygmei/11Zip.git") if self.settings.os != "Windows": git = tools.Git(folder="11zip/include/tinydir") git.clone("https://github.com/cxong/tinydir.git") tools.replace_path_in_file("11zip/CMakeLists.txt", "target_link_libraries(elzip tinydir)", "add_subdirectory(include/tinydir)")
def source(self): tools.mkdir(self._source_subfolder) branch_ = "master" with tools.chdir(self._source_subfolder): opengl_url_ = "https://github.com/CentricularK/OpenGL-Registry.git" git = tools.Git(folder="OpenGL-Registry") git.clone(opengl_url_, branch=branch_) #os.rename("OpenGL-Registry", self._source_subfolder) egl_url_ = "https://github.com/KhronosGroup/EGL-Registry.git" egl_git = tools.Git(folder="EGL-Registry") egl_git.clone(egl_url_, branch=branch_)
def source(self): breakpad_git = tools.Git(folder='breakpad') breakpad_git.clone( 'https://chromium.googlesource.com/breakpad/breakpad', branch=self.branch, shallow=True) if self.settings.os == 'Linux': lss_git = tools.Git(folder='breakpad/src/third_party/lss') lss_git.clone( 'https://chromium.googlesource.com/linux-syscall-support') if self.settings.os == 'Windows': gyp_git = tools.Git(folder='breakpad/src/tools/gyp') gyp_git.clone('https://github.com/umogSlayer/gyp-clone.git')
def _get_version(): try: content = tools.load("CMakeLists.txt") except EnvironmentError as err: if err.errno == errno.ENOENT: return None # Assume conan metadata already knows raise match = re.search(r"project\(Lass VERSION (\d+\.\d+\.\d+)\)", content) assert match version = match.group(1) git = tools.Git() # if this version has been tagged in Git, it's either this very commit (and a # release version), or a post-release (which is not allowed). version_tag = "lass-{}".format(version) try: describe = git.run( "describe --abbrev=8 --dirty --tags --match {}".format( version_tag)) except (errors.ConanException, errors.CalledProcessErrorWithStderr): pass # release tag doesn't exist yet, it's a pre-release. else: assert describe == version_tag, ( "Post-release builds are not allowed. Set base_tag to {!r} and " + "increment project(Lass VERSION X.Y.Z) in CMakeLists.txt." ).format(version_tag) return version # It's not a release version, so we want to add a pre-release number to the semver. # We can use describe to get an increasing number from a previous tag. To get a # stable number we need to fix that base tag, which is obviously not the current # version since that tag doesn't exist yet. # NOTE: you can only update this base tag _at_the_same_time_ you update # project(Lass VERSION ...) in CMakeLists. Otherwise, the prerelease numbers will # not properly increase. base_tag = "lass-1.10.0" git = tools.Git() try: describe = git.run( "describe --abbrev=8 --dirty --tags --match {}".format(base_tag)) except errors.ConanException: return None # Assume conan metadata already knows assert describe.startswith( base_tag), "{!r} does not start with {!r}".format(describe, base_tag) match = re.search(r"{}-(\d+)-(g\w+(-dirty)?)$".format(re.escape(base_tag)), describe) assert match, "unexpected describe format: {!r}".format(describe) pre_release, rev = match.group(1), match.group(2) return "{}-{}+{}".format(version, pre_release, rev)
def source(self): self._ice.source_dir = "{}-{}".format(self.name, self.version) source_info = self.conan_data["sources"][self.ice_source_entry( self.version)] if "branch" in source_info: git = tools.Git(folder=self._ice.source_dir) git.clone(source_info["url"], source_info["branch"]) if "commit" in source_info: git.checkout(source_info["commit"]) elif "tag" in source_info: git = tools.Git(folder=self._ice.source_dir) git.clone(source_info["url"], source_info["tag"]) else: tools.get(**source_info)
def source(self): # Clone Imgui imgui_git = tools.Git(folder="imgui") imgui_git.clone("https://github.com/ocornut/imgui.git", 'v{0}'.format(self.version)) # Clone Imgui-SFML imgui_sfml_git = tools.Git(folder="imgui-sfml") imgui_sfml_git.clone("https://github.com/eliasdaler/imgui-sfml.git", 'v{0}'.format(self.version_imgui_sfml)) # Create the source folder where all files will be moved to os.mkdir("sources") for file_name_and_path in glob.glob("imgui/*.h") + glob.glob( "imgui/*.cpp"): file_name = os.path.split(file_name_and_path)[-1] shutil.copy(file_name_and_path, os.path.join("sources", file_name)) for file_name_and_path in glob.glob("imgui-sfml/*.h") + glob.glob( "imgui-sfml/*.cpp"): file_name = os.path.split(file_name_and_path)[-1] shutil.copy(file_name_and_path, os.path.join("sources", file_name)) # Now all relevant files are in the sources folder. We still need to # append the content of sources/imconfig-SFML.h to sources/imconfig.h # and remove sources/imconfig-SFML.h imconfig_content = tools.load("sources/imconfig.h") imconfig_sfml_content = tools.load("sources/imconfig-SFML.h") concatenated_content = "{0}\n\n{1}".format(imconfig_content, imconfig_sfml_content) tools.save("sources/imconfig.h", concatenated_content) # Now we can remove the imgui and imgui-sfml folders shutil.rmtree("imgui/") shutil.rmtree("imgui-sfml/") # In case of ubuntu find_package will not find SFML unless we indicate # to cmake where to find the FindSFML.cmake file if (tools.os_info.linux_distro == 'ubuntu'): tools.replace_in_file( "CMakeLists.txt", "# PLACEHOLDER", ('# Add a folder to CMAKE_MODULE_PATH to indicate where the ' 'SFML module can be found\nlist(APPEND CMAKE_MODULE_PATH ' '"/usr/share/SFML/cmake/Modules")')) else: tools.replace_in_file("CMakeLists.txt", "# PLACEHOLDER", "") # Copy the CMakeLists.txt file to the sources folder shutil.move("CMakeLists.txt", "sources/")
def source(self): # branch = os.environ.get("TRAVIS_BRANCH","master") branch = os.environ["CONAN_TEST_BRANCH"] git = tools.Git() git.clone("https://github.com/Chrismarsh/CHM.git", branch=branch) git.run("submodule update --init --recursive")
def source(self): tools.Git().clone(url="https://github.com/littlstar/soil.git", branch=self.version, shallow=True) with open("CMakeLists.txt", "w") as f: f.write(cmakedata)
def set_version(self): # This is helpful in case someone defines the CONAN_REFERENCE environment variable. # The main situation this is for is when using docker containers to package and publish # as we run into issues determining revision and branch using git. if _is_conan_reference_defined(): conan_reference = os.getenv("CONAN_REFERENCE", "") match = re.match("%s/([^@]+)@.+" % self.name, conan_reference) if match: self.version = match.group(1) else: raise ValueError( "CONAN_REFERENCE could not be parsed for version") else: content = tools.load( os.path.join(self.recipe_folder, "../project-meta-info.cmake")) major_minor_patch = re.search( r"set\(project_version (\d+\.\d+\.\d+)\)", content).group(1) git = tools.Git() latest_release_tag = git.run( "rev-list --tags --no-walk --max-count=1") if latest_release_tag: latest_release_tag += ".." revision = git.run("rev-list %sHEAD --count" % latest_release_tag) branch = _get_branch(git) if revision == 0 and _is_release_branch(branch): # If we are on a release branch and there is no revisions from tag then we should create an # official release package. self.version = major_minor_patch else: self.version = "%s-%s+%s" % (major_minor_patch, revision, branch)
def get_version(): git = tools.Git() try: rev = git.get_revision()[:8] return rev except: return None
def source(self): git = tools.Git() git.clone("https://github.com/OGRECave/ogre.git", "v1.11.6") tools.replace_in_file( "CMakeLists.txt", "# OGRE BUILD SYSTEM", "include(${CMAKE_BINARY_DIR}/conan_paths.cmake)") tools.replace_in_file( "CMake/Packages/FindFreeImage.cmake", "set(FreeImage_LIBRARY_NAMES freeimage freeimageLib FreeImage FreeImageLib)", "set(FreeImage_LIBRARY_NAMES freeimage freeimageLib FreeImage FreeImageLib libFreeImage)" ) tools.replace_in_file( "CMake/Packages/FindZZip.cmake", "set(ZZip_LIBRARY_NAMES zziplib zzip zzip-0)", "set(ZZip_LIBRARY_NAMES zziplib zzip zzip-0 libzziplib)") tools.replace_in_file( "CMake/Dependencies.cmake", '''set(OGRE_DEPENDENCIES_DIR "" CACHE PATH "Path to prebuilt OGRE dependencies")''', '''set(OGRE_DEPENDENCIES_DIR ${CMAKE_PREFIX_PATH})''') tools.replace_in_file( "CMake/Utils/FindPkgMacros.cmake", 'set(${PREFIX} optimized ${${PREFIX}_REL} debug ${${PREFIX}_DBG})', 'set(${PREFIX} ${${PREFIX}_REL} ${${PREFIX}_DBG})') tools.patch(patch_string=''' --- OgreMain/src/OgreScriptLexer.cpp +++ OgreMain/src/OgreScriptLexer.cpp @@ -82 +82 @@ - return tokens; + braceLayer = 1; ''')
def source(self): if os.path.exists(self._source_folder): tools.rmdir(self._source_folder) git = tools.Git(folder=self._source_folder) git.clone(url="https://github.com/apache/xalan-c.git", branch="Xalan-C_1_12_0", shallow=True)
def test_git_repository(self, exports): conanfile = self.conanfile_base.format( exports=exports) if exports else self.conanfile_plain reference = 'name/version@jgsogo/test' url = 'http://some.url' git = tools.Git() git.run("init .") git.run('config user.email "*****@*****.**"') git.run('config user.name "Your Name"') tools.save('conanfile.py', content=conanfile) git.run('add --all') git.run('commit -am "initial"') git.run('remote add origin {}'.format(url)) output = self.conan(['export', '.', reference]) self.assertIn( "pre_export(): Exported metadata to file '{}'".format( METADATA_FILENAME), output) # Check that the file is in the export folder, contains expected data and is in the manifest output = self.conan(['get', reference, METADATA_FILENAME]) data = json.loads(output) self.assertDictEqual( data['repo'], { 'type': 'git', 'url': url, 'revision': git.get_commit(), 'dirty': False }) output = self.conan(['get', reference, CONAN_MANIFEST]) self.assertIn(METADATA_FILENAME, output)
def source(self): _git = tools.Git() _git.clone("https://github.com/coin-or-tools/{}.git" .format(self._coin_helper), branch=self._coin_helper_branch, shallow=True) hsl_archive = self.options.hsl_archive if hsl_archive is None: raise ConanInvalidConfiguration( "option:hsl_archive must point to an hsl archive file or url") hsl_archive = str(hsl_archive) if hsl_archive.startswith("http"): hsl_user = tools.get_env("HSL_USER") hsl_password = tools.get_env("HSL_PASSWORD") auth = None if hsl_user is not None and hsl_password is not None: auth = (hsl_user, hsl_password) tools.get(hsl_archive, auth=auth, strip_root=True, destination="coinhsl") else: self.output.info("Retrieving HSL from {}".format(hsl_archive)) tools.untargz(hsl_archive, strip_root=True, destination="coinhsl")
def export_sources(self): git = tools.Git(".") status_files =[x[2:].strip() for x in git.run("status -s --untracked-files=no").split("\n")] checkout_files = git.run("ls-tree -r HEAD --name-only").split("\n") files = uniq(status_files, checkout_files) for file in files: self.copy(file)
def source(self): git = tools.Git("crossguid") git.clone("https://github.com/graeme-hill/crossguid") git.checkout("b151b7d1aeb68c4b9e98a8a2e0a547885aa0b60c") tools.replace_in_file("crossguid/CMakeLists.txt", "project(CrossGuid)", '''project(CrossGuid) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup()''')
def source(self): git = tools.Git() git.clone("https://github.com/uofs-simlab/func") tools.replace_in_file( "src/CMakeLists.txt", "target_link_libraries(func PUBLIC ", "target_link_libraries(func PUBLIC Boost::Boost")
def source(self): rev = "v" + self.version git = tools.Git(folder=self._source_subfolder) git.clone(self.homepage, rev, shallow=True) #git.checkout(rev, submodule="shallow") with tools.chdir(self._source_subfolder): self.run("git submodule update --init")
def source(self): submodules = [ "qtbase", "qtimageformats", "qtsvg", "qttools", "qttranslations", "qtxmlpatterns" ] if self.settings.os == "Macos": submodules.append("qtmacextras") if self.settings.os == "Windows": submodules.append("qtwinextras") git = tools.Git(self.source_dir) git.clone(**self.conan_data["sources"][qtconf.QT_VERSION]) self.run( "cd {} && perl init-repository --no-update --module-subset={}". format(self.source_dir, ",".join(submodules))) self.run("cd {} && git submodule update".format(self.source_dir)) for patch in self.conan_data["patches"].get(qtconf.QT_VERSION, []): self.output.info("Applying patch {}".format(patch["patch_file"])) tools.patch(**patch) if self.settings.os != "Windows": self.run("chmod +x ./{}/configure".format(self.source_dir))
def source(self): self.setup_vars() if self.settings.os == "Windows": tools.download( "https://storage.googleapis.com/chrome-infra/depot_tools.zip", "depot_tools.zip") tools.unzip("depot_tools.zip", destination="depot_tools") else: git_depot_tools = tools.Git(folder="depot_tools") git_depot_tools.clone( "https://chromium.googlesource.com/chromium/tools/depot_tools.git", "main") with tools.environment_append({ "PATH": [self._depot_tools_dir], "DEPOT_TOOLS_WIN_TOOLCHAIN": "0" }): self.run("gclient") if self.settings.os == "iOS": self.run("fetch --nohooks webrtc_ios") else: self.run("fetch --nohooks webrtc") with tools.chdir('src'): self.run("git checkout -b %s branch-heads/%s" % (self.version, self._branchHead)) self.run("gclient sync -D") self._patch_runtime()
def source(self): isver = self.version[0].isdigit() tools.Git().clone( url="https://github.com/imneme/pcg-cpp.git", branch=("v" if isver else "") + self.version, shallow=True )
def set_version(self): """Use `git describe` for the version string.""" git = tools.Git() try: self.version = git.run("describe --abbrev=0") except subprocess.CalledProcessError: self.version = "0.0"
def source(self): sha1 = self._version_sha1[self.version] gitdir = os.path.join(self.source_folder, self._source_subfolder) git = tools.Git(folder=gitdir) git.clone("https://github.com/berkeley-abc/abc.git", "master") git.checkout(sha1) cmake_file = os.path.join(gitdir, "CMakeLists.txt") tools.replace_in_file( cmake_file, "add_library(libabc EXCLUDE_FROM_ALL ${ABC_SRC})", "add_library(libabc ${ABC_SRC})") tools.replace_in_file( cmake_file, "ABC_MAKE_NO_DEPS=1", "ABC_MAKE_NO_DEPS=1 ARCHFLAGS=-DABC_USE_STDINT_H=1") tools.replace_in_file( os.path.join(self.source_folder, self._source_subfolder, "src", "opt", "dau", "dauCanon.c"), "inline void Abc_TtVerifySmallTruth", "void Abc_TtVerifySmallTruth") with open(cmake_file, "a") as f: f.write(""" install(TARGETS abc libabc ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" )""")
def set_version(self): version_file = Path(self.recipe_folder) / "VERSION" if version_file.exists(): self.version = tools.load(version_file).strip() else: git = tools.Git(folder=self.recipe_folder) self.version = git.run("describe --dirty=-dirty")[1:]
def source(self): git = tools.Git("src") git.clone("https://github.com/sbmlteam/libCombine/") tools.replace_in_file( 'src/CMakeLists.txt', "project(libCombine)", '''project(libCombine) include(${CMAKE_BINARY_DIR}/../conanbuildinfo.cmake) conan_basic_setup()''')
def source(self): _git = tools.Git() _git.clone("https://github.com/coin-or-tools/{}.git" .format(self._coin_helper), branch=self._coin_helper_branch, shallow=True) self.run("./get.Metis", win_bash=tools.os_info.is_windows)
def source(self): git = tools.Git(folder=self.name) git.clone("https://github.com/PointCloudLibrary/pcl.git", "{}-{}".format(self.name, self.version)) tools.patch( base_path=self.name, patch_file="no_except.patch" ) # >= boost version 1.70 https://github.com/PointCloudLibrary/pcl/commit/5605910a26f299cb53bd792e923598b3aa5bbc18 tools.patch(base_path=self.name, patch_file="pcl_binaries.patch")