Add the recipe to build ninja

This commit is contained in:
Sameer Rahmani 2023-03-24 20:11:50 +00:00
parent 8c125a6b47
commit 2cbd170dc2
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
6 changed files with 27 additions and 14 deletions

11
builder
View File

@ -54,6 +54,13 @@ function _create() {
--profile:host="../../profiles/stage$1" \
. "${@:2}"
}
function _build() {
_push "packages/$1/"
_create "${@:2}"
_pop
}
function llvm-source() { ## Build the llvm source pkg
_push "packages/sources/llvm/"
_create "$@"
@ -72,6 +79,10 @@ function gcc() { ## Build the gcc package
_pop
}
function ninja() { ## Build the gcc package
_build ninja "$@"
}
function help() { ## Print out this help message
echo "Commands:"
grep -E '^function [a-zA-Z0-9_-]+\(\) \{ ## .*$$' "$0" | \

View File

@ -1 +0,0 @@
lxsameer@majin.15395:1678886450

View File

@ -17,7 +17,6 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
from conan.tools.files import get
from conan.tools.env import VirtualBuildEnv
import os

View File

@ -17,38 +17,46 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
from conan.tools.files import get
from conan.tools.env import VirtualBuildEnv
import os
class Cmake(ConanFile):
name = "cmake"
version = "3.26.0"
class Ninja(ConanFile):
name = "ninja"
version = "1.11.1"
settings = "os", "arch", "build_type", "compiler"
def requirements(self):
if self.settings.compiler == "gcc":
self.requires(f"gcc/latest@{self.user}/{self.channel}")
self.tool_requires(f"gcc/latest@{self.user}/{self.channel}")
self.tool_requires(f"cmake/3.26.0@{self.user}/{self.channel}")
def source(self):
get(
self,
f"https://github.com/Kitware/CMake/archive/v{self.version}.tar.gz",
f"https://github.com/ninja-build/ninja/archive/v{self.version}.tar.gz",
)
def configure(self):
self.settings.rm_safe("compiler.cppstd")
def generate(self):
tc = CMakeToolchain(self)
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def package_id(self):
# No need to delete those settings here, they were already deleted
pass
def build(self):
cmake = CMake(self)
cmake.configure(
{"CMAKE_USE_OPENSSL": "OFF", "BUILD_TESTING": "OFF"},
build_script_folder=f"CMake-{self.version}",
{},
build_script_folder=f"Ninja-{self.version}",
)
cmake.build()
cmake.install()

View File

@ -1,3 +0,0 @@
[conf]
core.download:parallel=10
tools.build:jobs=2

View File

@ -1,4 +1,3 @@
include(conf)
{% set gcc_triple = "x86_64-linux-musl" %}
[settings]