forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys-libs/libnvme: add ubsan fixes patch
See: linux-nvme/libnvme#732 Bug: https://bugs.gentoo.org/908793 Signed-off-by: Matoro Mahri <[email protected]> Closes: gentoo#34304 Signed-off-by: Sam James <[email protected]>
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Copyright 1999-2023 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
PYTHON_COMPAT=( python3_{10..12} ) | ||
inherit python-r1 meson | ||
|
||
DESCRIPTION="C Library for NVM Express on Linux" | ||
HOMEPAGE="https://github.com/linux-nvme/libnvme" | ||
SRC_URI="https://github.com/linux-nvme/libnvme/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz | ||
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-ubsan.patch.xz" | ||
|
||
LICENSE="LGPL-2.1+" | ||
SLOT="0/1" | ||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86" | ||
IUSE="dbus +json keyutils python ssl test +uuid" | ||
RESTRICT="!test? ( test )" | ||
|
||
REQUIRED_USE=" | ||
python? ( ${PYTHON_REQUIRED_USE} ) | ||
" | ||
|
||
DEPEND=" | ||
json? ( dev-libs/json-c:= ) | ||
keyutils? ( sys-apps/keyutils:= ) | ||
dbus? ( sys-apps/dbus:= ) | ||
python? ( ${PYTHON_DEPS} ) | ||
ssl? ( >=dev-libs/openssl-1.1:= ) | ||
uuid? ( sys-apps/util-linux:= ) | ||
" | ||
RDEPEND=" | ||
${DEPEND} | ||
" | ||
BDEPEND=" | ||
dev-lang/swig | ||
" | ||
|
||
PATCHES=( | ||
"${FILESDIR}"/${PN}-1.6-musl.patch | ||
"${FILESDIR}"/${P}-lld-17.patch | ||
"${WORKDIR}"/${P}-ubsan.patch | ||
) | ||
|
||
src_configure() { | ||
local emesonargs=( | ||
-Dpython=false | ||
$(meson_use test tests) | ||
$(meson_feature json json-c) | ||
$(meson_feature dbus libdbus) | ||
$(meson_feature keyutils) | ||
$(meson_feature ssl openssl) | ||
$(meson_feature python) | ||
) | ||
meson_src_configure | ||
} | ||
|
||
python_compile() { | ||
local emesonargs=( | ||
-Dpython=enabled | ||
) | ||
meson_src_configure --reconfigure | ||
meson_src_compile | ||
} | ||
|
||
src_compile() { | ||
meson_src_compile | ||
|
||
if use python; then | ||
python_copy_sources | ||
python_foreach_impl python_compile | ||
fi | ||
} | ||
|
||
python_install() { | ||
meson_src_install | ||
use python && python_optimize | ||
} | ||
|
||
src_install() { | ||
use python && python_foreach_impl python_install | ||
|
||
meson_src_install | ||
} |