diff --git a/recipes/wip/dev/python/python3-cython/recipe.toml b/recipes/wip/dev/python/python3-cython/recipe.toml new file mode 100644 index 000000000..d4ddeb0e2 --- /dev/null +++ b/recipes/wip/dev/python/python3-cython/recipe.toml @@ -0,0 +1,16 @@ +[source] +git = "https://github.com/cython/cython" +rev = "3.2.4" +shallow_clone = true + +[build] +template = "python" +dev-dependencies = [ + "host:python312", + "host:python3-setuptools", +] + +[package] +dependencies = [ + "python312" +] diff --git a/recipes/wip/dev/python/python3-setuptools/recipe.toml b/recipes/wip/dev/python/python3-setuptools/recipe.toml new file mode 100644 index 000000000..42503df2a --- /dev/null +++ b/recipes/wip/dev/python/python3-setuptools/recipe.toml @@ -0,0 +1,16 @@ +[source] +git = "https://github.com/pypa/setuptools" +rev = "v82.0.1" +shallow_clone = true + +[build] +template = "python" +dev-dependencies = [ + "host:python312", +] + +[package] +dependencies = [ + "python312" +] + diff --git a/recipes/wip/dev/python/python3-yaml/recipe.toml b/recipes/wip/dev/python/python3-yaml/recipe.toml new file mode 100644 index 000000000..9f2ccdfec --- /dev/null +++ b/recipes/wip/dev/python/python3-yaml/recipe.toml @@ -0,0 +1,17 @@ +[source] +git = "https://github.com/yaml/pyyaml.git" +rev = "6.0.3" +shallow_clone = true + +[build] +template = "python" +dev-dependencies = [ + "host:python312", + "host:python3-setuptools", + "host:python3-cython", +] + +[package] +dependencies = [ + "python312" +] diff --git a/recipes/wip/net/aws-cli/recipe.toml b/recipes/wip/net/aws-cli/recipe.toml new file mode 100644 index 000000000..bc5356790 --- /dev/null +++ b/recipes/wip/net/aws-cli/recipe.toml @@ -0,0 +1,11 @@ +# TODO: workout pyproject.toml deps +[source] +git = "https://github.com/aws/aws-cli.git" +rev = "2.15.31" +shallow_clone = true + +[build] +template = "python" +dev-dependencies = [ + "host:python312" +] diff --git a/src/cook/cook_build.rs b/src/cook/cook_build.rs index 0957a238e..819484215 100644 --- a/src/cook/cook_build.rs +++ b/src/cook/cook_build.rs @@ -388,6 +388,7 @@ pub fn build( "DYNAMIC_INIT\n{}cookbook_meson", flags_fn("COOKBOOK_MESON_FLAGS", mesonflags), ), + BuildKind::Python {} => format!("DYNAMIC_INIT\ncookbook_python"), BuildKind::Custom { script } => script.clone(), BuildKind::Remote => unreachable!(), BuildKind::None => "".to_owned(), diff --git a/src/cook/script.rs b/src/cook/script.rs index 530e9b9ca..a4c302eba 100644 --- a/src/cook/script.rs +++ b/src/cook/script.rs @@ -348,6 +348,15 @@ function cookbook_meson { "${COOKBOOK_NINJA}" -j"${COOKBOOK_MAKE_JOBS}" DESTDIR="${COOKBOOK_STAGE}" "${COOKBOOK_NINJA}" install -j"${COOKBOOK_MAKE_JOBS}" } +COOKBOOK_PYTHON="${COOKBOOK_TOOLCHAIN}/bin/python3" +function cookbook_python { + ARCH="${TARGET%%-*}" + OS=$(echo "${TARGET}" | cut -d - -f3-4) + export PYTHONPYCACHEPREFIX="${COOKBOOK_BUILD}" _PYTHON_HOST_PLATFORM="$OS-$ARCH" + "${COOKBOOK_PYTHON}" -m pip install --prefix="${COOKBOOK_STAGE}/usr" "${COOKBOOK_SOURCE}" \ + --ignore-installed --no-index --no-build-isolation "$@" + rsync -av "${COOKBOOK_BUILD}/${COOKBOOK_STAGE}/usr/" "${COOKBOOK_STAGE}/usr" +} "#; pub(crate) static BUILD_POSTSCRIPT: &str = r#" diff --git a/src/recipe.rs b/src/recipe.rs index fd084c932..57ee205a5 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -103,6 +103,9 @@ pub enum BuildKind { #[serde(default)] mesonflags: Vec, }, + /// Will build and install using python pip + #[serde(rename = "python")] + Python, /// Will build and install using custom commands #[serde(rename = "custom")] Custom { script: String },