Discussion:
11/12: gnu: android-make-stub: Update to 0.4.
Danny Milosavljevic
2018-05-09 20:34:58 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit 8bbf99ae25b5f45fe6d327fd4b0b3a809f61f112
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Wed May 9 21:43:32 2018 +0200

gnu: android-make-stub: Update to 0.4.

* gnu/packages/android.scm (android-make-stub): Update to 0.4.
---
gnu/packages/android.scm | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 34525f1..2da0a24 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -44,22 +44,20 @@
#:use-module (gnu packages linux))

(define-public android-make-stub
- (let ((commit "v0.1")
- (revision "21"))
(package
(name "android-make-stub")
- (version "0.1")
+ (version "0.4")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/daym/android-make-stub.git")
- (commit commit)))
+ (commit (string-append "v" version))))
(file-name (string-append "android-make-stub-"
version "-checkout"))
(sha256
(base32
- "1ni4szpcx2clf3lpzrybabwk7bgvsl6ynng7xxfc49y4jkdkk4sh"))))
+ "069bcldva63qbda7c8j6kyf9z28qnygszqfkgzq48hmkfmjrhbqg"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; None exist.
@@ -77,7 +75,7 @@
(description "@code{android-make-stub} provides stubs for the
@command{make} system of the Android platform. This allows us to
use their packages mostly unmodified in our Android NDK build system.")
- (license license:asl2.0))))
+ (license license:asl2.0)))

;; The Makefiles that we add are largely based on the Debian
;; packages. They are licensed under GPL-2 and have copyright:
Danny Milosavljevic
2018-05-09 20:34:57 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit c87ca40f9bff8b852018b884e1fed963a6643b57
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Wed May 9 19:58:51 2018 +0200

gnu: Add android-libselinux.

* gnu/packages/android.scm (android-libselinux): New variable.
---
gnu/packages/android.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index c3174ba..1acc7d4 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -35,7 +35,9 @@
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages gnupg)
+ #:use-module (gnu packages pcre)
#:use-module (gnu packages python)
+ #:use-module (gnu packages selinux)
#:use-module (gnu packages ssh)
#:use-module (gnu packages version-control)
#:use-module (gnu packages tls)
@@ -398,6 +400,48 @@ that is safe to use for user space. It also includes
@code{system_properties.h} and @code{_system_properties.h}.")
(license license:asl2.0)))

+(define-public android-libselinux
+ (package
+ (name "android-libselinux")
+ (version (android-platform-version))
+ (source
+ (android-platform-external version "libselinux"
+ "13m2q32gzdcs5d0zj1nwasjy1j8vsxsgbjg7m5sa9lfcjaj7nkm7"))
+ (build-system android-ndk-build-system)
+ (arguments
+ ;; See logd/Android.mk for the *_LOG_TAG values.
+ `(#:make-flags (list (string-append "CFLAGS=-Wno-error "
+ "-I core/include "
+ "-I core/libpackagelistparser/include "
+ "-DAUDITD_LOG_TAG=1003 "
+ "-DLOGD_LOG_TAG=1004 -D_GNU_SOURCE")
+ "LDFLAGS=-L . -lpcre")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'unpack-core
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p "core")
+ (with-directory-excursion "core"
+ (invoke "tar" "axf" (assoc-ref inputs "core") "--strip-components=1"))
+ #t))
+ (add-after 'unpack-core 'patch-HOST
+ (lambda _
+ ;; gettid duplicates otherwise.
+ (substitute* "src/procattr.c"
+ (("#ifdef HOST") "#ifdef XXX"))
+ #t)))))
+ (inputs
+ `(("openssl" ,openssl)))
+ (native-inputs
+ `(("android-bionic-uapi" ,android-bionic-uapi)
+ ("core" ,(android-platform-system-core version))))
+ (propagated-inputs
+ `(("pcre" ,pcre)))
+ (home-page "https://developer.android.com/")
+ (synopsis (package-synopsis libselinux))
+ (description (package-description libselinux))
+ (license (package-license libselinux))))
+
(define-public android-udev-rules
(package
(name "android-udev-rules")
Danny Milosavljevic
2018-05-09 20:34:58 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit 055e6fb3eb12b863ce6176f682fee62a36387b24
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Wed May 9 20:04:33 2018 +0200

gnu: Add android-f2fs-utils.

* gnu/packages/android.scm (android-f2fs-utils): New variable.
---
gnu/packages/android.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 6e44369..21b0c7c 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -507,6 +507,35 @@ that is safe to use for user space. It also includes
Android core.")
(license license:asl2.0)))

