-
Notifications
You must be signed in to change notification settings - Fork 2
/
conanfile.py
33 lines (26 loc) · 1.26 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from conans import ConanFile, CMake, tools
import os
class NinjaInstallerConan(ConanFile):
name = "ninja_installer"
version = "0.1"
license = "MIT"
url = "http://github.com/lasote/conan-ninja-installer"
settings = {"os": ["Windows", "Linux", "Macos"], "arch": ["x86", "x86_64"]}
options = {"version": ["1.8.2", "1.7.1", "1.6.0", "1.5.3", "1.5.1", "1.4.0"]} # https://github.com/ninja-build/ninja/releases
default_options = "version=1.8.2"
build_policy = "missing"
def build(self):
zip_name = {"Windows": "ninja-win.zip",
"Linux": "ninja-linux.zip",
"Macos": "ninja-mac.zip"}[str(self.settings.os)]
url = "https://github.com/ninja-build/ninja/releases/download/v%s/%s" % (self.options.version, zip_name)
tools.download(url, "ninja.zip", verify=False)
tools.unzip("ninja.zip")
def package(self):
if str(self.settings.os) in ["Linux", "Macos"]:
self.copy("ninja", dst="bin/")
self.run("chmod +x %s" % os.path.join(self.package_folder, "bin", "ninja"))
else:
self.copy("ninja.exe", dst="bin/")
def package_info(self):
self.env_info.path.append(os.path.join(self.package_folder, "bin"))