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(+) 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 v1.2.3