diff --git a/dev-python/setuptools/patches/setuptools-57.5.0.patchset b/dev-python/setuptools/patches/setuptools-57.5.0.patchset new file mode 100644 index 000000000..86988a3c8 --- /dev/null +++ b/dev-python/setuptools/patches/setuptools-57.5.0.patchset @@ -0,0 +1,120 @@ +From 94c8a5e7a92cc6dc438293e09ce36360decffa7b Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 13feeb8..caec8f1 100644 +--- a/setuptools/_distutils/command/install.py ++++ b/setuptools/_distutils/command/install.py +@@ -43,6 +43,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', +@@ -78,6 +99,14 @@ 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', ++ } ++ + # The keys to an installation scheme; if any new types of files are to be + # installed, be sure to add an entry to every installation scheme above, + # and to SCHEME_KEYS here. +@@ -423,10 +452,16 @@ class install(Command): + raise DistutilsPlatformError( + "User base directory is not specified") + self.install_base = self.install_platbase = self.install_userbase +- self.select_scheme("unix_user") ++ if sys.platform.startswith('haiku'): ++ self.select_scheme("haiku_user") ++ else: ++ self.select_scheme("unix_user") + elif self.home is not None: + self.install_base = self.install_platbase = self.home +- self.select_scheme("unix_home") ++ if sys.platform.startswith('haiku'): ++ self.select_scheme("haiku_home") ++ else: ++ self.select_scheme("unix_home") + else: + if self.prefix is None: + if self.exec_prefix is not None: +@@ -442,7 +477,13 @@ class install(Command): + + self.install_base = self.prefix + self.install_platbase = self.exec_prefix +- self.select_scheme("unix_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("unix_prefix") + + def finalize_other(self): + """Finalizes options for non-posix platforms""" +diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py +index 879b698..e9dec4a 100644 +--- a/setuptools/_distutils/sysconfig.py ++++ b/setuptools/_distutils/sysconfig.py +@@ -114,7 +114,8 @@ def get_python_inc(plat_specific=0, prefix=None): + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) + python_dir = 'python' + 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) + elif os.name == "nt": + if python_build: + # Include both the include and PC dir to ensure we can find +@@ -156,7 +157,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.30.2 + diff --git a/dev-python/setuptools/setuptools-57.5.0.recipe b/dev-python/setuptools/setuptools-57.5.0.recipe new file mode 100644 index 000000000..5f60bff11 --- /dev/null +++ b/dev-python/setuptools/setuptools-57.5.0.recipe @@ -0,0 +1,83 @@ +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="88fc85b6c0cf561e33c7359b887f2e1a29e877e420d74a257e8f2fe45f0ff856" +PATCHES="setuptools-$portVersion.patchset" + +ARCHITECTURES="any" + +PROVIDES=" + $portName = $portVersion + " +REQUIRES=" + haiku + " + +BUILD_REQUIRES=" + haiku_devel + " +BUILD_PREREQUIRES=" + " + +PYTHON_PACKAGES=(python3 python38 python39 python310) +PYTHON_VERSIONS=(3.7 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\ + cmd:python$pythonVersion\n\ + \"" +BUILD_PREREQUIRES="$BUILD_PREREQUIRES + cmd:python$pythonVersion" +done + +BUILD() +{ + rm -rf build* + for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + # GENERIC: all python_setuptools-based installs need this + python=$portPackageLinksDir/cmd~python$pythonVersion/bin/python$pythonVersion + installLocation=$prefix/lib/python$pythonVersion/vendor-packages/ + + export SETUPTOOLS_USE_DISTUTILS=local + $python setup.py egg_info + $python setup.py build + mv build build$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 + + mv build$pythonVersion build + export SETUPTOOLS_USE_DISTUTILS=local + $python setup.py install \ + --root=/ --prefix=$prefix + + packageEntries $pythonPackage \ + $prefix/lib/python* + mv build build$pythonVersion + done +}