TCC: allow builds from git

This commit is contained in:
Christoph Gerum 2022-05-16 09:47:00 +02:00
parent da3e9cab3f
commit db98e3a9c0
1 changed files with 14 additions and 6 deletions

View File

@ -3,7 +3,8 @@ import os
class TccConan(ConanFile): class TccConan(ConanFile):
name = "tcc" name = "tcc"
version = "0.9.27" revision = "62c30a4a"
version = "0.9.27+%s" % revision if revision else "0.9.27"
license = "GNU Lesser General Public License" license = "GNU Lesser General Public License"
author = "Eyck Jentzsch <eyck@minres.com>" author = "Eyck Jentzsch <eyck@minres.com>"
url = "https://github.com/Minres/conan-recipes/tree/master/TCC" url = "https://github.com/Minres/conan-recipes/tree/master/TCC"
@ -11,13 +12,20 @@ class TccConan(ConanFile):
topics = ("compiler", "c") topics = ("compiler", "c")
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
default_options = {} default_options = {}
source_tar = "http://download.savannah.gnu.org/releases/tinycc/tcc-%s.tar.bz2" % version source_tar = "http://download.savannah.gnu.org/releases/tinycc/tcc-%s.tar.bz2" % version
git_repo = "git://repo.or.cz/tinycc.git"
#generators = "cmake" #generators = "cmake"
sub_folder = "tcc-%s" % version sub_folder = "tcc-%s" % version
exports_sources = "tcc-%s/*" % version exports_sources = "tcc-%s/*" % version
def source(self): def source(self):
if self.revsion:
git = tools.Git(folder=self.sub_folder)
if not os.path.exists(self.sub_folder):
git.clone(self.git_repo)
git.pull()
git.checkout(self.revision)
else:
self.output.info("Downloading %s" %self.source_tar) self.output.info("Downloading %s" %self.source_tar)
tools.download(self.source_tar, "tcc.tar.bz2") tools.download(self.source_tar, "tcc.tar.bz2")
tools.unzip("tcc.tar.bz2") tools.unzip("tcc.tar.bz2")