From cfe44b4b9fdcd1f5af4a9da133e2e0e6c8e8cc93 Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 27 Apr 2022 04:23:40 +0200 Subject: [PATCH] nvme-cli: fix build on musl --- srcpkgs/nvme-cli/patches/musl.patch | 18 ++++++++++++++++++ srcpkgs/nvme-cli/template | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/nvme-cli/patches/musl.patch diff --git a/srcpkgs/nvme-cli/patches/musl.patch b/srcpkgs/nvme-cli/patches/musl.patch new file mode 100644 index 0000000000..4ebfba11d3 --- /dev/null +++ b/srcpkgs/nvme-cli/patches/musl.patch @@ -0,0 +1,18 @@ +commit ddf3610e8326d014360c9550d54a73f97b40e862 +Author: q66 +Date: Wed Apr 27 04:20:41 2022 +0200 + + fix build on musl + +diff --git a/util/base64.c b/util/base64.c +index e386c11..dad4492 100644 +--- a/util/base64.c ++++ b/util/base64.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + static const char base64_table[65] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; diff --git a/srcpkgs/nvme-cli/template b/srcpkgs/nvme-cli/template index 9b142b02de..d4e7bc8924 100644 --- a/srcpkgs/nvme-cli/template +++ b/srcpkgs/nvme-cli/template @@ -5,7 +5,7 @@ revision=1 build_style=meson configure_args="-Ddocs=man -Dudevrulesdir=lib/udev/rules.d" hostmakedepends="pkg-config" -makedepends="libnvme-devel zlib-devel json-c-devel libuuid-devel libhugetlbfs-devel" +makedepends="libnvme-devel zlib-devel json-c-devel libuuid-devel" short_desc="NVMe management command line interface" maintainer="Subhaditya Nath " license="GPL-2.0-only" @@ -14,6 +14,12 @@ distfiles="https://github.com/linux-nvme/nvme-cli/archive/v${version}.tar.gz" checksum=471869b3bf643bb357dc9613ad14d24ff342fcd97e2db5a753c81c335ad8859c conf_files="/etc/nvme/*.conf" +if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then + makedepends+=" libhugetlbfs-devel" +else + CFLAGS="-D_GNU_SOURCE" +fi + post_install() { # remove files that are systemd-only rm -rf "${DESTDIR}/usr/lib/systemd"