conanfile.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from conans import ConanFile, CMake, tools
  2. import os
  3. class NasmConan(ConanFile):
  4. name = "nasm"
  5. version = "2.14.02"
  6. license = "BSD-2-Clause"
  7. author = "Shawn Morford <DarkMorford@Gmail.com>"
  8. url = "https://code.darkmorford.net/conan-pkg/nasm"
  9. description = ("The Netwide Assembler, NASM, is an 80x86 and "
  10. "x86-64 assembler designed for portability and modularity.")
  11. homepage = "https://www.nasm.us/"
  12. topics = ("tools", "assembly")
  13. settings = "os", "compiler", "build_type", "arch"
  14. options = {"shared": [True, False]}
  15. default_options = {"shared": False}
  16. generators = "cmake"
  17. @property
  18. def subfolder(self):
  19. return os.path.join(self.source_folder, f"nasm-{self.version}")
  20. def source(self):
  21. tools.get(**self.conan_data["sources"][self.version])
  22. def configure(self):
  23. del self.settings.compiler.cppstd
  24. del self.settings.compiler.libcxx
  25. def build(self):
  26. cmake = CMake(self)
  27. cmake.configure(source_folder="hello")
  28. cmake.build()
  29. # Explicit way:
  30. # self.run('cmake %s/hello %s'
  31. # % (self.source_folder, cmake.command_line))
  32. # self.run("cmake --build . %s" % cmake.build_config)
  33. def package(self):
  34. self.copy("*.h", dst="include", src="hello")
  35. self.copy("*hello.lib", dst="lib", keep_path=False)
  36. self.copy("*.dll", dst="bin", keep_path=False)
  37. self.copy("*.so", dst="lib", keep_path=False)
  38. self.copy("*.dylib", dst="lib", keep_path=False)
  39. self.copy("*.a", dst="lib", keep_path=False)
  40. def package_info(self):
  41. self.cpp_info.libs = ["hello"]