all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob f4aa0285813ecb030ebced95c332bbc57e82789c 6656 bytes (raw)
name: gnu/packages/android.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages android)
  #:use-module ((srfi srfi-1) #:hide (zip))
  #:use-module (gnu packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages llvm))

(define-public adb
  (package
    (name "adb")
    (version "7.0.0_r21")
    (source (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://android.googlesource.com/platform/system/core")
		   (commit (string-append "android-" version))))
             (sha256
              (base32
               "0570iyxkknhfl6q4jif8569f6zxiqpg7vrgprk5jz2jjvz4wkd2h"))
             (patches (search-patches "adb-fix-build.patch"))))
    (build-system gnu-build-system)
    (propagated-inputs `(("openssl" ,openssl)))
    (arguments
      `(#:parallel-build? #f
        #:tests? #f
        #:phases
          (modify-phases %standard-phases
            (delete 'configure)
            (add-before 'build 'fix-clang
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "adb/adb_client.h"
                      (("_Nonnull") "")
                      (("_Nullable") ""))))
            (replace 'build
              (lambda* (#:key inputs #:allow-other-keys)
                (define (compile-c file)
                  (format #t "CC ~a\n" file)
                  (zero? (system* "gcc" "-o" (string-append file ".o")
                                  "-std=gnu11" "-DLIBLOG_LOG_TAG=1005"
                                  "-DFAKE_LOG_DEVICE=1" "-D_GNU_SOURCE"
                                  "-Ilog/include" "-Iinclude" "-c"
                                  file)))
                (define (compile-cpp file)
                  (format #t "CPP ~a\n" file)
                  (zero? (system* "g++" "-o" (string-append file ".o")
                                  "-std=gnu++14"
                                  (string-append "-DADB_REVISION=" "\""
                                                 ,version "\"")
                                  (string-append "-I" (assoc-ref inputs "gcc")
                                                 "/include/c++")
                                  (string-append "-I" (assoc-ref inputs "gcc")
                                                 "/include/c++/backward")
                                  (string-append "-I" (assoc-ref inputs "gcc")
                                                 "/include/c++/x86_64-unknown-linux-gnu")
                                  "-DWORKAROUND_BUG6558362" "-D_GNU_SOURCE"
                                  "-DADB_HOST=1" "-fpermissive"
                                  "-Iinclude" "-Ibase/include"
                                  "-Iadb" "-c" file)))
                (define cpp-source
                   (list "adb/adb.cpp" "adb/adb_auth.cpp"
                         "adb/adb_io.cpp" "adb/adb_listeners.cpp"
                         "adb/adb_trace.cpp" "adb/adb_utils.cpp"
                         "adb/line_printer.cpp" "adb/sockets.cpp"
                         "adb/transport.cpp" "adb/transport_local.cpp"
                         "adb/transport_usb.cpp" "adb/sysdeps_unix.cpp"
                         "adb/fdevent.cpp" "adb/get_my_path_linux.cpp"
                         "adb/usb_linux.cpp" "adb/adb_auth_host.cpp"
                         "adb/shell_service_protocol.cpp"
                         "adb/console.cpp" "adb/commandline.cpp"
                         "adb/adb_client.cpp" "adb/services.cpp"
                         "adb/file_sync_client.cpp" "adb/client/main.cpp"
                         "base/file.cpp" "base/logging.cpp"
                         "base/parsenetaddress.cpp" "base/stringprintf.cpp"
                         "base/strings.cpp" "base/errors_unix.cpp"
                         "libcutils/sockets_unix.cpp" "libcutils/sockets.cpp"
                         "adb/diagnose_usb.cpp"))
                (define c-source
                   (list "liblog/log_event_write.c" "liblog/fake_log_device.c"
                         "liblog/log_event_list.c" "liblog/logger_write.c"
                         "liblog/config_write.c" "liblog/logger_lock.c"
                         "liblog/fake_writer.c" "liblog/logger_name.c"
                         "libcutils/load_file.c"
                         "libcutils/socket_local_client_unix.c"
                         "libcutils/socket_loopback_client_unix.c"
                         "libcutils/socket_network_client_unix.c"
                         "libcutils/socket_loopback_server_unix.c"
                         "libcutils/socket_local_server_unix.c"
                         "libcutils/socket_inaddr_any_server_unix.c"))
                (define (file-o list)
                  (string-join (map (lambda (str) (string-append str ".o"))
                               list)))
                (map compile-c c-source)
                (map compile-cpp cpp-source)
                (zero?
                  (system
                    (string-append "g++ -o myadb -lrt -ldl -lpthread -lcrypto "
                                   (file-o c-source) " " (file-o cpp-source))))))
            (replace 'install
              (lambda* (#:key outputs #:allow-other-keys)
                (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
                   (mkdir-p bin)
                   (copy-file "myadb" (string-append bin "/adb"))))))))
    (home-page
     "https://android.googlesource.com/platform/system/core/")
    (synopsis "Android Debug Bridge")
    (description "Allows you to communicate with your android device through the
Android Debug Bridge.")
    (license license:asl2.0))) ; and others for some files


debug log:

solving f4aa02858 ...
found f4aa02858 in https://yhetil.org/guix/20161211172643.0da9750f@lepiller.eu/

applying [1/1] https://yhetil.org/guix/20161211172643.0da9750f@lepiller.eu/
diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
new file mode 100644
index 000000000..f4aa02858

Checking patch gnu/packages/android.scm...
1:138: new blank line at EOF.
+
Applied patch gnu/packages/android.scm cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 f4aa0285813ecb030ebced95c332bbc57e82789c	gnu/packages/android.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.