blob: 5db7f1b18f2bc5e1ef4dba59fa6f0a0ac0ed7b35 (
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..14} )
inherit autotools bash-completion-r1 dot-a python-single-r1
MY_PV_1="$(ver_cut 1-2)"
MY_PV_2="$(ver_cut 2)"
[[ $(( ${MY_PV_2} % 2 )) -eq 0 ]] && SD="stable" || SD="development"
DESCRIPTION="NBD client library in userspace"
HOMEPAGE="https://gitlab.com/nbdkit/libnbd"
SRC_URI="https://download.libguestfs.org/libnbd/${MY_PV_1}-${SD}/${P}.tar.gz"
LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~sparc ~x86"
IUSE="examples fuse gnutls go ocaml python test"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RESTRICT="!test? ( test )"
# libxml2 - URI support
RDEPEND="
dev-libs/libxml2:=
examples? ( dev-libs/glib
dev-libs/libev )
fuse? ( sys-fs/fuse:3 )
gnutls? ( net-libs/gnutls:= )
go? ( dev-lang/go )
ocaml? ( >=dev-lang/ocaml-4.03:=[ocamlopt] )
python? ( ${PYTHON_DEPS} )
"
DEPEND="
${RDEPEND}
ocaml? ( dev-ml/findlib )
test? ( sys-block/nbdkit[gnutls?]
net-libs/gnutls:=[tools]
ocaml? ( dev-ml/findlib[ocamlopt] )
)
"
BDEPEND="dev-lang/perl"
PATCHES=(
"${FILESDIR}/${PN}-1.22.2-build-Remove-automagic-compiling-of-examples.patch"
"${FILESDIR}/${PN}-1.22.2-Makefile.am-Conditionally-compile-some-SUBDIRS.patch"
)
pkg_setup() {
if use python; then
python_setup
fi
}
src_prepare() {
default
# Some tests require impossible to provide features, such as fuse.
# These are marked by requires_... in the functions.sh shell
# library. Rather than listing these tests, let's list out the
# impossible to support features and make them skip.
cat <<-EOF >> tests/functions.sh.in || die
requires_fuse ()
{
requires false
}
EOF
# Broken under sandbox.
cat <<-EOF > lib/test-fork-safe-execvpe.sh || die
#!/bin/sh
:
EOF
eautoreconf
}
src_configure() {
# /usr/lib64/ocaml/nbd/libmlnbd.a
# /usr/lib64/ocaml/stublibs/dllmlnbd.so
use ocaml && lto-guarantee-fat
local myeconfargs=(
$(use_enable examples)
$(use_enable fuse)
$(use_enable go golang)
$(use_enable ocaml)
$(use_enable python)
$(use_with gnutls)
--disable-rust
--disable-ublk # Not in portage
--with-libxml2
)
export bashcompdir="$(get_bashcompdir)"
econf "${myeconfargs[@]}"
}
src_install() {
default
use ocaml && strip-lto-bytecode
find "${ED}" -name '*.la' -delete || die
use python && python_optimize
}
|