-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* nasm - upgrade to conan v2, based on prior work done by @czoido * nasm - fix for linter * nasm - fixup cflags * nasm - guess what to do with tools.get_env() * nasm - don't require replace to be successful * nasm - try removing autotools.autoreconf() as the CI wasn't building * nasm - reenable autoreconf() * Update recipes/nasm/all/conanfile.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update recipes/nasm/all/conanfile.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update recipes/nasm/all/conanfile.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * nasm - remove share dir * nasm - fix test_v1_package * Fixes from uilianries review * Fixes from @prince-chrismc review * Moved the (conan < 2) check to a diff spot * Replace shutil.copy() with shutil.copy2() * Apply suggestions from code review Co-authored-by: Chris Mc <prince.chrismc@gmail.com> Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
- Loading branch information
1 parent
bd4cd7b
commit 720a0a9
Showing
5 changed files
with
114 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
import os | ||
from conans import ConanFile, tools | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "VirtualBuildEnv" | ||
test_type = "explicit" | ||
|
||
def build_requirements(self): | ||
self.tool_requires(self.tested_reference_str) | ||
|
||
def test(self): | ||
if not tools.cross_building(self, skip_x64_x86=True): | ||
self.run("nasm --version", run_environment=True) | ||
if can_run(self): | ||
self.run("nasm --version", env="conanbuild") | ||
asm_file = os.path.join(self.source_folder, "hello_linux.asm") | ||
out_file = os.path.join(self.build_folder, "hello_linux.o") | ||
bin_file = os.path.join(self.build_folder, "hello_linux") | ||
self.run("nasm -felf64 {} -o {}".format(asm_file, out_file), run_environment=True) | ||
self.run(f"nasm -felf64 {asm_file} -o {out_file}", env="conanbuild") | ||
if self.settings.os == "Linux" and self.settings.arch == "x86_64": | ||
ld = tools.get_env("LD", "ld") | ||
self.run("{} hello_linux.o -o {}".format(ld, bin_file), run_environment=True) | ||
# TODO was tools.get_env, what should it be? | ||
ld = os.getenv("LD", "ld") | ||
self.run(f"{ld} hello_linux.o -o {bin_file}", env="conanbuild") | ||
self.run(bin_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from conans import ConanFile, tools | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
|
||
def test(self): | ||
if not tools.cross_building(self, skip_x64_x86=True): | ||
self.run("nasm --version", run_environment=True) | ||
asm_file = os.path.join(self.source_folder, "hello_linux.asm") | ||
out_file = os.path.join(self.build_folder, "hello_linux.o") | ||
bin_file = os.path.join(self.build_folder, "hello_linux") | ||
self.run(f"nasm -felf64 {asm_file} -o {out_file}", run_environment=True) | ||
if self.settings.os == "Linux" and self.settings.arch == "x86_64": | ||
ld = tools.get_env("LD", "ld") | ||
self.run(f"{ld} hello_linux.o -o {bin_file}", run_environment=True) | ||
self.run(bin_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; Print "Hello, Conan" | ||
|
||
global _start | ||
|
||
section .text | ||
_start: mov rax, 1 ; system call for write | ||
mov rdi, 1 ; file handle 1 is stdout | ||
mov rsi, message ; address of string to output | ||
mov rdx, 13 ; number of bytes | ||
syscall ; invoke operating system to do the write | ||
mov rax, 60 ; system call for exit | ||
xor rdi, rdi ; exit code 0 | ||
syscall ; invoke operating system to exit | ||
|
||
section .data | ||
message: db "Hello, Conan", 10 ; note the newline at the end |