about summary refs log tree commit diff
path: root/pkgs/development/libraries/attr
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2018-02-16 09:13:12 +0100
committerVladimír Čunát <vcunat@gmail.com>2018-02-16 09:13:12 +0100
commitb5aaaf87a7741f1c20672c584ca08a01fa1a1129 (patch)
tree8cd4b2948285c21ad71abb1258dd5d41f17fdc01 /pkgs/development/libraries/attr
parent90252481bfe233c3fe5a54f9d6d73e93f08e1e27 (diff)
parent2b851d14d9f7fa09120a407fecf3a81cea12bebe (diff)
Merge staging and PR #35021
It's the last staging commit (mostly) built on Hydra,
and a minimal fix for Darwin regression in pysqlite.
Diffstat (limited to 'pkgs/development/libraries/attr')
-rw-r--r--pkgs/development/libraries/attr/default.nix4
-rw-r--r--pkgs/development/libraries/attr/fix-headers-musl.patch54
2 files changed, 57 insertions, 1 deletions
diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix
index dd23fcb73899c..0bfeaf81a81d0 100644
--- a/pkgs/development/libraries/attr/default.nix
+++ b/pkgs/development/libraries/attr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gettext }:
+{ stdenv, fetchurl, gettext, hostPlatform }:
 
 stdenv.mkDerivation rec {
   name = "attr-2.4.47";
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
 
   installTargets = [ "install" "install-lib" "install-dev" ];
 
+  patches = if (hostPlatform.libc == "musl") then [ ./fix-headers-musl.patch ] else null;
+
   meta = with stdenv.lib; {
     homepage = "http://savannah.nongnu.org/projects/attr/";
     description = "Library and tools for manipulating extended attributes";
diff --git a/pkgs/development/libraries/attr/fix-headers-musl.patch b/pkgs/development/libraries/attr/fix-headers-musl.patch
new file mode 100644
index 0000000000000..e969f640eeeff
--- /dev/null
+++ b/pkgs/development/libraries/attr/fix-headers-musl.patch
@@ -0,0 +1,54 @@
+--- attr-2.4.47/include/xattr.h
++++ attr-2.4.47/include/xattr.h
+@@ -31,33 +31,37 @@
+ #define XATTR_REPLACE 0x2       /* set value, fail if attr does not exist */
+ 
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ extern int setxattr (const char *__path, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
++		      const void *__value, size_t __size, int __flags);
+ extern int lsetxattr (const char *__path, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
++		      const void *__value, size_t __size, int __flags);
+ extern int fsetxattr (int __filedes, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
++		      const void *__value, size_t __size, int __flags);
+ 
+ extern ssize_t getxattr (const char *__path, const char *__name,
+-				void *__value, size_t __size) __THROW;
++				void *__value, size_t __size);
+ extern ssize_t lgetxattr (const char *__path, const char *__name,
+-				void *__value, size_t __size) __THROW;
++				void *__value, size_t __size);
+ extern ssize_t fgetxattr (int __filedes, const char *__name,
+-				void *__value, size_t __size) __THROW;
++				void *__value, size_t __size);
+ 
+ extern ssize_t listxattr (const char *__path, char *__list,
+-				size_t __size) __THROW;
++				size_t __size);
+ extern ssize_t llistxattr (const char *__path, char *__list,
+-				size_t __size) __THROW;
++				size_t __size);
+ extern ssize_t flistxattr (int __filedes, char *__list,
+-				size_t __size) __THROW;
++				size_t __size);
+ 
+-extern int removexattr (const char *__path, const char *__name) __THROW;
+-extern int lremovexattr (const char *__path, const char *__name) __THROW;
+-extern int fremovexattr (int __filedes,   const char *__name) __THROW;
++extern int removexattr (const char *__path, const char *__name);
++extern int lremovexattr (const char *__path, const char *__name);
++extern int fremovexattr (int __filedes,   const char *__name);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif	/* __XATTR_H__ */