From 682aef9917f53c62362d88bb116082370104abb4 Mon Sep 17 00:00:00 2001 From: Alexandre Acebedo Date: Mon, 3 Jan 2022 18:47:23 +0100 Subject: [PATCH] fixup! add scdoc documentation tool --- recipes/scdoc/all/conanfile.py | 21 ++++++++------------- recipes/scdoc/all/test_package/conanfile.py | 7 ++++--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/recipes/scdoc/all/conanfile.py b/recipes/scdoc/all/conanfile.py index c5a6c9b2bbb553..56d73c7be50ee3 100644 --- a/recipes/scdoc/all/conanfile.py +++ b/recipes/scdoc/all/conanfile.py @@ -2,26 +2,25 @@ from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.33.0" class ScdocInstallerConan(ConanFile): name = "scdoc" description = "scdoc is a simple man page generator for POSIX systems written in C99." - topics = ("scdoc", "documentation") + topics = ("manpage", "documentation", "posix") url = "https://github.com/conan-io/conan-center-index" homepage = "https://git.sr.ht/~sircmpwn/scdoc" - license = "Unknown" + license = "MIT" settings = "os", "arch", "compiler", "build_type" _autotools = None - no_copy_source = True @property def _source_subfolder(self): return "source_subfolder" def build_requirements(self): - self.build_requires("make/[>=4.3.0]") + self.build_requires("make/4.3") def configure(self): del self.settings.compiler.libcxx @@ -47,13 +46,12 @@ def _configure_autotools(self): def build(self): autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.source_folder, self._source_subfolder)): + with tools.chdir(self._source_subfolder): autotools.make() - autotools.make(target="check") def package(self): autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.source_folder, self._source_subfolder)): + with tools.chdir(self._source_subfolder): autotools.install(args=[f"PREFIX={self.package_folder}"]) self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) @@ -69,9 +67,6 @@ def package_info(self): self._chmod_plus_x(os.path.join(scdoc_root, "scdoc")) def validate(self): - if self.settings.os == "Macos": + if self.settings.os in ["Macos", "Windows"]: raise ConanInvalidConfiguration( - "Builds aren't supported on Macos") - if self.settings.os == "Windows": - raise ConanInvalidConfiguration( - "Builds aren't supported on Windows") + f"Builds aren't supported on {self.settings.os}") diff --git a/recipes/scdoc/all/test_package/conanfile.py b/recipes/scdoc/all/test_package/conanfile.py index aeb6c7baec326a..4864f9fac5f478 100644 --- a/recipes/scdoc/all/test_package/conanfile.py +++ b/recipes/scdoc/all/test_package/conanfile.py @@ -1,9 +1,10 @@ -from conans import ConanFile, Meson, tools +from conans import ConanFile, tools import os class TestPackageConan(ConanFile): def test(self): - self.run( - f"scdoc < {os.path.join(self.source_folder,'test_package.1.scd')}", run_environment=True) + if not tools.cross_building(self): + self.run( + f"scdoc < {os.path.join(self.source_folder,'test_package.1.scd')}", run_environment=True)