From 2ac499b9e9a6771add43d5bc3d863bdfccded376140abbf2abd1e6000baf6fed Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 14 Sep 2024 13:07:32 +0300 Subject: [PATCH] libtorrent's example utilities --- build/distfiles/.gitignore | 3 ++ ...ibtorrent-v2.0.10-41-g2ab8fedab.tar.zst.do | 13 +++++++ ...btorrent-v2.0.10-41-g2ab8fedab-examples.do | 35 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 build/distfiles/libtorrent-v2.0.10-41-g2ab8fedab.tar.zst.do create mode 100644 build/skel/ftp/libtorrent-v2.0.10-41-g2ab8fedab-examples.do diff --git a/build/distfiles/.gitignore b/build/distfiles/.gitignore index f2e4fdb..9646879 100644 --- a/build/distfiles/.gitignore +++ b/build/distfiles/.gitignore @@ -18,6 +18,7 @@ /bfs.git/ /BLAKE2.git/ /boost_1_74_0.tar.bz2 +/boost_1_86_0.tar.bz2 /brotli-dev-null-60-ga528bce.tar.zst /brotli.git/ /c-ares-1.30.0.tar.gz @@ -135,6 +136,8 @@ /libtap.git/ /libtheora-1.1.1.tar.bz2 /libtool-2.4.7.tar.xz +/libtorrent/ +/libtorrent-v2.0.10-41-g2ab8fedab.tar.zst /libvorbis-1.3.7.tar.gz /libvpx-v1.14.1-303-gd6ae3ea465.tar.zst /libvpx.git/ diff --git a/build/distfiles/libtorrent-v2.0.10-41-g2ab8fedab.tar.zst.do b/build/distfiles/libtorrent-v2.0.10-41-g2ab8fedab.tar.zst.do new file mode 100644 index 0000000..61c1741 --- /dev/null +++ b/build/distfiles/libtorrent-v2.0.10-41-g2ab8fedab.tar.zst.do @@ -0,0 +1,13 @@ +[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../.. +sname=$1.do . "$BASS_ROOT"/lib/rc +[ -d libtorrent ] || git clone --depth 1 https://github.com/arvidn/libtorrent.git >&2 +cd libtorrent +commit=2ab8fedabb7716947edc77958da6d0b5e1040df9 +git fetch origin $commit >&2 +git checkout $commit >&2 +git submodule update --init --recursive >&2 +dir=${1%.tar.zst} +{ + git archive --prefix=$dir/ @ + git submodule --quiet foreach 'git archive --prefix='$dir'/$sm_path/ @' +} | $COMPRESSOR diff --git a/build/skel/ftp/libtorrent-v2.0.10-41-g2ab8fedab-examples.do b/build/skel/ftp/libtorrent-v2.0.10-41-g2ab8fedab-examples.do new file mode 100644 index 0000000..7f482ad --- /dev/null +++ b/build/skel/ftp/libtorrent-v2.0.10-41-g2ab8fedab-examples.do @@ -0,0 +1,35 @@ +[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../../.. +sname=$1.do . "$BASS_ROOT"/lib/rc +. "$BASS_ROOT"/build/skel/common.rc + +bdeps="rc-paths stow archivers/zstd devel/pkgconf-2.1.1" +libtorrent=${NAME%-examples} +boost=boost_1_86_0 +redo-ifchange $bdeps "$DISTFILES"/$libtorrent.tar.zst "$DISTFILES"/$boost.tar.bz2 +hsh=$("$BASS_ROOT"/build/bin/cksum $BASS_REV $SPATH) +. "$BASS_ROOT"/build/lib/create-tmp-for-build.rc +"$BASS_ROOT"/build/bin/pkg-inst $bdeps +. ./rc +$TAR xf "$DISTFILES"/$libtorrent.tar.zst --options read_concatenated_archives +$TAR xf "$DISTFILES"/$boost.tar.bz2 +"$BASS_ROOT"/bin/rm-r "$SKELBINS"/$ARCH/$NAME-$hsh + +cd $boost/tools/build +./bootstrap.sh >&2 +cd ../../.. +cd $libtorrent +echo using clang \; >user-config.jam +PATH=$tmp/$boost/tools/build/src/engine:$PATH +export BOOST_ROOT=$tmp/$boost BOOST_BUILD_PATH=$tmp/$boost/tool/build +opts="variant=release link=static runtime-link=static" +b2 $opts >&2 +cd examples +b2 $opts >&2 +mkdir -p "$SKELBINS"/$ARCH/$NAME-$hsh/bin +find bin >&2 +for cmd in dump_bdecode dump_torrent make_torrent ; do + cp bin/*/release/*/*/*/*/*/$cmd "$SKELBINS"/$ARCH/$NAME-$hsh/bin +done + +cd "$SKELBINS"/$ARCH +"$BASS_ROOT"/build/lib/mk-pkg $NAME-$hsh -- 2.48.1