+(define-public android-f2fs-utils
+ (package
+ (name "android-f2fs-utils")
+ (version (android-platform-version))
+ (source (android-platform-system-extras version))
+ (build-system android-ndk-build-system)
+ (arguments
+ `(#:tests? #f ; TODO.
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'enter-source
+ (lambda _ (chdir "f2fs_utils") #t))
+ (add-after 'install 'install-headers
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (copy-recursively "." (string-append (assoc-ref outputs "out")
+ "/include"))
+ #t)))))
+ (inputs
+ `(("f2fs-tools" ,f2fs-tools-1.7)
+ ("android-libselinux" ,android-libselinux)
+ ("android-libsparse" ,android-libsparse)
+ ("libcutils" ,libcutils)
+ ("zlib" ,zlib)))
+ (home-page "https://developer.android.com/")
+ (synopsis "Android ext4 utils")
+ (description "@code{android-ext4-utils} is a library in common use by the
+Android core.")
+ (license license:asl2.0)))
+
(define-public android-udev-rules
(package
(name "android-udev-rules")
Danny Milosavljevic
2018-05-09 20:34:57 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit cc39d592d92102091c8d73ce6e6e63fde5e9e030
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Thu Apr 26 02:45:10 2018 +0200

gnu: Add android-bionic-uapi.

* gnu/packages/android.scm (android-bionic-uapi): New variable.
---
gnu/packages/android.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 7eb683c..17c9de7 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -103,6 +103,18 @@ use their packages mostly unmodified in our Android NDK build system.")
"adb-add-libraries.patch"
"libziparchive-add-includes.patch"))))

+(define (android-platform-bionic version)
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://android.googlesource.com/platform/bionic")
+ (commit (string-append "android-" version))))
+ (file-name (string-append "android-platform-bionic-"
+ version "-checkout"))
+ (sha256
+ (base32
+ "0n9wkz3ynqw39if1ss9n32m66iga14nndf29hpm7g1aqn4wvvgzk"))))
+
(define (android-platform-external version subdirectory checksum)
(origin
(method git-fetch)
@@ -352,6 +364,37 @@ performing and checking safe integer operations. Ensure that integer
operations do not result in silent overflow.")
(license license:bsd-2)))

