|
@@ -0,0 +1,50 @@
|
|
|
|
+from conans import ConanFile, CMake, tools
|
|
|
|
+import os
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class NasmConan(ConanFile):
|
|
|
|
+ name = "nasm"
|
|
|
|
+ version = "2.14.02"
|
|
|
|
+ license = "BSD-2-Clause"
|
|
|
|
+ author = "Shawn Morford <DarkMorford@Gmail.com>"
|
|
|
|
+ url = "https://code.darkmorford.net/conan-pkg/nasm"
|
|
|
|
+ description = ("The Netwide Assembler, NASM, is an 80x86 and "
|
|
|
|
+ "x86-64 assembler designed for portability and modularity.")
|
|
|
|
+ homepage = "https://www.nasm.us/"
|
|
|
|
+ topics = ("tools", "assembly")
|
|
|
|
+ settings = "os", "compiler", "build_type", "arch"
|
|
|
|
+ options = {"shared": [True, False]}
|
|
|
|
+ default_options = {"shared": False}
|
|
|
|
+ generators = "cmake"
|
|
|
|
+
|
|
|
|
+ @property
|
|
|
|
+ def subfolder(self):
|
|
|
|
+ return os.path.join(self.source_folder, f"nasm-{self.version}")
|
|
|
|
+
|
|
|
|
+ def source(self):
|
|
|
|
+ tools.get(**self.conan_data["sources"][self.version])
|
|
|
|
+
|
|
|
|
+ def configure(self):
|
|
|
|
+ del self.settings.compiler.cppstd
|
|
|
|
+ del self.settings.compiler.libcxx
|
|
|
|
+
|
|
|
|
+ def build(self):
|
|
|
|
+ cmake = CMake(self)
|
|
|
|
+ cmake.configure(source_folder="hello")
|
|
|
|
+ cmake.build()
|
|
|
|
+
|
|
|
|
+ # Explicit way:
|
|
|
|
+ # self.run('cmake %s/hello %s'
|
|
|
|
+ # % (self.source_folder, cmake.command_line))
|
|
|
|
+ # self.run("cmake --build . %s" % cmake.build_config)
|
|
|
|
+
|
|
|
|
+ def package(self):
|
|
|
|
+ self.copy("*.h", dst="include", src="hello")
|
|
|
|
+ self.copy("*hello.lib", dst="lib", keep_path=False)
|
|
|
|
+ self.copy("*.dll", dst="bin", keep_path=False)
|
|
|
|
+ self.copy("*.so", dst="lib", keep_path=False)
|
|
|
|
+ self.copy("*.dylib", dst="lib", keep_path=False)
|
|
|
|
+ self.copy("*.a", dst="lib", keep_path=False)
|
|
|
|
+
|
|
|
|
+ def package_info(self):
|
|
|
|
+ self.cpp_info.libs = ["hello"]
|