summaryrefslogtreecommitdiff
path: root/net/tor/options.mk
blob: 56d2dc1ce4d13a16c280d6799e99abae9ce9086e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# $NetBSD: options.mk,v 1.17 2021/02/17 22:53:52 wiz Exp $

PKG_OPTIONS_VAR=	PKG_OPTIONS.tor
PKG_SUPPORTED_OPTIONS=	doc lzma nss zstd # rust
PKG_SUGGESTED_OPTIONS+=	doc lzma zstd

.include "../../mk/bsd.options.mk"

PLIST_VARS+=		doc
PLIST_VARS+=		gencert

###
### This enables the build of manual pages. It requires asciidoc
### at build time, which comes with a tail of dependencies and
### may not be wanted under certain circumstances.
###
.if !empty(PKG_OPTIONS:Mdoc)
BUILD_DEPENDS+=		asciidoc>=8.3.3:../../textproc/asciidoc
CONFIGURE_ARGS+=	--enable-asciidoc
PLIST.doc=		yes
.else
CONFIGURE_ARGS+=	--disable-asciidoc
.endif

### This enables building tor with rust as per
### https://trac.torproject.org/projects/tor/wiki/RustInTor
### XXX:
### As of 0.4.4.6 I am not sure how this is supposed to work.
### https://gitlab.torproject.org/tpo/core/tor/-/issues/40191
#.if !empty(PKG_OPTIONS:Mrust)
#CONFIGURE_ENV+=	TOR_RUST_DEPENDENCIES=${WRKDIR}/vendor
#CONFIGURE_ARGS+=	--enable-rust
#CARGO_CRATE_DEPENDS+=	digest-0.7.2
#CARGO_CRATE_DEPENDS+=	generic-array-0.9.0
#CARGO_CRATE_DEPENDS+=	libc-0.2.39
#CARGO_CRATE_DEPENDS+=	rand-0.5.0-pre.2
#CARGO_CRATE_DEPENDS+=	rand_core-0.2.0-pre.0
#CARGO_CRATE_DEPENDS+=	typenum-1.9.0

#RUST_REQ=	1.34.0
#.include "../../lang/rust/cargo.mk"

#pre-configure:
#	cd ${WRKSRC} && ${MKDIR} -p src/rust/target/release

#.PHONY: show-tor-cargo-depends
## \todo: Maybe we should add a path option to show-cargo-depends.
#show-tor-cargo-depends:
#	${RUN}${AWK} '/^\"checksum/ { print "CARGO_CRATE_DEPENDS+=\t" $$2 "-" $$3""; next } ' ${WRKSRC}/src/rust/Cargo.lock

#.else
CONFIGURE_ARGS+=	--disable-rust
#.endif

.if !empty(PKG_OPTIONS:Mlzma)
CONFIGURE_ARGS+=	--enable-lzma
.include "../../archivers/lzmalib/buildlink3.mk"
.else
CONFIGURE_ARGS+=	--disable-lzma
.endif

.if !empty(PKG_OPTIONS:Mnss)
CONFIGURE_ARGS+=	--enable-nss
.include "../../devel/nss/buildlink3.mk"
.else
CONFIGURE_ARGS+=	--disable-nss
PLIST.gencert=		yes
.endif

.if !empty(PKG_OPTIONS:Mzstd)
CONFIGURE_ARGS+=	--enable-zstd
.include "../../archivers/zstd/buildlink3.mk"
.else
CONFIGURE_ARGS+=	--disable-zstd
.endif