mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
setuptools_rust: update to 1.11.1.
Not used by anything on-tree currently. Still, was in dire need of a clean up. Using pip in .recipes is a big NO NO. Previous version of this package included, besides setuptools_rust code, modules for tomli, setuptools, semantic_version, distutils-precedence, and pkg_resources. All which would override the files from "proper" .hpkg for those modules, depending on package activation order. Also, this brings down the size of the package from 1.6 MiB to 47 KiB.
This commit is contained in:
71
dev-python/setuptools_rust/setuptools_rust-1.11.1.recipe
Normal file
71
dev-python/setuptools_rust/setuptools_rust-1.11.1.recipe
Normal file
@@ -0,0 +1,71 @@
|
||||
SUMMARY="Compile and distribute Python extensions written in Rust"
|
||||
DESCRIPTION="setuptools_rust handles detecting and managing your build environment in relation \
|
||||
to the Rust toolchain."
|
||||
HOMEPAGE="https://github.com/PyO3/setuptools-rust"
|
||||
COPYRIGHT="2017-2018 PyO3 project & contributors"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://files.pythonhosted.org/packages/source/${portName:0:1}/$portName/$portName-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="7dabc4392252ced314b8050d63276e05fdc5d32398fc7d3cce1f6a6ac35b76c0"
|
||||
SOURCE_DIR="$portName-$portVersion"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
|
||||
PYTHON_VERSIONS=(3.10)
|
||||
|
||||
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
||||
pythonPackage=python${pythonVersion//.}
|
||||
|
||||
eval "PROVIDES_${pythonPackage}=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
\""
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
|
||||
BUILD_REQUIRES+="
|
||||
build_$pythonPackage
|
||||
installer_$pythonPackage
|
||||
setuptools_$pythonPackage
|
||||
wheel_$pythonPackage
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:python$pythonVersion
|
||||
"
|
||||
done
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# This is an "any" package, "building" it will create a
|
||||
# "$portBaseName-$portVersion-py3-none-any.whl" file that can be installed
|
||||
# on multiple Python versions, so we only need to build once.
|
||||
python=python${PYTHON_VERSIONS[0]}
|
||||
|
||||
$python -m build --wheel --skip-dependency-check --no-isolation
|
||||
}
|
||||
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
||||
pythonPackage=python${pythonVersion//.}
|
||||
|
||||
python=python$pythonVersion
|
||||
|
||||
$python -m installer --p $prefix dist/$portName-$portVersion-*-none-any.whl
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python*
|
||||
done
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
SUMMARY="Compile and distribute Python extensions written in Rust"
|
||||
DESCRIPTION="setuptools_rust handles detecting and managing your build environment in relation \
|
||||
to the Rust toolchain."
|
||||
HOMEPAGE="https://pypi.org/project/setuptools-rust"
|
||||
COPYRIGHT="2022-2024 Nikolay Kim"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://pypi.io/packages/source/s/setuptools-rust/setuptools-rust-$portVersion.tar.gz"
|
||||
SOURCE_DIR="setuptools-rust-$portVersion"
|
||||
CHECKSUM_SHA256="94b1dd5d5308b3138d5b933c3a2b55e6d6927d1a22632e509fcea9ddd0f7e486"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python39 python310)
|
||||
PYTHON_VERSIONS=(3.9 3.10)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
# semantic_version_$pythonPackage ??
|
||||
|
||||
eval "PROVIDES_${pythonPackage}=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
\""
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku
|
||||
tomli_$pythonPackage # only for Python < 3.11
|
||||
cmd:git
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||||
pip_$pythonPackage
|
||||
tomli_$pythonPackage # only for Python < 3.11
|
||||
setuptools_$pythonPackage
|
||||
"
|
||||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||||
cmd:python$pythonVersion
|
||||
"
|
||||
done
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
export PYTHONPATH=$installLocation:$PYTHONPATH
|
||||
mkdir -p $installLocation
|
||||
rm -rf build
|
||||
|
||||
pip3 install --target=$installLocation .
|
||||
#mv $prefix/bin/pyproject-build $prefix/bin/pyproject-build$pythonVersion
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python*
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user