conanfile.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. from conans import ConanFile, CMake, tools
  2. import os
  3. class LibOggConan(ConanFile):
  4. name = "libogg"
  5. version = "1.3.4"
  6. license = "BSD-2-Clause"
  7. author = "Shawn Morford <DarkMorford@Gmail.com>"
  8. url = "https://code.darkmorford.net/conan-pkg/libogg"
  9. description = ("Ogg is a multimedia container format, and the native file and stream format for the "
  10. "Xiph.org multimedia codecs. As with all Xiph.org technology it is an open format "
  11. "free for anyone to use.")
  12. homepage = "https://www.xiph.org/ogg/"
  13. topics = ("xiph.org", "media", "container")
  14. exports_sources = ["CMakeLists.txt"]
  15. settings = "os", "compiler", "build_type", "arch"
  16. options = {"shared": [True, False]}
  17. default_options = {"shared": False}
  18. generators = "cmake"
  19. @property
  20. def subfolder(self):
  21. return os.path.join(self.source_folder, f"libogg-{self.version}")
  22. def source(self):
  23. tools.get(**self.conan_data["sources"][self.version])
  24. def configure(self):
  25. del self.settings.compiler.cppstd
  26. del self.settings.compiler.libcxx
  27. def _configure_cmake(self):
  28. cmake = CMake(self)
  29. cmake.definitions["CONAN_SOURCE_LOCATION"] = self.subfolder
  30. cmake.definitions["INSTALL_CMAKE_PACKAGE_MODULE"] = False
  31. cmake.definitions["INSTALL_DOCS"] = False
  32. cmake.definitions["INSTALL_PKG_CONFIG_MODULE"] = False
  33. cmake.configure()
  34. return cmake
  35. def build(self):
  36. cmake = self._configure_cmake()
  37. cmake.build()
  38. def package(self):
  39. self.copy("COPYING", src=self.subfolder, dst="licenses",
  40. ignore_case=True, keep_path=False)
  41. cmake = self._configure_cmake()
  42. cmake.install()
  43. def package_info(self):
  44. self.cpp_info.libs = ["hello"]