guix-commits
[Top][All Lists]
Advanced

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

branch master updated: gnu: directfb: Fix building on armhf-linux.


From: guix-commits
Subject: branch master updated: gnu: directfb: Fix building on armhf-linux.
Date: Mon, 12 Jun 2023 11:14:09 -0400

This is an automated email from the git hooks/post-receive script.

efraim pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 3fc26c6dc4 gnu: directfb: Fix building on armhf-linux.
3fc26c6dc4 is described below

commit 3fc26c6dc4b6bbf558a17b5e3ef8092ea0eeeacd
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Mon Jun 12 18:07:07 2023 +0300

    gnu: directfb: Fix building on armhf-linux.
    
    * gnu/packages/graphics.scm (directfb)[arguments]: Add a phase when
    building for armhf-linux to apply a patch.
    [native-inputs]: Add patch, patch file.
    * gnu/packages/patches/directfb-davinci-glibc-228-compat.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/graphics.scm                          | 18 +++++++++-
 .../directfb-davinci-glibc-228-compat.patch        | 41 ++++++++++++++++++++++
 3 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index ce16d37e2b..6aabe2ba73 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1056,6 +1056,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/dezyne-add-missing-shebangs.patch       \
   %D%/packages/patches/dfu-programmer-fix-libusb.patch         \
   %D%/packages/patches/diffutils-fix-signal-processing.patch   \
+  %D%/packages/patches/directfb-davinci-glibc-228-compat.patch \
   %D%/packages/patches/dkimproxy-add-ipv6-support.patch                \
   %D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch     \
   %D%/packages/patches/docbook-xsl-support-old-url.patch       \
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 60db7543a6..bccfe89d55 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -189,13 +189,29 @@ framebuffer graphics, audio output and input event.")
            (lambda _
              (substitute* "src/core/core.c"
                (("..BUILDTIME..") ""))))
+         ;; TODO: Move patch to source.
+         ,@(if (target-arm32?)
+             `((add-after 'unpack 'patch-source
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (invoke "patch" "--force" "-p1" "-i"
+                           (assoc-ref inputs "patch-file")))))
+             '())
          (add-after 'unpack 'disable-configure-during-bootstrap
            (lambda _
              (substitute* "autogen.sh"
                (("^.*\\$srcdir/configure.*") ""))
              #t)))))
     (native-inputs
-     (list autoconf automake libtool perl pkg-config))
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ,@(if (target-arm32?)
+         `(("patch" ,patch)
+           ("patch-file"
+            ,(search-patch "directfb-davinci-glibc-228-compat.patch")))
+         '())))
     (inputs
      (list alsa-lib
            ffmpeg
diff --git a/gnu/packages/patches/directfb-davinci-glibc-228-compat.patch 
b/gnu/packages/patches/directfb-davinci-glibc-228-compat.patch
new file mode 100644
index 0000000000..eeee337f57
--- /dev/null
+++ b/gnu/packages/patches/directfb-davinci-glibc-228-compat.patch
@@ -0,0 +1,41 @@
+This patch is from upstream
+
+From 3a236241bbec3f15b012b6f0dbe94353d8094557 Mon Sep 17 00:00:00 2001
+From: Andrew Childs <lorne@cons.org.nz>
+Date: Sat, 2 May 2020 12:36:46 +0900
+Subject: [PATCH] davinci: fix build with glibc >= 2.28
+
+From glibc 2.28 release notes:
+
+* The macros 'major', 'minor', and 'makedev' are now only available from
+  the header <sys/sysmacros.h>; not from <sys/types.h> or various other
+  headers that happen to include <sys/types.h>.  These macros are rarely
+  used, not part of POSIX nor XSI, and their names frequently collide with
+  user code; see https://sourceware.org/bugzilla/show_bug.cgi?id=19239 for
+  further explanation.
+
+  <sys/sysmacros.h> is a GNU extension.  Portable programs that require
+  these macros should first include <sys/types.h>, and then include
+  <sys/sysmacros.h> if __GNU_LIBRARY__ is defined.
+
+https://lists.gnu.org/archive/html/info-gnu/2018-08/msg00000.html
+---
+ gfxdrivers/davinci/davinci_c64x.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gfxdrivers/davinci/davinci_c64x.c 
b/gfxdrivers/davinci/davinci_c64x.c
+index 431ffdd99..351250a03 100644
+--- a/gfxdrivers/davinci/davinci_c64x.c
++++ b/gfxdrivers/davinci/davinci_c64x.c
+@@ -39,6 +39,11 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ 
++// Required for `makedev` in glibc >= 2.28
++#if defined(__GNU_LIBRARY__)
++#include <sys/sysmacros.h>
++#endif
++
+ #include <directfb_util.h>
+ 
+ #include <direct/clock.h>



reply via email to

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