From 5b2a9e6295a5c2dde37289497ac508778fdf86f1 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Sat, 11 Dec 2021 15:53:57 +0900 Subject: [PATCH] new package: libtorrent-rasterbar --- packages/libtorrent-rasterbar/build.sh | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 packages/libtorrent-rasterbar/build.sh diff --git a/packages/libtorrent-rasterbar/build.sh b/packages/libtorrent-rasterbar/build.sh new file mode 100644 index 000000000..836e8b2aa --- /dev/null +++ b/packages/libtorrent-rasterbar/build.sh @@ -0,0 +1,44 @@ +TERMUX_PKG_HOMEPAGE=https://libtorrent.org/ +TERMUX_PKG_DESCRIPTION="A feature complete C++ bittorrent implementation focusing on efficiency and scalability" +TERMUX_PKG_LICENSE="BSD 3-Clause" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=2.0.5 +TERMUX_PKG_SRCURL=https://github.com/arvidn/libtorrent/releases/download/v${TERMUX_PKG_VERSION}/libtorrent-rasterbar-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=e965c2e53170c61c0db3a2d898a61769cb7acd541bbf157cbbef97a185930ea5 +TERMUX_PKG_DEPENDS="boost, openssl, python" + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dboost-python-module-name=python +-Dpython-bindings=ON +" + +termux_step_pre_configure() { + _PYTHON_VERSION=$(. $TERMUX_SCRIPTDIR/packages/python/build.sh; echo $_MAJOR_VERSION) + LDFLAGS+=" -lpython${_PYTHON_VERSION}" +} + +termux_step_create_debscripts() { + local pyext_orig="$TERMUX_PREFIX/lib/python${_PYTHON_VERSION%.*}/dist-packages/libtorrent.so" + local pyext_symlink="$TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages/libtorrent.so" + + echo "#!$TERMUX_PREFIX/bin/sh" > postinst + echo "pyext_orig=\"$pyext_orig\"" >> postinst + echo "pyext_symlink=\"$pyext_symlink\"" >> postinst + echo "mkdir -p \"\$(dirname \"\$pyext_symlink\")\"" >> postinst + echo "if [ ! -e \"\$pyext_symlink\" ]; then" >> postinst + echo " ln -sf \"\$pyext_orig\" \"\$pyext_symlink\"" >> postinst + echo "fi" >> postinst + echo "exit 0" >> postinst + chmod 0755 postinst + + echo "#!$TERMUX_PREFIX/bin/sh" > prerm + echo "pyext_orig=\"$pyext_orig\"" >> prerm + echo "pyext_symlink=\"$pyext_symlink\"" >> prerm + echo "if [ -L \"\$pyext_symlink\" ]; then" >> prerm + echo " if [ \"\$(readlink \"\$pyext_symlink\")\" == \"\$pyext_orig\" ]; then" >> prerm + echo " rm -f \"\$pyext_symlink\"" >> prerm + echo " fi" >> prerm + echo "fi" >> prerm + echo "exit 0" >> prerm + chmod 0755 prerm +}