diff --git a/recipes/boost/recipe.py b/recipes/boost/recipe.py index 002b727..73bc190 100644 --- a/recipes/boost/recipe.py +++ b/recipes/boost/recipe.py @@ -61,7 +61,10 @@ def cook(env: Environment, version) -> dict: libs.append(env.FindLib(f'libboost_{lib}-*', paths=build_result['LIBPATH'], use_glob=True)) else: raise Exception('Boost not supported on this platform.') + cpppath = { + 'nt': [f'{build_result['CPPPATH'][0]}/boost-{version[0]}_{version[1]}'] + }.get(os.name, build_result['CPPPATH']) return { - 'CPPPATH': build_result['CPPPATH'], + 'CPPPATH': cpppath, 'LIBS': libs } diff --git a/recipes/curl/recipe.py b/recipes/curl/recipe.py index 1cf663e..d8f38ec 100644 --- a/recipes/curl/recipe.py +++ b/recipes/curl/recipe.py @@ -8,7 +8,9 @@ def _build_lib_name(env: Environment) -> str: 'debug': 'curl-d' }.get(env['BUILD_TYPE'], 'curl') elif os.name == 'nt': - raise Exception('TODO') + return { + 'debug': 'libcurl-d' + }.get(env['BUILD_TYPE'], 'libcurl') else: raise Exception('curl is not supported yet on this OS') @@ -21,9 +23,23 @@ def _git_cook(env: Environment, repo: dict) -> dict: return { 'CPPPATH': build_result['CPPPATH'], 'LIBS': [env.FindLib(lib_name, paths=build_result['LIBPATH'])], + 'CPPDEFINES': ['CURL_STATICLIB=1'] } +_DEPENDENCIES = { + 'posix': { + 'openssl': {}, + 'zlib': {}, + 'psl': {} + }, + 'nt': { + 'wincrypt': {}, + 'winldap': {}, + 'winsock2': {} + } +} + env.GitRecipe( globals = globals(), repo_name = 'curl', @@ -31,9 +47,5 @@ env.GitRecipe( tag_pattern = re.compile(r'^curl-([0-9]+)_([0-9]+)_([0-9]+)$'), tag_fn = lambda version: f'curl-{version[0]}_{version[1]}_{version[2]}', cook_fn = _git_cook, - dependencies = { - 'openssl': {}, - 'zlib': {}, - 'psl': {} - } + dependencies = _DEPENDENCIES.get(os.name, {}) ) diff --git a/recipes/wincrypt/recipe.py b/recipes/wincrypt/recipe.py new file mode 100644 index 0000000..9937643 --- /dev/null +++ b/recipes/wincrypt/recipe.py @@ -0,0 +1,23 @@ + + +import os +from SCons.Script import * + + +def available(env: Environment): + if os.name != 'nt': + return 'Winscript is only available on Windows.' + +def versions(env: Environment, update: bool = False): + if os.name == 'nt': + return [(0, 0, 0)] + else: + return [] + +def dependencies(env: Environment, version) -> 'dict': + return {} + +def cook(env: Environment, version) -> dict: + return { + 'LIBS': ['Advapi32'] + } diff --git a/recipes/winldap/recipe.py b/recipes/winldap/recipe.py new file mode 100644 index 0000000..a6565b7 --- /dev/null +++ b/recipes/winldap/recipe.py @@ -0,0 +1,23 @@ + + +import os +from SCons.Script import * + + +def available(env: Environment): + if os.name != 'nt': + return 'Winldap is only available on Windows.' + +def versions(env: Environment, update: bool = False): + if os.name == 'nt': + return [(0, 0, 0)] + else: + return [] + +def dependencies(env: Environment, version) -> 'dict': + return {} + +def cook(env: Environment, version) -> dict: + return { + 'LIBS': ['Wldap32'] + }