Skip to content

Commit

Permalink
fixup! add scdoc documentation tool
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebedo committed Jan 3, 2022
1 parent 9a564aa commit 682aef9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
21 changes: 8 additions & 13 deletions recipes/scdoc/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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}")
7 changes: 4 additions & 3 deletions recipes/scdoc/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 682aef9

Please sign in to comment.