summaryrefslogtreecommitdiff
path: root/dev-libs/ossp-uuid/ossp-uuid-1.6.6.ebuild
blob: 7117c39dbad44a15eb508a5644d739b643cb19fa (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
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MY_P="UUID_${PV//./_}"
GENTOO_DEPEND_ON_PERL="no"
inherit autotools perl-module verify-sig

DESCRIPTION="An ISO-C:1999 API with CLI for generating DCE, ISO/IEC and RFC compliant UUID"
HOMEPAGE="https://sr.ht/~nabijaczleweli/ossp/"
SRC_URI="
	https://git.sr.ht/~nabijaczleweli/ossp-uuid/archive/${MY_P}.tar.gz
		-> ${PN}-${MY_P}.tar.gz
	verify-sig? (
		https://git.sr.ht/~nabijaczleweli/ossp-uuid/archive/${MY_P}.tar.gz.asc
			-> ${PN}-${MY_P}.tar.gz.asc
	)
"
S="${WORKDIR}/${PN}-${MY_P}"

LICENSE="ISC"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~hppa ~mips ppc ppc64 ~s390 ~sparc x86 ~x64-macos"
IUSE="+cxx perl static-libs ${GENTOO_PERL_USESTRING}"

DEPEND="
	app-crypt/libmd
	perl? (
		${GENTOO_PERL_DEPSTRING}
		dev-lang/perl:=
	)
"
RDEPEND="${DEPEND}"
BDEPEND="perl? ( dev-lang/perl )"

BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-nabijaczleweli )"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/nabijaczleweli.asc

src_prepare() {
	default

	eautoreconf
}

src_configure() {
	local myconf=(
		# collides with e2fstools libs and includes if not moved around
		--includedir="${EPREFIX}"/usr/include/ossp
		--with-dce
		--without-perl
		--with-libname=libossp-uuid
		$(use_with cxx)
		$(use_enable static-libs static)
	)
	econf "${myconf[@]}"
}

src_compile() {
	default

	if use perl; then
		cd perl || die
		# configure needs the ossp-uuid.la generated by `make` in $S
		LIBNAME=ossp-uuid perl-module_src_configure
		perl-module_src_compile
	fi
}

src_test() {
	export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${S}/.libs" # required for the perl-bindings to load the (correct) library
	default

	use perl && emake -C perl test
}

src_install() {
	default
	dodoc BINDINGS HISTORY

	if use perl ; then
		cd perl || die
		perl-module_src_install
	fi

	find "${ED}" -name '*.la' -delete || die

	mv "${ED}"/usr/share/man/man3/uuid.3{,ossp} || die
	if use cxx; then
		mv "${ED}"/usr/share/man/man3/uuid++.3{,ossp} || die
	fi
}