guix-commits
[Top][All Lists]
Advanced

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

10/12: gnu: Add android-libutils.


From: Danny Milosavljevic
Subject: 10/12: gnu: Add android-libutils.
Date: Wed, 9 May 2018 16:34:58 -0400 (EDT)

dannym pushed a commit to branch master
in repository guix.

commit be906ad16e9bf5ab322cc2a79cf934d37a06dcc7
Author: Danny Milosavljevic <address@hidden>
Date:   Wed May 9 20:11:30 2018 +0200

    gnu: Add android-libutils.
    
    * gnu/packages/patches/libutils-add-includes.patch: New file.
    * gnu/packages/patches/libutils-remove-damaging-includes.patch: New file.
    * gnu/packages/android.scm (android-platform-system-core): Use them.
    (android-libutils): New variable.
    * gnu/local.mk: Add them.
---
 gnu/local.mk                                       |  2 ++
 gnu/packages/android.scm                           | 29 ++++++++++++++++++++++
 gnu/packages/patches/libutils-add-includes.patch   | 11 ++++++++
 .../libutils-remove-damaging-includes.patch        | 21 ++++++++++++++++
 4 files changed, 63 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 5acc9fb..789e97f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -875,6 +875,8 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/libtool-skip-tests2.patch               \
   %D%/packages/patches/libusb-0.1-disable-tests.patch          \
   %D%/packages/patches/libusb-for-axoloti.patch                        \
+  %D%/packages/patches/libutils-add-includes.patch             \
+  %D%/packages/patches/libutils-remove-damaging-includes.patch \
   %D%/packages/patches/libvdpau-va-gl-unbundle.patch           \
   %D%/packages/patches/libvorbis-CVE-2017-14632.patch          \
   %D%/packages/patches/libvorbis-CVE-2017-14633.patch          \
diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 21b0c7c..34525f1 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -102,6 +102,8 @@ use their packages mostly unmodified in our Android NDK 
build system.")
     (patches
      (search-patches "libbase-use-own-logging.patch"
                      "libbase-fix-includes.patch"
+                     "libutils-remove-damaging-includes.patch"
+                     "libutils-add-includes.patch"
                      "adb-add-libraries.patch"
                      "libziparchive-add-includes.patch"))))
 
@@ -536,6 +538,33 @@ Android core.")
 Android core.")
     (license license:asl2.0)))
 
+(define-public android-libutils
+  (package
+    (name "android-libutils")
+    (version (android-platform-version))
+    (source (android-platform-system-core version))
+    (build-system android-ndk-build-system)
+    (arguments
+     `(#:tests? #f ; TODO
+       #:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'enter-source
+           (lambda _ (chdir "libutils") #t))
+
+         (add-after 'install 'install-headers
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (copy-recursively "../include/utils" (string-append (assoc-ref 
outputs "out") "/include/utils")))))))
+    (inputs
+     `(("android-safe-iop" ,android-safe-iop)
+       ("libcutils" ,libcutils)))
+    (native-inputs
+     `(("android-bionic-uapi" ,android-bionic-uapi)))
+    (home-page "https://developer.android.com/";)
+    (synopsis "Android utility library")
+    (description "@code{android-libutils} provides utilities for Android NDK 
developers.")
+    (license license:asl2.0)))
+
 (define-public android-udev-rules
   (package
     (name "android-udev-rules")
diff --git a/gnu/packages/patches/libutils-add-includes.patch 
b/gnu/packages/patches/libutils-add-includes.patch
new file mode 100644
index 0000000..354c59b
--- /dev/null
+++ b/gnu/packages/patches/libutils-add-includes.patch
@@ -0,0 +1,11 @@
+--- a/libutils/CallStack.cpp   2018-04-25 20:13:06.348665241 +0200
++++ b/libutils/CallStack.cpp   2018-04-25 20:13:18.360510763 +0200
+@@ -17,7 +17,7 @@
+ #define LOG_TAG "CallStack"
+ 
+ #include <memory>
+-
++#include <cstdlib>
+ #include <utils/CallStack.h>
+ #include <utils/Printer.h>
+ #include <utils/Errors.h>
diff --git a/gnu/packages/patches/libutils-remove-damaging-includes.patch 
b/gnu/packages/patches/libutils-remove-damaging-includes.patch
new file mode 100644
index 0000000..7867dd3
--- /dev/null
+++ b/gnu/packages/patches/libutils-remove-damaging-includes.patch
@@ -0,0 +1,21 @@
+--- a/include/utils/StrongPointer.h    2018-04-25 18:42:34.321003602 +0200
++++ b/include/utils/StrongPointer.h    2018-04-25 18:42:42.180912201 +0200
+@@ -17,8 +17,6 @@
+ #ifndef ANDROID_STRONG_POINTER_H
+ #define ANDROID_STRONG_POINTER_H
+ 
+-#include <cutils/atomic.h>
+-
+ #include <stdint.h>
+ #include <sys/types.h>
+ #include <stdlib.h>
+--- a/libutils/Trace.cpp       2018-04-25 20:41:48.775049786 +0200
++++ b/libutils/Trace.cpp       2018-04-25 20:42:13.674744182 +0200
+@@ -21,5 +21,7 @@
+ 
+ static void traceInit()
+ {
++#if defined(__ANDROID__)
+     ::android::add_sysprop_change_callback(atrace_update_tags, 0);
++#endif
+ }



reply via email to

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