From 5debc6d33498d9895e880c937dbf72e7652c8db5 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Fri, 7 Mar 2025 10:48:56 +0100 Subject: [PATCH] Added recipe for icon font cpp headers. --- recipes/icon_font_cpp_headers/recipe.py | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 recipes/icon_font_cpp_headers/recipe.py diff --git a/recipes/icon_font_cpp_headers/recipe.py b/recipes/icon_font_cpp_headers/recipe.py new file mode 100644 index 0000000..b4565a3 --- /dev/null +++ b/recipes/icon_font_cpp_headers/recipe.py @@ -0,0 +1,26 @@ + +import glob +import os +import shutil +from SCons.Script import * + +_REPO_NAME = 'icon_font_cpp_headers' +_REPO_URL = 'https://github.com/juliettef/IconFontCppHeaders.git' + +def versions(env: Environment, update: bool = False): + return [(0, 0, 0)] + +def dependencies(env: Environment, version) -> 'dict': + return {} + +def cook(env: Environment, version) -> dict: + repo = env.GitBranch(repo_name = _REPO_NAME, remote_url = _REPO_URL, git_ref = 'main') + checkout_root = repo['checkout_root'] + include_dir = os.path.join(checkout_root, 'include') + headers_dir = os.path.join(include_dir, 'ifch') + os.makedirs(headers_dir, exist_ok=True) + for header_file in glob.glob(os.path.join(checkout_root, '*.h')): + shutil.copy(header_file, headers_dir) + return { + 'CPPPATH': [include_dir] + }