From 8a3f40a0886e63c7639beb074636595676cfb85f Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 29 Aug 2011 18:58:59 +0000 Subject: [PATCH] Get libpciaccess to compile on darwin The added patch uses the correct byte-conversion functions on Apple systems. The library compiles on darwin but is not yet tested. svn path=/nixpkgs/trunk/; revision=28881 --- .../servers/x11/xorg/libpciaccess-apple.patch | 26 +++++++++++++++++++ pkgs/servers/x11/xorg/overrides.nix | 4 +++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/servers/x11/xorg/libpciaccess-apple.patch diff --git a/pkgs/servers/x11/xorg/libpciaccess-apple.patch b/pkgs/servers/x11/xorg/libpciaccess-apple.patch new file mode 100644 index 000000000000..a005c03cbbe4 --- /dev/null +++ b/pkgs/servers/x11/xorg/libpciaccess-apple.patch @@ -0,0 +1,26 @@ +diff -Naur libpciaccess-0.12.1-orig/src/common_interface.c libpciaccess-0.12.1/src/common_interface.c +--- libpciaccess-0.12.1-orig/src/common_interface.c 2010-07-12 00:32:05.000000000 -0400 ++++ libpciaccess-0.12.1/src/common_interface.c 2011-08-29 00:48:17.000000000 -0400 +@@ -67,6 +67,22 @@ + # define HTOLE_32(x) (x) + #endif /* Solaris */ + ++#elif defined(__APPLE__) ++ ++#include ++ ++#if __BYTE_ORDER == __BIG_ENDIAN ++# define LETOH_16(x) OSSwapInt16(x) ++# define HTOLE_16(x) OSSwapInt16(x) ++# define LETOH_32(x) OSSwapInt32(x) ++# define HTOLE_32(x) OSSwapInt32(x) ++#else ++# define LETOH_16(x) (x) ++# define HTOLE_16(x) (x) ++# define LETOH_32(x) (x) ++# define HTOLE_32(x) (x) ++#endif /* darwin */ ++ + #else + + #include diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index c896062bcd77..a624d27c2af2 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -47,6 +47,10 @@ in buildNativeInputs = [ args.perl ]; }; + libpciaccess = attrs : attrs // { + patches = [ ./libpciaccess-apple.patch ]; + }; + libX11 = attrs: attrs // { preConfigure = setMalloc0ReturnsNullCrossCompiling; postInstall =