Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json-c: add new version 0.18 #25332

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/json-c/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.18":
url: "https://github.com/json-c/json-c/archive/json-c-0.18-20240915.tar.gz"
sha256: "3112c1f25d39eca661fe3fc663431e130cc6e2f900c081738317fba49d29e298"
"0.17":
url: "https://github.com/json-c/json-c/archive/json-c-0.17-20230812.tar.gz"
sha256: "024d302a3aadcbf9f78735320a6d5aedf8b77876c8ac8bbb95081ca55054c7eb"
Expand Down
18 changes: 11 additions & 7 deletions recipes/json-c/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import collect_libs, copy, get, rmdir
from conan.tools.files import copy, get, rmdir
from conan.tools.scm import Version
import os

Expand All @@ -9,13 +9,13 @@

class JSONCConan(ConanFile):
name = "json-c"
package_type = "library"
description = "JSON-C - A JSON implementation in C"
topics = ("json", "encoding", "decoding", "manipulation")
description = "A JSON implementation in C"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/json-c/json-c"
license = "MIT"
topics = ("json", "encoding", "decoding", "manipulation")

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand Down Expand Up @@ -64,8 +64,12 @@ def package(self):
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))

def package_info(self):
self.cpp_info.libs = ["json-c"]

self.cpp_info.set_property("cmake_file_name", "json-c")
self.cpp_info.set_property("cmake_target_name", "json-c::json-c")
self.cpp_info.set_property("pkg_config_name", "json-c")
self.cpp_info.libs = collect_libs(self)
self.cpp_info.includedirs = ["include", "include/json-c"]
self.cpp_info.includedirs = ["include", os.path.join("include", "json-c")]

if Version(self.version) >= "0.17" and self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.extend(["m",])
2 changes: 2 additions & 0 deletions recipes/json-c/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.18":
folder: all
"0.17":
folder: all
"0.16":
Expand Down
Loading