libdevil: Update endianness handling patch

The patch no longer applied but MacPorts includes it for libdevil 1.7.8
so it seems valuable. Though __ORDER_BIG_ENDIAN__ and __BYTE_ORDER__ are
apparently not the right way to check for endiannes on MSVC,
https://reviews.llvm.org/D109108, which means this might break things
for Windows.

Since Windows is not yet supported in NixPkgs and MacPorts deems the
patch relevant for macOS, I've updated it to apply to the newer header.

toonn f353aa41 02c395d4

+36 -28
+35
pkgs/development/libraries/libdevil/0001-il_endian.h-Fix-endian-handling.patch
··· 1 + From 85ca659a59ae5be6fc0824b0684967ec94727e2a Mon Sep 17 00:00:00 2001 2 + From: toonn <toonn@toonn.io> 3 + Date: Wed, 12 Jun 2024 11:39:35 +0000 4 + Subject: [PATCH] il_endian.h: Fix endian handling 5 + 6 + Based on https://sourceforge.net/p/resil/tickets/8/, which has also been 7 + incorporated in the MacPort for libdevil 1.7.8, 8 + https://trac.macports.org/export/154482/trunk/dports/devel/libdevil/files/patch-src-IL-include-il_endian.h.diff, 9 + but updated for the header included in release 1.8.0 of libdevil. 10 + --- 11 + src-IL/include/il_endian.h | 6 +++++- 12 + 1 file changed, 5 insertions(+), 1 deletion(-) 13 + 14 + diff --git a/src-IL/include/il_endian.h b/src-IL/include/il_endian.h 15 + index c4e6d86..a3cd57f 100644 16 + --- a/src-IL/include/il_endian.h 17 + +++ b/src-IL/include/il_endian.h 18 + @@ -23,9 +23,13 @@ extern "C" { 19 + #ifndef __BIG_ENDIAN__ 20 + #define __BIG_ENDIAN__ 1 21 + #endif 22 + +#else 23 + +#ifndef __LITTLE_ENDIAN__ 24 + +#define __LITTLE_ENDIAN__ 1 25 + +#endif 26 + #endif 27 + 28 + -#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __BIG_ENDIAN__) \ 29 + +#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \ 30 + || (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) 31 + #undef __LITTLE_ENDIAN__ 32 + #define Short(s) iSwapShort(s) 33 + -- 34 + 2.44.0 35 +
+1 -1
pkgs/development/libraries/libdevil/default.nix
··· 45 45 ''; 46 46 47 47 patches = [ 48 - ./il_endian.h.patch 48 + ./0001-il_endian.h-Fix-endian-handling.patch 49 49 ]; 50 50 51 51 enableParallelBuilding = true;
-27
pkgs/development/libraries/libdevil/il_endian.h.patch
··· 1 - Source: http://sourceforge.net/p/resil/tickets/8/ 2 - --- devil-1.7.8.orig/src-IL/include/il_endian.h.orig 2009-03-08 01:10:08.000000000 -0600 3 - +++ devil-1.7.8/src-IL/include/il_endian.h 2013-11-03 01:52:37.000000000 -0600 4 - @@ -19,9 +19,13 @@ 5 - #ifndef __BIG_ENDIAN__ 6 - #define __BIG_ENDIAN__ 1 7 - #endif 8 - +#else 9 - + #ifndef __LITTLE_ENDIAN__ 10 - + #define __LITTLE_ENDIAN__ 1 11 - + #endif 12 - #endif 13 - 14 - -#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __BIG_ENDIAN__) \ 15 - +#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \ 16 - || (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) 17 - #undef __LITTLE_ENDIAN__ 18 - #define Short(s) iSwapShort(s) 19 - @@ -39,8 +43,6 @@ 20 - #define BigDouble(d) 21 - #else 22 - #undef __BIG_ENDIAN__ 23 - - #undef __LITTLE_ENDIAN__ // Not sure if it's defined by any compiler... 24 - - #define __LITTLE_ENDIAN__ 25 - #define Short(s) 26 - #define UShort(s) 27 - #define Int(i)