Skip to content

Commit

Permalink
setuptools(_scm), bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Begasus committed May 31, 2023
1 parent ca6b732 commit e736059
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 19 deletions.
120 changes: 120 additions & 0 deletions dev-python/setuptools/patches/setuptools-67.8.0.patchset
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
From cfe9a1ed59a7ae85a0befbb1e40e88df855c310f Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 14 Dec 2021 17:34:48 +0100
Subject: Distutils patch for Haiku


diff --git a/setuptools/_distutils/command/install.py b/setuptools/_distutils/command/install.py
index a7ac4e6..8e49005 100644
--- a/setuptools/_distutils/command/install.py
+++ b/setuptools/_distutils/command/install.py
@@ -50,6 +50,27 @@ INSTALL_SCHEMES = {
'data': '{base}',
},
'nt': WINDOWS_SCHEME,
+ 'haiku': {
+ 'purelib': '$base/non-packaged/lib/python$py_version_short/site-packages',
+ 'platlib': '$platbase/non-packaged/lib/python$py_version_short/site-packages',
+ 'headers': '$base/non-packaged/develop/headers/python$py_version_short/$dist_name',
+ 'scripts': '$base/non-packaged/bin',
+ 'data' : '$base/non-packaged',
+ },
+ 'haiku_vendor': {
+ 'purelib': '$base/lib/python$py_version_short/vendor-packages',
+ 'platlib': '$platbase/lib/python$py_version_short/vendor-packages',
+ 'headers': '$base/develop/headers/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'haiku_home': {
+ 'purelib': '$base/lib/python',
+ 'platlib': '$base/lib/python',
+ 'headers': '$base/develop/headers/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
'pypy': {
'purelib': '{base}/site-packages',
'platlib': '{base}/site-packages',
@@ -86,7 +107,13 @@ if HAS_USER_SITE:
'data': '{userbase}',
}

-
+ INSTALL_SCHEMES['haiku_user'] = {
+ 'purelib': '$usersite',
+ 'platlib': '$usersite',
+ 'headers': '$userbase/develop/headers/python$py_version_short/$dist_name',
+ 'scripts': '$userbase/bin',
+ 'data' : '$userbase',
+ }
INSTALL_SCHEMES.update(fw.schemes)


@@ -554,10 +581,16 @@ class install(Command):
if self.install_userbase is None:
raise DistutilsPlatformError("User base directory is not specified")
self.install_base = self.install_platbase = self.install_userbase
- self.select_scheme("posix_user")
+ if sys.platform.startswith('haiku'):
+ self.select_scheme("haiku_user")
+ else:
+ self.select_scheme("posix_user")
elif self.home is not None:
self.install_base = self.install_platbase = self.home
- self.select_scheme("posix_home")
+ if sys.platform.startswith('haiku'):
+ self.select_scheme("haiku_home")
+ else:
+ self.select_scheme("posix_home")
else:
if self.prefix is None:
if self.exec_prefix is not None:
@@ -577,7 +610,13 @@ class install(Command):

self.install_base = self.prefix
self.install_platbase = self.exec_prefix
- self.select_scheme("posix_prefix")
+ if sys.platform.startswith('haiku'):
+ if os.environ.get('HAIKU_USE_VENDOR_DIRECTORIES') == '1':
+ self.select_scheme("haiku_vendor")
+ else:
+ self.select_scheme("haiku")
+ else:
+ self.select_scheme("posix_prefix")

def finalize_other(self):
"""Finalizes options for non-posix platforms"""
diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py
index a40a723..9bfa334 100644
--- a/setuptools/_distutils/sysconfig.py
+++ b/setuptools/_distutils/sysconfig.py
@@ -190,7 +190,8 @@ def _get_python_inc_from_config(plat_specific, spec_prefix):
def _get_python_inc_posix_prefix(prefix):
implementation = 'pypy' if IS_PYPY else 'python'
python_dir = implementation + get_python_version() + build_flags
- return os.path.join(prefix, "include", python_dir)
+ inc_dir = "include" if sys.platform != "haiku1" else "develop/headers"
+ return os.path.join(prefix, inc_dir, python_dir)


def _get_python_inc_nt(prefix, spec_prefix, plat_specific):
@@ -244,7 +245,14 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
else:
prefix = plat_specific and EXEC_PREFIX or PREFIX

- if os.name == "posix":
+ if os.name == "posix" and sys.platform.startswith('haiku'):
+ if standard_lib:
+ return os.path.join(prefix,
+ "lib", "python" + get_python_version())
+ return os.path.join(prefix, "non-packaged",
+ "lib", "python" + get_python_version(),
+ "site-packages")
+ elif os.name == "posix":
if plat_specific or standard_lib:
# Platform-specific modules (any module from a non-pure-Python
# module distribution) or standard Python library modules.
--
2.37.3

66 changes: 66 additions & 0 deletions dev-python/setuptools/setuptools-67.8.0.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
SUMMARY="Download, build, install, upgrade, and uninstall Python packages"
DESCRIPTION="EasyInstall (easy_install) gives you a quick and painless way \
to install packages remotely by connecting to the cheeseshop or even other \
websites via HTTP. It is somewhat analogous to the CPAN and PEAR tools for \
Perl and PHP, respectively."
HOMEPAGE="https://pypi.python.org/pypi/setuptools"
COPYRIGHT="2006-2019 Python Packaging Authority"
LICENSE="Python"
REVISION="1"
SOURCE_URI="https://github.com/pypa/setuptools/archive/v$portVersion.tar.gz"
SOURCE_FILENAME="setuptools-$portVersion.tar.gz"
CHECKSUM_SHA256="d696681648c66c81142169219d0353a9b693b341827b7accc0f3820ec5423a7c"
PATCHES="setuptools-$portVersion.patchset"

ARCHITECTURES="any"

PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"

BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
"

PYTHON_PACKAGES=(python38 python39 python310)
PYTHON_VERSIONS=(3.8 3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
\""
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
export SETUPTOOLS_USE_DISTUTILS=local
# $python setup.py egg_info
$python setup.py build install \
--root=/ --prefix=$prefix

packageEntries $pythonPackage \
$prefix/lib/python*
done
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ or in a SCM managed file."
HOMEPAGE="https://github.com/pypa/setuptools_scm"
COPYRIGHT="2015-2020 Ronny Pfannschmidt"
LICENSE="MIT"
REVISION="4"
REVISION="1"
SOURCE_URI="https://pypi.io/packages/source/s/setuptools_scm/setuptools_scm-$portVersion.tar.gz"
CHECKSUM_SHA256="83a0cedd3449e3946307811a4c7b9d89c4b5fd464a2fb5eeccd0a5bb158ae5c8"
CHECKSUM_SHA256="6c508345a771aad7d56ebff0e70628bf2b0ec7573762be9960214730de278f27"

ARCHITECTURES="any"

Expand All @@ -25,27 +25,30 @@ BUILD_REQUIRES="
PYTHON_PACKAGES=(python38 python39 python310)
PYTHON_VERSIONS=(3.8 3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\n\
\"; \
REQUIRES_$pythonPackage=\"\
haiku\n\
setuptools_$pythonPackage\n\
toml_$pythonPackage\n\
cmd:git\n\
cmd:python$pythonVersion\n\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}

eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
setuptools_$pythonPackage
toml_$pythonPackage
cmd:git
cmd:python$pythonVersion
\""
BUILD_REQUIRES="$BUILD_REQUIRES
packaging_$pythonPackage
setuptools_$pythonPackage
"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion
"
done

INSTALL()
{
export SETUPTOOLS_SCM_PRETEND_VERSION="$portVersion"
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
Expand Down

0 comments on commit e736059

Please sign in to comment.