ronin.vala

class ronin.vala.ValaApi(command=None)

Bases: ronin.vala.ValaExecutor

Vala executor that generates “.vapi” files. These files are useful for incremental compilation, because they are equivalent to the real source files for the purposes of imports, but are much faster for valac to process.

The phase inputs are “.vala” (or “.gs”) source files. The phase outputs are “.vapi” files.

Parameters:command (str|FunctionType) – valac command; defaults to the context’s vala.valac_command
class ronin.vala.ValaBuild(command=None)

Bases: ronin.vala.ValaExecutor

Vala single-phase build executor. Behind the scenes the Vala source code is transpiled to C source code and fed into gcc.

The phase inputs are “.vala” (or “.gs”) source files. The single phase output is a binary.

Parameters:command (str|FunctionType) – valac command; defaults to the context’s vala.valac_command
class ronin.vala.ValaExecutor(command=None)

Bases: ronin.executors.ExecutorWithArguments

Base class for Vala executors.

Parameters:command (str|FunctionType) – valac command; defaults to the context’s vala.valac_command
add_cc_argument(value)
add_gir_path(*value)
add_package(value)
add_source_path(*value)
add_vapi_path(*value)
compile_only()
create_c_code()
create_c_header(*value)
create_deps(*value)
create_fast_vapi(*value)
disable_cc_warnings()
enable_cc_warnings()
enable_debug()
enable_deprecated()
enable_experimental()
enable_threads()
remove_cc_argument(value)
set_output_directory(*value)
target_glib(value)
class ronin.vala.ValaGccCompile(command=None, ccache=True, platform=None)

Bases: ronin.gcc.GccCompile

Identical to ronin.gcc.GccCompile, just with a default configuration most suitable for compiling C code generated by ValaTranspile.

Parameters:
  • command (str|FunctionType) – gcc (or g++, etc.) command; defaults to the context’s gcc.gcc_command
  • ccache (bool) – whether to use ccache; defaults to True
  • platform (str|FunctionType|:class:ronin.projects.Project) – target platform or project
class ronin.vala.ValaPackage(name=None, vapi_paths=None, c=True, c_compile_arguments=None, c_link_arguments=None)

Bases: ronin.extensions.Extension

A Vala package.

Internally may also have an extension usable by gcc executors, so it can be used with both Vala and gcc executors.

Parameters:
  • name (str|FunctionType) – package name
  • c (bool|:class:ronin.extensions.Extension) – set to True (default) to automatically include a ronin.pkg_config.Package of the same name (used by gcc-compatible phases), False to disable, or provide any arbitrary extension
  • c_compile_arguments ([str|FunctionType]) – arguments to add to gcc-compatible compile executors
  • c_link_arguments ([str|FunctionType]) – arguments to add to gcc-compatible link executors
apply_to_executor_gcc_compile(executor)
apply_to_executor_vala(executor)
apply_to_executor_vala_build(executor)
class ronin.vala.ValaTranspile(command=None, apis=None)

Bases: ronin.vala.ValaExecutor

Vala executor that transpiles Vala source code to C source code.

The phase inputs are “.vala” (or “.gs”) source files. The phase outputs are “.c” source files.

Due to the nature of the language, if the Vala source code import from other files, then they must be transpiled together, or a simplified “.vapi” version of these files can be used instead. For this reason, it’s useful to precede transpilation with ValaApi phases. Feed them into the apis arguments here.

Parameters:
  • command (str|FunctionType) – valac command; defaults to the context’s vala.valac_command
  • apis ([str|:class:ronin.phases.Phase]) – phases with ValaApi executors
ronin.vala.configure_vala(valac_command=None)

Configures the current context’s Vala support.

Parameters:valac_command (str|FunctionType) – valac command; defaults to “valac”