From a8ca9b6ea8de98cea7ce914f3b011bc5595ec6a3 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 8 Jan 2021 22:31:08 +0100 Subject: [PATCH 1/6] sassc 3.6.1 --- recipes/sassc/all/conandata.yml | 4 ++ recipes/sassc/all/conanfile.py | 52 +++++++++++++++++++++ recipes/sassc/all/test_package/conanfile.py | 9 ++++ recipes/sassc/config.yml | 3 ++ 4 files changed, 68 insertions(+) create mode 100644 recipes/sassc/all/conandata.yml create mode 100644 recipes/sassc/all/conanfile.py create mode 100644 recipes/sassc/all/test_package/conanfile.py create mode 100644 recipes/sassc/config.yml diff --git a/recipes/sassc/all/conandata.yml b/recipes/sassc/all/conandata.yml new file mode 100644 index 0000000000000..656792813274c --- /dev/null +++ b/recipes/sassc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.6.1": + sha256: 8cee391c49a102b4464f86fc40c4ceac3a2ada52a89c4c933d8348e3e4542a60 + url: https://github.com/sass/sassc/archive/3.6.1.tar.gz diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py new file mode 100644 index 0000000000000..5c6e227d05d74 --- /dev/null +++ b/recipes/sassc/all/conanfile.py @@ -0,0 +1,52 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools + + +class SasscConan(ConanFile): + name = "sassc" + license = "MIT" + homepage = "libsass.org" + 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 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) + args = [] + args.append("--disable-tests") + self._autotools.configure(args=args) + return self._autotools + + def build(self): + with tools.chdir(self._source_subfolder): + tools.save(path="VERSION", content="%s" % self.version) + 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") diff --git a/recipes/sassc/all/test_package/conanfile.py b/recipes/sassc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..70d62ab9bfc61 --- /dev/null +++ b/recipes/sassc/all/test_package/conanfile.py @@ -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) diff --git a/recipes/sassc/config.yml b/recipes/sassc/config.yml new file mode 100644 index 0000000000000..ffadf2d2ef31f --- /dev/null +++ b/recipes/sassc/config.yml @@ -0,0 +1,3 @@ +versions: + "3.6.1": + folder: all From 9fb95620e0d0325737e85059d571b08a70a66b18 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 13 Jan 2021 12:13:58 +0100 Subject: [PATCH 2/6] Update conanfile.py --- recipes/sassc/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py index 5c6e227d05d74..ef5b1e20f1e8d 100644 --- a/recipes/sassc/all/conanfile.py +++ b/recipes/sassc/all/conanfile.py @@ -1,4 +1,5 @@ from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration class SasscConan(ConanFile): @@ -24,6 +25,10 @@ def config_options(self): del self.settings.compiler.libcxx del self.settings.compiler.cppstd + def configure(self): + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration("sassc supports only Linux, FreeBSD and Macos") + def source(self): tools.get(**self.conan_data["sources"][self.version]) extracted_dir = self.name + "-" + self.version From 793e0dc2593cd3856469fc815d62f22d7b940d55 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 14 Jan 2021 07:02:27 +0100 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Chris Mc --- recipes/sassc/all/conanfile.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py index ef5b1e20f1e8d..1fd565155acf9 100644 --- a/recipes/sassc/all/conanfile.py +++ b/recipes/sassc/all/conanfile.py @@ -27,7 +27,7 @@ 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") + 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]) @@ -39,9 +39,7 @@ def _configure_autotools(self): return self._autotools self.run("autoreconf -fiv", run_environment=True) self._autotools = AutoToolsBuildEnvironment(self) - args = [] - args.append("--disable-tests") - self._autotools.configure(args=args) + self._autotools.configure(args=["--disable-tests"]) return self._autotools def build(self): From 04d993cfd6e56fe5ff946658dfb485b8fd968106 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 14 Jan 2021 12:42:28 +0100 Subject: [PATCH 4/6] Update recipes/sassc/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/sassc/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py index 1fd565155acf9..8b54a9ac277ad 100644 --- a/recipes/sassc/all/conanfile.py +++ b/recipes/sassc/all/conanfile.py @@ -53,3 +53,8 @@ def package(self): autotools = self._configure_autotools() autotools.install() self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + + 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) From 11938828e38823fd85c697634db706a102a021b6 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 14 Jan 2021 12:50:51 +0100 Subject: [PATCH 5/6] Update recipes/sassc/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/sassc/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py index 8b54a9ac277ad..f3dea447a8c3f 100644 --- a/recipes/sassc/all/conanfile.py +++ b/recipes/sassc/all/conanfile.py @@ -1,5 +1,6 @@ from conans import ConanFile, AutoToolsBuildEnvironment, tools from conans.errors import ConanInvalidConfiguration +import os class SasscConan(ConanFile): From b5e0e16d506ad894be498fc4f53d37f2a509093f Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 15 Jan 2021 19:30:04 +0100 Subject: [PATCH 6/6] Update conanfile.py --- recipes/sassc/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py index f3dea447a8c3f..7723b3853e727 100644 --- a/recipes/sassc/all/conanfile.py +++ b/recipes/sassc/all/conanfile.py @@ -6,7 +6,7 @@ class SasscConan(ConanFile): name = "sassc" license = "MIT" - homepage = "libsass.org" + homepage = "https://sass-lang.com/libsass" url = "https://github.com/conan-io/conan-center-index" description = "libsass command line driver" topics = ("Sass", "sassc", "compiler")