Skip to content

Commit f75da97

Browse files
Create conanfile.py
1 parent 5eb8510 commit f75da97

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

conanfile.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
from conan import ConanFile
2+
from conan.tools.meson import Meson, MesonToolchain
3+
from conan.tools.files import copy
4+
import os
5+
6+
class FossilJellyfishConan(ConanFile):
7+
name = "fossil_jellyfish"
8+
version = "0.1.4"
9+
license = "MPL-2.0"
10+
author = "Fossil Logic <[email protected]>"
11+
url = "https://github.com/fossillogic/fossil-jellyfish"
12+
description = "Fossil Jellyfish is a lightweight, portable Truthful Intelligence and AI library written in pure C with zero external dependencies."
13+
topics = ("c", "ti", "chat", "nlp", "cpp", "meson", "conan-recipe", "mesonbuild", "ninja-build")
14+
15+
settings = "os", "compiler", "build_type", "arch"
16+
options = {"shared": [True, False]}
17+
default_options = {"shared": False}
18+
19+
exports_sources = "code/**", "meson.build", "meson.options"
20+
generators = "PkgConfigDeps"
21+
22+
def layout(self):
23+
"""Define a basic build/source folder layout"""
24+
self.folders.source = "."
25+
self.folders.build = "builddir"
26+
27+
def generate(self):
28+
"""Generate Meson toolchain files"""
29+
tc = MesonToolchain(self)
30+
tc.generate()
31+
32+
def build(self):
33+
"""Configure and build the project using Meson"""
34+
meson = Meson(self)
35+
meson.configure()
36+
meson.build()
37+
38+
def source(self):
39+
self.run(f"git clone --branch v{self.version} --depth 1 {self.url}")
40+
41+
def package(self):
42+
"""Install headers and libraries into package folder"""
43+
meson = Meson(self)
44+
meson.install()
45+
46+
# Ensure headers are included even if not installed by Meson
47+
copy(self, "*.h",
48+
src="code/logic/fossil/ai",
49+
dst=os.path.join(self.package_folder, "include", "fossil", "ai"))
50+
51+
def package_info(self):
52+
"""Set information for consumers of the package"""
53+
self.cpp_info.libs = ["fossil_jellyfish"]
54+
self.cpp_info.includedirs = ["include"]
55+
56+
def source(self):
57+
self.run(f"git clone --branch v{self.version} {self.url}")

0 commit comments

Comments
 (0)