[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/04: gnu: plink: Set endian-ness on more architectures.
From: |
Efraim Flashner |
Subject: |
01/04: gnu: plink: Set endian-ness on more architectures. |
Date: |
Thu, 22 Sep 2016 19:43:26 +0000 (UTC) |
efraim pushed a commit to branch master
in repository guix.
commit 0dbb7ac2df86787cfcb7ae35915a0bfe88a500f9
Author: Efraim Flashner <address@hidden>
Date: Thu Sep 22 20:30:36 2016 +0300
gnu: plink: Set endian-ness on more architectures.
* gnu/packages/patches/plink-endian-detection.patch: New file.
* gnu/packages/bioinformatics.scm (plink)[source]: Use it.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
gnu/packages/bioinformatics.scm | 3 ++-
gnu/packages/patches/plink-endian-detection.patch | 30 +++++++++++++++++++++
3 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index a756638..d71d1c4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -745,6 +745,7 @@ dist_patch_DATA =
\
%D%/packages/patches/pinball-system-ltdl.patch \
%D%/packages/patches/pingus-sdl-libs-config.patch \
%D%/packages/patches/plink-1.07-unclobber-i.patch \
+ %D%/packages/patches/plink-endian-detection.patch \
%D%/packages/patches/plotutils-libpng-jmpbuf.patch \
%D%/packages/patches/polkit-drop-test.patch \
%D%/packages/patches/portaudio-audacity-compat.patch \
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 28d1388..7da6f55 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -4279,7 +4279,8 @@ accessed/downloaded on demand across HTTP.")
version "-src.zip"))
(sha256
(base32 "0as8gxm4pjyc8dxmm1sl873rrd7wn5qs0l29nqfnl31x8i467xaa"))
- (patches (search-patches "plink-1.07-unclobber-i.patch"))))
+ (patches (search-patches "plink-1.07-unclobber-i.patch"
+ "plink-endian-detection.patch"))))
(build-system gnu-build-system)
(arguments
'(#:tests? #f ;no "check" target
diff --git a/gnu/packages/patches/plink-endian-detection.patch
b/gnu/packages/patches/plink-endian-detection.patch
new file mode 100644
index 0000000..4d61855
--- /dev/null
+++ b/gnu/packages/patches/plink-endian-detection.patch
@@ -0,0 +1,30 @@
+This patch is borrowed from Debian's patches for plink
+
+Author: Peter Green <address@hidden>
+Puropose: Fallback to endian.h if all else fails on 64bit machines
+Closes: #528659
+Forwarded: Shaun Purcell <address@hidden>
+License: same as plink itself.
+===================================================================
+--- plink-1.06.orig/Rsrv.h 2009-05-15 03:35:29.000000000 +0100
++++ plink-1.06/Rsrv.h 2009-05-15 03:35:41.000000000 +0100
+@@ -313,7 +313,18 @@
+ #define __BIG_ENDIAN__ 1
+ #define SWAPEND 1
+ #elif ! defined Win32 /* Windows is little-endian is most cases, anywhere
else we're stuck */
+-#error "Cannot determine endianness. Make sure config.h is included or
__{BIG|LITTLE}_ENDIAN__ is defined ."
++ //try endian.h before we finally bail out
++ #include <endian.h>
++ #if __BYTE_ORDER == __LITTLE_ENDIAN
++ #warning using little endian based on information from endian.h
++ #define __LITTLE_ENDIAN__ 1
++ #elif __BYTE_ORDER == __BIG_ENDIAN
++ #warning using big endian based on information from endian.h
++ #define __BIG_ENDIAN__ 1
++ #define SWAPEND 1
++ #else
++ #error "Cannot determine endianness. Make sure config.h is included or
__{BIG|LITTLE}_ENDIAN__ is defined ."
++ #endif
+ #endif
+
+ /* FIXME: all the mess below needs more efficient implementation - the
current one is so messy to work around alignment problems on some platforms
like Sun and HP 9000 */