Files
haikuports/net-vpn/tor/tor-0.4.8.12.recipe
2024-09-10 19:25:39 -04:00

147 lines
3.5 KiB
Bash

SUMMARY="A virtual layer that helps you improve privacy and anonymity"
DESCRIPTION="Tor is a network of virtual tunnels that allows people and groups to improve \
their privacy and security on the Internet. It also enables software \
developers to create new communication tools with built-in privacy features. \
Tor provides the foundation for a range of applications that allow \
organizations and individuals to share information over public networks \
without compromising their privacy.\
Note: if a file named \"~/config/settings/tor_proxy_autostart\" exists, tor will start at boot."
HOMEPAGE="https://www.torproject.org/"
COPYRIGHT="2007-2024 The Tor Project, Inc.
2004-2006 Nick Mathewson
2001-2006 Roger Dingledine"
LICENSE="Tor"
REVISION="1"
SOURCE_URI="https://dist.torproject.org/tor-$portVersion.tar.gz"
CHECKSUM_SHA256="ca7cc735d98e3747b58f2f3cc14f804dd789fa0fb333a84dcb6bd70adbb8c874"
PATCHES="
tor-$portVersion.patchset
disable_tests_that_hang.diff
"
ARCHITECTURES="all !x86_gcc2"
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="x86"
fi
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandBinDir=$prefix/bin
fi
GLOBAL_WRITABLE_FILES="
settings/tor/torrc.sample auto-merge
"
USER_SETTINGS_FILES="
settings/tor directory
"
PROVIDES="
tor$secondaryArchSuffix = $portVersion
cmd:tor
cmd:tor_gencert
cmd:tor_print_ed_signing_cert
cmd:tor_resolve
cmd:torify
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libexecinfo$secondaryArchSuffix
lib:libevent_2.1$secondaryArchSuffix
lib:liblzma$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libzstd$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libexecinfo$secondaryArchSuffix
devel:libevent_2.1$secondaryArchSuffix
devel:liblzma$secondaryArchSuffix
devel:libssl$secondaryArchSuffix >= 3
devel:libz$secondaryArchSuffix
devel:libzstd$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoreconf
cmd:automake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
TEST_REQUIRES="
cmd:perl
cmd:python3
"
defineDebugInfoPackage tor$secondaryArchSuffix \
"$commandBinDir"/tor \
"$commandBinDir"/tor-gencert \
"$commandBinDir"/tor-resolve
BUILD()
{
export CPPFLAGS="-D_BSD_SOURCE"
export LDFLAGS="-lbsd"
autoreconf -vfi
runConfigure --omit-dirs "binDir" ./configure \
--bindir="$commandBinDir" \
--disable-asciidoc \
--disable-dependency-tracking \
--disable-gcc-hardening \
--enable-lzma \
--enable-zstd
make $jobArgs
}
INSTALL()
{
make install
# Install a "tor proxy service". It will only autostart at boot if the user creates a
# "~/config/settings/tor_proxy_autostart" file.
mkdir -p $dataDir/user_launch
echo "target desktop {
service tor_proxy {
launch /bin/tor
if file_exists ~/config/settings/tor_proxy_autostart
no_safemode
legacy
initial_volumes_mounted
}
}
" > $dataDir/user_launch/tor_proxy
}
# For reference, results on hrev57937+105 64 bits:
# TOTAL: 26 - PASS: 19 - SKIP: 1 - FAIL: 6
TEST()
{
# Notes:
# See "disable_tests_that_hang.diff" on PATCHES.
#
# Also, around 19 test actually crash. So to avoid having to manually close those
# crash dialogs, you might want to configure Debugger's default action to "kill".
#
# See https://git.haiku-os.org/haiku/commit/?id=1b744548e0a31d725a147cfeadf3eeb30a4eb84c
#
# Something like the following should work:
#
# executable_actions {
# /sources/tor-*/src/test/* kill
#}
#
make $jobArgs check
}