pkgs/fakeroot/0001-musl-build.patch

111 lines
4 KiB
Diff

From 8b754551389ec6faa44f04ba0cd785f0e6a588fd Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Sat, 6 Nov 2021 19:15:09 +0100
Subject: [PATCH 1/2] musl build
---
communicate.h | 3 ---
configure | 2 +-
doc/Makefile.in | 2 +-
faked.c | 8 ++++----
libfakeroot.c | 2 ++
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/communicate.h b/communicate.h
index a586108..e4138b7 100644
--- a/communicate.h
+++ b/communicate.h
@@ -69,9 +69,6 @@
|| (defined __UCLIBC__ && defined __UCLIBC_HAS_LFS__)
# define STAT64_SUPPORT
#else
-# ifndef __APPLE__
-# warning Not using stat64 support
-# endif
/* if glibc is 2.0 or older, undefine these again */
# undef STAT64_SUPPORT
# undef _LARGEFILE64_SOURCE
diff --git a/configure b/configure
index 75627a0..c8cba08 100755
--- a/configure
+++ b/configure
@@ -14468,7 +14468,7 @@ for SEARCH in %stat f%stat l%stat f%statat %stat64 f%stat64 l%stat64 f%statat64
FUNC=`echo $SEARCH|sed -e 's/.*%//'`
PRE=`echo $SEARCH|sed -e 's/%.*//'`
FOUND=
- for WRAPPED in __${PRE}x${FUNC} _${PRE}x${FUNC} __${PRE}${FUNC}13 ${PRE}${FUNC} __${PRE}${FUNC}; do
+ for WRAPPED in ${PRE}${FUNC} __${PRE}${FUNC}; do
for ac_func in $WRAPPED
do :
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 2934c85..6e20a9e 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -346,7 +346,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = de es fr nl pt ro sv
+SUBDIRS =
man_MANS = faked.1 fakeroot.1
#another automake bug workaround
diff --git a/faked.c b/faked.c
index ea51a23..b595a38 100644
--- a/faked.c
+++ b/faked.c
@@ -615,11 +615,11 @@ int save_database(const uint32_t remote)
#ifdef FAKEROOT_DB_PATH
if (find_path(i->buf.dev, i->buf.ino, roots, path))
- fprintf(f,"mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu %s\n",
+ fprintf(f,"mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" %s\n",
(uint64_t) i->buf.mode,(uint64_t) i->buf.uid,(uint64_t) i->buf.gid,
(uint64_t) i->buf.nlink,(uint64_t) i->buf.rdev,path);
#else
- fprintf(f,"dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
+ fprintf(f,"dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
(uint64_t) i->buf.dev,(uint64_t) i->buf.ino,(uint64_t) i->buf.mode,
(uint64_t) i->buf.uid,(uint64_t) i->buf.gid,(uint64_t) i->buf.nlink,
(uint64_t) i->buf.rdev);
@@ -645,7 +645,7 @@ int load_database(const uint32_t remote)
while(1){
#ifdef FAKEROOT_DB_PATH
- r=scanf("mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu "DB_PATH_SCAN"\n",
+ r=scanf("mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" "DB_PATH_SCAN"\n",
&stmode, &stuid, &stgid, &stnlink, &strdev, &path);
if (r != 6)
break;
@@ -660,7 +660,7 @@ int load_database(const uint32_t remote)
stdev = path_st.st_dev;
stino = path_st.st_ino;
#else
- r=scanf("dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
+ r=scanf("dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
&stdev, &stino, &stmode, &stuid, &stgid, &stnlink, &strdev);
if (r != 7)
break;
diff --git a/libfakeroot.c b/libfakeroot.c
index f821ad5..32dade8 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -86,12 +86,14 @@
#define SEND_STAT64(a,b,c) send_stat64(a,b,c)
#define SEND_GET_STAT(a,b) send_get_stat(a,b)
#define SEND_GET_STAT64(a,b) send_get_stat64(a,b)
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c)
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c)
#else
#define SEND_STAT(a,b,c) send_stat(a,b)
#define SEND_STAT64(a,b,c) send_stat64(a,b)
#define SEND_GET_STAT(a,b) send_get_stat(a)
#define SEND_GET_STAT64(a,b) send_get_stat64(a)
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b)
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
#endif
--
2.43.0