STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
recipe.h File Reference
#include "str.h"
#include "utils.h"
Include dependency graph for recipe.h:

Go to the source code of this file.

Macros

#define RECIPE_STYLE_UNKNOWN   0
 Unable to determine recipe repo type.
#define RECIPE_STYLE_CONDA_FORGE   1
 Recipe repo is from conda-forge.
#define RECIPE_STYLE_ASTROCONDA   2
 Recipe repo is from astroconda.
#define RECIPE_STYLE_GENERIC   3
 Recipe repo provides the required build configurations but doesn't match conda-forge or astroconda's signature.
#define RECIPE_BUILD_UNKNOWN   0
 Unable to determine required build system.
#define RECIPE_BUILD_CONDA_BUILD   1
 Build uses meta.yaml.
#define RECIPE_BUILD_RATTLER   2
 Build uses recipe.yaml.

Functions

int recipe_clone (char *recipe_dir, char *url, char *gitref, char **result)
int recipe_get_style (char *repopath)
int recipe_get_build_system (const char *repopath, int style)

Function Documentation

◆ recipe_clone()

int recipe_clone ( char * recipe_dir,
char * url,
char * gitref,
char ** result )

Download a Conda package recipe

char *recipe = NULL;
if (recipe_clone("base/dir", "https://github.com/example/repo", "branch", &recipe)) {
fprintf(stderr, "Failed to clone conda recipe\n");
exit(1);
} else {
chdir(recipe);
}
int recipe_clone(char *recipe_dir, char *url, char *gitref, char **result)
Definition recipe.c:3
Parameters
recipe_dirpath to store repository
urlremote address of git repository
gitrefbranch/tag/commit
resultabsolute path to downloaded repository
Returns
exit code from "git", -1 on error
Here is the call graph for this function:

◆ recipe_get_style()

int recipe_get_style ( char * repopath)

Determine the layout/type of repository path

if (recipe_clone("base/dir", "https://github.com/example/repo", "branch", &recipe)) {
fprintf(stderr, "Failed to clone conda recipe\n");
exit(1);
}
int recipe_type;
recipe_type = recipe_get_style(recipe);
switch (recipe_type) {
// do something specific for conda-forge directory structure
break;
// do something specific for astroconda directory structure
break;
// do something specific for a directory containing a meta.yaml config
break;
default:
// the structure is foreign or the path doesn't contain a conda recipe
break;
}
#define RECIPE_STYLE_CONDA_FORGE
Recipe repo is from conda-forge.
Definition recipe.h:11
int recipe_get_style(char *repopath)
Definition recipe.c:56
#define RECIPE_STYLE_ASTROCONDA
Recipe repo is from astroconda.
Definition recipe.h:13
#define RECIPE_STYLE_GENERIC
Recipe repo provides the required build configurations but doesn't match conda-forge or astroconda's ...
Definition recipe.h:15
#define RECIPE_STYLE_UNKNOWN
Unable to determine recipe repo type.
Definition recipe.h:9
Parameters
repopathpath to git repository containing conda recipe(s)
Returns
One of RECIPE_TYPE_UNKNOWN, RECIPE_TYPE_CONDA_FORGE, RECIPE_TYPE_ASTROCONDA, RECIPE_TYPE_GENERIC