nfs-utils: use upstream patch to fix i686 build

This commit is contained in:
Nikolay Amiantov 2019-06-06 21:20:12 +03:00
parent 9d11c30cf9
commit 63ac0fa94d
2 changed files with 6 additions and 102 deletions

View File

@ -48,7 +48,12 @@ stdenv.mkDerivation rec {
++ lib.optional (stdenv ? glibc) "--with-rpcgen=${stdenv.glibc.bin}/bin/rpcgen";
patches = [
./nfsdcld-sqlite-format.patch
# Fixes build on i686.
(fetchpatch {
name = "sqlite.c-Use-PRIx64-macro-to-print-64-bit-integers.patch";
url = "http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commitdiff_plain;h=a8133e1fd174267536cd459e19cfe0a1cbbe037c;hp=a709f25c1da4a2fb44a1f3fd060298fbbd88aa3c";
sha256 = "03azkw13xhp8f49777p08xziy0d7crz65qrisjbkzjnx1wczdqy5";
})
] ++ lib.optionals stdenv.hostPlatform.isMusl [
(fetchpatch {
url = "https://raw.githubusercontent.com/alpinelinux/aports/cb880042d48d77af412d4688f24b8310ae44f55f/main/nfs-utils/0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch";

View File

@ -1,101 +0,0 @@
diff -ru3 nfs-utils-2.3.4-old/utils/nfsdcld/sqlite.c nfs-utils-2.3.4-new/utils/nfsdcld/sqlite.c
--- nfs-utils-2.3.4-old/utils/nfsdcld/sqlite.c 2019-05-10 22:09:49.000000000 +0300
+++ nfs-utils-2.3.4-new/utils/nfsdcld/sqlite.c 2019-06-06 15:57:54.384549915 +0300
@@ -57,6 +57,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
+#include <inttypes.h>
#include <sqlite3.h>
#include <linux/limits.h>
@@ -535,7 +536,7 @@
xlog(L_ERROR, "Unable to begin transaction: %s", err);
goto rollback;
}
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016" PRIx64 "\";",
current_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -550,7 +551,7 @@
xlog(L_ERROR, "Unable to clear records from current epoch: %s", err);
goto rollback;
}
- ret = snprintf(buf, sizeof(buf), "INSERT INTO \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "INSERT INTO \"rec-%016" PRIx64 "\" "
"SELECT id FROM attached.clients;",
current_epoch);
if (ret < 0) {
@@ -703,7 +704,7 @@
int ret;
sqlite3_stmt *stmt = NULL;
- ret = snprintf(buf, sizeof(buf), "INSERT OR REPLACE INTO \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "INSERT OR REPLACE INTO \"rec-%016" PRIx64 "\" "
"VALUES (?);", current_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -748,7 +749,7 @@
int ret;
sqlite3_stmt *stmt = NULL;
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016" PRIx64 "\" "
"WHERE id==?;", current_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -798,7 +799,7 @@
int ret;
sqlite3_stmt *stmt = NULL;
- ret = snprintf(buf, sizeof(buf), "SELECT count(*) FROM \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "SELECT count(*) FROM \"rec-%016" PRIx64 "\" "
"WHERE id==?;", recovery_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -873,7 +874,7 @@
tcur++;
ret = snprintf(buf, sizeof(buf), "UPDATE grace "
- "SET current = %ld, recovery = %ld;",
+ "SET current = %" PRId64 ", recovery = %" PRId64 ";",
(int64_t)tcur, (int64_t)trec);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -891,7 +892,7 @@
goto rollback;
}
- ret = snprintf(buf, sizeof(buf), "CREATE TABLE \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "CREATE TABLE \"rec-%016" PRIx64 "\" "
"(id BLOB PRIMARY KEY);",
tcur);
if (ret < 0) {
@@ -915,7 +916,7 @@
* values in the grace table, just clear out the records for
* the current reboot epoch.
*/
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016" PRIx64 "\";",
tcur);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -976,7 +977,7 @@
goto rollback;
}
- ret = snprintf(buf, sizeof(buf), "DROP TABLE \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "DROP TABLE \"rec-%016" PRIx64 "\";",
recovery_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -1027,7 +1028,7 @@
return -EINVAL;
}
- ret = snprintf(buf, sizeof(buf), "SELECT * FROM \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "SELECT * FROM \"rec-%016" PRIx64 "\";",
recovery_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");