This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* multi-header installation is now the default * Install inside include/nlohmann * Add sha256 verification
- Loading branch information
1 parent
82800a4
commit 983f85c
Showing
2 changed files
with
11 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
from conans import ConanFile, tools | ||
from conans.tools import download | ||
import os | ||
|
||
|
||
class JsonForModernCppConan(ConanFile): | ||
name = "jsonformoderncpp" | ||
version = "3.1.0" | ||
homepage = "https://github.com/nlohmann/json" | ||
description = "JSON for Modern C++ parser and generator from https://github.com/nlohmann/json" | ||
license = "MIT" | ||
url = "https://github.com/vthiery/conan-jsonformoderncpp" | ||
repo_url = "https://github.com/nlohmann/json" | ||
author = "Vincent Thiery (vjmthiery@gmail.com)" | ||
|
||
def source(self): | ||
download("https://github.com/nlohmann/json/releases/download/v%s/json.hpp" % self.version, "json.hpp") | ||
tools.download("%s/blob/v%s/LICENSE.MIT" % (self.repo_url, self.version), "LICENSE.MIT") | ||
|
||
def build(self): | ||
# as there is no LICENSE file, lets extract and generate it. | ||
# It is useful for package consumers, so they can collect all license from all dependencies | ||
tmp = tools.load("json.hpp") | ||
license_contents = tmp[2:tmp.find("*/", 1)] | ||
tools.save("LICENSE", license_contents) | ||
expected_hash = "2b7234fca394d1e27b7e017117ed80b7518fafbb4f4c13a7c069624f6f924673" | ||
tools.get("%s/releases/download/v%s/include.zip" % (self.repo_url, self.version), sha256=expected_hash) | ||
|
||
def package(self): | ||
self.copy("*.hpp", dst="include") | ||
self.copy("LICENSE") | ||
self.copy("*.hpp") | ||
self.copy("LICENSE.MIT") | ||
|
||
def package_info(self): | ||
self.cpp_info.libdirs = [] | ||
self.cpp_info.bindirs = [] |
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