diff options
Diffstat (limited to 'sys-apps/nvme-cli')
-rw-r--r-- | sys-apps/nvme-cli/Manifest | 3 | ||||
-rw-r--r-- | sys-apps/nvme-cli/files/nvme-cli-2.9.1-musl-stdint.patch | 107 | ||||
-rw-r--r-- | sys-apps/nvme-cli/nvme-cli-2.9.1.ebuild | 4 |
3 files changed, 113 insertions, 1 deletions
diff --git a/sys-apps/nvme-cli/Manifest b/sys-apps/nvme-cli/Manifest index 875fe7bebf44..574c54e9756b 100644 --- a/sys-apps/nvme-cli/Manifest +++ b/sys-apps/nvme-cli/Manifest @@ -1,7 +1,8 @@ +AUX nvme-cli-2.9.1-musl-stdint.patch 3329 BLAKE2B aabe7e8dc991f810359cc1e626ec2ec786bbe595f833e43d4304a4a8109602b3469c2e9d0e4f7d571f7fac8b7c48818630ba8ec639949b0e84f78e746d6b3f96 SHA512 1bc88e0215686488d243a5b950d29d9e6ca2390165d5e72dc7c31e45222df6e1967b772e8bb89ad9c12fb3f43b9d08d21f64a00a28a1b79d0d768bd948c35cde DIST nvme-cli-2.7.1.gh.tar.gz 902081 BLAKE2B 7d14838f7f0fd6d1ab1cb30041f862fe2db6f40fe72c13cb4ce227831cac6e141ff5cec2924c846f30629188754b0ce0630ad9009d2a490c193da20e8b8a45d1 SHA512 6a9f3574dfd4375e6f7a76ed95f698efb26da5b72a490579caeba9d46c4811ae31650844e0a0e1047dc627158d5ffbdc020112a5059d3195e7eadff902b70b19 DIST nvme-cli-2.8.gh.tar.gz 910994 BLAKE2B c231fc087219622736bdc400c83d2a320670f247f77b53f0cad20c8117e620703badba7cd9a6f267ba79223be9c0d6710c2be968683f77fe72e45957e0c8b899 SHA512 1be0bed4e1bf8a25229f301c2b00b78d2de4eaf8ff2b815fa75e44dd35ddd7787604152bdf00696130df3281206a734c5f408c3f2127440e05c2e4b1cdbb79d4 DIST nvme-cli-2.9.1.gh.tar.gz 932210 BLAKE2B 865808c17f2098f8d0be8ba928869801023f77f0ffd44b5d2424b9f75e01180f8d1990684e3e4a79363e650a44e58abe213b5ab55328f0bde9ed699eba9a215c SHA512 c9c86e7567c2d4c59aff1eb9d18f4775923db3c81a89c628b819121c32150d4bc2d65d0dacac764c64594369890b380d0fd06bc7c1f83f4a7f3e71a51a6fee24 EBUILD nvme-cli-2.7.1.ebuild 926 BLAKE2B ffdaa6599c97b85a07f8e08e51c06d74157bfeff083c034bb93c023406689216e715537bfb8a47b289982a5ec1d83a5f273c4a903bed38207dfc43514a34c7da SHA512 48f4e66972e0594775f735e0dcc6900e009361ec03f06200e288922262f4a63e57e98cddc7bff820172f7fc9b02015dead97ec10f2479934be5dc4b61594b726 EBUILD nvme-cli-2.8.ebuild 948 BLAKE2B 6c0e31aaffb9b82a0d2173f33efcac65e2905d5a626b675e50fc48f54e4addb9a40f354d8e755628c438c4467da5865b3711e923dd4fb560bb364c0cdf7a09d6 SHA512 e16822d2851c816cb7caa2c5e2ed54ac29cd2b7ea6a5d6b82e38e3d7882524feb703359132bb434178576960130e7745e2d0d1bce1137378912770f2d1ae8806 -EBUILD nvme-cli-2.9.1.ebuild 950 BLAKE2B bbc4b0257e1e16ef4bceb4f66b9052b696c72dc2ee1a318778473f4d21f76550b485f80176367f295f89a5dbab6bf4cf0a0824eb299503b0ecf4c855674fc7e4 SHA512 ced3a356d71b62d1826885c8183ff10a43aab31981b50d5afd4081df676cb835d118e6ee8d347cc0043af7eca2c41b06b0001de91f9c7eb9f19d1b14cf5cc651 +EBUILD nvme-cli-2.9.1.ebuild 1008 BLAKE2B 8d8cdc3bd6389dbf1a2c06d9c1c00e72758fe9e3f624dbc73f1191c710a92b51b8e5a4e31a5a31497cad32d3c25e4b589ccf2886a8ce6a125bbcb3771b8f58cc SHA512 32ef09caa4cfb31caa086a4850a412ba9c512e56885a1c19e17d0e49ab3ed0aa09cc932c49f0e2a5061bed50524217b0803eac1a64c9c2e7eb84ef935d615326 MISC metadata.xml 435 BLAKE2B 6756d3cbc2fa183946f5cb5fe2e6cc3e19ffef2a63f6c5ba6cf203bbcc6eb0df68d615b8ad266dc89ce23cd06a5d843bddeae8eaf574bf45ad1c06442f50c9c5 SHA512 2b05f8e31378564378339755d80da4244524c8f261fc0fda47a1350bf5a6309b5cca68c74bad06566d6f2bf9e1cc1747b7ce2ebf783c46a9015d27fdcff44b7d diff --git a/sys-apps/nvme-cli/files/nvme-cli-2.9.1-musl-stdint.patch b/sys-apps/nvme-cli/files/nvme-cli-2.9.1-musl-stdint.patch new file mode 100644 index 000000000000..6ecdac41e3cc --- /dev/null +++ b/sys-apps/nvme-cli/files/nvme-cli-2.9.1-musl-stdint.patch @@ -0,0 +1,107 @@ +https://github.com/linux-nvme/nvme-cli/pull/2332 + +From 61bbd959bc069e4552e50a276b8a0e1487545ec2 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sat, 4 May 2024 09:13:06 +0100 +Subject: [PATCH 1/2] Use C99 types for uint32_t + +<stdint.h> provides `uint32_t`, while `u_int_32` is an unofficial/internal +typedef that glibc happens to provide. This fixes the build on musl. + +Bug: https://bugs.gentoo.org/931194 +Signed-off-by: Sam James <sam@gentoo.org> +--- a/nvme.c ++++ b/nvme.c +@@ -34,6 +34,7 @@ + #include <inttypes.h> + #include <locale.h> + #include <stdio.h> ++#include <stdint.h> + #include <stdlib.h> + #include <string.h> + #include <unistd.h> +@@ -9075,8 +9076,8 @@ static int check_dhchap_key(int argc, char **argv, struct command *command, stru + + unsigned char decoded_key[128]; + unsigned int decoded_len; +- u_int32_t crc = crc32(0L, NULL, 0); +- u_int32_t key_crc; ++ uint32_t crc = crc32(0L, NULL, 0); ++ uint32_t key_crc; + int err = 0, hmac; + struct config { + char *key; +@@ -9144,10 +9145,10 @@ static int check_dhchap_key(int argc, char **argv, struct command *command, stru + return -EINVAL; + } + crc = crc32(crc, decoded_key, decoded_len); +- key_crc = ((u_int32_t)decoded_key[decoded_len]) | +- ((u_int32_t)decoded_key[decoded_len + 1] << 8) | +- ((u_int32_t)decoded_key[decoded_len + 2] << 16) | +- ((u_int32_t)decoded_key[decoded_len + 3] << 24); ++ key_crc = ((uint32_t)decoded_key[decoded_len]) | ++ ((uint32_t)decoded_key[decoded_len + 1] << 8) | ++ ((uint32_t)decoded_key[decoded_len + 2] << 16) | ++ ((uint32_t)decoded_key[decoded_len + 3] << 24); + if (key_crc != crc) { + nvme_show_error("CRC mismatch (key %08x, crc %08x)", key_crc, crc); + return -EINVAL; +--- a/util/base64.c ++++ b/util/base64.c +@@ -20,6 +20,7 @@ + * MA 02110-1301, USA. + */ + ++#include <stdint.h> + #include <stdlib.h> + #include <string.h> + #include <errno.h> +@@ -42,7 +43,7 @@ static const char base64_table[65] = + int base64_encode(const unsigned char *src, int srclen, char *dst) + { + int i, bits = 0; +- u_int32_t ac = 0; ++ uint32_t ac = 0; + char *cp = dst; + + for (i = 0; i < srclen; i++) { +@@ -77,7 +78,7 @@ int base64_encode(const unsigned char *src, int srclen, char *dst) + */ + int base64_decode(const char *src, int srclen, unsigned char *dst) + { +- u_int32_t ac = 0; ++ uint32_t ac = 0; + int i, bits = 0; + unsigned char *bp = dst; + + +From 51208e30da0bfb12340d3a4f3afa0472312a8541 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sat, 4 May 2024 09:15:03 +0100 +Subject: [PATCH 2/2] `u_char` -> `unsigned char` + +`u_char` is not a standard name for `unsigned char` and may not work; +some implementations may provide it for convenience. + +Signed-off-by: Sam James <sam@gentoo.org> +--- a/plugins/innogrit/typedef.h ++++ b/plugins/innogrit/typedef.h +@@ -53,14 +53,14 @@ struct vsc_smart_log { + unsigned int low_pwr_cnt; + unsigned int wa; + unsigned int ps3_entry_cnt; +- u_char highest_temp[4]; ++ unsigned char highest_temp[4]; + unsigned int weight_ec; + unsigned int slc_cap_mb; + unsigned long long nand_page_write_cnt; + unsigned int program_error_cnt; + unsigned int erase_error_cnt; +- u_char flash_type; +- u_char reserved2[3]; ++ unsigned char flash_type; ++ unsigned char reserved2[3]; + unsigned int hs_crc_err_cnt; + unsigned int ddr_ecc_err_cnt; + unsigned int reserved3[44]; + diff --git a/sys-apps/nvme-cli/nvme-cli-2.9.1.ebuild b/sys-apps/nvme-cli/nvme-cli-2.9.1.ebuild index ec7eb940d65c..ead3edbdb1f6 100644 --- a/sys-apps/nvme-cli/nvme-cli-2.9.1.ebuild +++ b/sys-apps/nvme-cli/nvme-cli-2.9.1.ebuild @@ -27,6 +27,10 @@ BDEPEND=" virtual/pkgconfig " +PATCHES=( + "${FILESDIR}"/${PN}-2.9.1-musl-stdint.patch +) + src_configure() { local emesonargs=( -Dversion-tag="${PV}" |