+(define-public android-bionic-uapi
+ (package
+ (name "android-bionic-uapi")
+ (version (android-platform-version))
+ (source (android-platform-bionic version))
+ (build-system android-ndk-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'enter-source
+ (lambda _ (chdir "libc") #t))
+ (replace 'check
+ (const #t))
+ (replace 'build
+ (const #t))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (out-sys (string-append out "/include/sys")))
+ (mkdir-p out-sys)
+ (install-file "include/sys/system_properties.h" out-sys)
+ (install-file "include/sys/_system_properties.h" out-sys)
+ (copy-recursively "kernel/uapi" (string-append out "/include"))
+ #t))))))
+ (home-page "https://developer.android.com/")
+ (synopsis "Android Linux API that is safe for user space")
+ (description "@code{android-bionic-uapi} provides the part of the Linux API
+that is safe to use for user space. It also includes
+@code{system_properties.h} and @code{_system_properties.h}.")
+ (license license:asl2.0)))
+
(define-public android-udev-rules
(package
(name "android-udev-rules")
Danny Milosavljevic
2018-05-09 20:34:56 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit 16c2be0b42c68371802b12b9687d7d720751c64d
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Thu Apr 26 02:23:29 2018 +0200

gnu: Add android-libziparchive.

* gnu/packages/android.scm (android-libziparchive): New variable.
* gnu/packages/patches/libziparchive-add-includes.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/android.scm | 32 +++++++++++++++++++++-
.../patches/libziparchive-add-includes.patch | 10 +++++++
3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 0e1d686..5acc9fb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -805,6 +805,7 @@ dist_patch_DATA = \
%D%/packages/patches/jq-CVE-2015-8863.patch \
%D%/packages/patches/kdbusaddons-kinit-file-name.patch \
%D%/packages/patches/khmer-use-libraries.patch \
+ %D%/packages/patches/libziparchive-add-includes.patch \
%D%/packages/patches/kiki-level-selection-crash.patch \
%D%/packages/patches/kiki-makefile.patch \
%D%/packages/patches/kiki-missing-includes.patch \
diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index ec32a5c..ea225fa 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -33,6 +33,7 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages check)
+ #:use-module (gnu packages compression)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages python)
#:use-module (gnu packages ssh)
@@ -99,7 +100,8 @@ use their packages mostly unmodified in our Android NDK build system.")
(patches
(search-patches "libbase-use-own-logging.patch"
"libbase-fix-includes.patch"
- "adb-add-libraries.patch"))))
+ "adb-add-libraries.patch"
+ "libziparchive-add-includes.patch"))))

(define liblog
(package
@@ -193,6 +195,34 @@ various Android core host applications.")
various Android core host applications.")
(license license:asl2.0)))

+(define-public android-libziparchive
+ (package
+ (name "android-libziparchive")
+ (version (android-platform-version))
+ (source (android-platform-system-core version))
+ (build-system android-ndk-build-system)
+ (arguments
+ `(#:tests? #f ; TODO.
+ #:make-flags '("CFLAGS=-Wno-error"
+ "CXXFLAGS=-fpermissive -Wno-error -std=gnu++11")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'enter-source
+ (lambda _ (chdir "libziparchive") #t))
+ (add-after 'install 'install-headers
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (copy-recursively "../include/ziparchive"
+ (string-append out "/include/ziparchive"))
+ #t))))))
+ (inputs
+ `(("zlib" ,zlib)))
+ (home-page "https://developer.android.com/")
+ (synopsis "Android platform ZIP library")
+ (description "@code{android-libziparchive} is a library in common use by the
+various Android core host applications.")
+ (license license:asl2.0)))
+
(define-public adb
(package
(name "adb")
diff --git a/gnu/packages/patches/libziparchive-add-includes.patch b/gnu/packages/patches/libziparchive-add-includes.patch
new file mode 100644
index 0000000..4113710
--- /dev/null
+++ b/gnu/packages/patches/libziparchive-add-includes.patch
@@ -0,0 +1,10 @@
+--- a/libziparchive/zip_writer.cc 2018-04-25 22:33:05.472674164 +0200
++++ b/libziparchive/zip_writer.cc 2018-04-25 22:33:21.296519518 +0200
+@@ -22,6 +22,7 @@
+
+ #include <sys/param.h>
+
++#include <cstring>
+ #include <cassert>
+ #include <cstdio>
+ #include <memory>
Danny Milosavljevic
2018-05-09 20:34:58 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit 81abe370075188e718264dd76e7584c12adb482a
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Wed May 9 21:45:13 2018 +0200

gnu: liblog: Build library correctly.

* gnu/packages/android.scm (liblog)[arguments]<#:make-flags>: Add LDLIBS.
<#:phases>[ldconfig]: New phase.
---
gnu/packages/android.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 2da0a24..2e5f1d5 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -151,11 +151,16 @@ use their packages mostly unmodified in our Android NDK build system.")
(build-system android-ndk-build-system)
(arguments
`(#:tests? #f ; TODO.
- #:make-flags '("CC=gcc")
+ #:make-flags '("LDLIBS=-lpthread")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'enter-source
- (lambda _ (chdir "liblog") #t)))))
+ (lambda _ (chdir "liblog") #t))
+ (add-after 'install 'ldconfig
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (symlink "liblog.so.0" (string-append out "/lib/liblog.so"))
+ #t))))))
(home-page "https://developer.android.com/")
(synopsis "Logging library from the Android platform.")
(description "@code{liblog} represents an interface to the volatile Android
Danny Milosavljevic
2018-05-09 20:34:57 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit 7b592cfb03dcf94be8d688bff8a67e1d5ab781b0
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Thu Apr 26 02:35:41 2018 +0200

gnu: Add android-safe-iop.

* gnu/packages/android.scm (android-platform-external): New procedure.
(android-safe-iop): New variable.
---
gnu/packages/android.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index e9c591d..7eb683c 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -103,6 +103,20 @@ use their packages mostly unmodified in our Android NDK build system.")
"adb-add-libraries.patch"
"libziparchive-add-includes.patch"))))

+(define (android-platform-external version subdirectory checksum)
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url
+ (string-append "https://android.googlesource.com/platform/external/"
+ subdirectory))
+ (commit (string-append "android-" version))))
+ (file-name (string-append "android-platform-system-external-" subdirectory "-"
+ version "-checkout"))
+ (sha256
+ (base32
+ checksum))))
+
(define liblog
(package
(name "liblog")
@@ -314,6 +328,30 @@ to a Unix shell that can run commands on the connected device or emulator.")
Images.")
(license license:asl2.0)))

+(define-public android-safe-iop
+ (package
+ (name "android-safe-iop")
+ (version (android-platform-version))
+ (source (android-platform-external version "safe-iop"
+ "1nyyrs463advjhlq8xx1lm37m4g5afv7gy0csxrj7biwwl0v13qw"))
+ (build-system android-ndk-build-system)
+ (arguments
+ `(#:make-flags '("CXXFLAGS=-fpermissive -Wno-error")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'patch-host
+ (lambda _
+ ;; TODO: Cross-compile.
+ (substitute* "Android.mk"
+ (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY"))
+ #t)))))
+ (home-page "https://developer.android.com/")
+ (synopsis "Safe integers in C")
+ (description "@code{android-safe-iop} provides a set of functions for
+performing and checking safe integer operations. Ensure that integer
+operations do not result in silent overflow.")
+ (license license:bsd-2)))
+
(define-public android-udev-rules
(package
(name "android-udev-rules")
Danny Milosavljevic
2018-05-09 20:34:58 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit be906ad16e9bf5ab322cc2a79cf934d37a06dcc7
Author: Danny Milosavljevic <***@scratchpost.org>
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
+ }
Danny Milosavljevic
2018-05-09 20:34:58 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit 2d804f9202fa7f51daf22af98a542e363c56fc57
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Wed May 9 22:32:04 2018 +0200

gnu: Add android-ext4-utils.

* gnu/packages/android.scm (android-platform-system-extras): New procedure.
(android-ext4-utils): New variable.
---
gnu/packages/android.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 68 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 1acc7d4..6e44369 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -105,6 +105,18 @@ use their packages mostly unmodified in our Android NDK build system.")
"adb-add-libraries.patch"
"libziparchive-add-includes.patch"))))

+(define (android-platform-system-extras version)
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://android.googlesource.com/platform/system/extras")
+ (commit (string-append "android-" version))))
+ (file-name (string-append "android-platform-system-extras-"
+ version "-checkout"))
+ (sha256
+ (base32
+ "18130c23ybqcpgjc5v6f8kdbv2xn39hyiaj17dzldjb9rlwzcyy9"))))
+
(define (android-platform-bionic version)
(origin
(method git-fetch)
@@ -434,14 +446,67 @@ that is safe to use for user space. It also includes
`(("openssl" ,openssl)))
(native-inputs
`(("android-bionic-uapi" ,android-bionic-uapi)
- ("core" ,(android-platform-system-core version))))
- (propagated-inputs
- `(("pcre" ,pcre)))
+ ("core" ,(android-platform-system-core version))
+ ;; pcre is inlined by our package.
+ ("pcre" ,pcre)))
(home-page "https://developer.android.com/")
(synopsis (package-synopsis libselinux))
(description (package-description libselinux))
(license (package-license libselinux))))

+(define-public android-ext4-utils
+ (package
+ (name "android-ext4-utils")
+ (version (android-platform-version))
+ (source (android-platform-system-extras version))
+ (build-system android-ndk-build-system)
+ (arguments
+ `(#:tests? #f ; TODO.
+ #:make-flags
+ (list (string-append "CPPFLAGS="
+ ;"-Wno-error "
+ "-I "
+ (assoc-ref %build-inputs "android-libselinux")
+ "/include "
+ "-I " (assoc-ref %build-inputs "android-libsparse")
+ "/include "
+ "-I " (assoc-ref %build-inputs "libcutils")
+ "/include "
+ "-I " (assoc-ref %build-inputs "liblog") "/include "
+ "-I ../core/include")
+ "CFLAGS=-Wno-error"
+ "install-libext4_utils_host.a"
+ (string-append "prefix=" (assoc-ref %outputs "out")))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'unpack-core
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p "core")
+ (with-directory-excursion "core"
+ (invoke "tar" "axf" (assoc-ref inputs "android-core")
+ "--strip-components=1"))
+ #t))
+ (add-after 'unpack-core 'enter-source
+ (lambda _ (chdir "ext4_utils") #t))
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (copy-recursively "." (string-append out "/include")))
+ #t)))))
+ (inputs
+ `(("libcutils" ,libcutils)
+ ("liblog" ,liblog)
+ ("android-libselinux" ,android-libselinux)
+ ("android-libsparse" ,android-libsparse)
+ ("zlib" ,zlib)))
+ (native-inputs
+ `(("android-core" ,(android-platform-system-core version))))
+ (home-page "https://developer.android.com/")
+ (synopsis "Android ext4 filesystem utils")
+ (description "@code{android-ext4-utils} is a library in common use by the
+Android core.")
+ (license license:asl2.0)))
+
(define-public android-udev-rules
(package
(name "android-udev-rules")
Danny Milosavljevic
2018-05-09 20:34:57 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit 092f88a6d7d0b3779aa9bcc99bf3c110ddfef862
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Thu Apr 26 02:26:53 2018 +0200

gnu: Add android-libsparse.

* gnu/packages/android.scm (android-libsparse): New variable.
---
gnu/packages/android.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index ea225fa..e9c591d 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -195,6 +195,28 @@ various Android core host applications.")
various Android core host applications.")
(license license:asl2.0)))

+(define-public android-libsparse
+ (package
+ (name "android-libsparse")
+ (version (android-platform-version))
+ (source (android-platform-system-core version))
+ (build-system android-ndk-build-system)
+ (arguments
+ `(#:tests? #f ; TODO.
+ #:make-flags '("CFLAGS=-Wno-error"
+ "CXXFLAGS=-fpermissive -Wno-error")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'enter-source
+ (lambda _ (chdir "libsparse") #t)))))
+ (inputs
+ `(("zlib" ,zlib)))
+ (home-page "https://developer.android.com/")
+ (synopsis "Android platform sparse library")
+ (description "@code{android-libsparse} is a library in common use by the
+various Android core host applications.")
+ (license license:asl2.0)))
+
(define-public android-libziparchive
(package
(name "android-libziparchive")
Danny Milosavljevic
2018-05-09 20:34:57 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit cbf83e00909ed0ec2403e0e85c1bc24fd159c021
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Thu Apr 26 02:52:18 2018 +0200

gnu: libcutils: Install header files.

* gnu/packages/android.scm (libcutils)[arguments]<#:phases>[install]: Install
header files.
---
gnu/packages/android.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 17c9de7..c3174ba 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -210,10 +210,13 @@ various Android core host applications.")
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
- (lib (string-append out "/lib")))
+ (lib (string-append out "/lib"))
+ (include (string-append out "/include")))
(install-file "libcutils.so.0" lib)
(with-directory-excursion lib
(symlink "libcutils.so.0" "libcutils.so"))
+ (copy-recursively "../include/cutils"
+ (string-append include "/cutils"))
#t))))))
(home-page "https://developer.android.com/")
(synopsis "Android platform c utils library")
Danny Milosavljevic
2018-05-09 20:34:56 UTC
Permalink
dannym pushed a commit to branch master
in repository guix.

commit b98d4478187347d2c52ff5ff4c83fcb12346b505
Author: Danny Milosavljevic <***@scratchpost.org>
Date: Thu Apr 26 02:17:58 2018 +0200

gnu: Patch Android system core at the origin.

* gnu/packages/android.scm (android-platform-system-core): Add patches.
(libbase): Remove patches.
(adb): Remove patches.
---
gnu/packages/android.scm | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 53b0183..ec32a5c 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -95,7 +95,11 @@ use their packages mostly unmodified in our Android NDK build system.")
version "-checkout"))
(sha256
(base32
- "0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg"))))
+ "0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg"))
+ (patches
+ (search-patches "libbase-use-own-logging.patch"
+ "libbase-fix-includes.patch"
+ "adb-add-libraries.patch"))))

(define liblog
(package
@@ -122,11 +126,7 @@ in Main, System, Radio and Events sub-logs.")
(package
(name "libbase")
(version (android-platform-version))
- (source (origin
- (inherit (android-platform-system-core version))
- (patches
- (search-patches "libbase-use-own-logging.patch"
- "libbase-fix-includes.patch"))))
+ (source (android-platform-system-core version))
(build-system android-ndk-build-system)
(arguments
`(#:tests? #f ; TODO.
@@ -197,12 +197,7 @@ various Android core host applications.")
(package
(name "adb")
(version (android-platform-version))
- (source (origin
- (inherit (android-platform-system-core version))
- (patches
- (search-patches "libbase-use-own-logging.patch"
- "libbase-fix-includes.patch"
- "adb-add-libraries.patch"))))
+ (source (android-platform-system-core version))
(build-system android-ndk-build-system)
(arguments
`(#:tests? #f ; TODO.

Loading...