summaryrefslogtreecommitdiff
blob: b8022d5f11a947bafb9df41c016a533dbbf7bb0d (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs multilib-minimal

DESCRIPTION="a free, pretty much fully featured and stable TrueCrypt implementation"
HOMEPAGE="https://github.com/bwalex/tc-play"
SRC_URI="https://github.com/bwalex/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="gnutls"

DEPEND="
	dev-libs/libgpg-error
	sys-fs/lvm2
	sys-apps/util-linux
	dev-libs/libgcrypt:0
	gnutls? ( net-libs/gnutls )
	!gnutls? (
		dev-libs/openssl:0=
	)"
RDEPEND="${DEPEND}"

DOCS=(
	README.md
)

PATCHES=(
	"${FILESDIR}/${P}-build.patch"
)

pkg_setup() {
	local backend="openssl"
	use gnutls && local backend="gcrypt"

	EXTRA_MAKE_FLAGS=(
		PBKDF_BACKEND="${backend}"
		WARNFLAGS=""
		CC=$(tc-getCC)
		AR=$(tc-getAR)
		PREFIX=/usr \
		LIBDIR=/usr/$(get_libdir)
	)
}

src_compile() {
	emake -f Makefile.classic \
		tcplay \
		"${EXTRA_MAKE_FLAGS[@]}"
}

src_install() {
	emake -f Makefile.classic \
		"${EXTRA_MAKE_FLAGS[@]}" \
		install_program \
		DESTDIR="${ED}"
}