mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-13 06:36:37 -05:00
gnu: apr: Fix building on powerpc-linux.
* gnu/packages/apr.scm (apr): When building for powerpc-linux add a phase to apply a patch. [native-inputs]: When building for powerpc-linux add a patch. * gnu/packages/patches/apr-fix-atomics.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it.
This commit is contained in:
parent
6ccfa48d83
commit
23e2ff223c
3 changed files with 69 additions and 2 deletions
|
@ -904,6 +904,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \
|
%D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \
|
||||||
%D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \
|
%D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \
|
||||||
%D%/packages/patches/aoflagger-use-system-provided-pybind11.patch \
|
%D%/packages/patches/aoflagger-use-system-provided-pybind11.patch \
|
||||||
|
%D%/packages/patches/apr-fix-atomics.patch \
|
||||||
%D%/packages/patches/apr-skip-getservbyname-test.patch \
|
%D%/packages/patches/apr-skip-getservbyname-test.patch \
|
||||||
%D%/packages/patches/ark-skip-xar-test.patch \
|
%D%/packages/patches/ark-skip-xar-test.patch \
|
||||||
%D%/packages/patches/arpack-ng-propagate-rng-state.patch \
|
%D%/packages/patches/arpack-ng-propagate-rng-state.patch \
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
|
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
|
||||||
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
|
||||||
|
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -21,6 +22,8 @@ (define-module (gnu packages apr)
|
||||||
#:use-module ((guix licenses) #:prefix l:)
|
#:use-module ((guix licenses) #:prefix l:)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
|
#:use-module (guix gexp)
|
||||||
|
#:use-module (guix utils)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (gnu packages)
|
#:use-module (gnu packages)
|
||||||
#:use-module (gnu packages perl)
|
#:use-module (gnu packages perl)
|
||||||
|
@ -46,9 +49,23 @@ (define-public apr
|
||||||
;; Sometimes we end up with two processes concurrently trying to make
|
;; Sometimes we end up with two processes concurrently trying to make
|
||||||
;; 'libmod_test.la': <http://hydra.gnu.org/build/60266/nixlog/2/raw>.
|
;; 'libmod_test.la': <http://hydra.gnu.org/build/60266/nixlog/2/raw>.
|
||||||
;; Thus, build sequentially.
|
;; Thus, build sequentially.
|
||||||
'(#:parallel-build? #f
|
`(#:parallel-build? #f
|
||||||
#:parallel-tests? #f))
|
#:parallel-tests? #f
|
||||||
|
,@(if (target-ppc32?)
|
||||||
|
`(#:phases
|
||||||
|
(modify-phases %standard-phases
|
||||||
|
(add-after 'unpack 'patch-sources
|
||||||
|
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
||||||
|
(invoke "patch" "-p1" "--force" "--input"
|
||||||
|
(assoc-ref (or native-inputs inputs)
|
||||||
|
"atomics-patch"))))))
|
||||||
|
'())))
|
||||||
(inputs (list perl libltdl))
|
(inputs (list perl libltdl))
|
||||||
|
(native-inputs
|
||||||
|
`(,@(if (target-ppc32?)
|
||||||
|
`(("atomics-patch"
|
||||||
|
,(local-file (search-patch "apr-fix-atomics.patch"))))
|
||||||
|
'())))
|
||||||
(home-page "https://apr.apache.org/")
|
(home-page "https://apr.apache.org/")
|
||||||
(synopsis "The Apache Portable Runtime Library")
|
(synopsis "The Apache Portable Runtime Library")
|
||||||
(description
|
(description
|
||||||
|
|
49
gnu/packages/patches/apr-fix-atomics.patch
Normal file
49
gnu/packages/patches/apr-fix-atomics.patch
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
This patch is taken from Debian, using Debian version 1.7.0-8.
|
||||||
|
A new patch will be needed when apr is updated.
|
||||||
|
|
||||||
|
# quick and dirty fix for FTBFS on mipsel
|
||||||
|
# There should be a proper configure check, see
|
||||||
|
# https://bz.apache.org/bugzilla/show_bug.cgi?id=63566
|
||||||
|
Index: apr-1.7.0/include/arch/unix/apr_arch_atomic.h
|
||||||
|
===================================================================
|
||||||
|
--- apr-1.7.0.orig/include/arch/unix/apr_arch_atomic.h
|
||||||
|
+++ apr-1.7.0/include/arch/unix/apr_arch_atomic.h
|
||||||
|
@@ -26,6 +26,9 @@
|
||||||
|
/* noop */
|
||||||
|
#elif HAVE_ATOMIC_BUILTINS
|
||||||
|
# define USE_ATOMICS_BUILTINS
|
||||||
|
+# if (__INTPTR_WIDTH__ == 32) && ( defined(__MIPSEL__) || defined(__powerpc__) ) || defined(__m68k__) || defined(__sh__)
|
||||||
|
+# define NEED_ATOMICS_GENERIC64
|
||||||
|
+# endif
|
||||||
|
#elif defined(SOLARIS2) && SOLARIS2 >= 10
|
||||||
|
# define USE_ATOMICS_SOLARIS
|
||||||
|
# define NEED_ATOMICS_GENERIC64
|
||||||
|
Index: apr-1.7.0/atomic/unix/builtins64.c
|
||||||
|
===================================================================
|
||||||
|
--- apr-1.7.0.orig/atomic/unix/builtins64.c
|
||||||
|
+++ apr-1.7.0/atomic/unix/builtins64.c
|
||||||
|
@@ -16,7 +16,7 @@
|
||||||
|
|
||||||
|
#include "apr_arch_atomic.h"
|
||||||
|
|
||||||
|
-#ifdef USE_ATOMICS_BUILTINS
|
||||||
|
+#if defined(USE_ATOMICS_BUILTINS) && ! defined(NEED_ATOMICS_GENERIC64)
|
||||||
|
|
||||||
|
APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem)
|
||||||
|
{
|
||||||
|
Index: apr-1.7.0/atomic/unix/builtins.c
|
||||||
|
===================================================================
|
||||||
|
--- apr-1.7.0.orig/atomic/unix/builtins.c
|
||||||
|
+++ apr-1.7.0/atomic/unix/builtins.c
|
||||||
|
@@ -20,7 +20,11 @@
|
||||||
|
|
||||||
|
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
|
||||||
|
{
|
||||||
|
+#if defined (NEED_ATOMICS_GENERIC64)
|
||||||
|
+ return apr__atomic_generic64_init(p);
|
||||||
|
+#else
|
||||||
|
return APR_SUCCESS;
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem)
|
Loading…
Reference in a new issue