-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
92 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"1.0.5": | ||
url: "https://codeberg.org/dnkl/tllist/archive/1.0.5.tar.gz" | ||
sha256: b0f32c9b2c2015c8d8dd068fd4e8b586aa91ca1670badc274ec962559ee0aadd |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import os | ||
|
||
from conans import ConanFile, Meson, tools | ||
from conans.errors import ConanInvalidConfiguration | ||
|
||
required_conan_version = ">=1.33.0" | ||
|
||
|
||
class TllistConan(ConanFile): | ||
name = "tllist" | ||
license = "MIT" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://codeberg.org/dnkl/tllist" | ||
description = "A C header file only implementation of a typed linked list." | ||
topics = ("list", "utils", "tllist") | ||
generators = ("pkg_config") | ||
settings = "os", "arch", "build_type" | ||
tool_requires = "pkgconf/[>=1.7.4]", "meson/[>=0.60.0]", "ninja/[>=1.10.0]" | ||
no_copy_source = True | ||
_meson = None | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
|
||
def validate(self): | ||
if self.settings.os != "Linux": | ||
raise ConanInvalidConfiguration("Only Linux supported") | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], | ||
destination=self._source_subfolder, strip_root=True) | ||
|
||
def _configure_meson(self): | ||
if self._meson: | ||
return self._meson | ||
self._meson = Meson(self) | ||
self._meson.configure(source_folder=self._source_subfolder) | ||
return self._meson | ||
|
||
def build(self): | ||
meson = self._configure_meson() | ||
meson.build() | ||
meson.test() | ||
|
||
def package(self): | ||
self.copy("LICENSE", src=self._source_subfolder, dst="licenses") | ||
meson = self._configure_meson() | ||
meson.install() | ||
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) | ||
tools.rmdir(os.path.join(self.package_folder, "share")) | ||
|
||
def package_id(self): | ||
self.info.header_only() |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conans import ConanFile, Meson, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
generators = "pkg_config" | ||
tool_requires = "pkgconf/[>=1.7.4]", "meson/[>=0.60.0]", "ninja/[>=1.10.0]" | ||
settings = "os", "compiler", "build_type", "arch" | ||
|
||
def build(self): | ||
meson = Meson(self) | ||
meson.configure() | ||
meson.build() | ||
|
||
def test(self): | ||
bin_path = os.path.join(".", "test_package") | ||
self.run(bin_path, run_environment=True) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
project('test_package', 'c') | ||
tllist = dependency('tllist') | ||
|
||
executable('test_package', 'test_package.c', dependencies : tllist) |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <stdlib.h> | ||
#include <tllist.h> | ||
|
||
int main(int argc, const char *const *argv) { | ||
tll(int) l = tll_init(); | ||
|
||
tll_push_back(l, 43); | ||
|
||
return EXIT_SUCCESS; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"1.0.5": | ||
folder: "all" |