Skip to content

Commit

Permalink
(conan-io#5600) sassc: resolve build requires conflicts
Browse files Browse the repository at this point in the history
* no os.rename

* resolve build requirements conflicts

* call autoreconf in build() only
  • Loading branch information
SpaceIm authored and madebr committed Jun 21, 2021
1 parent 0027be3 commit c635047
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions recipes/sassc/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from conans.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.33.0"


class SasscConan(ConanFile):
name = "sassc"
Expand All @@ -12,10 +14,6 @@ class SasscConan(ConanFile):
topics = ("Sass", "sassc", "compiler")
settings = "os", "compiler", "build_type", "arch"

build_requires = "autoconf/2.69", "libtool/2.4.6"

requires = "libsass/3.6.4"

_autotools = None

@property
Expand All @@ -29,22 +27,27 @@ def config_options(self):
def configure(self):
if self.settings.os not in ["Linux", "FreeBSD", "Macos"]:
raise ConanInvalidConfiguration("sassc supports only Linux, FreeBSD and Macos at this time, contributions are welcomed")


def requirements(self):
self.requires("libsass/3.6.4")

def build_requirements(self):
self.build_requires("libtool/2.4.6")

def source(self):
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = self.name + "-" + self.version
tools.rename(extracted_dir, self._source_subfolder)
tools.get(**self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)

def _configure_autotools(self):
if self._autotools:
return self._autotools
self.run("autoreconf -fiv", run_environment=True)
self._autotools = AutoToolsBuildEnvironment(self)
self._autotools.configure(args=["--disable-tests"])
return self._autotools

def build(self):
with tools.chdir(self._source_subfolder):
self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True)
tools.save(path="VERSION", content="%s" % self.version)
autotools = self._configure_autotools()
autotools.make()
Expand Down

0 comments on commit c635047

Please sign in to comment.