Merge pull request #2 from cgerum/master

TCC: allow builds from git
This commit is contained in:
Eyck Jentzsch 2022-05-16 12:23:41 +02:00 committed by GitHub
commit 0d9296adc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 6 deletions

View File

@ -1,9 +1,11 @@
from conans import ConanFile, AutoToolsBuildEnvironment, tools from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os import os
import shutil
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,17 +13,25 @@ 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):
self.output.info("Downloading %s" %self.source_tar) if self.revision:
tools.download(self.source_tar, "tcc.tar.bz2") self.output.info("Cloning from %s" % self.git_repo)
tools.unzip("tcc.tar.bz2") git = tools.Git(folder=self.sub_folder)
os.remove("tcc.tar.bz2") if os.path.exists(self.sub_folder):
shutil.rmtree(self.sub_folder)
git.clone(self.git_repo)
git.checkout(self.revision)
else:
self.output.info("Downloading %s" % self.source_tar)
tools.download(self.source_tar, "tcc.tar.bz2")
tools.unzip("tcc.tar.bz2")
os.remove("tcc.tar.bz2")
def configure(self): def configure(self):
del self.settings.compiler.libcxx del self.settings.compiler.libcxx