brotli: do not depend on any particular minor version of Python.

This commit is contained in:
fbrosson
2018-10-21 11:51:35 +00:00
parent 1c6091e9b4
commit ccdf287e09

View File

@@ -7,7 +7,7 @@ methods. It is similar in speed with deflate but offers more dense compression."
HOMEPAGE="https://github.com/google/brotli"
COPYRIGHT="2009, 2010, 2013-2018 Brotli Authors"
LICENSE="MIT"
REVISION="2"
REVISION="3"
SOURCE_URI="https://github.com/google/brotli/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="ce94b7f48af5e8f444c3949ca93201c1b4bb40da633db084e900133ce87848db"
SOURCE_FILENAME="brotli-$portVersion.tar.gz"
@@ -54,49 +54,45 @@ BUILD_PREREQUIRES="
cmd:make
"
PYTHON_PACKAGES=(python python3)
PYTHON_VERSIONS=(2.7 3.6)
PYTHON_PACKAGES=()
PYTHON_LIBSUFFIXES=()
PYTHON_VERSIONS=()
# We don't have python2 for secondaryArch,
# and gcc2 doesn't support the flags passed by python3
if [ -n "$secondaryArchSuffix" ]; then
unset PYTHON_PACKAGES[0]
unset PYTHON_VERSIONS[0]
elif [ "$effectiveTargetArchitecture" = "x86_gcc2" ]; then
unset PYTHON_PACKAGES[1]
unset PYTHON_VERSIONS[1]
if [ -z "$secondaryArchSuffix" ]; then
PYTHON_PACKAGES+=(python)
PYTHON_LIBSUFFIXES+=("")
fi
# gcc2 does not support the flags passed by python3
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
PYTHON_PACKAGES+=(python3)
PYTHON_LIBSUFFIXES+=(m)
fi
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\
\"; \
REQUIRES_$pythonPackage=\"\
haiku$secondaryArchSuffix\n\
cmd:python$pythonVersion\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done
pythonPackage=${PYTHON_PACKAGES[i]}
pythonLibSuffix=${PYTHON_LIBSUFFIXES[$i]}
pythonVersion="`$pythonPackage --version 2>&1 | sed \
-e "s/Python \([[:digit:]]*\.[[:digit:]]*\)\..*/\1/"`"
PYTHON_VERSIONS+=($pythonVersion)
if [ -z "$secondaryArchSuffix" ]; then
REQUIRES_python+="
lib:libpython${PYTHON_VERSIONS[0]}
eval "\
PROVIDES_${pythonPackage}=\"\n\
${portName}_$pythonPackage = $portVersion\n\
\"; \
REQUIRES_$pythonPackage=\"\n\
haiku$secondaryArchSuffix\n\
cmd:python$pythonVersion\n\
lib:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix\n\
\"\
"
BUILD_REQUIRES+="
setuptools_$pythonPackage
devel:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix
"
BUILD_PREREQUIRES+="
devel:libpython${PYTHON_VERSIONS[0]}
cmd:python$pythonVersion
"
fi
if [ "$effectiveTargetArchitecture" != "x86_gcc2" ]; then
REQUIRES_python3+="
lib:libpython${PYTHON_VERSIONS[1]}m$secondaryArchSuffix
"
BUILD_PREREQUIRES+="
devel:libpython${PYTHON_VERSIONS[1]}m$secondaryArchSuffix
"
fi
done
BUILD()
{
@@ -128,8 +124,9 @@ INSTALL()
install -t "$manDir/man1" docs/brotli.1
install -t "$manDir/man3" docs/*.3
fixPkgconfig
prepareInstalledDevelLibs libbrotli{common,dec,enc}{,-static}
fixPkgconfig
packageEntries devel \
"$manDir/man3" \
"$developDir"