guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: chmlib: Patch for compilation on mips.


From: Andreas Enge
Subject: 01/01: gnu: chmlib: Patch for compilation on mips.
Date: Sat, 21 Feb 2015 09:17:23 +0000

andreas pushed a commit to branch master
in repository guix.

commit a34816ef6e0abc91530701afe9d112da54edd499
Author: Andreas Enge <address@hidden>
Date:   Fri Feb 20 21:53:07 2015 +0100

    gnu: chmlib: Patch for compilation on mips.
    
    * gnu/packages/patches/chmlib-inttypes.patch: New file.
    * gnu-system.am (dist_patch_DATA): Register patch.
    * gnu/packages/ebook.scm (chmlib): Apply patch.
---
 gnu-system.am                              |    3 +-
 gnu/packages/ebook.scm                     |    6 ++-
 gnu/packages/patches/chmlib-inttypes.patch |   60 ++++++++++++++++++++++++++++
 3 files changed, 66 insertions(+), 3 deletions(-)

diff --git a/gnu-system.am b/gnu-system.am
index eeadd8f..71697be 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -1,6 +1,6 @@
 # GNU Guix --- Functional package management for GNU
 # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <address@hidden>
-# Copyright © 2013, 2014 Andreas Enge <address@hidden>
+# Copyright © 2013, 2014, 2015 Andreas Enge <address@hidden>
 # Copyright © 2013, 2014, 2015 Mark H Weaver <address@hidden>
 #
 # This file is part of GNU Guix.
@@ -362,6 +362,7 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/binutils-ld-new-dtags.patch             \
   gnu/packages/patches/binutils-loongson-workaround.patch      \
   gnu/packages/patches/cdparanoia-fpic.patch                   \
+  gnu/packages/patches/chmlib-inttypes.patch                   \
   gnu/packages/patches/clucene-pkgconfig.patch                 \
   gnu/packages/patches/cmake-fix-tests.patch                   \
   gnu/packages/patches/coreutils-dummy-man.patch               \
diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index f34966c..e4d609a 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -20,7 +20,8 @@
   #:use-module ((guix licenses) #:select (lgpl2.1+))
   #:use-module (guix packages)
   #:use-module (guix download)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages))
 
 (define-public chmlib
   (package
@@ -32,7 +33,8 @@
                                  version ".tar.bz2"))
              (sha256
                (base32
-                "18zzb4x3z0d7fjh1x5439bs62dmgsi4c1pg3qyr7h5gp1i5xcj9l"))))
+                "18zzb4x3z0d7fjh1x5439bs62dmgsi4c1pg3qyr7h5gp1i5xcj9l"))
+             (patches (list (search-patch "chmlib-inttypes.patch")))))
     (build-system gnu-build-system)
     (home-page "http://www.jedrea.com/chmlib/";)
     (synopsis "Library for CHM files")
diff --git a/gnu/packages/patches/chmlib-inttypes.patch 
b/gnu/packages/patches/chmlib-inttypes.patch
new file mode 100644
index 0000000..033e808
--- /dev/null
+++ b/gnu/packages/patches/chmlib-inttypes.patch
@@ -0,0 +1,60 @@
+Taken from Debian, necessary for compilation on mips.
+
+Patch to fix integer types problem by Goswin von Brederlow
+<address@hidden> (#258444)
+--- chmlib-0.39.orig/src/chm_lib.c
++++ chmlib-0.39/src/chm_lib.c
+@@ -56,6 +56,7 @@
+ 
+ #include "lzx.h"
+ 
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #ifdef CHM_DEBUG
+@@ -149,22 +150,9 @@
+ typedef __int64                 Int64;
+ typedef unsigned __int64        UInt64;
+ 
+-/* I386, 32-bit, non-Windows */
+-/* Sparc        */
+-/* MIPS         */
+-/* PPC          */
+-#elif __i386__ || __sun || __sgi || __ppc__
+-typedef unsigned char           UChar;
+-typedef short                   Int16;
+-typedef unsigned short          UInt16;
+-typedef long                    Int32;
+-typedef unsigned long           UInt32;
+-typedef long long               Int64;
+-typedef unsigned long long      UInt64;
+-
+ /* x86-64 */
+ /* Note that these may be appropriate for other 64-bit machines. */
+-#elif __x86_64__ || __ia64__
++#elif defined(__LP64__)
+ typedef unsigned char           UChar;
+ typedef short                   Int16;
+ typedef unsigned short          UInt16;
+@@ -173,10 +161,18 @@
+ typedef long                    Int64;
+ typedef unsigned long           UInt64;
+ 
++/* I386, 32-bit, non-Windows */
++/* Sparc        */
++/* MIPS         */
++/* PPC          */
+ #else
+-
+-/* yielding an error is preferable to yielding incorrect behavior */
+-#error "Please define the sized types for your platform in chm_lib.c"
++typedef unsigned char           UChar;
++typedef short                   Int16;
++typedef unsigned short          UInt16;
++typedef long                    Int32;
++typedef unsigned long           UInt32;
++typedef long long               Int64;
++typedef unsigned long long      UInt64;
+ #endif
+ 
+ /* GCC */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]