blob: b6634c8ef4d56d3d1d9ea1194a5be23bef265acc (
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
|
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
COMMIT="64a2db402f5e"
MY_PN=build2-toolchain
MY_P="${MY_PN}-$(ver_cut 1-3)-a.$(ver_cut 5).$(ver_cut 7).${COMMIT}"
inherit toolchain-funcs multiprocessing
SRC_URI="https://stage.build2.org/0/$(ver_cut 1-3)-a.$(ver_cut 5)/${MY_P}.tar.xz"
KEYWORDS="~amd64 ~x86"
DESCRIPTION="cross-platform toolchain for building and packaging C++ code"
HOMEPAGE="https://build2.org"
LICENSE="MIT"
SLOT="0"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
dev-db/sqlite:3
"
DEPEND="virtual/pkgconfig
${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-0.13.0_alpha0_pre20200710-nousrlocal.patch
)
S="${WORKDIR}/${MY_P}"
b() {
local myargs=(
--jobs $(makeopts_jobs)
--verbose 3
)
export LD_LIBRARY_PATH="${S}/libbutl/libbutl:${S}/build2/libbuild2:${S}/build2/libbuild2/bash:${S}/build2/libbuild2/in:${S}/build2/libbuild2/bin:${S}/build2/libbuild2/c:${S}/build2/libbuild2/cc:${S}/build2/libbuild2/cxx:${S}/build2/libbuild2/version:${S}/libpkgconf/libpkgconf:${LD_LIBRARY_PATH}"
set -- "${S}"/build2/build2/b-boot "${@}" "${myargs[@]}"
echo "${@}"
"${@}" || die "${@} failed"
}
src_prepare() {
printf 'cxx.libs += %s\ncxx.poptions += %s\n' \
"-L${EPREFIX}/usr/$(get_libdir) $($(tc-getPKG_CONFIG) sqlite3 --libs)" \
"$($(tc-getPKG_CONFIG) sqlite3 --cflags)" >> \
libodb-sqlite/buildfile \
|| die
sed \
-e 's:libsqlite3[/]\?::' \
-i buildfile build/bootstrap.build \
|| die
if has_version dev-util/pkgconf; then
for i in build2/build2/buildfile build2/libbuild2/buildfile; do
printf 'cxx.libs += %s\ncxx.poptions += %s\n' \
"$($(tc-getPKG_CONFIG) libpkgconf --libs)" \
"$($(tc-getPKG_CONFIG) libpkgconf --cflags)" >> \
"${i}" \
|| die
done
sed \
-e 's:libpkgconf[/]\?::' \
-i buildfile build/bootstrap.build \
|| die
fi
default
}
src_configure() {
emake -C build2 -f bootstrap.gmake \
CXX=$(tc-getCXX) \
CXXFLAGS="${CXXFLAGS}" \
LDFLAGS="${LDFLAGS}"
b configure \
config.cxx="$(tc-getCXX)" \
config.cxx.coptions="${CXXFLAGS}" \
config.cxx.loptions="${LDFLAGS}" \
config.c="$(tc-getCC)" \
config.cc.coptions="${CFLAGS}" \
config.cc.loptions="${LDFLAGS}" \
config.bin.ar="$(tc-getAR)" \
config.bin.ranlib="$(tc-getRANLIB)" \
config.bin.lib=shared \
config.install.chroot="${D}" \
config.install.root="${EPREFIX}"/usr \
config.install.lib="${EPREFIX}"/usr/$(get_libdir) \
config.install.doc="${EPREFIX}"/usr/share/doc/${PF}
}
src_compile() {
b update-for-install
use test && b update-for-test
}
src_test() {
b test
}
src_install() {
b install
mkdir -p "${ED}"/usr/share/doc/${PF}/html || die
mv -f "${ED}"/usr/share/doc/${PF}/*.xhtml "${ED}"/usr/share/doc/${PF}/html || die
}
|