Skip to content

Commit ac1d0c4

Browse files
committedMar 9, 2019
xfstests: fix build (see #53716) by applying upstream patches
1 parent 83e20a5 commit ac1d0c4

File tree

2 files changed

+110
-1
lines changed

2 files changed

+110
-1
lines changed
 

‎pkgs/tools/misc/xfstests/default.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ stdenv.mkDerivation {
2222
hardeningDisable = [ "format" ];
2323
enableParallelBuilding = true;
2424

25-
patchPhase = ''
25+
patches = [ ./xattr.patch ];
26+
27+
postPatch = ''
2628
# Patch the destination directory
2729
sed -i include/builddefs.in -e "s|^PKG_LIB_DIR\s*=.*|PKG_LIB_DIR=$out/lib/xfstests|"
2830

‎pkgs/tools/misc/xfstests/xattr.patch

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
2+
index 1bffa115..edbb3f2f 100644
3+
--- a/ltp/fsstress.c
4+
+++ b/ltp/fsstress.c
5+
@@ -10,9 +10,6 @@
6+
#include <stddef.h>
7+
#include "global.h"
8+
9+
-#ifdef HAVE_ATTR_XATTR_H
10+
-#include <attr/xattr.h>
11+
-#endif
12+
#ifdef HAVE_ATTR_ATTRIBUTES_H
13+
#include <attr/attributes.h>
14+
#endif
15+
diff --git a/src/t_immutable.c b/src/t_immutable.c
16+
index 9a4e0169..eadef78f 100644
17+
--- a/src/t_immutable.c
18+
+++ b/src/t_immutable.c
19+
@@ -23,7 +23,7 @@
20+
#include <grp.h>
21+
#include <libgen.h>
22+
#include <sys/acl.h>
23+
-#include <attr/xattr.h>
24+
+#include <sys/xattr.h>
25+
#include <linux/fs.h>
26+
#include <linux/magic.h>
27+
#include <xfs/xfs.h>
28+
diff --git a/configure.ac b/configure.ac
29+
index 57092f1c..63ea032d 100644
30+
--- a/configure.ac
31+
+++ b/configure.ac
32+
@@ -51,7 +51,6 @@ AC_PACKAGE_NEED_XFSCTL_MACRO
33+
AC_PACKAGE_NEED_XFS_HANDLE_H
34+
35+
AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE
36+
-AC_PACKAGE_NEED_ATTR_XATTR_H
37+
AC_PACKAGE_NEED_ATTRIBUTES_H
38+
AC_PACKAGE_WANT_ATTRLIST_LIBATTR
39+
AC_PACKAGE_NEED_GETXATTR_LIBATTR
40+
diff --git a/m4/package_attrdev.m4 b/m4/package_attrdev.m4
41+
index 12251ceb..9a82f241 100644
42+
--- a/m4/package_attrdev.m4
43+
+++ b/m4/package_attrdev.m4
44+
@@ -1,14 +1,3 @@
45+
-AC_DEFUN([AC_PACKAGE_NEED_ATTR_XATTR_H],
46+
- [ AC_CHECK_HEADERS([attr/xattr.h])
47+
- if test "$ac_cv_header_attr_xattr_h" != "yes"; then
48+
- echo
49+
- echo 'FATAL ERROR: attr/xattr.h does not exist.'
50+
- echo 'Install the extended attributes (attr) development package.'
51+
- echo 'Alternatively, run "make install-dev" from the attr source.'
52+
- exit 1
53+
- fi
54+
- ])
55+
-
56+
AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
57+
[ AC_CHECK_HEADERS([attr/error_context.h])
58+
if test "$ac_cv_header_attr_error_context_h" != "yes"; then
59+
@@ -37,20 +26,6 @@ AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
60+
AC_SUBST(have_attr_list)
61+
])
62+
63+
-AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR],
64+
- [ AC_CHECK_LIB(attr, getxattr,, [
65+
- echo
66+
- echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
67+
- echo 'Install the extended attributes (attr) development package.'
68+
- echo 'Alternatively, run "make install-lib" from the attr source.'
69+
- exit 1
70+
- ])
71+
- libattr="-lattr"
72+
- test -f ${libexecdir}${libdirsuffix}/libattr.la && \
73+
- libattr="${libexecdir}${libdirsuffix}/libattr.la"
74+
- AC_SUBST(libattr)
75+
- ])
76+
-
77+
AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
78+
[ AC_CHECK_LIB(attr, attr_get,, [
79+
echo
80+
diff --git a/configure.ac b/configure.ac
81+
index 63ea032d..aede4f59 100644
82+
--- a/configure.ac
83+
+++ b/configure.ac
84+
@@ -53,7 +53,7 @@ AC_PACKAGE_NEED_XFS_HANDLE_H
85+
AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE
86+
AC_PACKAGE_NEED_ATTRIBUTES_H
87+
AC_PACKAGE_WANT_ATTRLIST_LIBATTR
88+
-AC_PACKAGE_NEED_GETXATTR_LIBATTR
89+
+AC_PACKAGE_NEED_ATTRSET_LIBATTR
90+
91+
AC_PACKAGE_NEED_SYS_ACL_H
92+
AC_PACKAGE_NEED_ACL_LIBACL_H
93+
diff --git a/m4/package_attrdev.m4 b/m4/package_attrdev.m4
94+
index 9a82f241..d994cfc2 100644
95+
--- a/m4/package_attrdev.m4
96+
+++ b/m4/package_attrdev.m4
97+
@@ -26,8 +26,8 @@ AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
98+
AC_SUBST(have_attr_list)
99+
])
100+
101+
-AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
102+
- [ AC_CHECK_LIB(attr, attr_get,, [
103+
+AC_DEFUN([AC_PACKAGE_NEED_ATTRSET_LIBATTR],
104+
+ [ AC_CHECK_LIB(attr, attr_set,, [
105+
echo
106+
echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
107+
echo 'Install the extended attributes (attr) development package.'

0 commit comments

Comments
 (0)
Please sign in to comment.