BinaryBuilderProducts.AbstractProduct
— TypeAn AbstractProduct
is an expected result after building of a package.
Examples of Product
s include LibraryProduct
, FrameworkProduct
, ExecutableProduct
and FileProduct
. All AbstractProduct
types must define the following minimum set of functionality:
locate(product::AbstractProduct, prefix::String; env::Dict)
Locate a product relative to the givenprefix
, returning its location as a string. Templating of environment variables is performed with the givenenv
dictionary. Returnsnothing
if location fails.variable_name(::AbstractProduct)
: Returns the given variable name for a product as aSymbol
.
BinaryBuilderProducts.ExecutableProduct
— TypeExecutableProduct(names::Vector{String}, varname::Symbol; dir_path = nothing)
On all platforms, an ExecutableProduct
checks for existence of the file. On Windows platforms, it will check that the file ends with ".exe", (adding it on automatically to the search paths, if it is not already present).
BinaryBuilderProducts.FileProduct
— TypeFileProduct(paths::Vector{String}, varname::Symbol)
Declares a FileProduct
that points to a file located relative to the root of a Prefix
, must simply exist to be satisfied.
BinaryBuilderProducts.LibraryProduct
— TypeLibraryProduct(paths::Vector{String}, varname::Symbol;
deps=LibraryProduct[],
dlopen_flags=Symbol[])
Declares a LibraryProduct
that points to a library located within the prefix. paths
contain valid paths for this library, varname
is the name of the variable in the JLL package that can be used to call into the library. The flags to pass to dlopen
can be specified as a vector of Symbols
with the dlopen_flags
keyword argument.
Each element of path
takes the form [dirname/]basename[.versioned-ext]
where dirname
and versioned-ext
are optional and can be omitted. Accordingly, the following three paths will all find the same library:
lib/libnettle.so.6
lib/libnettle
libnettle.so.6
libnettle
On non-Windows targets, omitting dirname
will automatically prepend lib
, while on Windows targets bin
will be prepended. Omitting the versioned extension will allow any version of the library to be used (usually not a problem as there's typically only one version of a library at a time).
BinaryBuilderProducts.locate
— Methodlocate(ep::ExecutableProduct, prefix::String;
verbose::Bool = false)
If the given executable file exists and is executable, return its path.
On all platforms, an ExecutableProduct
checks for existence of the file. On non-Windows platforms, it will check for the executable bit being set. On Windows platforms, it will check that the file ends with ".exe", (adding it on automatically, if it is not already present).
BinaryBuilderProducts.locate
— Methodlocate(fp::FileProduct, prefix::String; env, verbose = false)
If the file product exists at any of its search paths, return that path.
BinaryBuilderProducts.locate
— Methodlocate(lp::LibraryProduct, prefix::Prefix;
env::Dict{String,String},
verbose::Bool = false)
If the given library exists (under any reasonable name) and is dlopen()
able, (assuming it was built for the current platform) return its location. Note that the dlopen()
test is only run if the current platform matches the given platform
keyword argument, as cross-compiled libraries cannot be dlopen()
ed on foreign platforms.
BinaryBuilderProducts.path_prefix_transformation
— Methodpath_prefix_transformation(::Type{<:AbstractProduct}, path, prefix, env)
Performs ths transformation to alter a path
to be relative to prefix
. Takes into account templating via env
, as well as applying add_default_product_dir()
to products that can have their leading directory dropped (e.g. ExecutableProduct
and LibraryProduct
).
BinaryBuilderProducts.valid_dl_path
— Methodvalid_dl_path(path, platform)
Returns true
if path
represents a valid dynamic library path (e.g. libfoo.so.X
on Linux/FreeBSD, libfoo-X.dll
on Windows, libfoo.X.dylib
on macOS) as specified by Base.BinaryPlatforms.parse_dl_name_version()
. Returns false
otherwise