From ccdf287e0953256bed9a49f3f5ada0832621c43b Mon Sep 17 00:00:00 2001 From: fbrosson Date: Sun, 21 Oct 2018 11:51:35 +0000 Subject: [PATCH] brotli: do not depend on any particular minor version of Python. --- app-arch/brotli/brotli-1.0.6.recipe | 73 ++++++++++++++--------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/app-arch/brotli/brotli-1.0.6.recipe b/app-arch/brotli/brotli-1.0.6.recipe index 50db3b175..0bcf8a3aa 100644 --- a/app-arch/brotli/brotli-1.0.6.recipe +++ b/app-arch/brotli/brotli-1.0.6.recipe @@ -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"