Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sassc 3.6.1 #4182

Merged
merged 6 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipes/sassc/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"3.6.1":
sha256: 8cee391c49a102b4464f86fc40c4ceac3a2ada52a89c4c933d8348e3e4542a60
url: https://github.com/sass/sassc/archive/3.6.1.tar.gz
61 changes: 61 additions & 0 deletions recipes/sassc/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from conans import ConanFile, AutoToolsBuildEnvironment, tools
from conans.errors import ConanInvalidConfiguration
ericLemanissier marked this conversation as resolved.
Show resolved Hide resolved
import os


class SasscConan(ConanFile):
name = "sassc"
license = "MIT"
homepage = "https://sass-lang.com/libsass"
url = "https://github.com/conan-io/conan-center-index"
description = "libsass command line driver"
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
def _source_subfolder(self):
return "source_subfolder"

def config_options(self):
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd

def configure(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def configure(self):
def validate(self):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #4261 I think we should wait before using validate

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 source(self):
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = self.name + "-" + self.version
tools.rename(extracted_dir, self._source_subfolder)

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):
tools.save(path="VERSION", content="%s" % self.version)
ericLemanissier marked this conversation as resolved.
Show resolved Hide resolved
autotools = self._configure_autotools()
autotools.make()

def package(self):
with tools.chdir(self._source_subfolder):
autotools = self._configure_autotools()
autotools.install()
self.copy("LICENSE", src=self._source_subfolder, dst="licenses")
ericLemanissier marked this conversation as resolved.
Show resolved Hide resolved

def package_info(self):
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)
9 changes: 9 additions & 0 deletions recipes/sassc/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from conans import ConanFile, tools


class LibsassTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"

def test(self):
if not tools.cross_building(self):
self.run("sassc --version", run_environment=True)
3 changes: 3 additions & 0 deletions recipes/sassc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"3.6.1":
folder: all