conanfile.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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.configure()
  31. return cmake
  32. def build(self):
  33. cmake = self._configure_cmake()
  34. cmake.build()
  35. def package(self):
  36. self.copy("*.h", dst="include", src="hello")
  37. self.copy("*hello.lib", dst="lib", keep_path=False)
  38. self.copy("*.dll", dst="bin", keep_path=False)
  39. self.copy("*.so", dst="lib", keep_path=False)
  40. self.copy("*.dylib", dst="lib", keep_path=False)
  41. self.copy("*.a", dst="lib", keep_path=False)
  42. def package_info(self):
  43. self.cpp_info.libs = ["hello"]