conanfile.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. settings = "os", "compiler", "build_type", "arch"
  15. options = {"shared": [True, False]}
  16. default_options = {"shared": False}
  17. generators = "cmake"
  18. @property
  19. def subfolder(self):
  20. return os.path.join(self.source_folder, f"libogg-{self.version}")
  21. def source(self):
  22. tools.get(**self.conan_data["sources"][self.version])
  23. def configure(self):
  24. del self.settings.compiler.cppstd
  25. del self.settings.compiler.libcxx
  26. def build(self):
  27. cmake = CMake(self)
  28. cmake.configure(source_folder="hello")
  29. cmake.build()
  30. # Explicit way:
  31. # self.run('cmake %s/hello %s'
  32. # % (self.source_folder, cmake.command_line))
  33. # self.run("cmake --build . %s" % cmake.build_config)
  34. def package(self):
  35. self.copy("*.h", dst="include", src="hello")
  36. self.copy("*hello.lib", dst="lib", keep_path=False)
  37. self.copy("*.dll", dst="bin", keep_path=False)
  38. self.copy("*.so", dst="lib", keep_path=False)
  39. self.copy("*.dylib", dst="lib", keep_path=False)
  40. self.copy("*.a", dst="lib", keep_path=False)
  41. def package_info(self):
  42. self.cpp_info.libs = ["hello"]