aboutsummaryrefslogblamecommitdiffstats
path: root/community/libtorrent-rasterbar/APKBUILD
blob: a63b86ee47997bf5eaeac3d1efd5f0fca212c600 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                 
                                       
                            
            
        
                                                        
                                                   
          
                      
                                     
                                                                                 
                                            
                                                                                                            
 








                                 
         
                                         
                                 
                                               

                                             
                                                                      

                                      
                           
 

         

                                                      
                                                                             

                                                                                   
 


                                                          


                                                     
               
                                                                                         
 
                                                                                       

 
           
                                             




                   
                             

 
        
                                            
 
                              

 
            
                                                                                                                                                                   
 
# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=libtorrent-rasterbar
pkgver=2.0.8
pkgrel=1
pkgdesc="Feature complete C++ bittorrent implementation"
url="https://www.rasterbar.com/products/libtorrent"
arch="all"
license="BSD-3-Clause"
depends_dev="boost-dev openssl-dev>3"
makedepends="$depends_dev cmake linux-headers python3-dev py3-setuptools samurai"
subpackages="py3-$pkgname:_py3 $pkgname-dev"
source="https://github.com/arvidn/libtorrent/releases/download/v$pkgver/libtorrent-rasterbar-$pkgver.tar.gz"

case "$CARCH" in
arm*|x86)
	# fail to build on 32-bit
	options="$options !check"
	;;
*)
	;;
esac

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_CXX_STANDARD=17 \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-Dbuild_tests="$(want_check && echo ON || echo OFF)" \
		-Dpython-bindings=ON \
		-Dpython-egg-info=ON
	cmake --build build
}

check() {
	# upnp: relies on upnp networking setup
	# flags: fails randomly, on 32-bit and aarch64
	# remove_torrent: random failures when running multiple tests at once
	# privacy: flaky on port allocation
	local tests_to_skip="test_upnp|test_flags|test_remove_torrent|test_privacy"

	# broken
	tests_to_skip="$tests_to_skip|test_create_torrent"

	# fails on btrfs?
	tests_to_skip="$tests_to_skip|test_copy_file"

	# flaky
	tests_to_skip="$tests_to_skip|test_web_seed|test_url_seed|test_transfer|test_ssl"

	ctest -j2 --output-on-failure --test-dir build --exclude-regex "$tests_to_skip"
}

package() {
	DESTDIR=$pkgdir cmake --install build
}

dev() {
	default_dev

	amove usr/share/cmake
}

_py3() {
	pkgdesc="$pkgdesc (python bindings)"

	amove usr/lib/python3*
}

sha512sums="
697988feae149876745097bedfbfb4cceae00ffe1cd4ba2063dcb93a8eee9e99344f772b8364e3df1986a50105e386e56b75fe362707d58ba3272139d9beb98f  libtorrent-rasterbar-2.0.8.tar.gz
"