Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libblockdev/, sys-libs/libblockdev/files/
Date: Wed, 01 Mar 2023 23:12:14
Message-Id: 1677712319.a11e14dc7b67dc0e99e5f8fbfbe2a78872984539.marecki@gentoo
1 commit: a11e14dc7b67dc0e99e5f8fbfbe2a78872984539
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 1 23:08:19 2023 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 1 23:11:59 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a11e14dc
7
8 sys-libs/libblockdev: fix documentation building on non-bash systems
9
10 Closes: https://bugs.gentoo.org/890993
11 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
12
13 .../files/libblockdev-2.28-sh_tests.patch | 23 ++++
14 sys-libs/libblockdev/libblockdev-2.28-r1.ebuild | 136 +++++++++++++++++++++
15 2 files changed, 159 insertions(+)
16
17 diff --git a/sys-libs/libblockdev/files/libblockdev-2.28-sh_tests.patch b/sys-libs/libblockdev/files/libblockdev-2.28-sh_tests.patch
18 new file mode 100644
19 index 000000000000..2fbeaf49f233
20 --- /dev/null
21 +++ b/sys-libs/libblockdev/files/libblockdev-2.28-sh_tests.patch
22 @@ -0,0 +1,23 @@
23 +bash is fine with "test . == ." but e.g. dash fails on not having
24 +the two dots quoted as strings.
25 +
26 +--- a/docs/Makefile.am
27 ++++ b/docs/Makefile.am
28 +@@ -2,7 +2,7 @@
29 +
30 + html-doc.stamp: ${srcdir}/libblockdev-docs.xml ${srcdir}/libblockdev-sections.txt $(wildcard ${srcdir}/../src/plugins/*.[ch]) $(wildcard ${srcdir}/../src/lib/*.[ch]) $(wildcard ${srcdir}/../src/utils/*.[ch])
31 + touch ${builddir}/html-doc.stamp
32 +- test ${builddir} == ${srcdir} || cp ${srcdir}/libblockdev-sections.txt ${srcdir}/libblockdev-docs.xml ${builddir}
33 ++ test "${builddir}" == "${srcdir}" || cp ${srcdir}/libblockdev-sections.txt ${srcdir}/libblockdev-docs.xml ${builddir}
34 + gtkdoc-scan --rebuild-types --module=libblockdev --source-dir=${srcdir}/../src/plugins/ --source-dir=${srcdir}/../src/lib/ --source-dir=${srcdir}/../src/utils/
35 + gtkdoc-mkdb --module=libblockdev --output-format=xml --source-dir=${srcdir}/../src/plugins/ --source-dir=${srcdir}/../src/lib/ --source-dir=${srcdir}/../src/utils/ --source-suffixes=c,h
36 + test -d ${builddir}/html || mkdir ${builddir}/html
37 +@@ -13,7 +13,7 @@
38 + -rm -rf ${builddir}/html
39 + -rm -rf ${builddir}/xml
40 + test ! -f ${builddir}/html-doc.stamp || rm ${builddir}/html-doc.stamp
41 +- test ${builddir} == ${srcdir} || rm -f ${builddir}/libblockdev-sections.txt ${builddir}/libblockdev-docs.xml
42 ++ test "${builddir}" == "${srcdir}" || rm -f ${builddir}/libblockdev-sections.txt ${builddir}/libblockdev-docs.xml
43 +
44 + install-data-local:
45 + test -d ${DESTDIR}${datadir}/gtk-doc/html/libblockdev || mkdir -p ${DESTDIR}${datadir}/gtk-doc/html/libblockdev
46
47 diff --git a/sys-libs/libblockdev/libblockdev-2.28-r1.ebuild b/sys-libs/libblockdev/libblockdev-2.28-r1.ebuild
48 new file mode 100644
49 index 000000000000..0fa5e1d604f8
50 --- /dev/null
51 +++ b/sys-libs/libblockdev/libblockdev-2.28-r1.ebuild
52 @@ -0,0 +1,136 @@
53 +# Copyright 1999-2023 Gentoo Authors
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=8
57 +
58 +PYTHON_COMPAT=( python3_{9..11} )
59 +inherit autotools python-single-r1 xdg-utils
60 +
61 +DESCRIPTION="A library for manipulating block devices"
62 +HOMEPAGE="https://github.com/storaged-project/libblockdev"
63 +if [[ "${PV}" == *9999 ]] ; then
64 + inherit git-r3
65 + EGIT_REPO_URI="https://github.com/storaged-project/libblockdev.git"
66 + BDEPEND="
67 + sys-devel/autoconf-archive
68 + "
69 +else
70 + MY_PV="${PV}-1"
71 + SRC_URI="https://github.com/storaged-project/${PN}/releases/download/${MY_PV}/${P}.tar.gz"
72 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
73 +fi
74 +LICENSE="LGPL-2+"
75 +SLOT="0"
76 +IUSE="bcache +cryptsetup device-mapper dmraid escrow gtk-doc introspection lvm kbd test +tools vdo"
77 +# Tests require root. In a future release, we may be able to run a smaller
78 +# subset with new run_tests.py arguments.
79 +RESTRICT="!test? ( test ) test"
80 +
81 +RDEPEND="
82 + >=dev-libs/glib-2.42.2
83 + dev-libs/libbytesize
84 + >=sys-apps/kmod-19
85 + >=sys-apps/util-linux-2.27
86 + >=sys-block/parted-3.1
87 + cryptsetup? (
88 + escrow? (
89 + >=dev-libs/nss-3.18.0
90 + dev-libs/volume_key
91 + )
92 + >=sys-fs/cryptsetup-1.6.7:=
93 + )
94 + device-mapper? ( sys-fs/lvm2 )
95 + dmraid? (
96 + sys-fs/dmraid
97 + sys-fs/lvm2
98 + )
99 + lvm? (
100 + sys-fs/lvm2
101 + virtual/udev
102 + )
103 + vdo? ( dev-libs/libyaml )
104 + ${PYTHON_DEPS}
105 +"
106 +
107 +DEPEND="
108 + ${RDEPEND}
109 +"
110 +
111 +# TODO: relax libbytesize condition once it has gained py3.11 support
112 +BDEPEND+="
113 + dev-util/gtk-doc-am
114 + gtk-doc? ( dev-util/gtk-doc )
115 + introspection? ( >=dev-libs/gobject-introspection-1.3.0 )
116 + test? (
117 + $(python_gen_cond_dep '
118 + dev-libs/libbytesize[python,${PYTHON_USEDEP}]
119 + ' python3_{9..10} )
120 + sys-block/targetcli-fb
121 + )
122 +"
123 +
124 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
125 + escrow? ( cryptsetup )"
126 +
127 +PATCHES=(
128 + "${FILESDIR}"/${PN}-2.28-sh_tests.patch
129 +)
130 +
131 +pkg_setup() {
132 + python-single-r1_pkg_setup
133 +}
134 +
135 +src_prepare() {
136 + xdg_environment_reset #623992
137 + default
138 +
139 + # https://bugs.gentoo.org/744289
140 + find -type f \( -name "Makefile.am" -o -name "configure.ac" \) -print0 \
141 + | xargs --null sed "s@ -Werror@@" -i || die
142 +
143 + eautoreconf
144 +}
145 +
146 +src_configure() {
147 + local myeconfargs=(
148 + --with-btrfs
149 + --with-fs
150 + --with-part
151 + --with-python3
152 + --without-mpath
153 + --without-nvdimm
154 + --without-python2
155 + $(use_enable introspection)
156 + $(use_enable test tests)
157 + $(use_with bcache)
158 + $(use_with cryptsetup crypto)
159 + $(use_with device-mapper dm)
160 + $(use_with dmraid)
161 + $(use_with escrow)
162 + $(use_with gtk-doc)
163 + $(use_with kbd)
164 + $(use_with lvm lvm)
165 + $(use_with lvm lvm-dbus)
166 + $(use_with tools)
167 + $(use_with vdo)
168 + )
169 + econf "${myeconfargs[@]}"
170 +}
171 +
172 +src_test() {
173 + # See http://storaged.org/libblockdev/ch03.html
174 + # The 'check' target just does Pylint.
175 + # ... but it needs root.
176 + emake test
177 +}
178 +
179 +src_install() {
180 + default
181 + find "${ED}" -type f -name "*.la" -delete || die
182 + # This is installed even with USE=-lvm, but libbd_lvm are omitted so it
183 + # doesn't work at all.
184 + if ! use lvm ; then
185 + rm -f "${ED}"/usr/bin/lvm-cache-stats || die
186 + fi
187 + python_optimize #718576
188 +}