]> Cypherpunks repositories - bass.git/commitdiff
libtorrent's example utilities
authorSergey Matveev <stargrave@stargrave.org>
Sat, 14 Sep 2024 10:07:32 +0000 (13:07 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 14 Sep 2024 10:07:32 +0000 (13:07 +0300)
build/distfiles/.gitignore
build/distfiles/libtorrent-v2.0.10-41-g2ab8fedab.tar.zst.do [new file with mode: 0644]
build/skel/ftp/libtorrent-v2.0.10-41-g2ab8fedab-examples.do [new file with mode: 0644]

index f2e4fdb1779851f64523c504f7e3285301fd6ab8ceefdaff371549ec814bf767..9646879386a38159faba570ea24b963dacfe5613cc46b8cde94b939af13a6ba3 100644 (file)
@@ -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
 /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 (file)
index 0000000..61c1741
--- /dev/null
@@ -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 (file)
index 0000000..7f482ad
--- /dev/null
@@ -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