gnu: Add go-github-com-emirpasic-gods-containers.
[jackhill/guix/guix.git] / gnu / packages / android.scm
index 68bcb72..544a65d 100644 (file)
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012 Stefan Handschuh <handschuh.stefan@googlemail.com>
 ;;; Copyright © 2015 Kai-Chung Yan <seamlikok@gmail.com>
-;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -65,7 +65,7 @@
      (origin
       (method git-fetch)
       (uri (git-reference
-            (url "https://github.com/daym/android-make-stub.git")
+            (url "https://github.com/daym/android-make-stub")
             (commit (string-append "v" version))))
       (file-name (string-append "android-make-stub-"
                                 version "-checkout"))
@@ -99,7 +99,7 @@ use their packages mostly unmodified in our Android NDK build system.")
      (origin
        (method git-fetch)
        (uri (git-reference
-              (url "https://github.com/google/googletest.git")
+              (url "https://github.com/google/googletest")
               (commit (string-append "release-" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -126,9 +126,9 @@ use their packages mostly unmodified in our Android NDK build system.")
 ;; Big thanks to them for laying the groundwork.
 
 ;; The version tag is consistent between all repositories.
-(define (android-platform-version) "7.1.2_r36")
+(define-public (android-platform-version) "7.1.2_r36")
 
-(define (android-platform-system-core version)
+(define-public (android-platform-system-core version)
   (origin
     (method git-fetch)
     (uri (git-reference
@@ -185,7 +185,7 @@ use their packages mostly unmodified in our Android NDK build system.")
      (base32
       checksum))))
 
-(define android-liblog
+(define-public android-liblog
   (package
     (name "android-liblog")
     (version (android-platform-version))
@@ -229,7 +229,7 @@ in Main, System, Radio and Events sub-logs.")
 various Android core host applications.")
     (license license:asl2.0)))
 
-(define android-libcutils
+(define-public android-libcutils
   (package
     (name "android-libcutils")
     (version (android-platform-version))
@@ -611,9 +611,20 @@ file system.")
        #:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
        #:phases
        (modify-phases %standard-phases
+         (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Hide the default GCC from CPLUS_INCLUDE_PATH to prevent it from
+             ;; shadowing the version of GCC provided in native-inputs.
+             (let ((gcc (assoc-ref inputs "gcc")))
+               (setenv "CPLUS_INCLUDE_PATH"
+                       (string-join
+                        (delete (string-append gcc "/include/c++")
+                                (string-split (getenv "CPLUS_INCLUDE_PATH")
+                                              #\:))
+                        ":"))
+               #t)))
          (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")))))))
@@ -623,7 +634,7 @@ file system.")
     (native-inputs
      `(("android-bionic-uapi" ,android-bionic-uapi)
        ("android-liblog" ,android-liblog)
-       ("gcc" ,gcc-5))) ; XXX: fails to build with GCC 7
+       ("gcc@5" ,gcc-5))) ; XXX: fails to build with GCC 7
     (home-page "https://developer.android.com/")
     (synopsis "Android utility library")
     (description "@code{android-libutils} provides utilities for Android NDK developers.")