From 74c0ee66bb742208a21603c92ba93f970909fac1 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 19:14:21 +0200 Subject: gnu: Add android-make-stub. * gnu/packages/android.scm (android-make-stub): New variable. --- gnu/packages/android.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 92de9736f1..285a285151 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -39,6 +39,42 @@ #:use-module (gnu packages tls) #:use-module (gnu packages linux)) +(define-public android-make-stub + (let ((commit "v0.1") + (revision "21")) + (package + (name "android-make-stub") + (version "0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/daym/android-make-stub.git") + (commit commit))) + (file-name (string-append "android-make-stub-" + version "-checkout")) + (sha256 + (base32 + "1ni4szpcx2clf3lpzrybabwk7bgvsl6ynng7xxfc49y4jkdkk4sh")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; None exist. + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (invoke "make" (string-append "prefix=" out) "install") + #t)))))) + (home-page "https://github.com/daym/android-make-stub") + (synopsis "Stubs for the @command{make} system of the Android platform") + (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)))) + ;; The Makefiles that we add are largely based on the Debian ;; packages. They are licensed under GPL-2 and have copyright: ;; 2012, Stefan Handschuh -- cgit 1.4.1 From 116c69d9fe4fcfc44d2b006d8c1754f7e872999b Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:15:57 +0200 Subject: gnu: liblog: Use android-ndk-build-system. * gnu/packages/android.scm (liblog)[build-system]: Switch to android-ndk-build-system. [arguments]<#:phases>[create-Makefile]: Delete phase. --- gnu/packages/android.scm | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 285a285151..7c131e7e83 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -27,6 +27,7 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) + #:use-module (guix build-system android-ndk) #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module ((guix licenses) #:prefix license:) @@ -101,46 +102,14 @@ use their packages mostly unmodified in our Android NDK build system.") (name "liblog") (version (android-platform-version)) (source (android-platform-system-core version)) - (build-system gnu-build-system) + (build-system android-ndk-build-system) (arguments `(#:tests? #f ; TODO. #:make-flags '("CC=gcc") #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-source - (lambda _ (chdir "liblog") #t)) - (add-after 'enter-source 'create-Makefile - (lambda _ - ;; No useful makefile is shipped, so we create one. - (with-output-to-file "Makefile" - (lambda _ - (display - (string-append - "NAME = liblog\n" - "SOURCES = log_event_list.c log_event_write.c" - " logger_write.c config_write.c logger_name.c" - " logger_lock.c fake_log_device.c fake_writer.c" - " event_tag_map.c\n" - - "CFLAGS += -fvisibility=hidden -fPIC\n" - "CPPFLAGS += -I../include -DFAKE_LOG_DEVICE=1" - ;; Keep these two in sync with "liblog/Android.bp". - " -DLIBLOG_LOG_TAG=1005" - " -DSNET_EVENT_LOG_TAG=1397638484\n" - "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread\n" - - "build: $(SOURCES)\n" - " $(CC) $^ -o $(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)\n")) - #t)))) - (delete 'configure) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib"))) - (install-file "liblog.so.0" lib) - (with-directory-excursion lib - (symlink "liblog.so.0" "liblog.so")) - #t)))))) + (lambda _ (chdir "liblog") #t))))) (home-page "https://developer.android.com/") (synopsis "Logging library from the Android platform.") (description "@code{liblog} represents an interface to the volatile Android -- cgit 1.4.1 From 11cb109baeda4ef7d7038ade3503e2041ea25c13 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:15:58 +0200 Subject: gnu: libbase: Use android-ndk-build-system. * gnu/packages/android.scm (libbase)[build-system]: Switch to android-ndk-build-system. [arguments]<#:phases>[create-Makefile]: Delete phase. [arguments]<#:make-flags]: Add CXXFLAGS. --- gnu/packages/android.scm | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 7c131e7e83..09426058e4 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -127,43 +127,14 @@ in Main, System, Radio and Events sub-logs.") (patches (search-patches "libbase-use-own-logging.patch" "libbase-fix-includes.patch")))) - (build-system gnu-build-system) + (build-system android-ndk-build-system) (arguments `(#:tests? #f ; TODO. + #:make-flags '("CXXFLAGS=-std=gnu++11") #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-source - (lambda _ (chdir "base") #t)) - (add-after 'enter-source 'create-Makefile - (lambda _ - ;; No useful makefile is shipped, so we create one. - (with-output-to-file "Makefile" - (lambda _ - (display - (string-append - "NAME = libbase\n" - "SOURCES = file.cpp logging.cpp parsenetaddress.cpp" - " stringprintf.cpp strings.cpp errors_unix.cpp\n" - - "CXXFLAGS += -std=gnu++11 -fPIC\n" - "CPPFLAGS += -Iinclude -I../include\n" - "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0" - " -L.. -llog\n" - - "build: $(SOURCES)\n" - " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS)" - " $(LDFLAGS)\n")) - #t)))) - (delete 'configure) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib"))) - (install-file "libbase.so.0" lib) - (with-directory-excursion lib - (symlink "libbase.so.0" "libbase.so")) - (copy-recursively "include" out) - #t)))))) + (lambda _ (chdir "base") #t))))) (inputs `(("liblog" ,liblog))) (home-page "https://developer.android.com/") (synopsis "Android platform base library") -- cgit 1.4.1 From f6e75b0db28bf3ba0e402069b0fc173411d414af Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:15:59 +0200 Subject: gnu: adb: Use android-ndk-build-system. * gnu/packages/android.scm (adb)[build-system]: Switch to android-ndk-build-system. [arguments]<#:tests?>: Disable. [arguments]<#:phases>[create-Makefile]: Delete phase. [arguments]<#:phases>[fix-clang]: Delete phase. [arguments]<#:phases>[fix-main]: Delete phase. [arguments]<#:phases>[make-libs-available]: New phase. [arguments]<#:phases>[install-headers]: New phase. [arguments]<#:make-flags]: Add CFLAGS, CXXFLAGS. [inputs]: Add liblog. [source]: Add patch "adb-add-libraries.patch". * gnu/packages/patches/adb-add-libraries.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/android.scm | 87 ++++++---------------------- gnu/packages/patches/adb-add-libraries.patch | 19 ++++++ 3 files changed, 39 insertions(+), 68 deletions(-) create mode 100644 gnu/packages/patches/adb-add-libraries.patch (limited to 'gnu/packages/android.scm') diff --git a/gnu/local.mk b/gnu/local.mk index cacc146e4a..0e1d686a6c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -553,6 +553,7 @@ dist_patch_DATA = \ %D%/packages/patches/abiword-black-drawing-with-gtk322.patch \ %D%/packages/patches/acl-fix-perl-regex.patch \ %D%/packages/patches/acl-hurd-path-max.patch \ + %D%/packages/patches/adb-add-libraries.patch \ %D%/packages/patches/aegis-constness-error.patch \ %D%/packages/patches/aegis-perl-tempdir1.patch \ %D%/packages/patches/aegis-perl-tempdir2.patch \ diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 09426058e4..085bf41aeb 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -201,82 +201,33 @@ various Android core host applications.") (inherit (android-platform-system-core version)) (patches (search-patches "libbase-use-own-logging.patch" - "libbase-fix-includes.patch")))) - (build-system gnu-build-system) + "libbase-fix-includes.patch" + "adb-add-libraries.patch")))) + (build-system android-ndk-build-system) (arguments - `(#:phases + `(#:tests? #f ; TODO. + #:make-flags + (list "CFLAGS=-Wno-error" + "CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ." + (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib " + "-Wl,-rpath=" (assoc-ref %build-inputs "openssl") "/lib -L .")) + #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-source (lambda _ (chdir "adb") #t)) - (add-before 'build 'fix-clang - (lambda _ - ;; adb_client.h contains _Nonnull and _Nullable attributes, that - ;; are not understood by gcc. - (substitute* "adb_client.h" - (("_Nonnull") "") - (("_Nullable") "")) - #t)) - (add-before 'build 'fix-main - (lambda _ - ;; main.cpp used to be adb_main.cpp in the current directory - ;; rather than in its own subdirectory, but it was not fixed. - ;; This leads to some header files not being found anymore. - (copy-file "client/main.cpp" "adb_main.cpp") + (add-after 'enter-source 'make-libs-available + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "Android.mk" + (("libcrypto_static") "libcrypto")) #t)) - (add-after 'enter-source 'create-Makefile - (lambda* (#:key outputs #:allow-other-keys) - ;; No useful makefile is shipped, so we create one. - (with-output-to-file "Makefile" - (lambda _ - (display - (string-append - ;; Common for all components. - "CXXFLAGS += -std=gnu++14 -fpermissive\n" - "CPPFLAGS += -I../include -I../base/include -I. -DADB_HOST=1 " - "-DADB_REVISION='\"" ,version "\"' -fPIC\n" - "LDFLAGS += -lcrypto -lpthread -lbase -lcutils -L. -ladb\n" - - ;; Libadb specifics. - "LIBADB_SOURCES = adb.cpp adb_auth.cpp adb_io.cpp " - "adb_listeners.cpp adb_trace.cpp adb_utils.cpp fdevent.cpp " - "sockets.cpp transport.cpp transport_local.cpp transport_usb.cpp " - "get_my_path_linux.cpp sysdeps_unix.cpp usb_linux.cpp " - "adb_auth_host.cpp diagnose_usb.cpp services.cpp " - "shell_service_protocol.cpp bugreport.cpp line_printer.cpp\n" - - "LIBADB_LDFLAGS += -shared -Wl,-soname,libadb.so.0 " - "-lcrypto -lpthread -lbase\n" - - ;; Adb specifics. - "ADB_SOURCES = adb_main.cpp console.cpp commandline.cpp " - "adb_client.cpp file_sync_client.cpp\n" - "ADB_LDFLAGS += -Wl,-rpath=" (assoc-ref outputs "out") "/lib\n" - - "build: libadb $(ADB_SOURCES)\n" - " $(CXX) $(ADB_SOURCES) -o adb $(CXXFLAGS) $(CPPFLAGS) " - "$(ADB_LDFLAGS) $(LDFLAGS)\n" - - "libadb: $(LIBADB_SOURCES)\n" - " $(CXX) $^ -o libadb.so.0 $(CXXFLAGS) $(CPPFLAGS) " - "$(LIBADB_LDFLAGS)\n" - " ln -sv libadb.so.0 libadb.so\n")) - #t)))) - (delete 'configure) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib")) - (bin (string-append out "/bin"))) - (install-file "libadb.so.0" lib) - (install-file "adb" bin) - (with-directory-excursion lib - (symlink "libadb.so.0" "libadb.so")) - #t)))) - ;; Test suite must be run with attached devices - #:tests? #f)) + (add-after 'install 'install-headers + (lambda* (#:key inputs outputs #:allow-other-keys) + (install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include")) + #t))))) (inputs `(("libbase" ,libbase) ("libcutils" ,libcutils) + ("liblog" ,liblog) ("openssl" ,openssl))) (home-page "https://developer.android.com/studio/command-line/adb.html") (synopsis "Android Debug Bridge") diff --git a/gnu/packages/patches/adb-add-libraries.patch b/gnu/packages/patches/adb-add-libraries.patch new file mode 100644 index 0000000000..06b3ec3764 --- /dev/null +++ b/gnu/packages/patches/adb-add-libraries.patch @@ -0,0 +1,19 @@ +--- a/adb/Android.mk 2018-04-25 23:23:29.527198350 +0200 ++++ b/adb/Android.mk 2018-04-25 23:24:25.558632573 +0200 +@@ -226,7 +226,7 @@ + LOCAL_SRC_FILES := test_track_devices.cpp + LOCAL_SANITIZE := $(adb_host_sanitize) + LOCAL_SHARED_LIBRARIES := libbase +-LOCAL_STATIC_LIBRARIES := libadb libcrypto_static libcutils ++LOCAL_STATIC_LIBRARIES := libadb libbase libcrypto_static libcutils + LOCAL_LDLIBS += -lrt -ldl -lpthread + include $(BUILD_HOST_EXECUTABLE) + endif +@@ -278,6 +278,7 @@ + LOCAL_SANITIZE := $(adb_host_sanitize) + LOCAL_STATIC_LIBRARIES := \ + libadb \ ++ libcutils \ + libbase \ + libcrypto_static \ + libdiagnose_usb \ -- cgit 1.4.1 From 3724d375778b11c6f857138198329e3b99984af5 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:16:00 +0200 Subject: gnu: mkbootimg: Install "bootimg.h". * gnu/packages/android.scm (mkbootimg)[arguments]<#:phases>[install]: Install "bootimg.h". --- gnu/packages/android.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 085bf41aeb..53b0183f92 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -256,8 +256,10 @@ to a Unix shell that can run commands on the connected device or emulator.") (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin"))) + (bin (string-append out "/bin")) + (include (string-append out "/include"))) (install-file "mkbootimg" bin) + (install-file "bootimg.h" include) #t)))))) (home-page "https://developer.android.com/studio/command-line/adb.html") (synopsis "Tool to create Android boot images") -- cgit 1.4.1 From b98d4478187347d2c52ff5ff4c83fcb12346b505 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:17:58 +0200 Subject: 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(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 53b0183f92..ec32a5cfdf 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. -- cgit 1.4.1 From 16c2be0b42c68371802b12b9687d7d720751c64d Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:23:29 +0200 Subject: 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(-) create mode 100644 gnu/packages/patches/libziparchive-add-includes.patch (limited to 'gnu/packages/android.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 0e1d686a6c..5acc9fb136 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 ec32a5cfdf..ea225fa900 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 0000000000..41137105a0 --- /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 + ++#include + #include + #include + #include -- cgit 1.4.1 From 092f88a6d7d0b3779aa9bcc99bf3c110ddfef862 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:26:53 +0200 Subject: gnu: Add android-libsparse. * gnu/packages/android.scm (android-libsparse): New variable. --- gnu/packages/android.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index ea225fa900..e9c591d434 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") -- cgit 1.4.1 From 7b592cfb03dcf94be8d688bff8a67e1d5ab781b0 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:35:41 +0200 Subject: 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(+) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index e9c591d434..7eb683c94d 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") -- cgit 1.4.1 From cc39d592d92102091c8d73ce6e6e63fde5e9e030 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:45:10 +0200 Subject: gnu: Add android-bionic-uapi. * gnu/packages/android.scm (android-bionic-uapi): New variable. --- gnu/packages/android.scm | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 7eb683c94d..17c9de70a5 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") -- cgit 1.4.1 From cbf83e00909ed0ec2403e0e85c1bc24fd159c021 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 26 Apr 2018 02:52:18 +0200 Subject: 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(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 17c9de70a5..c3174babbd 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") -- cgit 1.4.1 From c87ca40f9bff8b852018b884e1fed963a6643b57 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 19:58:51 +0200 Subject: gnu: Add android-libselinux. * gnu/packages/android.scm (android-libselinux): New variable. --- gnu/packages/android.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index c3174babbd..1acc7d454a 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") -- cgit 1.4.1 From 2d804f9202fa7f51daf22af98a542e363c56fc57 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 22:32:04 +0200 Subject: 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(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 1acc7d454a..6e44369f72 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") -- cgit 1.4.1 From 055e6fb3eb12b863ce6176f682fee62a36387b24 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 20:04:33 +0200 Subject: gnu: Add android-f2fs-utils. * gnu/packages/android.scm (android-f2fs-utils): New variable. --- gnu/packages/android.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 6e44369f72..21b0c7c64c 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") -- cgit 1.4.1 From be906ad16e9bf5ab322cc2a79cf934d37a06dcc7 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 20:11:30 +0200 Subject: 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(+) create mode 100644 gnu/packages/patches/libutils-add-includes.patch create mode 100644 gnu/packages/patches/libutils-remove-damaging-includes.patch (limited to 'gnu/packages/android.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 5acc9fb136..789e97f482 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 21b0c7c64c..34525f1eca 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 0000000000..354c59b735 --- /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 +- ++#include + #include + #include + #include 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 0000000000..7867dd3b80 --- /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 +- + #include + #include + #include +--- 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 + } -- cgit 1.4.1 From 8bbf99ae25b5f45fe6d327fd4b0b3a809f61f112 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 21:43:32 +0200 Subject: 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(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 34525f1eca..2da0a24f5c 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: -- cgit 1.4.1 From 81abe370075188e718264dd76e7584c12adb482a Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 21:45:13 +0200 Subject: 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(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 2da0a24f5c..2e5f1d5933 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 -- cgit 1.4.1 From 455b8fed7e0af287e433232f0edf59e26c6e5f4f Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 21:48:35 +0200 Subject: gnu: Add fastboot. * gnu/packages/android.scm (fastboot): New variable. --- gnu/packages/android.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 2e5f1d5933..c3beba6155 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -568,6 +568,70 @@ Android core.") (description "@code{android-libutils} provides utilities for Android NDK developers.") (license license:asl2.0))) +(define-public fastboot + (package + (name "fastboot") + (version (android-platform-version)) + (source #f) + (build-system android-ndk-build-system) + (arguments + `(#:make-flags (list "CXXFLAGS=-std=gnu++11") + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "core") + (with-directory-excursion "core" + (invoke "tar" "axf" (assoc-ref inputs "core") "--strip-components=1") + (substitute* "fastboot/Android.mk" + (("libext4_utils_host") "libext4_utils_host libselinux libpcre"))) + (copy-recursively (assoc-ref inputs "extras") "extras" + #:keep-mtime? #t) + #t)) + (add-after 'unpack 'enter-source + (lambda _ + (chdir "core/fastboot") + #t)) + (add-after 'enter-source 'make-googletest-available + (lambda* (#:key inputs #:allow-other-keys) + (let ((googletest (assoc-ref inputs "googletest"))) + (symlink (string-append googletest "/lib/libgtest.so") "libgtest_host.so") + #t))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (bin (string-append out "/bin"))) + (install-file "fastboot" bin) + #t)))) + #:tests? #f)) ; Require network + (inputs + `(("adb" ,adb) + ("android-safe-iop" ,android-safe-iop) + ("android-ext4-utils" ,android-ext4-utils) + ("android-f2fs-utils" ,android-f2fs-utils) + ("googletest" ,googletest) + ("libbase" ,libbase) + ("libcutils" ,libcutils) + ("liblog" ,liblog) + ("android-libutils" ,android-libutils) + ("android-libsparse" ,android-libsparse) + ("android-libziparchive" ,android-libziparchive) + ("android-libselinux" ,android-libselinux) + ("pcre" ,pcre) + ("mkbootimg" ,mkbootimg) + ("openssl" ,openssl) ; FIXME remove + ("zlib" ,zlib))) + (native-inputs + `(("core" ,(android-platform-system-core version)) + ("extras" ,(android-platform-system-extras version)) + ("xz" ,xz))) + (home-page "https://developer.android.com/studio/command-line/") + (synopsis "Android image flasher") + (description + "This package provides @command{fastboot}, a tool to upload file system images to Android devices.") + (license license:asl2.0))) + (define-public android-udev-rules (package (name "android-udev-rules") -- cgit 1.4.1 From 8272e5e0b77760bb89f01815a89326f59b360c0e Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 22:25:10 +0200 Subject: gnu: Rename "liblog" to "android-liblog". * gnu/packages/android.scm (liblog): Rename to... (android-liblog): ...this. --- gnu/packages/android.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index c3beba6155..bc679a1777 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -143,9 +143,9 @@ use their packages mostly unmodified in our Android NDK build system.") (base32 checksum)))) -(define liblog +(define android-liblog (package - (name "liblog") + (name "android-liblog") (version (android-platform-version)) (source (android-platform-system-core version)) (build-system android-ndk-build-system) @@ -182,7 +182,7 @@ in Main, System, Radio and Events sub-logs.") (modify-phases %standard-phases (add-after 'unpack 'enter-source (lambda _ (chdir "base") #t))))) - (inputs `(("liblog" ,liblog))) + (inputs `(("android-liblog" ,android-liblog))) (home-page "https://developer.android.com/") (synopsis "Android platform base library") (description "@code{libbase} is a library in common use by the @@ -322,7 +322,7 @@ various Android core host applications.") (inputs `(("libbase" ,libbase) ("libcutils" ,libcutils) - ("liblog" ,liblog) + ("android-liblog" ,android-liblog) ("openssl" ,openssl))) (home-page "https://developer.android.com/studio/command-line/adb.html") (synopsis "Android Debug Bridge") @@ -477,7 +477,7 @@ that is safe to use for user space. It also includes "/include " "-I " (assoc-ref %build-inputs "libcutils") "/include " - "-I " (assoc-ref %build-inputs "liblog") "/include " + "-I " (assoc-ref %build-inputs "android-liblog") "/include " "-I ../core/include") "CFLAGS=-Wno-error" "install-libext4_utils_host.a" @@ -500,7 +500,7 @@ that is safe to use for user space. It also includes #t))))) (inputs `(("libcutils" ,libcutils) - ("liblog" ,liblog) + ("android-liblog" ,android-liblog) ("android-libselinux" ,android-libselinux) ("android-libsparse" ,android-libsparse) ("zlib" ,zlib))) @@ -613,7 +613,7 @@ Android core.") ("googletest" ,googletest) ("libbase" ,libbase) ("libcutils" ,libcutils) - ("liblog" ,liblog) + ("android-liblog" ,android-liblog) ("android-libutils" ,android-libutils) ("android-libsparse" ,android-libsparse) ("android-libziparchive" ,android-libziparchive) -- cgit 1.4.1 From 01a2389a66719b4106321b13c802ad3f84896b4c Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 22:26:06 +0200 Subject: gnu: Rename "libbase" to "android-libbase". * gnu/packages/android.scm (libbase): Rename to... (android-libbase): ...this. --- gnu/packages/android.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index bc679a1777..58259c1689 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -169,9 +169,9 @@ interfaces for either writing or reading logs. The log buffers are divided up in Main, System, Radio and Events sub-logs.") (license license:asl2.0))) -(define libbase +(define android-libbase (package - (name "libbase") + (name "android-libbase") (version (android-platform-version)) (source (android-platform-system-core version)) (build-system android-ndk-build-system) @@ -320,7 +320,7 @@ various Android core host applications.") (install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include")) #t))))) (inputs - `(("libbase" ,libbase) + `(("android-libbase" ,android-libbase) ("libcutils" ,libcutils) ("android-liblog" ,android-liblog) ("openssl" ,openssl))) @@ -611,7 +611,7 @@ Android core.") ("android-ext4-utils" ,android-ext4-utils) ("android-f2fs-utils" ,android-f2fs-utils) ("googletest" ,googletest) - ("libbase" ,libbase) + ("android-libbase" ,android-libbase) ("libcutils" ,libcutils) ("android-liblog" ,android-liblog) ("android-libutils" ,android-libutils) -- cgit 1.4.1 From 3385db349f05cec431099e8a693afa0f957c57b5 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 9 May 2018 22:27:34 +0200 Subject: gnu: Rename "libcutils" to "android-libcutils". * gnu/packages/android.scm (libcutils): Rename to... (android-libcutils): ...this. --- gnu/packages/android.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 58259c1689..472e1448ca 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -189,9 +189,9 @@ in Main, System, Radio and Events sub-logs.") various Android core host applications.") (license license:asl2.0))) -(define libcutils +(define android-libcutils (package - (name "libcutils") + (name "android-libcutils") (version (android-platform-version)) (source (android-platform-system-core version)) (build-system gnu-build-system) @@ -321,7 +321,7 @@ various Android core host applications.") #t))))) (inputs `(("android-libbase" ,android-libbase) - ("libcutils" ,libcutils) + ("android-libcutils" ,android-libcutils) ("android-liblog" ,android-liblog) ("openssl" ,openssl))) (home-page "https://developer.android.com/studio/command-line/adb.html") @@ -475,7 +475,7 @@ that is safe to use for user space. It also includes "/include " "-I " (assoc-ref %build-inputs "android-libsparse") "/include " - "-I " (assoc-ref %build-inputs "libcutils") + "-I " (assoc-ref %build-inputs "android-libcutils") "/include " "-I " (assoc-ref %build-inputs "android-liblog") "/include " "-I ../core/include") @@ -499,7 +499,7 @@ that is safe to use for user space. It also includes (copy-recursively "." (string-append out "/include"))) #t))))) (inputs - `(("libcutils" ,libcutils) + `(("android-libcutils" ,android-libcutils) ("android-liblog" ,android-liblog) ("android-libselinux" ,android-libselinux) ("android-libsparse" ,android-libsparse) @@ -533,7 +533,7 @@ Android core.") `(("f2fs-tools" ,f2fs-tools-1.7) ("android-libselinux" ,android-libselinux) ("android-libsparse" ,android-libsparse) - ("libcutils" ,libcutils) + ("android-libcutils" ,android-libcutils) ("zlib" ,zlib))) (home-page "https://developer.android.com/") (synopsis "Android ext4 utils") @@ -560,7 +560,7 @@ Android core.") (copy-recursively "../include/utils" (string-append (assoc-ref outputs "out") "/include/utils"))))))) (inputs `(("android-safe-iop" ,android-safe-iop) - ("libcutils" ,libcutils))) + ("android-libcutils" ,android-libcutils))) (native-inputs `(("android-bionic-uapi" ,android-bionic-uapi))) (home-page "https://developer.android.com/") @@ -612,7 +612,7 @@ Android core.") ("android-f2fs-utils" ,android-f2fs-utils) ("googletest" ,googletest) ("android-libbase" ,android-libbase) - ("libcutils" ,libcutils) + ("android-libcutils" ,android-libcutils) ("android-liblog" ,android-liblog) ("android-libutils" ,android-libutils) ("android-libsparse" ,android-libsparse) -- cgit 1.4.1 From 0e1011b18e653f36f837d3555de4473e0c5e5ba1 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 00:10:58 +0200 Subject: gnu: android-make-stub: Update to 0.5. * gnu/packages/android.scm (android-make-stub): Update to 0.5. --- gnu/packages/android.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 472e1448ca..c7d81ec633 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -46,7 +46,7 @@ (define-public android-make-stub (package (name "android-make-stub") - (version "0.4") + (version "0.5") (source (origin (method git-fetch) @@ -57,7 +57,7 @@ version "-checkout")) (sha256 (base32 - "069bcldva63qbda7c8j6kyf9z28qnygszqfkgzq48hmkfmjrhbqg")))) + "13jwp8rjakk0myddq7byy35fjdq1kr5f2m9zwqa5n0df293pgf6l")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; None exist. -- cgit 1.4.1 From aa820a1be7893b3d3a5f7b3f25baa488322b43fc Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 00:32:17 +0200 Subject: gnu: android-make-stub: Update to 0.5.1. * gnu/packages/android.scm (android-make-stub): Update to 0.5.1. --- gnu/packages/android.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index c7d81ec633..7ff7521fb6 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -46,7 +46,7 @@ (define-public android-make-stub (package (name "android-make-stub") - (version "0.5") + (version "0.5.1") (source (origin (method git-fetch) @@ -57,7 +57,7 @@ version "-checkout")) (sha256 (base32 - "13jwp8rjakk0myddq7byy35fjdq1kr5f2m9zwqa5n0df293pgf6l")))) + "0sbnn7fd607lfsgfs695k30gs9q5cz8jc2ki56x8irxlvhhrwdin")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; None exist. -- cgit 1.4.1 From 26dcbb8cfea08e892494f29194682ac16a6decdf Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:02:32 +0200 Subject: gnu: android-make-stub: Update to 0.5.2. * gnu/packages/android.scm (android-make-stub): Update to 0.5.2. --- gnu/packages/android.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 7ff7521fb6..7e4f402c9c 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -46,7 +46,7 @@ (define-public android-make-stub (package (name "android-make-stub") - (version "0.5.1") + (version "0.5.2") (source (origin (method git-fetch) @@ -57,7 +57,7 @@ version "-checkout")) (sha256 (base32 - "0sbnn7fd607lfsgfs695k30gs9q5cz8jc2ki56x8irxlvhhrwdin")))) + "158qnp1x8isqfxcqglikinz65hw8iz6paw2cn8z0s8dysp4awb9g")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; None exist. -- cgit 1.4.1 From 0d697202fcb53ac819c2fc8b103b7837e7db4c10 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:04:46 +0200 Subject: gnu: android-selinux: Simplify. * gnu/packages/android.scm (android-selinux)[arguments]<#:phases>[unpack-core]: Delete. [native-inputs]: Remove "core". --- gnu/packages/android.scm | 7 ------- 1 file changed, 7 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 7e4f402c9c..bae5b77ffe 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -435,12 +435,6 @@ that is safe to use for user space. It also includes "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. @@ -451,7 +445,6 @@ 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)) ;; pcre is inlined by our package. ("pcre" ,pcre))) (home-page "https://developer.android.com/") -- cgit 1.4.1 From 5c45730a0390477feb3a3e82d0e51881070fd906 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:08:49 +0200 Subject: gnu: android-liblog: Don't disable tests. * gnu/packages/android.scm (android-liblog)[arguments]: Enable tests. --- gnu/packages/android.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index bae5b77ffe..9302fc3f2f 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -150,8 +150,7 @@ use their packages mostly unmodified in our Android NDK build system.") (source (android-platform-system-core version)) (build-system android-ndk-build-system) (arguments - `(#:tests? #f ; TODO. - #:make-flags '("LDLIBS=-lpthread") + `(#:make-flags '("LDLIBS=-lpthread") #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-source -- cgit 1.4.1 From c774d8e19a114951bd3c7d63bb1a80a0344804a7 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:10:33 +0200 Subject: gnu: android-libbase: Document test failure. * gnu/packages/android.scm (android-libbase): Document test failure. --- gnu/packages/android.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 9302fc3f2f..e1bc3ff27b 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -175,7 +175,7 @@ in Main, System, Radio and Events sub-logs.") (source (android-platform-system-core version)) (build-system android-ndk-build-system) (arguments - `(#:tests? #f ; TODO. + `(#:tests? #f ; Test failure: logging.UNIMPLEMENTED #:make-flags '("CXXFLAGS=-std=gnu++11") #:phases (modify-phases %standard-phases -- cgit 1.4.1 From 23e70a692c3c334c36adf7a3f4e9cbc7e2952644 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:11:30 +0200 Subject: gnu: android-libsparse: Don't disable tests. * gnu/packages/android.scm (android-libsparse)[arguments]: Enable tests. --- gnu/packages/android.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index e1bc3ff27b..dbe8c12025 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -249,8 +249,7 @@ various Android core host applications.") (source (android-platform-system-core version)) (build-system android-ndk-build-system) (arguments - `(#:tests? #f ; TODO. - #:make-flags '("CFLAGS=-Wno-error" + `(#:make-flags '("CFLAGS=-Wno-error" "CXXFLAGS=-fpermissive -Wno-error") #:phases (modify-phases %standard-phases -- cgit 1.4.1 From 52bdbaf2d32bb159a3613d1120be3792ab1e3691 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:26:30 +0200 Subject: gnu: android-make-stub: Update to 0.5.3. * gnu/packages/android.scm (android-make-stub): Update to 0.5.3. --- gnu/packages/android.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index dbe8c12025..7aad719135 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -46,7 +46,7 @@ (define-public android-make-stub (package (name "android-make-stub") - (version "0.5.2") + (version "0.5.3") (source (origin (method git-fetch) @@ -57,7 +57,7 @@ version "-checkout")) (sha256 (base32 - "158qnp1x8isqfxcqglikinz65hw8iz6paw2cn8z0s8dysp4awb9g")))) + "1q1hx4afca8wxwwf8xka7vngyh7znwpblw5y876p9zvyn84f4ysf")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; None exist. -- cgit 1.4.1 From e55e6d30f5aea01ce96edd27c97b73a71b07b627 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:27:01 +0200 Subject: gnu: android-libziparchive: Enable tests. * gnu/packages/android.scm (android-libziparchive)[arguments]: Enable tests. <#:phases>[setenv]: New phase. [native-inputs]: Add android-libbase, android-libutils, android-liblog. --- gnu/packages/android.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 7aad719135..82f6f5360e 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -270,13 +270,16 @@ various Android core host applications.") (source (android-platform-system-core version)) (build-system android-ndk-build-system) (arguments - `(#:tests? #f ; TODO. - #:make-flags '("CFLAGS=-Wno-error" + `(#: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-before 'check 'setenv + (lambda _ + (setenv "ziparchive_tests_host_PARAMS" "--test_data_dir=testdata") + #t)) (add-after 'install 'install-headers (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -285,6 +288,10 @@ various Android core host applications.") #t)))))) (inputs `(("zlib" ,zlib))) + (native-inputs + `(("android-libbase" ,android-libbase) + ("android-libutils" ,android-libutils) + ("android-liblog" ,android-liblog))) (home-page "https://developer.android.com/") (synopsis "Android platform ZIP library") (description "@code{android-libziparchive} is a library in common use by the -- cgit 1.4.1 From d3324a4b3b8f7b46adedfa06f9eb7132d0d240fa Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:35:33 +0200 Subject: gnu: android-ext4-utils: Don't disable tests. * gnu/packages/android.scm (android-ext4-utils): Don't disable tests. --- gnu/packages/android.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 82f6f5360e..fe286c2018 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -464,8 +464,7 @@ that is safe to use for user space. It also includes (source (android-platform-system-extras version)) (build-system android-ndk-build-system) (arguments - `(#:tests? #f ; TODO. - #:make-flags + `(#:make-flags (list (string-append "CPPFLAGS=" ;"-Wno-error " "-I " -- cgit 1.4.1 From 9e8f0ff2a91c97a241284ba064dc3d0462b5005b Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:36:53 +0200 Subject: gnu: android-f2fs-utils: Don't disable tests. * gnu/packages/android.scm (android-f2fs-utils): Don't disable tests. --- gnu/packages/android.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index fe286c2018..4c47505375 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -516,8 +516,7 @@ Android core.") (source (android-platform-system-extras version)) (build-system android-ndk-build-system) (arguments - `(#:tests? #f ; TODO. - #:phases + `(#:phases (modify-phases %standard-phases (add-after 'unpack 'enter-source (lambda _ (chdir "f2fs_utils") #t)) -- cgit 1.4.1 From c6ee92c41bfc0bc3b5634651bfa62bf35f2f11b5 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 01:51:08 +0200 Subject: gnu: Add android-googletest. * gnu/packages/android.scm (android-googletest): New variable. * guix/build-system/android-ndk.scm (android-ndk-build): Use it. --- gnu/packages/android.scm | 17 +++++++++++++++++ guix/build-system/android-ndk.scm | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 4c47505375..eda243314a 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -77,6 +77,23 @@ use their packages mostly unmodified in our Android NDK build system.") (license license:asl2.0))) +(define-public android-googletest + (package (inherit googletest) + (name "android-googletest") + (arguments + `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON") + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-host-libraries + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib"))) + (symlink "libgtest.so" + (string-append lib "/libgtest_host.so")) + (symlink "libgmock.so" + (string-append lib "/libgmock_host.so")) + #t)))))))) + ;; The Makefiles that we add are largely based on the Debian ;; packages. They are licensed under GPL-2 and have copyright: ;; 2012, Stefan Handschuh diff --git a/guix/build-system/android-ndk.scm b/guix/build-system/android-ndk.scm index 891fc6e042..029f654bb3 100644 --- a/guix/build-system/android-ndk.scm +++ b/guix/build-system/android-ndk.scm @@ -113,7 +113,7 @@ ;; Keep the standard inputs of 'gnu-build-system' ,@(standard-packages))) (build-inputs `(("android-make-stub" ,(module-ref (resolve-interface '(gnu packages android)) 'android-make-stub)) - ("googletest" ,(module-ref (resolve-interface '(gnu packages check)) 'googletest)) + ("android-googletest" ,(module-ref (resolve-interface '(gnu packages android)) 'android-googletest)) ,@native-inputs)) (outputs outputs) (build android-ndk-build) -- cgit 1.4.1 From 7715269e3aa16b6744890036b27791fff93cd3c1 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 02:27:31 +0200 Subject: gnu: android-make-stub: Update to 0.5.4. * gnu/packages/android.scm (android-make-stub): Update to 0.5.4. --- gnu/packages/android.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index eda243314a..511ec352b0 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -46,7 +46,7 @@ (define-public android-make-stub (package (name "android-make-stub") - (version "0.5.3") + (version "0.5.4") (source (origin (method git-fetch) @@ -57,7 +57,7 @@ version "-checkout")) (sha256 (base32 - "1q1hx4afca8wxwwf8xka7vngyh7znwpblw5y876p9zvyn84f4ysf")))) + "0jg5qalxgbdwva7c5r350fna9baxdbpys21g6x3l2p0wzp01calp")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; None exist. -- cgit 1.4.1 From cad7c591f0d21360f56edd13887cd60e201e0424 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 02:33:38 +0200 Subject: gnu: android-make-stub: Update to 0.5.5. * gnu/packages/android.scm (android-make-stub): Update to 0.5.5. --- gnu/packages/android.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 511ec352b0..9e2ce429a2 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -46,7 +46,7 @@ (define-public android-make-stub (package (name "android-make-stub") - (version "0.5.4") + (version "0.5.5") (source (origin (method git-fetch) @@ -57,7 +57,7 @@ version "-checkout")) (sha256 (base32 - "0jg5qalxgbdwva7c5r350fna9baxdbpys21g6x3l2p0wzp01calp")))) + "0shm4xvc2v6dn6pxydy6yn64qrrpcvx8ssmym9053wk0w5s9wp9q")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; None exist. -- cgit 1.4.1 From cc59bf70975b2ab4224f165709c8be3c661d4cdb Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 02:34:30 +0200 Subject: gnu: android-libutils: Add android-liblog. * gnu/packages/android.scm (android-libutils)[native-inputs]: Add android-liblog. --- gnu/packages/android.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 9e2ce429a2..88961ca4ff 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -575,7 +575,8 @@ Android core.") `(("android-safe-iop" ,android-safe-iop) ("android-libcutils" ,android-libcutils))) (native-inputs - `(("android-bionic-uapi" ,android-bionic-uapi))) + `(("android-bionic-uapi" ,android-bionic-uapi) + ("android-liblog" ,android-liblog))) (home-page "https://developer.android.com/") (synopsis "Android utility library") (description "@code{android-libutils} provides utilities for Android NDK developers.") -- cgit 1.4.1 From fff92439b292a6b4fcb22563a1b9fcec37c1a5ca Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 02:38:20 +0200 Subject: gnu: fastboot: Simplify package. * gnu/packages/android.scm (fastboot)[arguments]<#:phases> [make-googletest-available]: Delete phase. [inputs]: Remove openssl. --- gnu/packages/android.scm | 6 ------ 1 file changed, 6 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 88961ca4ff..9a2a990f44 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -606,11 +606,6 @@ Android core.") (lambda _ (chdir "core/fastboot") #t)) - (add-after 'enter-source 'make-googletest-available - (lambda* (#:key inputs #:allow-other-keys) - (let ((googletest (assoc-ref inputs "googletest"))) - (symlink (string-append googletest "/lib/libgtest.so") "libgtest_host.so") - #t))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -634,7 +629,6 @@ Android core.") ("android-libselinux" ,android-libselinux) ("pcre" ,pcre) ("mkbootimg" ,mkbootimg) - ("openssl" ,openssl) ; FIXME remove ("zlib" ,zlib))) (native-inputs `(("core" ,(android-platform-system-core version)) -- cgit 1.4.1 From b913d1eaf23bf7ed6de24b85dbe18ea129fd2e1d Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 02:41:20 +0200 Subject: gnu: fastboot: Enable tests. * gnu/packages/android.scm (fastboot)[arguments]: Enable tests. --- gnu/packages/android.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 9a2a990f44..e9e13a655c 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -612,8 +612,7 @@ Android core.") (lib (string-append out "/lib")) (bin (string-append out "/bin"))) (install-file "fastboot" bin) - #t)))) - #:tests? #f)) ; Require network + #t)))))) (inputs `(("adb" ,adb) ("android-safe-iop" ,android-safe-iop) -- cgit 1.4.1 From 362f3bf3547cfe6b880acfe2baee243e20840e5c Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 02:44:34 +0200 Subject: gnu: adb: Document test failure. * gnu/packages/android.scm (adb): Document test failure. --- gnu/packages/android.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index e9e13a655c..d7b1182579 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -322,7 +322,7 @@ various Android core host applications.") (source (android-platform-system-core version)) (build-system android-ndk-build-system) (arguments - `(#:tests? #f ; TODO. + `(#:tests? #f ; Test failure: sysdeps_poll.fd_count #:make-flags (list "CFLAGS=-Wno-error" "CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ." -- cgit 1.4.1 From f546fcb4f96b2ecf0d51f50589b3f5976723905d Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 04:04:27 +0200 Subject: gnu: fastboot: Remove (duplicate) googletest. * gnu/packages/android.scm (fastboot)[inputs]: Remove googletest. --- gnu/packages/android.scm | 1 - 1 file changed, 1 deletion(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index d7b1182579..812898c8ac 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -618,7 +618,6 @@ Android core.") ("android-safe-iop" ,android-safe-iop) ("android-ext4-utils" ,android-ext4-utils) ("android-f2fs-utils" ,android-f2fs-utils) - ("googletest" ,googletest) ("android-libbase" ,android-libbase) ("android-libcutils" ,android-libcutils) ("android-liblog" ,android-liblog) -- cgit 1.4.1 From 8297f01ee0094005c1d40923f605360a15030628 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 04:13:00 +0200 Subject: gnu: fastboot: Simplify package. * gnu/packages/android.scm (fastboot)[source]: Use android-platform-system-core. [arguments]<#:phases>[unpack]: Remove. <#:phases>[enter-source]: Modify. <#:phases>[patch-source]: New phase. [native-inputs]: Remove core, extras. --- gnu/packages/android.scm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 812898c8ac..d09cd635e5 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -586,25 +586,20 @@ Android core.") (package (name "fastboot") (version (android-platform-version)) - (source #f) + (source (android-platform-system-core version)) (build-system android-ndk-build-system) (arguments `(#:make-flags (list "CXXFLAGS=-std=gnu++11") #:phases (modify-phases %standard-phases - (replace 'unpack - (lambda* (#:key inputs #:allow-other-keys) - (mkdir-p "core") - (with-directory-excursion "core" - (invoke "tar" "axf" (assoc-ref inputs "core") "--strip-components=1") - (substitute* "fastboot/Android.mk" - (("libext4_utils_host") "libext4_utils_host libselinux libpcre"))) - (copy-recursively (assoc-ref inputs "extras") "extras" - #:keep-mtime? #t) - #t)) (add-after 'unpack 'enter-source (lambda _ - (chdir "core/fastboot") + (chdir "fastboot") + #t)) + (add-after 'enter-source 'patch-source + (lambda _ + (substitute* "Android.mk" + (("libext4_utils_host") "libext4_utils_host libselinux libpcre")) #t)) (replace 'install (lambda* (#:key outputs #:allow-other-keys) @@ -629,9 +624,7 @@ Android core.") ("mkbootimg" ,mkbootimg) ("zlib" ,zlib))) (native-inputs - `(("core" ,(android-platform-system-core version)) - ("extras" ,(android-platform-system-extras version)) - ("xz" ,xz))) + `(("xz" ,xz))) (home-page "https://developer.android.com/studio/command-line/") (synopsis "Android image flasher") (description -- cgit 1.4.1 From 51eb4a6e67bab2d84dcdc34c3b7b000dda140e4c Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 11:12:50 +0200 Subject: gnu: android-f2fs-utils: Update synopsis and description. * gnu/packages/android.scm (android-f2fs-utils)[synopsis]: Modify. [description]: Modify. --- gnu/packages/android.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index d09cd635e5..ddfe90a6b4 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -549,9 +549,10 @@ Android core.") ("android-libcutils" ,android-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.") + (synopsis "Android f2fs utils") + (description "@code{android-f2fs-utils} is a library in common use by the +Android core. It allows the user to create images for the @code{f2fs} Flash +file system.") (license license:asl2.0))) (define-public android-libutils -- cgit 1.4.1 From a73489e8a74bf5cbd85f0025c28610d098267b53 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 11:24:18 +0200 Subject: gnu: android-f2fs-utils: Install mkf2fsuserimg.sh. * gnu/packages/android.scm (android-f2fs-utils)[arguments]<#:phases> [install-shell-scripts]: New phase. --- gnu/packages/android.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index ddfe90a6b4..763be48748 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -541,7 +541,16 @@ Android core.") (lambda* (#:key inputs outputs #:allow-other-keys) (copy-recursively "." (string-append (assoc-ref outputs "out") "/include")) - #t))))) + #t)) + (add-after 'install 'install-shell-scripts + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (patch-shebang "mkf2fsuserimg.sh") + (substitute* "mkf2fsuserimg.sh" + (("make_f2fs") (string-append bin "/make_f2fs"))) + (install-file "mkf2fsuserimg.sh" bin) + #t)))))) (inputs `(("f2fs-tools" ,f2fs-tools-1.7) ("android-libselinux" ,android-libselinux) -- cgit 1.4.1 From b87fc9ab9d619e83947c5a281b682338df136fc6 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 10 May 2018 15:31:43 +0200 Subject: gnu: android-make-stub: Update to 0.6.0. * gnu/packages/android.scm (android-make-stub): Update to 0.6.0. * guix/build-system/android-ndk.scm (android-ndk-build): Modify. (lower): Modify. --- gnu/packages/android.scm | 4 ++-- guix/build-system/android-ndk.scm | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gnu/packages/android.scm') diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 763be48748..d42a7aef1a 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -46,7 +46,7 @@ (define-public android-make-stub (package (name "android-make-stub") - (version "0.5.5") + (version "0.6.0") (source (origin (method git-fetch) @@ -57,7 +57,7 @@ version "-checkout")) (sha256 (base32 - "0shm4xvc2v6dn6pxydy6yn64qrrpcvx8ssmym9053wk0w5s9wp9q")))) + "0y1b2x96d37n6f1bp6dcx08bn08zac0cylmbfsx6mf2nahc02fhc")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; None exist. diff --git a/guix/build-system/android-ndk.scm b/guix/build-system/android-ndk.scm index 029f654bb3..dbfa626a19 100644 --- a/guix/build-system/android-ndk.scm +++ b/guix/build-system/android-ndk.scm @@ -67,8 +67,8 @@ #:make-flags (cons* "-f" ,(string-append (derivation->output-path - (car (assoc-ref inputs "android-make-stub"))) - "/share/android-make-stub/Makefile") + (car (assoc-ref inputs "android-build"))) + "/share/android/build/core/main.mk") ,make-flags) #:outputs %outputs #:search-paths ',(map search-path-specification->sexp @@ -112,7 +112,7 @@ ;; Keep the standard inputs of 'gnu-build-system' ,@(standard-packages))) - (build-inputs `(("android-make-stub" ,(module-ref (resolve-interface '(gnu packages android)) 'android-make-stub)) + (build-inputs `(("android-build" ,(module-ref (resolve-interface '(gnu packages android)) 'android-make-stub)) ("android-googletest" ,(module-ref (resolve-interface '(gnu packages android)) 'android-googletest)) ,@native-inputs)) (outputs outputs) -- cgit 1.4.1