mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-05 12:07:46 +08:00
Fix python-setuptools by adding legacy build option
This commit is contained in:
parent
a309abb16b
commit
a551de6eb8
@ -7,8 +7,8 @@ shallow_clone = true
|
||||
template = "python"
|
||||
dev-dependencies = [
|
||||
"host:python312",
|
||||
"host:python3-setuptools",
|
||||
"python312",
|
||||
"python3-setuptools",
|
||||
]
|
||||
|
||||
[package]
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
[source]
|
||||
git = "https://github.com/pypa/setuptools"
|
||||
rev = "v82.0.1"
|
||||
rev = "v83.0.0"
|
||||
shallow_clone = true
|
||||
|
||||
[build]
|
||||
template = "python"
|
||||
legacysetup = true
|
||||
dev-dependencies = [
|
||||
"host:python312",
|
||||
"python312",
|
||||
|
||||
@ -390,7 +390,14 @@ pub fn build(
|
||||
"DYNAMIC_INIT\n{}cookbook_meson",
|
||||
flags_fn("COOKBOOK_MESON_FLAGS", mesonflags),
|
||||
),
|
||||
BuildKind::Python {} => format!("DYNAMIC_INIT\ncookbook_python"),
|
||||
BuildKind::Python { legacysetup } => format!(
|
||||
"DYNAMIC_INIT\n{}cookbook_python",
|
||||
if *legacysetup {
|
||||
"COOKBOOK_PYTHON_LEGACY_SETUP=1\n"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
),
|
||||
BuildKind::Custom { script } => script.clone(),
|
||||
BuildKind::Remote => unreachable!(),
|
||||
BuildKind::None => "".to_owned(),
|
||||
|
||||
@ -361,7 +361,12 @@ function PYTHON_INIT {
|
||||
}
|
||||
function cookbook_python {
|
||||
PYTHON_INIT
|
||||
"${COOKBOOK_PYTHON}" -m pip install --prefix="${COOKBOOK_STAGE}/usr" "${COOKBOOK_SOURCE}" \
|
||||
# no way to do out-of-tree build: https://github.com/pypa/setuptools/issues/3237
|
||||
rsync -a "${COOKBOOK_SOURCE}/" ./source
|
||||
if [ -n "${COOKBOOK_PYTHON_LEGACY_SETUP}" ]; then
|
||||
python3 ./source/setup.py install
|
||||
fi
|
||||
"${COOKBOOK_PYTHON}" -m pip install --prefix="${COOKBOOK_STAGE}/usr" "./source" \
|
||||
--ignore-installed --no-index --no-build-isolation "$@"
|
||||
rsync -av "${COOKBOOK_BUILD}/${COOKBOOK_STAGE}/usr/" "${COOKBOOK_STAGE}/usr"
|
||||
}
|
||||
|
||||
@ -105,7 +105,14 @@ pub enum BuildKind {
|
||||
},
|
||||
/// Will build and install using python pip
|
||||
#[serde(rename = "python")]
|
||||
Python,
|
||||
Python {
|
||||
/// Some recipes need to run setup.py,
|
||||
/// other does not allow running setup.py.
|
||||
/// This defaults to not run setup.py, but if build result in error,
|
||||
/// like "invalid command 'dist_info'", set this on.
|
||||
#[serde(default)]
|
||||
legacysetup: bool,
|
||||
},
|
||||
/// Will build and install using custom commands
|
||||
#[serde(rename = "custom")]
|
||||
Custom { script: String },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user