Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
82185f1a4e | |||
ad79d0c9a5 | |||
1875e6fff5 | |||
9a00657560 |
26
recipes/SpirVHeaders/recipe.py
Normal file
26
recipes/SpirVHeaders/recipe.py
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
import re
|
||||
from SCons.Script import *
|
||||
|
||||
|
||||
def _git_cook(env: Environment, repo: dict) -> dict:
|
||||
vulkan_headers = env.Cook('VulkanHeaders')
|
||||
checkout_root = repo['checkout_root']
|
||||
|
||||
return {
|
||||
'CPPPATH': [f'{checkout_root}/include']
|
||||
}
|
||||
|
||||
|
||||
env.GitRecipe(
|
||||
globals = globals(),
|
||||
repo_name = 'SpirVHeaders',
|
||||
repo_url = 'https://github.com/KhronosGroup/SPIRV-Headers.git',
|
||||
tag_pattern = re.compile(r'^vulkan-sdk-([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$'),
|
||||
tag_fn = lambda version: f'vulkan-sdk-{version[0]}.{version[1]}.{version[2]}.{version[3]}',
|
||||
cook_fn = _git_cook,
|
||||
dependencies = {
|
||||
'VulkanHeaders': {}
|
||||
}
|
||||
)
|
43
recipes/SpirVReflect/recipe.py
Normal file
43
recipes/SpirVReflect/recipe.py
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
import re
|
||||
from SCons.Script import *
|
||||
|
||||
|
||||
def _git_cook(env: Environment, repo: dict) -> dict:
|
||||
checkout_root = repo['checkout_root']
|
||||
|
||||
source_files = [f'{checkout_root}/spirv_reflect.cpp']
|
||||
|
||||
additional_cxx_flags = []
|
||||
additional_cppdefines = ['SPIRV_REFLECT_USE_SYSTEM_SPIRV_H']
|
||||
if env['COMPILER_FAMILY'] == 'gcc':
|
||||
additional_cxx_flags.append('-Wno-overflow')
|
||||
lib_spirv_reflect = env.StaticLibrary(
|
||||
CCFLAGS = env['CCFLAGS'] + additional_cxx_flags,
|
||||
CPPPATH = [repo['checkout_root']],
|
||||
CPPDEFINES = list(env['CPPDEFINES']) + additional_cppdefines,
|
||||
target = env['LIB_DIR'] + '/spirv_reflect',
|
||||
source = source_files,
|
||||
dependencies = {
|
||||
'SpirVHeaders': {}
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
'CPPPATH': [repo['checkout_root']],
|
||||
'LIBS': [lib_spirv_reflect]
|
||||
}
|
||||
|
||||
|
||||
env.GitRecipe(
|
||||
globals = globals(),
|
||||
repo_name = 'SpirVReflect',
|
||||
repo_url = 'https://github.com/KhronosGroup/SPIRV-Reflect.git',
|
||||
tag_pattern = re.compile(r'^vulkan-sdk-([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$'),
|
||||
tag_fn = lambda version: f'vulkan-sdk-{version[0]}.{version[1]}.{version[2]}.{version[3]}',
|
||||
cook_fn = _git_cook,
|
||||
dependencies = {
|
||||
'SpirVHeaders': {}
|
||||
}
|
||||
)
|
@ -40,6 +40,10 @@ def cook(env: Environment, version) -> dict:
|
||||
git_ref = f'refs/tags/v{version[0]}.{version[1]}.{version[2]}'
|
||||
repo = env.GitBranch(repo_name = _get_repo_name(env), remote_url = _get_repo_url(env), git_ref = git_ref)
|
||||
checkout_root = repo['checkout_root']
|
||||
include_dir = os.path.join(checkout_root, 'include')
|
||||
return {
|
||||
'CPPPATH': [os.path.join(checkout_root, 'include')]
|
||||
'CPPPATH': [include_dir],
|
||||
'CMAKE_VARS': {
|
||||
'Vulkan_INCLUDE_DIR': include_dir
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
from SCons.Script import *
|
||||
|
||||
|
||||
@ -8,12 +10,20 @@ def _git_cook(env: Environment, repo: dict) -> dict:
|
||||
checkout_root = repo['checkout_root']
|
||||
build_result = env.CMakeProject(checkout_root, generate_args = [
|
||||
f'-C{repo['checkout_root']}/cmake/caches/PredefinedParams.cmake',
|
||||
'-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON'
|
||||
'-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON', '-DHLSL_INCLUDE_TESTS=OFF', '-DLLVM_INCLUDE_TESTS=OFF',
|
||||
'-DSPIRV_BUILD_TESTS=OFF'
|
||||
])
|
||||
|
||||
link_flags = []
|
||||
if env['COMPILER_FAMILY'] in ('gcc', 'clang') and env['BUILD_TYPE'] != 'release':
|
||||
link_flags.append(f'-Wl,-rpath,{build_result["LIBPATH"][0]}')
|
||||
elif env['COMPILER_FAMILY'] == 'cl':
|
||||
# for some reason CMake doesn't copy the .lib file
|
||||
lib_src = os.path.join(build_result['build_dir'], 'lib/dxcompiler.lib')
|
||||
lib_dst = os.path.join(build_result['LIBPATH'][0], 'dxcompiler.lib')
|
||||
if not os.path.exists(lib_dst):
|
||||
shutil.copy(lib_src, lib_dst)
|
||||
|
||||
return {
|
||||
'CPPPATH': build_result['CPPPATH'],
|
||||
'LIBS': [env.FindLib('dxcompiler', type='shared', paths=build_result['LIBPATH'])],
|
||||
|
79
recipes/libmagic/recipe.py
Normal file
79
recipes/libmagic/recipe.py
Normal file
@ -0,0 +1,79 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
from SCons.Script import *
|
||||
|
||||
_DEPENDENCIES = {
|
||||
'zlib': {}
|
||||
}
|
||||
|
||||
def _git_cook(env: Environment, repo: dict) -> dict:
|
||||
checkout_root = repo['checkout_root']
|
||||
|
||||
magic_source_files = [
|
||||
os.path.join(checkout_root, 'src/buffer.c'),
|
||||
os.path.join(checkout_root, 'src/magic.c'),
|
||||
os.path.join(checkout_root, 'src/apprentice.c'),
|
||||
os.path.join(checkout_root, 'src/softmagic.c'),
|
||||
os.path.join(checkout_root, 'src/ascmagic.c'),
|
||||
os.path.join(checkout_root, 'src/encoding.c'),
|
||||
os.path.join(checkout_root, 'src/compress.c'),
|
||||
os.path.join(checkout_root, 'src/is_csv.c'),
|
||||
os.path.join(checkout_root, 'src/is_json.c'),
|
||||
os.path.join(checkout_root, 'src/is_simh.c'),
|
||||
os.path.join(checkout_root, 'src/is_tar.c'),
|
||||
os.path.join(checkout_root, 'src/readelf.c'),
|
||||
os.path.join(checkout_root, 'src/print.c'),
|
||||
os.path.join(checkout_root, 'src/fsmagic.c'),
|
||||
os.path.join(checkout_root, 'src/funcs.c'),
|
||||
os.path.join(checkout_root, 'src/apptype.c'),
|
||||
os.path.join(checkout_root, 'src/der.c'),
|
||||
os.path.join(checkout_root, 'src/cdf.c'),
|
||||
os.path.join(checkout_root, 'src/cdf_time.c'),
|
||||
os.path.join(checkout_root, 'src/readcdf.c'),
|
||||
os.path.join(checkout_root, 'src/fmtcheck.c')
|
||||
]
|
||||
|
||||
version_dict = {'X.YY': '5.46'}
|
||||
env.Substfile(os.path.join(checkout_root, 'src/magic.h.in'), SUBST_DICT=version_dict)
|
||||
|
||||
additional_ccflags = []
|
||||
if env['COMPILER_FAMILY'] == 'gcc':
|
||||
additional_ccflags.extend(['-Wno-unused-parameter', '-Wno-unused-const-variable'])
|
||||
|
||||
lib_magic = env.StaticLibrary(
|
||||
CPPDEFINES = list(env['CPPDEFINES']) + ['HAVE_BYTESWAP_H', 'HAVE_BZLIB_H', 'HAVE_ERR_H',
|
||||
'HAVE_FREELOCALE', 'HAVE_GETOPT_H', 'HAVE_INTTYPES_H', 'HAVE_LIBSECCOMP',
|
||||
'HAVE_LRZIP_H', 'HAVE_LZLIB_H', 'HAVE_LZMA_H', 'HAVE_MBRTOWC',
|
||||
'HAVE_MEMMEM', 'HAVE_MMAP', 'HAVE_NEWLOCALE',
|
||||
'HAVE_POSIX_SPAWNP', 'HAVE_SPAWN_H', 'HAVE_STDINT_H', 'HAVE_STRNDUP',
|
||||
'HAVE_STRTOF', 'HAVE_STRUCT_OPTION', 'HAVE_STRUCT_STAT_ST_RDEV',
|
||||
'HAVE_STRUCT_TM_TM_GMTOFF', 'HAVE_STRUCT_TM_TM_ZONE',
|
||||
'HAVE_SYS_IOCTL_H', 'HAVE_SYS_MMAN_H', 'HAVE_SYS_SYSMACROS_H',
|
||||
'HAVE_SYS_TIME_H', 'HAVE_SYS_UTIME_H', 'HAVE_SYS_WAIT_H',
|
||||
'HAVE_UNISTD_H', 'HAVE_USELOCALE', 'HAVE_UTIME', 'HAVE_UTIMES',
|
||||
'HAVE_UTIME_H', 'HAVE_WCHAR_H', 'HAVE_WCTYPE_H', 'HAVE_WCWIDTH',
|
||||
'HAVE_ZLIB_H', 'HAVE_ZSTD_H', 'VERSION=\\"5.46\\"'],
|
||||
|
||||
|
||||
CCFLAGS = list(env['CCFLAGS']) + additional_ccflags,
|
||||
target = env['LIB_DIR'] + '/magic',
|
||||
source = magic_source_files,
|
||||
dependencies = _DEPENDENCIES
|
||||
)
|
||||
|
||||
return {
|
||||
'CPPPATH': [os.path.join(checkout_root, 'src')],
|
||||
'LIBS': [lib_magic]
|
||||
}
|
||||
|
||||
|
||||
env.GitRecipe(
|
||||
globals = globals(),
|
||||
repo_name = 'libmagic',
|
||||
repo_url = 'https://github.com/file/file.git',
|
||||
tag_pattern = re.compile(r'^FILE([0-9]+)_([0-9]+)$'),
|
||||
tag_fn = lambda version: f'FILE{version[0]}_{version[1]}',
|
||||
cook_fn = _git_cook,
|
||||
dependencies = _DEPENDENCIES
|
||||
)
|
@ -8,13 +8,13 @@ _REPO_URL = 'https://git.mewin.de/mewin/mijin2.git'
|
||||
def versions(env: Environment, update: bool = False):
|
||||
return [(0, 0, 0)]
|
||||
|
||||
def dependencies(env: Environment, version) -> 'dict':
|
||||
repo = env.GitBranch(repo_name = _REPO_NAME, remote_url = _REPO_URL, git_ref = 'master')
|
||||
def dependencies(env: Environment, version, options: dict = {}) -> 'dict':
|
||||
repo = env.GitBranch(repo_name = _REPO_NAME, remote_url = _REPO_URL, git_ref = options.get('git_ref', 'master'))
|
||||
checkout_root = repo['checkout_root']
|
||||
with open(os.path.join(checkout_root, 'dependencies.json'), 'r') as f:
|
||||
return env.DepsFromJson(json.load(f))
|
||||
|
||||
def cook(env: Environment, version) -> dict:
|
||||
repo = env.GitBranch(repo_name = _REPO_NAME, remote_url = _REPO_URL, git_ref = 'master')
|
||||
def cook(env: Environment, version, options: dict = {}) -> dict:
|
||||
repo = env.GitBranch(repo_name = _REPO_NAME, remote_url = _REPO_URL, git_ref = options.get('git_ref', 'master'))
|
||||
checkout_root = repo['checkout_root']
|
||||
return env.Module(os.path.join(checkout_root, 'SModule'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user