[SOLVED] Building libtorrent with ponce slackbuild script fails with python binding version error (PEP 440)
by rinza from LinuxQuestions.org on (#6HVR0)
Hi, I'm on slackware64-current and I've tried to compile the version 1.2.19 of libtorrent-rasterbar, which is the current intended version for the ponce script I'm using, but it gives an error of versioning while compiling the python bindings I can't understand:
Code:[100%] Generating timestamp
running build
running build_py
creating /tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python/lib
copying /tmp/SBo/libtorrent-rasterbar-1.2.19/build/bindings/python/setup.py -> /tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python/lib
running egg_info
/usr/lib64/python3.9/site-packages/setuptools/command/egg_info.py:151: SetuptoolsDeprecationWarning: Invalid version: '0/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python'.
!!
********************************************************************************
Version '0/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python' is not valid according to PEP 440.
Please make sure to specify a valid version for your package.
Also note that future releases of setuptools may halt the build process
if an invalid version is given.
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.
See https://peps.python.org/pep-0440/ for details.
********************************************************************************
!!
return _normalization.best_effort_version(f"0{self.vtags}")[1:]
/usr/lib64/python3.9/site-packages/setuptools/command/egg_info.py:131: SetuptoolsDeprecationWarning: Invalid version: '1.2.19/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python'.
!!
********************************************************************************
Version '1.2.19/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python' is not valid according to PEP 440.
Please make sure to specify a valid version for your package.
Also note that future releases of setuptools may halt the build process
if an invalid version is given.
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.
See https://peps.python.org/pep-0440/ for details.
********************************************************************************
!!
return _normalization.best_effort_version(tagged)
Traceback (most recent call last):
File "/tmp/SBo/libtorrent-rasterbar-1.2.19/build/bindings/python/setup.py", line 4, in <module>
setup(
File "/usr/lib64/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
super().run_command(command)
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "/usr/lib64/python3.9/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options
parsed_version = packaging.version.Version(self.egg_version)
File "/usr/lib64/python3.9/site-packages/setuptools/_vendor/packaging/version.py", line 197, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
setuptools.extern.packaging.version.InvalidVersion: Invalid version: '1.2.19-tmp-SBo-libtorrent-rasterbar-1.2.19-bindings-python'
make[2]: *** [bindings/python/CMakeFiles/python_bindings.dir/build.make:75: bindings/python/timestamp] Error 1
make[1]: *** [CMakeFiles/Makefile2:169: bindings/python/CMakeFiles/python_bindings.dir/all] Error 2
make: *** [Makefile:136: all] Error 2I've tried both the original ponce script, and also editing it to use ninja, both fails at the same point. Here is the original script:
Code:cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=libtorrent-rasterbar
VERSION=${VERSION:-1.2.19}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
*) export ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
EXAMPLES=${EXAMPLES:-no}
[ "$EXAMPLES" = "yes" ] && examples="-Dbuild_examples=ON"
mkdir -p build
cd build
cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR:PATH=lib${LIBDIRSUFFIX} \
-Dpython-bindings=ON \
-Dpython-egg-info=ON \
-DCMAKE_BUILD_TYPE=Release ..
make
make install/strip DESTDIR=$PKG
cd ..
# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING LICENSE ChangeLog NEWS README* docs/ tools/ \
$PKG/usr/doc/$PRGNAM-$VERSION
if [ "$EXAMPLES" = "yes" ]; then
cp -a examples/ $PKG/usr/doc/$PRGNAM-$VERSION
fi
find $PKG \
\( -name .deps -o -name .libs -o -name .dirstamp \
\) -exec rm -rf {} \; || true
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPEDo you have any ideas how to fix this?
Code:[100%] Generating timestamp
running build
running build_py
creating /tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python/lib
copying /tmp/SBo/libtorrent-rasterbar-1.2.19/build/bindings/python/setup.py -> /tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python/lib
running egg_info
/usr/lib64/python3.9/site-packages/setuptools/command/egg_info.py:151: SetuptoolsDeprecationWarning: Invalid version: '0/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python'.
!!
********************************************************************************
Version '0/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python' is not valid according to PEP 440.
Please make sure to specify a valid version for your package.
Also note that future releases of setuptools may halt the build process
if an invalid version is given.
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.
See https://peps.python.org/pep-0440/ for details.
********************************************************************************
!!
return _normalization.best_effort_version(f"0{self.vtags}")[1:]
/usr/lib64/python3.9/site-packages/setuptools/command/egg_info.py:131: SetuptoolsDeprecationWarning: Invalid version: '1.2.19/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python'.
!!
********************************************************************************
Version '1.2.19/tmp/SBo/libtorrent-rasterbar-1.2.19/bindings/python' is not valid according to PEP 440.
Please make sure to specify a valid version for your package.
Also note that future releases of setuptools may halt the build process
if an invalid version is given.
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.
See https://peps.python.org/pep-0440/ for details.
********************************************************************************
!!
return _normalization.best_effort_version(tagged)
Traceback (most recent call last):
File "/tmp/SBo/libtorrent-rasterbar-1.2.19/build/bindings/python/setup.py", line 4, in <module>
setup(
File "/usr/lib64/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
super().run_command(command)
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "/usr/lib64/python3.9/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options
parsed_version = packaging.version.Version(self.egg_version)
File "/usr/lib64/python3.9/site-packages/setuptools/_vendor/packaging/version.py", line 197, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
setuptools.extern.packaging.version.InvalidVersion: Invalid version: '1.2.19-tmp-SBo-libtorrent-rasterbar-1.2.19-bindings-python'
make[2]: *** [bindings/python/CMakeFiles/python_bindings.dir/build.make:75: bindings/python/timestamp] Error 1
make[1]: *** [CMakeFiles/Makefile2:169: bindings/python/CMakeFiles/python_bindings.dir/all] Error 2
make: *** [Makefile:136: all] Error 2I've tried both the original ponce script, and also editing it to use ninja, both fails at the same point. Here is the original script:
Code:cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=libtorrent-rasterbar
VERSION=${VERSION:-1.2.19}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
*) export ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
EXAMPLES=${EXAMPLES:-no}
[ "$EXAMPLES" = "yes" ] && examples="-Dbuild_examples=ON"
mkdir -p build
cd build
cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR:PATH=lib${LIBDIRSUFFIX} \
-Dpython-bindings=ON \
-Dpython-egg-info=ON \
-DCMAKE_BUILD_TYPE=Release ..
make
make install/strip DESTDIR=$PKG
cd ..
# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING LICENSE ChangeLog NEWS README* docs/ tools/ \
$PKG/usr/doc/$PRGNAM-$VERSION
if [ "$EXAMPLES" = "yes" ]; then
cp -a examples/ $PKG/usr/doc/$PRGNAM-$VERSION
fi
find $PKG \
\( -name .deps -o -name .libs -o -name .dirstamp \
\) -exec rm -rf {} \; || true
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPEDo you have any ideas how to fix this?