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

libsass: add mingw support and pure C consumer + del fPIC if shared + early checks in configure() + explicit pkg_config name #4240

Merged
merged 8 commits into from
Jan 14, 2021
13 changes: 10 additions & 3 deletions recipes/libsass/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.29.1"


class LibsassConan(ConanFile):
name = "libsass"
Expand All @@ -14,18 +16,22 @@ class LibsassConan(ConanFile):
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}

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

_autotools = None

@property
def _source_subfolder(self):
return "source_subfolder"

def validate(self):
def configure(self):
if self.options.shared:
del self.options.fPIC
if self.settings.os not in ["Linux", "FreeBSD", "Macos"]:
raise ConanInvalidConfiguration("libsass supports only Linux, FreeBSD and Macos")

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

def source(self):
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = self.name + "-" + self.version
Expand Down Expand Up @@ -58,6 +64,7 @@ def package(self):
tools.remove_files_by_mask(self.package_folder, "*.la")

def package_info(self):
self.cpp_info.names["pkg_config"] = "libsass"
self.cpp_info.libs = ["sass"]
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs = ["dl", "m"]