#!/bin/bash # Slackware build script for yt-dlp # Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # Note: I honestly prefer the standalone executable version of this, # which I keep in ~/bin. It allows me to run "yt-dlp -U" as my user to # get the latest version. However, since it's listed as a dependency # for clipgrab, haruna, xdman, ytfzf, and an optional dependency for # pipe-viewer, it has to exist on SBo. # 20240217 bkw: switched to pythonhosted.org source tarball, thanks # to Jeremy Hansen for finding this. Filename now has the version # number in it, so no more caching problems for the download. Build # had to change slightly as there's no more CONTRIBUTING file. # 20240216 bkw: updated for v2023.12.30 # 20231219 bkw: updated for v2023.11.16 # 20231031 bkw: updated for v2023.10.13 # 20230904 bkw: BUILD=2, silence complaints from 'pip3 check' # 20230711 bkw: updated for v2023.07.06 # 20230623 bkw: updated for v2023.06.22, added version check # 20230402 bkw: updated for v2023.03.04 # 20230222 bkw: updated for v2023.02.17 # 20230104 bkw: updated for v2023.01.02 cd $(dirname $0) ; CWD=$(pwd) PRGNAM=yt-dlp VERSION=${VERSION:-2023.12.30} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) 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} # no need for CFLAGS or LIBDIRSUFFIX. actually this would be noarch, # except for the lib vs. lib64 python problem. set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ # hardcoded paths. sed -i -e "s,share/doc/yt_dlp,doc/$PRGNAM-$VERSION," \ -e "s,share/man,man," \ setup.py # 20230904 bkw: mixed signals from upstream. The README.md documents # various python modules as optional, but some of them are listed in # requirements.txt, meaning 'pip3 check' treats them as required, # even though yt-dlp itself works fine without them. The fix is to # remove the optional stuff from requirements.txt, to make it agreee # with README.md. My own README documents these already. brotli and # certifi are included in Slackware. sed -i '/\(mutagen\|pycryptodomex\|websockets\)/d' requirements.txt # if anyone's wondering, there's no python2 support. python3 setup.py install --root=$PKG gzip -9 $PKG/usr/man/man1/* # AUTHORS is 0 bytes in 2022.01.21 (still is, in 2023.03.04). PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cp -a LICENSE *.md $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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.$PKGTYPE