Files
haikuports/dev-python/markdown/markdown-3.2.recipe
2026-01-14 14:44:23 +01:00

91 lines
2.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
SUMMARY="Python implementation of Markdown"
DESCRIPTION="This is a Python implementation of John Grubers Markdown. \
It is almost completely compliant with the reference implementation, though \
there are a few known issues."
HOMEPAGE="https://pythonhosted.org/Markdown/
https://pypi.python.org/pypi/Markdown/"
COPYRIGHT="2007, 2008 The Python Markdown Project
2004, 2005, 2006 Yuri Takhteyev
2004 Manfred Stienstra"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-$portVersion.tar.gz"
CHECKSUM_SHA256="5ad7180c3ec16422a764568ad6409ec82460c40d1631591fa53d597033cc98bf"
SOURCE_DIR="Markdown-$portVersion"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
cmd:markdown_py_$pythonVersion
\""
# Provide non-suffixed cmd only for the default Python version
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:markdown_py = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
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-$pythonVersion
done
# And provide suffix-less symlinks for the default version
if [ $pythonVersion = $defaultVersion ]; then
for f in $binDir/*; do
ln -sr $f ${f%-$pythonVersion}
done
fi
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir
done
}