mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
docutils: clean up, support Python 3.10. (#8134)
* docutils: clean up, support Python 3.10. - Use loops to generate the package/version specific PROVIDES. - Use version suffixes for the provided cmds, except for the ones from the package for the default Python version (3.9 currently). Note: Moved suffixes after the ".py", as names like "rst2html4310.py" looked weird, and we can't use "rst2html4-3.10.py" due to the "no dashes in PROVIDES or REQUIRES" rule. * docutils: change script suffixes. Original recipe was using, eg., "rst2html438.py", which looks weird. Previous commit used "rst2html4.py3.8", which at least is consistent with what it's done for Python and pip recipes. This one changes it to "rst2html4-3.8.py", which looks better, and matches what's done on ports for other platforms (MacPorts, for example). * docutils: further clean up. Provide versioned scripts, and also non-versioned symlinks for the scripts from the version of the packate that matches the default Python version (3.9 at the moment). * docutis: update to version 0.19 * docutils: simplify symlinks creation. As pointed out by Jérôme, we can use ln's ability to produce links relative link's location.
This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
SUMMARY="An open-source text processing system"
|
||||
DESCRIPTION="Docutils is an open-source text processing system for processing \
|
||||
plaintext documentation into useful formats, such as HTML, LaTeX, man-pages, \
|
||||
open-document or XML. It includes reStructuredText, the easy to read, easy to \
|
||||
use, what-you-see-is-what-you-get plaintext markup language."
|
||||
HOMEPAGE="http://docutils.sourceforge.net/"
|
||||
COPYRIGHT="Günter Milde
|
||||
John Gruber
|
||||
Alex Fernández"
|
||||
LICENSE="Public Domain
|
||||
BSD (2-clause)
|
||||
GNU GPL v3
|
||||
Python"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://pypi.io/packages/source/${portName:0:1}/$portName/$portName-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python38 python39)
|
||||
PYTHON_VERSIONS=(3.8 3.9)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
eval "PROVIDES_${pythonPackage}=\"\
|
||||
${portName}_$pythonPackage = $portVersion\
|
||||
\"; \
|
||||
REQUIRES_$pythonPackage=\"\
|
||||
haiku\n\
|
||||
cmd:python$pythonVersion\
|
||||
\""
|
||||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||||
setuptools_$pythonPackage"
|
||||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||||
cmd:python$pythonVersion"
|
||||
done
|
||||
|
||||
PROVIDES_python39="$PROVIDES_python39
|
||||
cmd:rst2html.py = $portVersion
|
||||
cmd:rst2html4.py = $portVersion
|
||||
cmd:rst2html5.py = $portVersion
|
||||
cmd:rst2latex.py = $portVersion
|
||||
cmd:rst2man.py = $portVersion
|
||||
cmd:rst2newlatex.py = $portVersion
|
||||
cmd:rst2odt_prepstyles.py = $portVersion
|
||||
cmd:rst2odt.py = $portVersion
|
||||
cmd:rst2pseudoxml.py = $portVersion
|
||||
cmd:rst2s5.py = $portVersion
|
||||
cmd:rst2xetex.py = $portVersion
|
||||
cmd:rst2xml.py = $portVersion
|
||||
cmd:rstpep2html.py = $portVersion
|
||||
"
|
||||
PROVIDES_python38="$PROVIDES_python38
|
||||
cmd:rst2html38.py = $portVersion
|
||||
cmd:rst2html438.py = $portVersion
|
||||
cmd:rst2html538.py = $portVersion
|
||||
cmd:rst2latex38.py = $portVersion
|
||||
cmd:rst2man38.py = $portVersion
|
||||
cmd:rst2newlatex38.py = $portVersion
|
||||
cmd:rst2odt_prepstyles38.py = $portVersion
|
||||
cmd:rst2odt38.py = $portVersion
|
||||
cmd:rst2pseudoxml38.py = $portVersion
|
||||
cmd:rst2s538.py = $portVersion
|
||||
cmd:rst2xetex38.py = $portVersion
|
||||
cmd:rst2xml38.py = $portVersion
|
||||
cmd:rstpep2html38.py = $portVersion
|
||||
"
|
||||
|
||||
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
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
|
||||
if [ $pythonPackage == python38 ]; then
|
||||
for f in $binDir/*.py; do
|
||||
mv $f ${f%.py}38.py
|
||||
done
|
||||
fi
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python* \
|
||||
$binDir
|
||||
done
|
||||
}
|
||||
121
dev-python/docutils/docutils-0.19.recipe
Normal file
121
dev-python/docutils/docutils-0.19.recipe
Normal file
@@ -0,0 +1,121 @@
|
||||
SUMMARY="An open-source text processing system"
|
||||
DESCRIPTION="Docutils is an open-source text processing system for processing \
|
||||
plaintext documentation into useful formats, such as HTML, LaTeX, man-pages, \
|
||||
open-document or XML. It includes reStructuredText, the easy to read, easy to \
|
||||
use, what-you-see-is-what-you-get plaintext markup language."
|
||||
HOMEPAGE="http://docutils.sourceforge.net/"
|
||||
COPYRIGHT="Günter Milde
|
||||
John Gruber
|
||||
Alex Fernández"
|
||||
LICENSE="Public Domain
|
||||
BSD (2-clause)
|
||||
GNU GPL v3
|
||||
Python"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://pypi.io/packages/source/${portName:0:1}/$portName/$portName-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python38 python39 python310)
|
||||
PYTHON_VERSIONS=(3.8 3.9 3.10)
|
||||
defaultVersion=3.9
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
commandSuffix=${commandSuffixes[$i]}
|
||||
|
||||
eval "PROVIDES_${pythonPackage}=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
cmd:docutils_$pythonVersion.py = $portVersion
|
||||
cmd:rst2html_$pythonVersion.py = $portVersion
|
||||
cmd:rst2html4_$pythonVersion.py = $portVersion
|
||||
cmd:rst2html5_$pythonVersion.py = $portVersion
|
||||
cmd:rst2latex_$pythonVersion.py = $portVersion
|
||||
cmd:rst2man_$pythonVersion.py = $portVersion
|
||||
cmd:rst2newlatex_$pythonVersion.py = $portVersion
|
||||
cmd:rst2odt_prepstyles_$pythonVersion.py = $portVersion
|
||||
cmd:rst2odt_$pythonVersion.py = $portVersion
|
||||
cmd:rst2pseudoxml_$pythonVersion.py = $portVersion
|
||||
cmd:rst2s5_$pythonVersion.py = $portVersion
|
||||
cmd:rst2xetex_$pythonVersion.py = $portVersion
|
||||
cmd:rst2xml_$pythonVersion.py = $portVersion
|
||||
cmd:rstpep2html_$pythonVersion.py = $portVersion
|
||||
\""
|
||||
|
||||
if [ $pythonVersion = $defaultVersion ]; then
|
||||
eval "PROVIDES_${pythonPackage}+=\"
|
||||
cmd:docutils = $portVersion
|
||||
cmd:rst2html = $portVersion
|
||||
cmd:rst2html4 = $portVersion
|
||||
cmd:rst2html5 = $portVersion
|
||||
cmd:rst2latex = $portVersion
|
||||
cmd:rst2man = $portVersion
|
||||
cmd:rst2newlatex = $portVersion
|
||||
cmd:rst2odt_prepstyles = $portVersion
|
||||
cmd:rst2odt = $portVersion
|
||||
cmd:rst2pseudoxml = $portVersion
|
||||
cmd:rst2s5 = $portVersion
|
||||
cmd:rst2xetex = $portVersion
|
||||
cmd:rst2xml = $portVersion
|
||||
cmd:rstpep2html = $portVersion
|
||||
\""
|
||||
fi
|
||||
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
BUILD_REQUIRES+="
|
||||
setuptools_$pythonPackage
|
||||
"
|
||||
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
|
||||
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
|
||||
# Version suffix all the scripts
|
||||
for f in $binDir/*; do
|
||||
mv $f ${f%.py}-${pythonVersion}.py
|
||||
done
|
||||
|
||||
# And provide suffix-less symlinks for the default version
|
||||
if [ $pythonVersion = $defaultVersion ]; then
|
||||
for f in $binDir/*; do
|
||||
ln -sr $f ${f%-$pythonVersion.py}
|
||||
done
|
||||
fi
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python* \
|
||||
$binDir
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user