From unknown Fri Aug 15 21:25:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26522: gnu: Add adb Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Apr 2017 16:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26522 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 26522@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.149227395518181 (code B ref -1); Sat, 15 Apr 2017 16:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Apr 2017 16:32:35 +0000 Received: from localhost ([127.0.0.1]:49179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czQcb-0004j0-EJ for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czQcW-0004ii-43 for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czQcO-0001hb-8t for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1czQcO-0001hU-40 for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czQcL-0005OV-Ei for guix-patches@gnu.org; Sat, 15 Apr 2017 12:32:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czQcI-0001cN-7R for guix-patches@gnu.org; Sat, 15 Apr 2017 12:32:09 -0400 Received: from dau94-h03-89-91-205-84.dsl.sta.abo.bbox.fr ([89.91.205.84]:45670 helo=skaro.lepiller.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1czQcH-0001ZW-HN for guix-patches@gnu.org; Sat, 15 Apr 2017 12:32:06 -0400 Received: from localhost (localhost [127.0.0.1]) by skaro.lepiller.eu (Postfix) with ESMTP id 577177FE7E for ; Sat, 15 Apr 2017 18:32:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492273922; bh=KsZZl9tT/vEPSWkCrLJPpqWVNbk3MwLUJ3HM+20I1SI=; h=Date:From:To:Subject:From; b=RbA5SvmGqFSgcZi+83jtGvYrOIh/wBqwUhnsvdHdBUrWfFzSey9vwqJSUdKEVIYGj AAPM+oK2Us2hxEq4EL38cWKN33lqKH0zwf2mHyIIg7d37qyuEBpiwm1KYK9e50Lk2f EUG7oqI3lwjFZn0Q5tHdE1mAKPLbLUBqvgQ0nHVmVzeT1ogELWFahMvqdwXz/Il2nb 8HUKq936G4XKy+RkBone7FS/5JLngdm8pOFa02pP0Tg9aePrKnlg6QQcBFrq8Oy7pZ /AWLImqMF05mhTKz1hmmvgIMLM3oUpLgOuw1rk0JMDaxM6ZahuqmcVWnBK1QS0Xu8A QFhK/yOGSTCCImU+EeIPMdXn0uofleZmLg7v/08djrb1zDq16M3LMVawoCSarg0eii G6BtKqvkuQUxgDY30KfpUE+hSBzWOsj+OM29LoXFL0vI+mKBQozMksyoQRQ4J5fY2x bTTdyOBMH/pPky7vadiD/++pL4ojNWOUN0VmCtkdWzF7uHNIKu7DyKXJxnIwZHIwBJ 9UBKk5gcIltZylcZ+2m6JKbzElJqg0RnNZfGdVW+QrIW1gBvVO84NOe4u/+jqVa85/ HN7h3D5trm1AkWo4XJ/Yrn4ShZVmTCXhOySvISMS0Z1DbelLbucrTtvSVFycKVzkHC sfn35FwlIS8BR43/Did5GU8Y= X-Virus-Scanned: Debian amavisd-new at lepiller.eu Received: from skaro.lepiller.eu ([127.0.0.1]) by localhost (lepiller.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FSodvZliN7mA for ; Sat, 15 Apr 2017 18:31:52 +0200 (CEST) Received: from localhost (89-93-157-164.hfc.dyn.abo.bbox.fr [89.93.157.164]) by skaro.lepiller.eu (Postfix) with ESMTPSA id 668877FA6C for ; Sat, 15 Apr 2017 18:31:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492273911; bh=KsZZl9tT/vEPSWkCrLJPpqWVNbk3MwLUJ3HM+20I1SI=; h=Date:From:To:Subject:From; b=n6fTx7zT48dOD7MB4elfvsEe2dP7O+6kPhFBIWzmLg35u1PZ7lChgSwt1S9L/K4bv F0XKwnWIGy1qPqngsUlrMlk8sH2VRrC7GbgChWlv9D9YZaONqf+LXHzKjqHT3xXMPc 7bYpIN9g61GZdXIqdFs0S7ws2+udu0nxp96dqs7swwbAWsLEE7AelCFPAceOB5sUPd 0I0DH0fUCpG4bkYGMgtGnAcN544bJcL55WeV9fTD/CVEna2Y+zTltDcXbdGwuFcUj6 kxe+yTEu1yaHvZS9Btx7ywsDbWL7FsmrZAJVWKSOCT9oN/T277j6tOjiPszlYJYzUU 6R+Kwn/94BdraANlBkfjXjNJlPINKafW78IHKXKO8q4OO4ok80bWFOlQnzh4SU2AR2 lI/FxFkZWBwRPkrO5Ylxz4oR5ER9Eu21wQdjV7BXBrbbK797WFjydndKy+lgZdKYv1 kmDcfqdq4ssEOleXgBmX0YqKjio8hI2ihOgTZea0FyMRJXV0kBhcYNUhzOLOZHaO4a 25GcCsad8mXQnTbWQff3o+fYmBYJ0qmegcdpdH3E+0MWhzJsfiSHo1bON7438ayGlH m/S3g8/d5vrw1JDFJRW1uWHsQgyg+v9/3JVJ/62VTYP6ZO7v1+Nbh8HP7MvEeqh8D0 qW9orCH+Fwx+f3Zf5Jsdh0CI= Date: Sat, 15 Apr 2017 18:31:46 +0200 From: Julien Lepiller Message-ID: <20170415183146.45f95eda@lepiller.eu> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/8LtqhbUobiNGOBFscY.WPSH" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --MP_/8LtqhbUobiNGOBFscY.WPSH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi guix, here is an updated version of Marius' patch mixed with my own. It updates our patches to the latest 7_1_2.rc6, adapts to some changes since last version, and fixes the build of adb. --MP_/8LtqhbUobiNGOBFscY.WPSH Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-adb.patch =46rom 96a5136e94bcae6cc2db0c83c81ef4831258779e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 15 Apr 2017 18:17:27 +0200 Subject: [PATCH] gnu: Add adb. * gnu/packages/android.scm: New file. * gnu/packages/patches/libbase-fix-includes.patch: New file. * gnu/packages/patches/libbase-use-own-logging.patch: New file. * gnu/local.mk (GNU_SYSTEM_MODULES, dist_patch_DATA): Add them. Co-Authored-By: Marius Bakke --- gnu/local.mk | 3 + gnu/packages/android.scm | 290 +++++++++++++++++= ++++ gnu/packages/patches/libbase-fix-includes.patch | 68 +++++ gnu/packages/patches/libbase-use-own-logging.patch | 77 ++++++ 4 files changed, 438 insertions(+) create mode 100644 gnu/packages/android.scm create mode 100644 gnu/packages/patches/libbase-fix-includes.patch create mode 100644 gnu/packages/patches/libbase-use-own-logging.patch diff --git a/gnu/local.mk b/gnu/local.mk index 82e94171b..4a80afc7d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -45,6 +45,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/adns.scm \ %D%/packages/algebra.scm \ %D%/packages/aidc.scm \ + %D%/packages/android.scm \ %D%/packages/animation.scm \ %D%/packages/anthy.scm \ %D%/packages/apl.scm \ @@ -686,6 +687,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/liba52-link-with-libm.patch \ %D%/packages/patches/liba52-set-soname.patch \ %D%/packages/patches/liba52-use-mtune-not-mcpu.patch \ + %D%/packages/patches/libbase-fix-includes.patch \ + %D%/packages/patches/libbase-use-own-logging.patch \ %D%/packages/patches/libbonobo-activation-test-race.patch \ %D%/packages/patches/libcanberra-sound-theme-freedesktop.patch \ %D%/packages/patches/libdrm-symbol-check.patch \ diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm new file mode 100644 index 000000000..3e13b9a18 --- /dev/null +++ b/gnu/packages/android.scm @@ -0,0 +1,290 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2012 Stefan Handschuh +;;; Copyright =C2=A9 2015 Kai-Chung Yan +;;; Copyright =C2=A9 2016 Marius Bakke +;;; Copyright =C2=A9 2017 Julien Lepiller +;;; +;;; 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 . + +(define-module (gnu packages android) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages tls)) + +;; The Makefiles that we add are largely based on the Debian +;; packages. They are licensed under GPL-2 and have copyright: +;; 2012, Stefan Handschuh +;; 2015, Kai-Chung Yan +;; Big thanks to them for laying the groundwork. + +;; The version tag is consistent between all repositories. +(define (android-platform-version) "7.1.2_r6") + +(define (android-platform-system-core version) + (origin + (method git-fetch) + (uri (git-reference + (url "https://android.googlesource.com/platform/system/core") + (commit (string-append "android-" version)))) + (file-name (string-append "android-platform-system-core-" + version "-checkout")) + (sha256 + (base32 + "0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg")))) + +(define liblog + (package + (name "liblog") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:make-flags '("CC=3Dgcc") + #: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 =3D liblog\n" + "SOURCES =3D 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 +=3D -fvisibility=3Dhidden -fPIC\n" + "CPPFLAGS +=3D -I../include -DFAKE_LOG_DEVICE=3D1" + ;; Keep these two in sync with "liblog/Android.bp". + " -DLIBLOG_LOG_TAG=3D1005" + " -DSNET_EVENT_LOG_TAG=3D1397638484\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0 -lpthrea= d\n" + + "build: $(SOURCES)\n" + " $(CC) $^ -o $(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFL= AGS)\n")))))) + (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)))))) + (home-page "https://developer.android.com/") + (synopsis "Logging library from the Android platform.") + (description "@code{liblog} represents an interface to the volatile An= droid +Logging system for NDK (Native) applications and libraries and contain +interfaces for either writing or reading logs. The log buffers are divide= d up +in Main, System, Radio and Events sub-logs.") + (license license:asl2.0))) + +(define libbase + (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")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #: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 =3D libbase\n" + "SOURCES =3D file.cpp logging.cpp parsenetaddress.cpp" + " stringprintf.cpp strings.cpp errors_unix.cpp\n" + + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0" + " -L.. -llog\n" + + "build: $(SOURCES)\n" + " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(L= DFLAGS)\n" + )))))) + (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)))))) + (inputs `(("liblog" ,liblog))) + (home-page "https://developer.android.com/") + (synopsis "Android platform base library") + (description "@code{libbase} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define libcutils + (package + (name "libcutils") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-source + (lambda _ (chdir "libcutils") #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 =3D libcutils\n" + "SOURCES =3D load_file.o socket_local_client_unix.o" + " socket_loopback_client_unix.o socket_network_client_u= nix.o" + " socket_loopback_server_unix.o socket_local_server_uni= x.o" + " sockets_unix.o socket_inaddr_any_server_unix.o" + " sockets.o\n" + "CC =3D gcc\n" + + "CFLAGS +=3D -fPIC\n" + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0\n" + + "build: $(SOURCES)\n" + " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(L= DFLAGS)\n" + )))))) + (delete 'configure) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib"))) + (install-file "libcutils.so.0" lib) + (with-directory-excursion lib + (symlink "libcutils.so.0" "libcutils.so")) + #t)))))) + (home-page "https://developer.android.com/") + (synopsis "Android platform c utils library") + (description "@code{libcutils} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define-public adb + (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")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-source + (lambda _ (chdir "adb") #t)) + (add-before 'build 'fix-clang + (lambda _ + (substitute* "adb_client.h" + (("_Nonnull") "") + (("_Nullable") "")))) + (add-before 'build 'fix-main + (lambda _ + (copy-file "client/main.cpp" "adb_main.cpp"))) + (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 +=3D -std=3Dgnu++14 -fpermissive\n" + "CPPFLAGS +=3D -I../include -I../base/include -I. -DADB= _HOST=3D1 " + "-DADB_REVISION=3D'\"" ,version "\"' -fPIC\n" + "LDFLAGS +=3D -lcrypto -lpthread -lbase -lcutils -L. -l= adb\n" + + ;; Libadb specifics. + "LIBADB_SOURCES =3D 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 transpor= t_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 +=3D -shared -Wl,-soname,libadb.so.0 " + "-lcrypto -lpthread -lbase\n" + + ;; Adb specifics. + "ADB_SOURCES =3D adb_main.cpp console.cpp commandline.c= pp " + "adb_client.cpp file_sync_client.cpp\n" + "ADB_LDFLAGS +=3D -Wl,-rpath=3D" (assoc-ref outputs "ou= t") "/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" + )))))) + (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)) + (inputs + `(("libbase" ,libbase) + ("libcutils" ,libcutils) + ("openssl" ,openssl))) + (home-page "https://developer.android.com/studio/command-line/adb.html= ") + (synopsis "Android Debug Bridge") + (description + "@command{adb} is a versatile command line tool that lets you communi= cate +with an emulator instance or connected Android device. It facilitates a v= ariety +of device actions, such as installing and debugging apps, and it provides = access +to a Unix shell that can run commands on the connected device or emulator.= ") + (license license:asl2.0))) diff --git a/gnu/packages/patches/libbase-fix-includes.patch b/gnu/packages= /patches/libbase-fix-includes.patch new file mode 100644 index 000000000..24847ae0c --- /dev/null +++ b/gnu/packages/patches/libbase-fix-includes.patch @@ -0,0 +1,68 @@ +This patch fixes the build of adb on linux. It was taken from archlinux. + +diff --git a/adb/sysdeps.h b/adb/sysdeps.h +index 75dcc86..867f3ec 100644 +--- a/adb/sysdeps.h ++++ b/adb/sysdeps.h +@@ -25,6 +25,7 @@ + #endif +=20 + #include ++#include +=20 + #include + #include +@@ -831,7 +832,16 @@ static __inline__ int adb_is_absolute_host_path(const= char* path) { +=20 + static __inline__ unsigned long adb_thread_id() + { +- return (unsigned long)gettid(); ++ // TODO: this function should be merged with GetThreadId ++#if defined(__BIONIC__) ++ return gettid(); ++#elif defined(__APPLE__) ++ return syscall(SYS_thread_selfid); ++#elif defined(__linux__) ++ return syscall(__NR_gettid); ++#elif defined(_WIN32) ++ return GetCurrentThreadId(); ++#endif + } +=20 + #endif /* !_WIN32 */ +diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp +index 296995e..48269b6 100644 +--- a/base/errors_unix.cpp ++++ b/base/errors_unix.cpp +@@ -17,6 +17,7 @@ + #include "android-base/errors.h" +=20 + #include ++#include +=20 + namespace android { + namespace base { +diff --git a/base/file.cpp b/base/file.cpp +index da1adba..91a3901 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include +=20 + #include +=20 +diff --git a/base/logging.cpp b/base/logging.cpp +index 1741871..e97c7f1 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -21,6 +21,7 @@ + #include "android-base/logging.h" +=20 + #include ++#include +=20 + // For getprogname(3) or program_invocation_short_name. + #if defined(__ANDROID__) || defined(__APPLE__) diff --git a/gnu/packages/patches/libbase-use-own-logging.patch b/gnu/packa= ges/patches/libbase-use-own-logging.patch new file mode 100644 index 000000000..4fcff832f --- /dev/null +++ b/gnu/packages/patches/libbase-use-own-logging.patch @@ -0,0 +1,77 @@ +From e5dd71a290f664d3f3bf0dd8a4bad411dc7ad416 Mon Sep 17 00:00:00 2001 +From: Elliott Hughes +Date: Thu, 28 Jul 2016 15:15:28 -0700 +Subject: [PATCH] libbase should use its own logging! + +Not doing so led to us using a bogus log tag. + +Bug: http://b/30281203 +Change-Id: I3ac91758a1a043146c65f2ae0f36fcfbe372c30f +--- + base/file.cpp | 11 +++++------ + base/logging.cpp | 3 +-- + 2 files changed, 6 insertions(+), 8 deletions(-) + +diff --git a/base/file.cpp b/base/file.cpp +index da1adba19..4e7ac82d1 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -24,9 +24,8 @@ + #include +=20 + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. ++#include "android-base/logging.h" + #include "android-base/utf8.h" +-#define LOG_TAG "base.file" +-#include "cutils/log.h" + #include "utils/Compat.h" +=20 + namespace android { +@@ -86,22 +85,22 @@ bool WriteStringToFile(const std::string& content, con= st std::string& path, + int flags =3D O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW | O= _BINARY; + int fd =3D TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); + if (fd =3D=3D -1) { +- ALOGE("android::WriteStringToFile open failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile open failed"; + return false; + } +=20 + // We do an explicit fchmod here because we assume that the caller real= ly + // meant what they said and doesn't want the umask-influenced mode. + if (fchmod(fd, mode) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchmod failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchmod failed"; + return CleanUpAfterFailedWrite(path); + } + if (fchown(fd, owner, group) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchown failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchown failed"; + return CleanUpAfterFailedWrite(path); + } + if (!WriteStringToFd(content, fd)) { +- ALOGE("android::WriteStringToFile write failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile write failed"; + return CleanUpAfterFailedWrite(path); + } + close(fd); +diff --git a/base/logging.cpp b/base/logging.cpp +index 769c266c9..959bb8b05 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -43,12 +43,11 @@ +=20 + #include "android-base/macros.h" + #include "android-base/strings.h" +-#include "cutils/threads.h" +=20 + // Headers for LogMessage::LogLine. + #ifdef __ANDROID__ + #include +-#include "cutils/log.h" ++#include "log/log.h" + #else + #include + #include +--=20 +2.11.0 + --=20 2.12.2 --MP_/8LtqhbUobiNGOBFscY.WPSH-- From unknown Fri Aug 15 21:25:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26522: gnu: Add adb Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Apr 2017 18:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26522 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Julien Lepiller , 26522@debbugs.gnu.org Received: via spool by 26522-submit@debbugs.gnu.org id=B26522.149227937914557 (code B ref 26522); Sat, 15 Apr 2017 18:03:01 +0000 Received: (at 26522) by debbugs.gnu.org; 15 Apr 2017 18:02:59 +0000 Received: from localhost ([127.0.0.1]:49320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czS2B-0003mf-Oj for submit@debbugs.gnu.org; Sat, 15 Apr 2017 14:02:59 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czS2A-0003mX-9G for 26522@debbugs.gnu.org; Sat, 15 Apr 2017 14:02:55 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2ECF720664; Sat, 15 Apr 2017 14:02:54 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Sat, 15 Apr 2017 14:02:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=Sza5zET8syIy7u4yGIDxNOWt5cLwtabgGqwODKpaC GQ=; b=VUu+VGcm+xjt5gL3lCEDe8JaOnqLNuL7/qTEmj6JumoLiLmNgelvCCa6M 6Z26EACAeC14zbCNjfzQzymJWqR20jQPL1sP/X9avap1kd6xswpBI3pO7e28syaG 77HcDzUXBG6jT9aCtn0i6jxWAIBp6ZSm5knA6td+lXBiBYH5m7ia1rr35ImZ+PLT upKx3ZjP+vM/pz9ZmvWE8nZD63Iu7BsMsHpYwSLQIQ75MSc9FYhC2cnPRG3tGea+ 4krSWKtT7XE4ifm4PWq/z2EHCUFJAqcEhsmHFtHcGABcAoMyJ2NE6Dx8mL5Nc/xN HQxPsP2ETAPwaE/4UYAl34mLOnr+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=Sza5zET8syIy7u4yGI DxNOWt5cLwtabgGqwODKpaCGQ=; b=MK6hG1R7EeOtB6WrSHwP0FhG2ujeG3Sh+H tXWjNdTa84lwexkVKSEMrD1Hmv+GOCOx4xMcsHX+kFgHTW7Rr1WlC6RZAW7M4MTv FAVfQSZCkYngV9F5DmbBuwiHwwz6OZP6ozlW9d1lWtiqH+pAoxVqfYPjlQoEhDgL lzc4Ewbn4PTIFms5DHJdoJBA0Qe3x2twkRaQAYKEOYbI5/s90usa9Ano1/2isahZ CzFhjAys7Op3BNfzqzK18EMZaRzPmpa4gEKxopsx20DIoDaAV2xzJC1LYRWzZzOy s12IJvK3czpwufHeqjHi2xDc4fTH7oyzUHCeJ0R8al4FR9nL/TEw== X-ME-Sender: X-Sasl-enc: +U9f5BVruAeg8f1abwiGHiodTlf19RBjJvFA0THeOtTi 1492279373 Received: from localhost (unknown [188.113.81.93]) by mail.messagingengine.com (Postfix) with ESMTPA id B6A8324750; Sat, 15 Apr 2017 14:02:53 -0400 (EDT) From: Marius Bakke In-Reply-To: <20170415183146.45f95eda@lepiller.eu> References: <20170415183146.45f95eda@lepiller.eu> User-Agent: Notmuch/0.24.1 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-unknown-linux-gnu) Date: Sat, 15 Apr 2017 20:02:52 +0200 Message-ID: <87a87hmtv7.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Julien Lepiller writes: > Hi guix, > > here is an updated version of Marius' patch mixed with my own. It > updates our patches to the latest 7_1_2.rc6, adapts to some changes > since last version, and fixes the build of adb. Wahoo! :) I was *just* thinking yesterday that I should fix up this package ASAP. Thanks a lot for beating me to it! [...] > +(define liblog > + (package > + (name "liblog") > + (version (android-platform-version)) > + (source (android-platform-system-core version)) > + (build-system gnu-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")))))) I'm actually not sure what the return value of "display" is and the Guile manual does not mention. I'd end this on a #t just to be "safe". > + (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)))))) > + (home-page "https://developer.android.com/") > + (synopsis "Logging library from the Android platform.") > + (description "@code{liblog} represents an interface to the volatile Android > +Logging system for NDK (Native) applications and libraries and contain > +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 > + (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")))) > + (build-system gnu-build-system) > + (arguments > + `(#:tests? #f ; TODO. > + #: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" > + )))))) Same here, and also move the parens to the previous line. Possibly also break it into two lines :) > + (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)))))) > + (inputs `(("liblog" ,liblog))) > + (home-page "https://developer.android.com/") > + (synopsis "Android platform base library") > + (description "@code{libbase} is a library in common use by the > +various Android core host applications.") > + (license license:asl2.0))) > + > +(define libcutils > + (package > + (name "libcutils") > + (version (android-platform-version)) > + (source (android-platform-system-core version)) > + (build-system gnu-build-system) > + (arguments > + `(#:tests? #f ; TODO. > + #:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'enter-source > + (lambda _ (chdir "libcutils") #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 = libcutils\n" > + "SOURCES = load_file.o socket_local_client_unix.o" > + " socket_loopback_client_unix.o socket_network_client_unix.o" > + " socket_loopback_server_unix.o socket_local_server_unix.o" > + " sockets_unix.o socket_inaddr_any_server_unix.o" > + " sockets.o\n" > + "CC = gcc\n" > + > + "CFLAGS += -fPIC\n" > + "CXXFLAGS += -std=gnu++11 -fPIC\n" > + "CPPFLAGS += -Iinclude -I../include\n" > + "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0\n" > + > + "build: $(SOURCES)\n" > + " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)\n" > + )))))) ...and here. > + (delete 'configure) > + (replace 'install > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (lib (string-append out "/lib"))) > + (install-file "libcutils.so.0" lib) > + (with-directory-excursion lib > + (symlink "libcutils.so.0" "libcutils.so")) > + #t)))))) > + (home-page "https://developer.android.com/") > + (synopsis "Android platform c utils library") > + (description "@code{libcutils} is a library in common use by the > +various Android core host applications.") > + (license license:asl2.0))) > + > +(define-public adb > + (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")))) > + (build-system gnu-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'enter-source > + (lambda _ (chdir "adb") #t)) > + (add-before 'build 'fix-clang > + (lambda _ > + (substitute* "adb_client.h" > + (("_Nonnull") "") > + (("_Nullable") "")))) Can you add a comment explaining what this does? From the phase name, I'd guess it removes a clang dependency, but it's not clear how or why. Also check indentation here and end with an explicit #t. > + (add-before 'build 'fix-main > + (lambda _ > + (copy-file "client/main.cpp" "adb_main.cpp"))) This should also end on a #t. A comment would be nice too if you know why it's needed, what an odd build step. > + (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" > + )))))) ...lonely parens here too (`lint` should complain about this) :) LGTM with these fixes! Thank you! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAljyYEwACgkQoqBt8qM6 VPp0sgf/QVHMFE81EpH7YoK5u7LNiDsIpZdcU/d5Rv+1rmktOQUufvDL2ypvWKQC Ti1y7YzXT/8ntn6tGoUEaDqb0reGQ3WGd50QCL/c7ZkdmtO8P8mVpuo3OrohLeo6 NfSkm7MDyRk6LZnfquDI7sF0u1eXI1XwtyR25hI3fGkgeR3UYDKswFwgOyFKt41T tge/pS4VXQVGCWJzFp4+oc1koh1PTDpFsZbnGGCI4mivBhd0xuXlcZ3/adghv/k+ IJ8+zHzNXlWKONBCWntY4kU+MX8kWBXHdeT16Eyh1yr8e+J5UXcAENQEwdK516Ho CF7xAsVEKFnl9YfqF+IagAhJOZa5WA== =OPtV -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Aug 15 21:25:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26522: gnu: Add adb Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Apr 2017 09:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26522 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 26522@debbugs.gnu.org Received: via spool by 26522-submit@debbugs.gnu.org id=B26522.14923345697637 (code B ref 26522); Sun, 16 Apr 2017 09:23:01 +0000 Received: (at 26522) by debbugs.gnu.org; 16 Apr 2017 09:22:49 +0000 Received: from localhost ([127.0.0.1]:49736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czgOF-0001yx-3y for submit@debbugs.gnu.org; Sun, 16 Apr 2017 05:22:48 -0400 Received: from dau94-h03-89-91-205-84.dsl.sta.abo.bbox.fr ([89.91.205.84]:42134 helo=skaro.lepiller.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czgOA-0001yh-89 for 26522@debbugs.gnu.org; Sun, 16 Apr 2017 05:22:38 -0400 Received: from localhost (localhost [127.0.0.1]) by skaro.lepiller.eu (Postfix) with ESMTP id 9827C810EB for <26522@debbugs.gnu.org>; Sun, 16 Apr 2017 11:22:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492334547; bh=r0WBvSmVE3ZGpOiD14VlSfJmCmgKF21eQm5azRTYpUg=; h=Date:From:To:Subject:In-Reply-To:References:From; b=i/FQiCR/QPJf6bnH09WWZ9cz+HBa1C3h80oVUu9anPga7GLqEgYaiNRwNAcytFW0G grK7j8Gv+NpgNCdWNzCzcQSv2mOxmw+nSTnDlcawQvcDrExv2OZL3+2MWU57SO3wvK 3xZfZo/WzkOYa+Y1BNM8rD7nff9tiaga009dI1/WEbn5Qt5FF9hRSqAUqeQ5bWzFE9 2jpVozZc6nPtpBiEWuGtxHPhfqTLaWlsQPFh8DQ7EGdyy52bCBlu+UD2r7VGUTJDsJ NN5YBlnEf2ySQ7NVHevlVK07UcHVrOZ2OZp+fyU4rAosoMS1K/scPIcDpoKZbKMbsZ AiyOld+wZAtUdmByzQqbkIwTStDNwYaFXicM6OZgKAhtxbCZ6G7o3drBh9nfaH8iJ4 7qGrvxsleSZ/REyO/AJATZF6m3kxBLzgDDcWbyAE2YE28zc1IrIP80oEYe8byq+0qL 8MVC5Y6HI+bWWs3+RTTGcaY1BMWGjQOSBE0kA5kwvX84dbk/8Q32t+iAE7gmLPXHJB 49DFpOGgtUOHn1Kp+VaA72wpapQg7vvZhBChJjIk8ufhffd0D68FY7K7bh/YDqzp7R BAID6gHUD0Rv35g0W/geraYSEMLemHqH5i3199WvirwNnHw3P/4Gn39j0PcMHOw5UK 3eqRMdqH5AgVUB738BtMP+OQ= X-Virus-Scanned: Debian amavisd-new at lepiller.eu Received: from skaro.lepiller.eu ([127.0.0.1]) by localhost (lepiller.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YfCw2SdEbGDC for <26522@debbugs.gnu.org>; Sun, 16 Apr 2017 11:22:17 +0200 (CEST) Received: from localhost (89-93-157-164.hfc.dyn.abo.bbox.fr [89.93.157.164]) by skaro.lepiller.eu (Postfix) with ESMTPSA id EF8C37FE7E for <26522@debbugs.gnu.org>; Sun, 16 Apr 2017 11:22:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492334537; bh=r0WBvSmVE3ZGpOiD14VlSfJmCmgKF21eQm5azRTYpUg=; h=Date:From:To:Subject:In-Reply-To:References:From; b=PEb+A6hnK4N/6kZMFL84l4fyyDYMPzQkw1XcgChg+QWgzAjNSwpAfCV7R6n+hh7kh ZWLTsuqpgpFRZ/xYHnCV5pDh0F3dKJRLslb8xJhjIaD7PifKszqdVBmiupDOP9celx 6YcOe8rYpQfckeM5dE/ktjx5xQM09e+tSGsGz2t/N6DFYLmR9Vf4eLa/TPS9RGqSz5 pvGAG3VYwsixLCkjthk8EPCUlOnEdrFCSYTQ0g7+lbTDbSl2bz8/e/GEjW4RriIOgj Y62C9qbL+IusFcGTaZa9PWyjfavzzv+avFRsq6XZsLhXM4eSioxndPzuLJIPgr+SOI jDLrWyj1qw6QdwwUu8lLv/A6JwzcslBbUlV4xVTTDMBQMEgQxcxYBu7NA8/SF5l5UH guobM4R+jiuWRcvKCTrpomZsUJGv+uKfWquyR/bB8+NN0cEmm/xZb+TR3dFrgbLUIF riKZXnlzodnjNbVNQjaPIQ8MN4SYgQaTGlzITFEOY2sQ1w/8SVBQpTlOxmWIeYVc54 /C3oUHTiAjqAoY8N1h1RD3kMlPV+zx0vZkDAJyrJacxM2B5WcniJoDPwu05rTzbZ1d TETKR0nDU73TdpSmzxZ+ucHgG3XVCWSTKLSR/tqmTHAR9+Z2crcOmG+sidx2XLiKs+ VQI+xXQ/rYoh/u6ZRhKtdBDQ= Date: Sun, 16 Apr 2017 11:22:11 +0200 From: Julien Lepiller Message-ID: <20170416112200.51037253@lepiller.eu> In-Reply-To: <87a87hmtv7.fsf@fastmail.com> References: <20170415183146.45f95eda@lepiller.eu> <87a87hmtv7.fsf@fastmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/XLCHl9bJjPU..MzOGYKFGtK" X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) --MP_/XLCHl9bJjPU..MzOGYKFGtK Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Marius, thanks for the quick review. This should fix your comments. --MP_/XLCHl9bJjPU..MzOGYKFGtK Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-adb.patch =46rom a6a608744dc5628bc94ffdb2bc9abf359daf72dc Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 15 Apr 2017 18:17:27 +0200 Subject: [PATCH] gnu: Add adb. * gnu/packages/android.scm: New file. * gnu/packages/patches/libbase-fix-includes.patch: New file. * gnu/packages/patches/libbase-use-own-logging.patch: New file. * gnu/local.mk (GNU_SYSTEM_MODULES, dist_patch_DATA): Add them. Co-Authored-By: Marius Bakke --- gnu/local.mk | 3 + gnu/packages/android.scm | 300 +++++++++++++++++= ++++ gnu/packages/patches/libbase-fix-includes.patch | 68 +++++ gnu/packages/patches/libbase-use-own-logging.patch | 77 ++++++ 4 files changed, 448 insertions(+) create mode 100644 gnu/packages/android.scm create mode 100644 gnu/packages/patches/libbase-fix-includes.patch create mode 100644 gnu/packages/patches/libbase-use-own-logging.patch diff --git a/gnu/local.mk b/gnu/local.mk index 82e94171b..4a80afc7d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -45,6 +45,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/adns.scm \ %D%/packages/algebra.scm \ %D%/packages/aidc.scm \ + %D%/packages/android.scm \ %D%/packages/animation.scm \ %D%/packages/anthy.scm \ %D%/packages/apl.scm \ @@ -686,6 +687,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/liba52-link-with-libm.patch \ %D%/packages/patches/liba52-set-soname.patch \ %D%/packages/patches/liba52-use-mtune-not-mcpu.patch \ + %D%/packages/patches/libbase-fix-includes.patch \ + %D%/packages/patches/libbase-use-own-logging.patch \ %D%/packages/patches/libbonobo-activation-test-race.patch \ %D%/packages/patches/libcanberra-sound-theme-freedesktop.patch \ %D%/packages/patches/libdrm-symbol-check.patch \ diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm new file mode 100644 index 000000000..e23d0fd91 --- /dev/null +++ b/gnu/packages/android.scm @@ -0,0 +1,300 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2012 Stefan Handschuh +;;; Copyright =C2=A9 2015 Kai-Chung Yan +;;; Copyright =C2=A9 2016 Marius Bakke +;;; Copyright =C2=A9 2017 Julien Lepiller +;;; +;;; 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 . + +(define-module (gnu packages android) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages tls)) + +;; The Makefiles that we add are largely based on the Debian +;; packages. They are licensed under GPL-2 and have copyright: +;; 2012, Stefan Handschuh +;; 2015, Kai-Chung Yan +;; Big thanks to them for laying the groundwork. + +;; The version tag is consistent between all repositories. +(define (android-platform-version) "7.1.2_r6") + +(define (android-platform-system-core version) + (origin + (method git-fetch) + (uri (git-reference + (url "https://android.googlesource.com/platform/system/core") + (commit (string-append "android-" version)))) + (file-name (string-append "android-platform-system-core-" + version "-checkout")) + (sha256 + (base32 + "0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg")))) + +(define liblog + (package + (name "liblog") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:make-flags '("CC=3Dgcc") + #: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 =3D liblog\n" + "SOURCES =3D 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 +=3D -fvisibility=3Dhidden -fPIC\n" + "CPPFLAGS +=3D -I../include -DFAKE_LOG_DEVICE=3D1" + ;; Keep these two in sync with "liblog/Android.bp". + " -DLIBLOG_LOG_TAG=3D1005" + " -DSNET_EVENT_LOG_TAG=3D1397638484\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0 -lpthrea= d\n" + + "build: $(SOURCES)\n" + " $(CC) $^ -o $(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFL= AGS)\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)))))) + (home-page "https://developer.android.com/") + (synopsis "Logging library from the Android platform.") + (description "@code{liblog} represents an interface to the volatile An= droid +Logging system for NDK (Native) applications and libraries and contain +interfaces for either writing or reading logs. The log buffers are divide= d up +in Main, System, Radio and Events sub-logs.") + (license license:asl2.0))) + +(define libbase + (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")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #: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 =3D libbase\n" + "SOURCES =3D file.cpp logging.cpp parsenetaddress.cpp" + " stringprintf.cpp strings.cpp errors_unix.cpp\n" + + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -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)))))) + (inputs `(("liblog" ,liblog))) + (home-page "https://developer.android.com/") + (synopsis "Android platform base library") + (description "@code{libbase} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define libcutils + (package + (name "libcutils") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-source + (lambda _ (chdir "libcutils") #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 =3D libcutils\n" + "SOURCES =3D load_file.o socket_local_client_unix.o" + " socket_loopback_client_unix.o socket_network_client_u= nix.o" + " socket_loopback_server_unix.o socket_local_server_uni= x.o" + " sockets_unix.o socket_inaddr_any_server_unix.o" + " sockets.o\n" + "CC =3D gcc\n" + + "CFLAGS +=3D -fPIC\n" + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0\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 "libcutils.so.0" lib) + (with-directory-excursion lib + (symlink "libcutils.so.0" "libcutils.so")) + #t)))))) + (home-page "https://developer.android.com/") + (synopsis "Android platform c utils library") + (description "@code{libcutils} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define-public adb + (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")))) + (build-system gnu-build-system) + (arguments + `(#: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, t= hat + ;; 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") + #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 +=3D -std=3Dgnu++14 -fpermissive\n" + "CPPFLAGS +=3D -I../include -I../base/include -I. -DADB= _HOST=3D1 " + "-DADB_REVISION=3D'\"" ,version "\"' -fPIC\n" + "LDFLAGS +=3D -lcrypto -lpthread -lbase -lcutils -L. -l= adb\n" + + ;; Libadb specifics. + "LIBADB_SOURCES =3D 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 transpor= t_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 +=3D -shared -Wl,-soname,libadb.so.0 " + "-lcrypto -lpthread -lbase\n" + + ;; Adb specifics. + "ADB_SOURCES =3D adb_main.cpp console.cpp commandline.c= pp " + "adb_client.cpp file_sync_client.cpp\n" + "ADB_LDFLAGS +=3D -Wl,-rpath=3D" (assoc-ref outputs "ou= t") "/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)) + (inputs + `(("libbase" ,libbase) + ("libcutils" ,libcutils) + ("openssl" ,openssl))) + (home-page "https://developer.android.com/studio/command-line/adb.html= ") + (synopsis "Android Debug Bridge") + (description + "@command{adb} is a versatile command line tool that lets you communi= cate +with an emulator instance or connected Android device. It facilitates a v= ariety +of device actions, such as installing and debugging apps, and it provides = access +to a Unix shell that can run commands on the connected device or emulator.= ") + (license license:asl2.0))) diff --git a/gnu/packages/patches/libbase-fix-includes.patch b/gnu/packages= /patches/libbase-fix-includes.patch new file mode 100644 index 000000000..24847ae0c --- /dev/null +++ b/gnu/packages/patches/libbase-fix-includes.patch @@ -0,0 +1,68 @@ +This patch fixes the build of adb on linux. It was taken from archlinux. + +diff --git a/adb/sysdeps.h b/adb/sysdeps.h +index 75dcc86..867f3ec 100644 +--- a/adb/sysdeps.h ++++ b/adb/sysdeps.h +@@ -25,6 +25,7 @@ + #endif +=20 + #include ++#include +=20 + #include + #include +@@ -831,7 +832,16 @@ static __inline__ int adb_is_absolute_host_path(const= char* path) { +=20 + static __inline__ unsigned long adb_thread_id() + { +- return (unsigned long)gettid(); ++ // TODO: this function should be merged with GetThreadId ++#if defined(__BIONIC__) ++ return gettid(); ++#elif defined(__APPLE__) ++ return syscall(SYS_thread_selfid); ++#elif defined(__linux__) ++ return syscall(__NR_gettid); ++#elif defined(_WIN32) ++ return GetCurrentThreadId(); ++#endif + } +=20 + #endif /* !_WIN32 */ +diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp +index 296995e..48269b6 100644 +--- a/base/errors_unix.cpp ++++ b/base/errors_unix.cpp +@@ -17,6 +17,7 @@ + #include "android-base/errors.h" +=20 + #include ++#include +=20 + namespace android { + namespace base { +diff --git a/base/file.cpp b/base/file.cpp +index da1adba..91a3901 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include +=20 + #include +=20 +diff --git a/base/logging.cpp b/base/logging.cpp +index 1741871..e97c7f1 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -21,6 +21,7 @@ + #include "android-base/logging.h" +=20 + #include ++#include +=20 + // For getprogname(3) or program_invocation_short_name. + #if defined(__ANDROID__) || defined(__APPLE__) diff --git a/gnu/packages/patches/libbase-use-own-logging.patch b/gnu/packa= ges/patches/libbase-use-own-logging.patch new file mode 100644 index 000000000..4fcff832f --- /dev/null +++ b/gnu/packages/patches/libbase-use-own-logging.patch @@ -0,0 +1,77 @@ +From e5dd71a290f664d3f3bf0dd8a4bad411dc7ad416 Mon Sep 17 00:00:00 2001 +From: Elliott Hughes +Date: Thu, 28 Jul 2016 15:15:28 -0700 +Subject: [PATCH] libbase should use its own logging! + +Not doing so led to us using a bogus log tag. + +Bug: http://b/30281203 +Change-Id: I3ac91758a1a043146c65f2ae0f36fcfbe372c30f +--- + base/file.cpp | 11 +++++------ + base/logging.cpp | 3 +-- + 2 files changed, 6 insertions(+), 8 deletions(-) + +diff --git a/base/file.cpp b/base/file.cpp +index da1adba19..4e7ac82d1 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -24,9 +24,8 @@ + #include +=20 + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. ++#include "android-base/logging.h" + #include "android-base/utf8.h" +-#define LOG_TAG "base.file" +-#include "cutils/log.h" + #include "utils/Compat.h" +=20 + namespace android { +@@ -86,22 +85,22 @@ bool WriteStringToFile(const std::string& content, con= st std::string& path, + int flags =3D O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW | O= _BINARY; + int fd =3D TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); + if (fd =3D=3D -1) { +- ALOGE("android::WriteStringToFile open failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile open failed"; + return false; + } +=20 + // We do an explicit fchmod here because we assume that the caller real= ly + // meant what they said and doesn't want the umask-influenced mode. + if (fchmod(fd, mode) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchmod failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchmod failed"; + return CleanUpAfterFailedWrite(path); + } + if (fchown(fd, owner, group) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchown failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchown failed"; + return CleanUpAfterFailedWrite(path); + } + if (!WriteStringToFd(content, fd)) { +- ALOGE("android::WriteStringToFile write failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile write failed"; + return CleanUpAfterFailedWrite(path); + } + close(fd); +diff --git a/base/logging.cpp b/base/logging.cpp +index 769c266c9..959bb8b05 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -43,12 +43,11 @@ +=20 + #include "android-base/macros.h" + #include "android-base/strings.h" +-#include "cutils/threads.h" +=20 + // Headers for LogMessage::LogLine. + #ifdef __ANDROID__ + #include +-#include "cutils/log.h" ++#include "log/log.h" + #else + #include + #include +--=20 +2.11.0 + --=20 2.12.2 --MP_/XLCHl9bJjPU..MzOGYKFGtK-- From unknown Fri Aug 15 21:25:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26522: gnu: Add adb Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Apr 2017 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26522 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Julien Lepiller , 26522@debbugs.gnu.org Received: via spool by 26522-submit@debbugs.gnu.org id=B26522.14923796925405 (code B ref 26522); Sun, 16 Apr 2017 21:55:01 +0000 Received: (at 26522) by debbugs.gnu.org; 16 Apr 2017 21:54:52 +0000 Received: from localhost ([127.0.0.1]:51043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czs8B-0001P7-Uu for submit@debbugs.gnu.org; Sun, 16 Apr 2017 17:54:52 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:40435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czs8A-0001Oz-EQ for 26522@debbugs.gnu.org; Sun, 16 Apr 2017 17:54:51 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B969720880; Sun, 16 Apr 2017 17:54:49 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Sun, 16 Apr 2017 17:54:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=QgVyI2/qCiP063Pd9aLo29PmID29+IJI3Y5K+r2PJ FM=; b=fTBKn79tdu4nn5wRokvMD/Cer7lDnPajTALjh3Nq0l3p6Gmf/F3zufruX qz7g+1I800bTBxqzDZoK5YNRtUxy/zA7TPiPgvuJyyNd9Mq67LcmbZaHLYOWlD80 dtT5PeCbp4Uei3FF8Z78T2LPwU1Bep1KvQ5BBIaZTkatuGCWkhSA6mrCayL/70v9 cffQlhEw+jGhoVwK/fMOxnTB6uCNxdpzmGw9YYYvg65aao6cvyb5G+1Uujn3N7/5 iDGzMUUbYY7REDRj0t3aJdR6iR5LVKWjWDqBG6FzRxS0q3bRPpKOxJZYuZ0W4Rgm BB483gbH90V1RIXyydG5tck4547AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=QgVyI2/qCiP063Pd9a Lo29PmID29+IJI3Y5K+r2PJFM=; b=hvjoCqVvMSHR2C32db0N0q96KYCfydtRor Rtd0VgY81196EJ3QFxl95XKwbSQHNJTMcbzhNNLn5WTKYbSSsFQXS4kB52WV4hpy 4VKvQ9TLZzVWY9aaPO3N/sNVlBJJZEDN+FeBTEfl73bCdIxqPN0pBBNYl3RvrhHV LAtihhMG0QTmXwpFNuhUopkwj5LRcfnAhA/d9GIF4gxBYb/JOT5LltHYgvJXKo5W GiSeVHAJVwhHjoldRS1d3NTcTgGnoY8y0/lPl2tjSgVm2y1oicfQj4pGLNro4l1d n+ZuJ+9NRQZGM2ezI/vPL9hSHs8XZxi043zt2do5AiNkwbEQqZug== X-ME-Sender: X-Sasl-enc: Eb0U6680ruFZcLc0296PDojl1RNk+6KoELE9iQ/hF1bL 1492379689 Received: from localhost (unknown [188.113.81.93]) by mail.messagingengine.com (Postfix) with ESMTPA id 58CD824373; Sun, 16 Apr 2017 17:54:49 -0400 (EDT) From: Marius Bakke In-Reply-To: <20170416112200.51037253@lepiller.eu> References: <20170415183146.45f95eda@lepiller.eu> <87a87hmtv7.fsf@fastmail.com> <20170416112200.51037253@lepiller.eu> User-Agent: Notmuch/0.24.1 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-unknown-linux-gnu) Date: Sun, 16 Apr 2017 23:54:47 +0200 Message-ID: <87pogckogo.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Julien Lepiller writes: > Hi Marius, > > thanks for the quick review. This should fix your comments. Great! One thing I overlooked last time was the patches. It would be good to include the origin in URL form, so we can dig them out later. The arch patch shouldn't be too hard to find (but URL would be convenient!), I'm curious where the other patch comes from. Patches tend to evolve over time, so checking what happened "upstream" can be handy when you're stumped. See e.g. any CVE patch for examples :) Other than that looks good! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAljz6CcACgkQoqBt8qM6 VPrTzwgAyXRumuSj1/YYCTvM/UFzH+UBUjwXBf7NrVS774qMfcK8BKOmoxgi5GY2 xQCTA/wXQUrIzGH+mCc/Hpxbc8GsjlQAXrbXqUJP0/kDdWL2h0vr9eTBXowmcDpx TO+AG1iCcLEyePKvnuLbxWB/7KdFE0QF2y9QerZ8Sk5kfSmAntkipVILZfTjqja5 ydSUVhdZsvXaqAShz+9diCPkR4RWlsobRBU1Y8W+CuFkVbqcfAFZmd9m0EALdjle 9I+Vz2VBA70DPWTWmS6twPazcMIU7goZj/s75JKjdsVKgOqtayTvEkwk4U9GpLtt UosHxlI9x0/6dGVhug7NGZ7uyxkROg== =9HKB -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Aug 15 21:25:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26522: gnu: Add adb Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Apr 2017 08:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26522 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 26522@debbugs.gnu.org Received: via spool by 26522-submit@debbugs.gnu.org id=B26522.149241846718754 (code B ref 26522); Mon, 17 Apr 2017 08:42:01 +0000 Received: (at 26522) by debbugs.gnu.org; 17 Apr 2017 08:41:07 +0000 Received: from localhost ([127.0.0.1]:51449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d02DS-0004rt-DO for submit@debbugs.gnu.org; Mon, 17 Apr 2017 04:41:07 -0400 Received: from dau94-h03-89-91-205-84.dsl.sta.abo.bbox.fr ([89.91.205.84]:42742 helo=skaro.lepiller.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d02DL-0004rZ-PJ for 26522@debbugs.gnu.org; Mon, 17 Apr 2017 04:40:56 -0400 Received: from localhost (localhost [127.0.0.1]) by skaro.lepiller.eu (Postfix) with ESMTP id 0F5A8810EB for <26522@debbugs.gnu.org>; Mon, 17 Apr 2017 10:40:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492418445; bh=xsoNHwU1jq+CyTnN6LoXTF+SZv+EXtMuSIBPOjz32ew=; h=Date:From:To:Subject:In-Reply-To:References:From; b=kfqLyJFXo5v8S/zy7eF4PdNsJUk3HDe1zddTup/9TPD3MuVI0vUy7hxMh3x4a88yg 5w07ucr/QXkf8jg8yZbFlY5ciX0LteT5Z2+oZ11f5x+adoHxLsUf/yt1XOS8GNiXj9 dtT1dcIK3B98Zp+lXOa/GkKw5TPv7ziswc+WR3VFZx/9BGduvntvnxNmQc45fqmf2h iJFIYYme+yGoS+CBjwQkr37ydy3wlbsbvg70bx4Y4vKQPNAxW2WbwCeMxyTYkz/x4g LQzHFJrJJrgyYI+iEZcd261kn7i0FwVEZxnfgPYGXHvU+h6K49T4Pv+5vtYYHd+bGJ LDYHMqOfMbG9aL0sexDatWmNvyOhynKWpsRgYU+oa8ioGdOegX+jREBMPToTo8Sbdc qUaEF+/BDikZGZ0CdGwuFRLLTLkYGEQgT4El9EVkSjnd+Wbjd14iqYvQOEWugHvK5N a7vdtbuGaKrVGuDbhlyYqVq7rU1TTWooX0hjWVlJIGNav27px9dm8355N9WqPbpiBj 68JRtJqKiSgMA+7wRJskRXtOehsppoldIMYCBcODI91pEXWdWMsNilz2qPQ8hAzOH+ 9Ly7N8sheZhbtEw8Q1LPV22P/jBdRq3X+f13RGh4mpcFcv+rKrX5Fg+phjkgaiv+so rUAlgHXZOAjyAVx+7uF+NSSo= X-Virus-Scanned: Debian amavisd-new at lepiller.eu Received: from skaro.lepiller.eu ([127.0.0.1]) by localhost (lepiller.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r_A5QScThYrk for <26522@debbugs.gnu.org>; Mon, 17 Apr 2017 10:40:34 +0200 (CEST) Received: from localhost (89-93-157-164.hfc.dyn.abo.bbox.fr [89.93.157.164]) by skaro.lepiller.eu (Postfix) with ESMTPSA id A3F277FE7E for <26522@debbugs.gnu.org>; Mon, 17 Apr 2017 10:40:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492418433; bh=xsoNHwU1jq+CyTnN6LoXTF+SZv+EXtMuSIBPOjz32ew=; h=Date:From:To:Subject:In-Reply-To:References:From; b=N/Zo2bBd8/x4WQEPzPvDzrJhY21UTRSrpI60I7c3KTX1+oVUcCpjgzChx7vgalrj8 iOL1dUOQeKrceBG+zTyM2RAw2egnj9S8b49YHA01b9PP6CV5f7CUsS1Hu+5v7Jdl8O 3O7g/pNIa2e1gOD2dYsLXCrZChmfRozMYDIOFwKnS5I1CRal/CzNaku40i+0hqNDRQ 0zGEBJs7ChPem8+B2443rXRntSt+YaOKKUOxvjidSe8GdMI2WuUJfkSpRq7q4rfZij tx2qER8iOkE6KXAh8o+jV8hOa74h4/mndEO3BR+aTl37OHR7N3l9tlEMHqlHwMhNQz 95sUlNkoWL+f+NiYuUyIIeqzi+t1Cff8JvqkwdGKN4b10aK9pcPX+OeP7ada2KZ1T4 4Tcs3MmjUqX2eIyOYXMhWVDh88tsxHGVkswC7eyeu0JQXYQfbIAwBCFXsG9kzlLGpR tG6h8X0fm+5wuwYQEobojRbsnNA8ex7YbQg4oQSc8RCuc/efybGDAlOvZG3T6SIpO0 3FGUBOPSoysVFTmtPZNL75ESyk9OZOwwByWUxm6kNrZSNeVm7AJwVGBIKyba16TCTt w/5ar/aHMxCsr2OnsASzibU0T1M6mORf3Yzb78bFV2abZ7mE+/Ol8TIj+5eBzxay07 5E+sTj+LybHttHyige9q2nTw= Date: Mon, 17 Apr 2017 10:40:29 +0200 From: Julien Lepiller Message-ID: <20170417104022.3947db41@lepiller.eu> In-Reply-To: <87pogckogo.fsf@fastmail.com> References: <20170415183146.45f95eda@lepiller.eu> <87a87hmtv7.fsf@fastmail.com> <20170416112200.51037253@lepiller.eu> <87pogckogo.fsf@fastmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Np1qisqkeh8Y5CNzMFxO0Fc" X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) --MP_/Np1qisqkeh8Y5CNzMFxO0Fc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Sun, 16 Apr 2017 23:54:47 +0200, Marius Bakke a =C3=A9crit : > Julien Lepiller writes: >=20 > > Hi Marius, > > > > thanks for the quick review. This should fix your comments. >=20 > Great! One thing I overlooked last time was the patches. It would be > good to include the origin in URL form, so we can dig them out later. >=20 > The arch patch shouldn't be too hard to find (but URL would be > convenient!), I'm curious where the other patch comes from. >=20 > Patches tend to evolve over time, so checking what happened "upstream" > can be handy when you're stumped. See e.g. any CVE patch for > examples :) >=20 > Other than that looks good! Here is an updated patch with a link to archlinux' patch. You were the one to add the other patch, and I can't find it. I'm also curious where it comes from :p --MP_/Np1qisqkeh8Y5CNzMFxO0Fc Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-adb.patch =46rom 063e22dd5faceb9b0461c5daee5b5b963336ad75 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 15 Apr 2017 18:17:27 +0200 Subject: [PATCH] gnu: Add adb. * gnu/packages/android.scm: New file. * gnu/packages/patches/libbase-fix-includes.patch: New file. * gnu/packages/patches/libbase-use-own-logging.patch: New file. * gnu/local.mk (GNU_SYSTEM_MODULES, dist_patch_DATA): Add them. Co-Authored-By: Marius Bakke --- gnu/local.mk | 3 + gnu/packages/android.scm | 300 +++++++++++++++++= ++++ gnu/packages/patches/libbase-fix-includes.patch | 71 +++++ gnu/packages/patches/libbase-use-own-logging.patch | 77 ++++++ 4 files changed, 451 insertions(+) create mode 100644 gnu/packages/android.scm create mode 100644 gnu/packages/patches/libbase-fix-includes.patch create mode 100644 gnu/packages/patches/libbase-use-own-logging.patch diff --git a/gnu/local.mk b/gnu/local.mk index 82e94171b..4a80afc7d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -45,6 +45,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/adns.scm \ %D%/packages/algebra.scm \ %D%/packages/aidc.scm \ + %D%/packages/android.scm \ %D%/packages/animation.scm \ %D%/packages/anthy.scm \ %D%/packages/apl.scm \ @@ -686,6 +687,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/liba52-link-with-libm.patch \ %D%/packages/patches/liba52-set-soname.patch \ %D%/packages/patches/liba52-use-mtune-not-mcpu.patch \ + %D%/packages/patches/libbase-fix-includes.patch \ + %D%/packages/patches/libbase-use-own-logging.patch \ %D%/packages/patches/libbonobo-activation-test-race.patch \ %D%/packages/patches/libcanberra-sound-theme-freedesktop.patch \ %D%/packages/patches/libdrm-symbol-check.patch \ diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm new file mode 100644 index 000000000..e23d0fd91 --- /dev/null +++ b/gnu/packages/android.scm @@ -0,0 +1,300 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2012 Stefan Handschuh +;;; Copyright =C2=A9 2015 Kai-Chung Yan +;;; Copyright =C2=A9 2016 Marius Bakke +;;; Copyright =C2=A9 2017 Julien Lepiller +;;; +;;; 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 . + +(define-module (gnu packages android) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages tls)) + +;; The Makefiles that we add are largely based on the Debian +;; packages. They are licensed under GPL-2 and have copyright: +;; 2012, Stefan Handschuh +;; 2015, Kai-Chung Yan +;; Big thanks to them for laying the groundwork. + +;; The version tag is consistent between all repositories. +(define (android-platform-version) "7.1.2_r6") + +(define (android-platform-system-core version) + (origin + (method git-fetch) + (uri (git-reference + (url "https://android.googlesource.com/platform/system/core") + (commit (string-append "android-" version)))) + (file-name (string-append "android-platform-system-core-" + version "-checkout")) + (sha256 + (base32 + "0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg")))) + +(define liblog + (package + (name "liblog") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:make-flags '("CC=3Dgcc") + #: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 =3D liblog\n" + "SOURCES =3D 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 +=3D -fvisibility=3Dhidden -fPIC\n" + "CPPFLAGS +=3D -I../include -DFAKE_LOG_DEVICE=3D1" + ;; Keep these two in sync with "liblog/Android.bp". + " -DLIBLOG_LOG_TAG=3D1005" + " -DSNET_EVENT_LOG_TAG=3D1397638484\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0 -lpthrea= d\n" + + "build: $(SOURCES)\n" + " $(CC) $^ -o $(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFL= AGS)\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)))))) + (home-page "https://developer.android.com/") + (synopsis "Logging library from the Android platform.") + (description "@code{liblog} represents an interface to the volatile An= droid +Logging system for NDK (Native) applications and libraries and contain +interfaces for either writing or reading logs. The log buffers are divide= d up +in Main, System, Radio and Events sub-logs.") + (license license:asl2.0))) + +(define libbase + (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")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #: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 =3D libbase\n" + "SOURCES =3D file.cpp logging.cpp parsenetaddress.cpp" + " stringprintf.cpp strings.cpp errors_unix.cpp\n" + + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -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)))))) + (inputs `(("liblog" ,liblog))) + (home-page "https://developer.android.com/") + (synopsis "Android platform base library") + (description "@code{libbase} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define libcutils + (package + (name "libcutils") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-source + (lambda _ (chdir "libcutils") #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 =3D libcutils\n" + "SOURCES =3D load_file.o socket_local_client_unix.o" + " socket_loopback_client_unix.o socket_network_client_u= nix.o" + " socket_loopback_server_unix.o socket_local_server_uni= x.o" + " sockets_unix.o socket_inaddr_any_server_unix.o" + " sockets.o\n" + "CC =3D gcc\n" + + "CFLAGS +=3D -fPIC\n" + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0\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 "libcutils.so.0" lib) + (with-directory-excursion lib + (symlink "libcutils.so.0" "libcutils.so")) + #t)))))) + (home-page "https://developer.android.com/") + (synopsis "Android platform c utils library") + (description "@code{libcutils} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define-public adb + (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")))) + (build-system gnu-build-system) + (arguments + `(#: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, t= hat + ;; 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") + #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 +=3D -std=3Dgnu++14 -fpermissive\n" + "CPPFLAGS +=3D -I../include -I../base/include -I. -DADB= _HOST=3D1 " + "-DADB_REVISION=3D'\"" ,version "\"' -fPIC\n" + "LDFLAGS +=3D -lcrypto -lpthread -lbase -lcutils -L. -l= adb\n" + + ;; Libadb specifics. + "LIBADB_SOURCES =3D 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 transpor= t_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 +=3D -shared -Wl,-soname,libadb.so.0 " + "-lcrypto -lpthread -lbase\n" + + ;; Adb specifics. + "ADB_SOURCES =3D adb_main.cpp console.cpp commandline.c= pp " + "adb_client.cpp file_sync_client.cpp\n" + "ADB_LDFLAGS +=3D -Wl,-rpath=3D" (assoc-ref outputs "ou= t") "/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)) + (inputs + `(("libbase" ,libbase) + ("libcutils" ,libcutils) + ("openssl" ,openssl))) + (home-page "https://developer.android.com/studio/command-line/adb.html= ") + (synopsis "Android Debug Bridge") + (description + "@command{adb} is a versatile command line tool that lets you communi= cate +with an emulator instance or connected Android device. It facilitates a v= ariety +of device actions, such as installing and debugging apps, and it provides = access +to a Unix shell that can run commands on the connected device or emulator.= ") + (license license:asl2.0))) diff --git a/gnu/packages/patches/libbase-fix-includes.patch b/gnu/packages= /patches/libbase-fix-includes.patch new file mode 100644 index 000000000..3071a0c40 --- /dev/null +++ b/gnu/packages/patches/libbase-fix-includes.patch @@ -0,0 +1,71 @@ +This patch fixes the build of adb on linux. + +Copied from archlinux repository: +https://git.archlinux.org/svntogit/community.git/tree/trunk/fix_build.patc= h?h=3Dpackages/android-tools + +diff --git a/adb/sysdeps.h b/adb/sysdeps.h +index 75dcc86..867f3ec 100644 +--- a/adb/sysdeps.h ++++ b/adb/sysdeps.h +@@ -25,6 +25,7 @@ + #endif +=20 + #include ++#include +=20 + #include + #include +@@ -831,7 +832,16 @@ static __inline__ int adb_is_absolute_host_path(const= char* path) { +=20 + static __inline__ unsigned long adb_thread_id() + { +- return (unsigned long)gettid(); ++ // TODO: this function should be merged with GetThreadId ++#if defined(__BIONIC__) ++ return gettid(); ++#elif defined(__APPLE__) ++ return syscall(SYS_thread_selfid); ++#elif defined(__linux__) ++ return syscall(__NR_gettid); ++#elif defined(_WIN32) ++ return GetCurrentThreadId(); ++#endif + } +=20 + #endif /* !_WIN32 */ +diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp +index 296995e..48269b6 100644 +--- a/base/errors_unix.cpp ++++ b/base/errors_unix.cpp +@@ -17,6 +17,7 @@ + #include "android-base/errors.h" +=20 + #include ++#include +=20 + namespace android { + namespace base { +diff --git a/base/file.cpp b/base/file.cpp +index da1adba..91a3901 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include +=20 + #include +=20 +diff --git a/base/logging.cpp b/base/logging.cpp +index 1741871..e97c7f1 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -21,6 +21,7 @@ + #include "android-base/logging.h" +=20 + #include ++#include +=20 + // For getprogname(3) or program_invocation_short_name. + #if defined(__ANDROID__) || defined(__APPLE__) diff --git a/gnu/packages/patches/libbase-use-own-logging.patch b/gnu/packa= ges/patches/libbase-use-own-logging.patch new file mode 100644 index 000000000..4fcff832f --- /dev/null +++ b/gnu/packages/patches/libbase-use-own-logging.patch @@ -0,0 +1,77 @@ +From e5dd71a290f664d3f3bf0dd8a4bad411dc7ad416 Mon Sep 17 00:00:00 2001 +From: Elliott Hughes +Date: Thu, 28 Jul 2016 15:15:28 -0700 +Subject: [PATCH] libbase should use its own logging! + +Not doing so led to us using a bogus log tag. + +Bug: http://b/30281203 +Change-Id: I3ac91758a1a043146c65f2ae0f36fcfbe372c30f +--- + base/file.cpp | 11 +++++------ + base/logging.cpp | 3 +-- + 2 files changed, 6 insertions(+), 8 deletions(-) + +diff --git a/base/file.cpp b/base/file.cpp +index da1adba19..4e7ac82d1 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -24,9 +24,8 @@ + #include +=20 + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. ++#include "android-base/logging.h" + #include "android-base/utf8.h" +-#define LOG_TAG "base.file" +-#include "cutils/log.h" + #include "utils/Compat.h" +=20 + namespace android { +@@ -86,22 +85,22 @@ bool WriteStringToFile(const std::string& content, con= st std::string& path, + int flags =3D O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW | O= _BINARY; + int fd =3D TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); + if (fd =3D=3D -1) { +- ALOGE("android::WriteStringToFile open failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile open failed"; + return false; + } +=20 + // We do an explicit fchmod here because we assume that the caller real= ly + // meant what they said and doesn't want the umask-influenced mode. + if (fchmod(fd, mode) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchmod failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchmod failed"; + return CleanUpAfterFailedWrite(path); + } + if (fchown(fd, owner, group) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchown failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchown failed"; + return CleanUpAfterFailedWrite(path); + } + if (!WriteStringToFd(content, fd)) { +- ALOGE("android::WriteStringToFile write failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile write failed"; + return CleanUpAfterFailedWrite(path); + } + close(fd); +diff --git a/base/logging.cpp b/base/logging.cpp +index 769c266c9..959bb8b05 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -43,12 +43,11 @@ +=20 + #include "android-base/macros.h" + #include "android-base/strings.h" +-#include "cutils/threads.h" +=20 + // Headers for LogMessage::LogLine. + #ifdef __ANDROID__ + #include +-#include "cutils/log.h" ++#include "log/log.h" + #else + #include + #include +--=20 +2.11.0 + --=20 2.12.2 --MP_/Np1qisqkeh8Y5CNzMFxO0Fc-- From unknown Fri Aug 15 21:25:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26522: gnu: Add adb Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Apr 2017 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26522 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Julien Lepiller , 26522@debbugs.gnu.org Received: via spool by 26522-submit@debbugs.gnu.org id=B26522.149244175029005 (code B ref 26522); Mon, 17 Apr 2017 15:10:02 +0000 Received: (at 26522) by debbugs.gnu.org; 17 Apr 2017 15:09:10 +0000 Received: from localhost ([127.0.0.1]:52630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d08H7-0007Xk-Tt for submit@debbugs.gnu.org; Mon, 17 Apr 2017 11:09:10 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d08H5-0007Xb-NF for 26522@debbugs.gnu.org; Mon, 17 Apr 2017 11:09:08 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3ED86209FF; Mon, 17 Apr 2017 11:09:07 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 17 Apr 2017 11:09:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=vM+SKnXk6+l4IH5CXdDqkj9agFGAMB7ZV/qcJGzAs CI=; b=FxeL1Y2prTURQeotN/McYoRMrbY8DkqD2+Y/+3YznxH74f0KCKwP2pgMR irzjvDgANxsQ+XxDbvodSgA0juv0kbd7R54jQCpHyeV5X46PiRLvKpY96geDaVuQ 98BRsdApl71OxuoORF8RpScuNPIkhbgIr6KcBbHIpyhrIljn66fx3Eh6mO+YIwkh DZAiytVjahw8YXhpO706G3IScT2E9Ml71/kjMeFbqFYXnmMrUDRf7KqTspQrTr8x d/+TCPulh9X80LGzkgbkD4zhPxe7a3YUN1w/wnMMK1FTqq+bXJWfDB50ccL8Ropa XzTT1oCfWlPVee7A685Okcv9X/Y+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=vM+SKnXk6+l4IH5CXd Dqkj9agFGAMB7ZV/qcJGzAsCI=; b=B6/Rd2PyQ1PNI20EqNB0n2x6lrHs5VQZw7 CtIy4G3dqRoxoMAjbwn6JAw0qmDx/xQG+93dEzvWM27Dcl3Os4A/qixrvqiJQSvp ukYvxEqQNDZTZbOu+T7jH+23XSHjoTctwInDzqYUigjiPibk0sK3nZT4yK7CODhD oLlXvjpVB8QYh6ql+1NeHg9OPhqUcynr4XsO0dsXB3TUh8tHRRZEA96jSX34yVfa 4apiMEASIZwai+ra5t9PCQu6kGARP2Y7GE7SQWto3OJplQ0+EGipKyXU1DEy8L22 PEC0u8I0hOb1DUw4e4I20l5Fol2qQi7O/0UWxzrCzZAiRxkOFksg== X-ME-Sender: X-Sasl-enc: 8OAbIblJxOJ5ed/uP5bpib0V9Q582EsUO5xlhG0GvIt1 1492441746 Received: from localhost (unknown [188.113.81.93]) by mail.messagingengine.com (Postfix) with ESMTPA id CE3E47E2C3; Mon, 17 Apr 2017 11:09:06 -0400 (EDT) From: Marius Bakke In-Reply-To: <20170417104022.3947db41@lepiller.eu> References: <20170415183146.45f95eda@lepiller.eu> <87a87hmtv7.fsf@fastmail.com> <20170416112200.51037253@lepiller.eu> <87pogckogo.fsf@fastmail.com> <20170417104022.3947db41@lepiller.eu> User-Agent: Notmuch/0.24.1 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-unknown-linux-gnu) Date: Mon, 17 Apr 2017 17:09:04 +0200 Message-ID: <87lgqzkr5b.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Julien Lepiller writes: > Le Sun, 16 Apr 2017 23:54:47 +0200, > Marius Bakke a =C3=A9crit : > >> Julien Lepiller writes: >>=20 >> > Hi Marius, >> > >> > thanks for the quick review. This should fix your comments. >>=20 >> Great! One thing I overlooked last time was the patches. It would be >> good to include the origin in URL form, so we can dig them out later. >>=20 >> The arch patch shouldn't be too hard to find (but URL would be >> convenient!), I'm curious where the other patch comes from. >>=20 >> Patches tend to evolve over time, so checking what happened "upstream" >> can be handy when you're stumped. See e.g. any CVE patch for >> examples :) >>=20 >> Other than that looks good! > > Here is an updated patch with a link to archlinux' patch. You were the > one to add the other patch, and I can't find it. I'm also curious where > it comes from :p Hehe...I deliberately did not add a reference just to prove this point! ...but I remember now, it is this commit, which I don't think will hit a release until Android 8 if I've understood their branching correctly: https://android.googlesource.com/platform/system/core/+/e5dd71a290f664d3f3b= f0dd8a4bad411dc7ad416 Please add it and push! :D --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlj02pEACgkQoqBt8qM6 VPrs4QgAjh4t0y+WM5pweKjDRxrPD4aQCE3j+MFpzwevYsYub8NCC4/lgR+IzoDu AGftCAh5mTPnoR2XQ+9f73NQwcCpo3LY8QhlC6cCrwpjSoQlJszO3N80jV6PiBhz P6apgAccXB6CZWA3RHnq6faJAhQuKDzGwjjuT6jDOMwciK0Ts8s8iXO+iE6T0gSk ox0QeQrK8v6AgcbOGbFisYWYnT/03z7FiV6z041bqx6zwcZ6fypCbVkRoTgFBRMV INnzF+HLX3pw+H5+9GX+shKs9rvAjUROuj5SH8URR5Kx8CWQRg+51QzgP6qiEpHK +0hjceyqnM12N4pDJmg+xGO87XKyXA== =KWb0 -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Aug 15 21:25:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26522: gnu: Add adb Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 18 Apr 2017 08:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26522 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Marius Bakke Cc: Julien Lepiller , 26522@debbugs.gnu.org Received: via spool by 26522-submit@debbugs.gnu.org id=B26522.14925036839547 (code B ref 26522); Tue, 18 Apr 2017 08:22:01 +0000 Received: (at 26522) by debbugs.gnu.org; 18 Apr 2017 08:21:23 +0000 Received: from localhost ([127.0.0.1]:53399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0OO3-0002Tv-99 for submit@debbugs.gnu.org; Tue, 18 Apr 2017 04:21:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0OO1-0002Th-D1 for 26522@debbugs.gnu.org; Tue, 18 Apr 2017 04:21:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0ONv-0006KD-Ea for 26522@debbugs.gnu.org; Tue, 18 Apr 2017 04:21:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0ONv-0006K9-BE; Tue, 18 Apr 2017 04:21:15 -0400 Received: from [193.50.110.90] (port=46262 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d0ONu-0008SU-My; Tue, 18 Apr 2017 04:21:15 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170415183146.45f95eda@lepiller.eu> <87a87hmtv7.fsf@fastmail.com> <20170416112200.51037253@lepiller.eu> <87pogckogo.fsf@fastmail.com> <20170417104022.3947db41@lepiller.eu> <87lgqzkr5b.fsf@fastmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 29 Germinal an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Tue, 18 Apr 2017 10:21:13 +0200 In-Reply-To: <87lgqzkr5b.fsf@fastmail.com> (Marius Bakke's message of "Mon, 17 Apr 2017 17:09:04 +0200") Message-ID: <87d1cat9c6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Marius Bakke skribis: > Please add it and push! :D Awesome, nice work gentlefolks! Ludo=E2=80=99. From unknown Fri Aug 15 21:25:13 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Julien Lepiller Subject: bug#26522: closed () Message-ID: References: <20170415183146.45f95eda@lepiller.eu> X-Gnu-PR-Message: they-closed 26522 X-Gnu-PR-Package: guix-patches Reply-To: 26522@debbugs.gnu.org Date: Thu, 20 Apr 2017 08:34:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1492677242-6572-1" This is a multi-part message in MIME format... ------------=_1492677242-6572-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #26522: gnu: Add adb which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 26522@debbugs.gnu.org. --=20 26522: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D26522 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1492677242-6572-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 26522-done) by debbugs.gnu.org; 20 Apr 2017 08:33:22 +0000 Received: from localhost ([127.0.0.1]:57880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d17Wj-0001h5-Qs for submit@debbugs.gnu.org; Thu, 20 Apr 2017 04:33:21 -0400 Received: from dau94-h03-89-91-205-84.dsl.sta.abo.bbox.fr ([89.91.205.84]:49641 helo=skaro.lepiller.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d17Wh-0001gq-UV for 26522-done@debbugs.gnu.org; Thu, 20 Apr 2017 04:33:20 -0400 Received: from localhost (localhost [127.0.0.1]) by skaro.lepiller.eu (Postfix) with ESMTP id DD78D80BB7 for <26522-done@debbugs.gnu.org>; Thu, 20 Apr 2017 10:33:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492677193; bh=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=; h=Date:From:To:Subject:From; b=STVPOWULbnSA5irUD+nKGYV8L79bEygQvgr2ldwLX9bEb46W984ySsurIMKU0H2Df WthLyibyc2dYzYZB4qxh1/WaP7Ogiwe6USamKvM/jCNrklk6SVX+H/7BK4JwDyo0YB Vqke5Sx3v7n3dNSytuJIDyYtoiXXphmIbMDvJ4NUCuHwwRjFkeC3GXkurXCICXz+DC Nm+m8iQm8r62Aw5pAx0qanK5r3rxwud5NGFbt4Af+YnOjNVzNAsJlRoovCX8zwjBbr IXjOTfLmMRxsPbxCGRSrj0QzQfL0ta/4JMWaIHGTsCyr3YwsBvh8yngZWFs3nuF4Yx W2TpJ+pF+SKz6on8mI9teXtwrnQXWmaX+2NhA3YnOUlpEoux826UkZ9NsT9vtbTPMi Xi3+7vH10jq5ICRrilYeTzu9v4DKujL+ECR7ZxkF3pe195la2r1X8ajTU7pzyoteY+ 0oTqgXRB8EUgCbWCxTmYDWvu2cz99NQiGvZO6tx0oEXO4Q0rfvlKOwa9pnrfSPVWX5 yctvnwHu8qshv1mr8GV4DbrEdE8HTgKcyMNqY0EW+GNyhlfWLyXScLp8gRdgtN+9k8 EmLs83cNwiUgZmT6OrjNb5wbDkH5ilz3RxR7RFAgRqeQJ7PDZ+4fmE8jgHgwVmztjc gBUiQYXNhtQN5DCoSSr6JNrY= X-Virus-Scanned: Debian amavisd-new at lepiller.eu Received: from skaro.lepiller.eu ([127.0.0.1]) by localhost (lepiller.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D0FCq3I_5OZw for <26522-done@debbugs.gnu.org>; Thu, 20 Apr 2017 10:33:12 +0200 (CEST) Received: from webmail.lepiller.eu (localhost [127.0.0.1]) by skaro.lepiller.eu (Postfix) with ESMTPA id C382A80B1E for <26522-done@debbugs.gnu.org>; Thu, 20 Apr 2017 10:33:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492677191; bh=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=; h=Date:From:To:Subject:From; b=CPgxvQ38mpeSFzN7tHtBLlXkNokxBZBgNqmPA+Yg8NbCuQSPD1he8otv7a2G+TXV8 FXuAAg2FN8otCNakCHDC2RC7Pj9n7f1tIMuup6RoRtCZH4QsAW4WXMui/ncvhmdO1O ciJ7ZMKCVlECE17RjLE5YAWR6W6YQ7Y7v4jAyA/tzhaMmineEKD241vQlchrRLIP5t 09KRX0l2SRa+JAZ8UweATIgmRQZvlpaU05csomrk32SRPzMAhSeFUmL5l6O4wJEerD 2eTr7v3hsAXNFz/+5kDRsJARfxJ12il5vN923hh6Srm2rp0Ns06wkUpEPu8OuqZ/sK soljNp51SrtU8WZkI6eqZoH+bP8Zm/Z/wZNrdFl3cxxZctzynHAe1cMMsuWxj/QZ/I lYDfTEA2WTf58KMlrRFjB2DQHxin+u9fyKyzgJbS4Hg2UaNDjbQ7s8NTIHu/J6+VLg jBlX0YBprKFdMNripkRtaDEAJJVfrXIQ23FjjM8CRwXx1gbVL06+mx/IsSGueZZtOj 1+ptICSUeC2Lww2mUhEoKSAWhD+Pxuq93pOqLiEtdKi3pwjHpThtHBZlRgDhZ7jWyV UEx4vTrdWSZuc5Th0kkcSERn72frGzicarHTJyameA2U9cWRgNwgGeK4leSqkfzbnf /LVYBf818iN/5CeanRIoCN2Q= MIME-Version: 1.0 Date: Thu, 20 Apr 2017 10:33:11 +0200 From: julien lepiller To: 26522-done@debbugs.gnu.org Subject: Message-ID: X-Sender: julien@lepiller.eu User-Agent: Roundcube Webmail/1.2.4 X-Spam-Score: 4.7 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: [...] Content analysis details: (4.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 2.3 EMPTY_MESSAGE Message appears to have no textual parts and no Subject: text 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 26522-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 4.7 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: [...] Content analysis details: (4.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 2.3 EMPTY_MESSAGE Message appears to have no textual parts and no Subject: text 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid ------------=_1492677242-6572-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Apr 2017 16:32:35 +0000 Received: from localhost ([127.0.0.1]:49179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czQcb-0004j0-EJ for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czQcW-0004ii-43 for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czQcO-0001hb-8t for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1czQcO-0001hU-40 for submit@debbugs.gnu.org; Sat, 15 Apr 2017 12:32:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czQcL-0005OV-Ei for guix-patches@gnu.org; Sat, 15 Apr 2017 12:32:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czQcI-0001cN-7R for guix-patches@gnu.org; Sat, 15 Apr 2017 12:32:09 -0400 Received: from dau94-h03-89-91-205-84.dsl.sta.abo.bbox.fr ([89.91.205.84]:45670 helo=skaro.lepiller.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1czQcH-0001ZW-HN for guix-patches@gnu.org; Sat, 15 Apr 2017 12:32:06 -0400 Received: from localhost (localhost [127.0.0.1]) by skaro.lepiller.eu (Postfix) with ESMTP id 577177FE7E for ; Sat, 15 Apr 2017 18:32:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492273922; bh=KsZZl9tT/vEPSWkCrLJPpqWVNbk3MwLUJ3HM+20I1SI=; h=Date:From:To:Subject:From; b=RbA5SvmGqFSgcZi+83jtGvYrOIh/wBqwUhnsvdHdBUrWfFzSey9vwqJSUdKEVIYGj AAPM+oK2Us2hxEq4EL38cWKN33lqKH0zwf2mHyIIg7d37qyuEBpiwm1KYK9e50Lk2f EUG7oqI3lwjFZn0Q5tHdE1mAKPLbLUBqvgQ0nHVmVzeT1ogELWFahMvqdwXz/Il2nb 8HUKq936G4XKy+RkBone7FS/5JLngdm8pOFa02pP0Tg9aePrKnlg6QQcBFrq8Oy7pZ /AWLImqMF05mhTKz1hmmvgIMLM3oUpLgOuw1rk0JMDaxM6ZahuqmcVWnBK1QS0Xu8A QFhK/yOGSTCCImU+EeIPMdXn0uofleZmLg7v/08djrb1zDq16M3LMVawoCSarg0eii G6BtKqvkuQUxgDY30KfpUE+hSBzWOsj+OM29LoXFL0vI+mKBQozMksyoQRQ4J5fY2x bTTdyOBMH/pPky7vadiD/++pL4ojNWOUN0VmCtkdWzF7uHNIKu7DyKXJxnIwZHIwBJ 9UBKk5gcIltZylcZ+2m6JKbzElJqg0RnNZfGdVW+QrIW1gBvVO84NOe4u/+jqVa85/ HN7h3D5trm1AkWo4XJ/Yrn4ShZVmTCXhOySvISMS0Z1DbelLbucrTtvSVFycKVzkHC sfn35FwlIS8BR43/Did5GU8Y= X-Virus-Scanned: Debian amavisd-new at lepiller.eu Received: from skaro.lepiller.eu ([127.0.0.1]) by localhost (lepiller.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FSodvZliN7mA for ; Sat, 15 Apr 2017 18:31:52 +0200 (CEST) Received: from localhost (89-93-157-164.hfc.dyn.abo.bbox.fr [89.93.157.164]) by skaro.lepiller.eu (Postfix) with ESMTPSA id 668877FA6C for ; Sat, 15 Apr 2017 18:31:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lepiller.eu; s=default; t=1492273911; bh=KsZZl9tT/vEPSWkCrLJPpqWVNbk3MwLUJ3HM+20I1SI=; h=Date:From:To:Subject:From; b=n6fTx7zT48dOD7MB4elfvsEe2dP7O+6kPhFBIWzmLg35u1PZ7lChgSwt1S9L/K4bv F0XKwnWIGy1qPqngsUlrMlk8sH2VRrC7GbgChWlv9D9YZaONqf+LXHzKjqHT3xXMPc 7bYpIN9g61GZdXIqdFs0S7ws2+udu0nxp96dqs7swwbAWsLEE7AelCFPAceOB5sUPd 0I0DH0fUCpG4bkYGMgtGnAcN544bJcL55WeV9fTD/CVEna2Y+zTltDcXbdGwuFcUj6 kxe+yTEu1yaHvZS9Btx7ywsDbWL7FsmrZAJVWKSOCT9oN/T277j6tOjiPszlYJYzUU 6R+Kwn/94BdraANlBkfjXjNJlPINKafW78IHKXKO8q4OO4ok80bWFOlQnzh4SU2AR2 lI/FxFkZWBwRPkrO5Ylxz4oR5ER9Eu21wQdjV7BXBrbbK797WFjydndKy+lgZdKYv1 kmDcfqdq4ssEOleXgBmX0YqKjio8hI2ihOgTZea0FyMRJXV0kBhcYNUhzOLOZHaO4a 25GcCsad8mXQnTbWQff3o+fYmBYJ0qmegcdpdH3E+0MWhzJsfiSHo1bON7438ayGlH m/S3g8/d5vrw1JDFJRW1uWHsQgyg+v9/3JVJ/62VTYP6ZO7v1+Nbh8HP7MvEeqh8D0 qW9orCH+Fwx+f3Zf5Jsdh0CI= Date: Sat, 15 Apr 2017 18:31:46 +0200 From: Julien Lepiller To: guix-patches@gnu.org Subject: gnu: Add adb Message-ID: <20170415183146.45f95eda@lepiller.eu> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/8LtqhbUobiNGOBFscY.WPSH" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --MP_/8LtqhbUobiNGOBFscY.WPSH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi guix, here is an updated version of Marius' patch mixed with my own. It updates our patches to the latest 7_1_2.rc6, adapts to some changes since last version, and fixes the build of adb. --MP_/8LtqhbUobiNGOBFscY.WPSH Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-adb.patch =46rom 96a5136e94bcae6cc2db0c83c81ef4831258779e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 15 Apr 2017 18:17:27 +0200 Subject: [PATCH] gnu: Add adb. * gnu/packages/android.scm: New file. * gnu/packages/patches/libbase-fix-includes.patch: New file. * gnu/packages/patches/libbase-use-own-logging.patch: New file. * gnu/local.mk (GNU_SYSTEM_MODULES, dist_patch_DATA): Add them. Co-Authored-By: Marius Bakke --- gnu/local.mk | 3 + gnu/packages/android.scm | 290 +++++++++++++++++= ++++ gnu/packages/patches/libbase-fix-includes.patch | 68 +++++ gnu/packages/patches/libbase-use-own-logging.patch | 77 ++++++ 4 files changed, 438 insertions(+) create mode 100644 gnu/packages/android.scm create mode 100644 gnu/packages/patches/libbase-fix-includes.patch create mode 100644 gnu/packages/patches/libbase-use-own-logging.patch diff --git a/gnu/local.mk b/gnu/local.mk index 82e94171b..4a80afc7d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -45,6 +45,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/adns.scm \ %D%/packages/algebra.scm \ %D%/packages/aidc.scm \ + %D%/packages/android.scm \ %D%/packages/animation.scm \ %D%/packages/anthy.scm \ %D%/packages/apl.scm \ @@ -686,6 +687,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/liba52-link-with-libm.patch \ %D%/packages/patches/liba52-set-soname.patch \ %D%/packages/patches/liba52-use-mtune-not-mcpu.patch \ + %D%/packages/patches/libbase-fix-includes.patch \ + %D%/packages/patches/libbase-use-own-logging.patch \ %D%/packages/patches/libbonobo-activation-test-race.patch \ %D%/packages/patches/libcanberra-sound-theme-freedesktop.patch \ %D%/packages/patches/libdrm-symbol-check.patch \ diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm new file mode 100644 index 000000000..3e13b9a18 --- /dev/null +++ b/gnu/packages/android.scm @@ -0,0 +1,290 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2012 Stefan Handschuh +;;; Copyright =C2=A9 2015 Kai-Chung Yan +;;; Copyright =C2=A9 2016 Marius Bakke +;;; Copyright =C2=A9 2017 Julien Lepiller +;;; +;;; 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 . + +(define-module (gnu packages android) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages tls)) + +;; The Makefiles that we add are largely based on the Debian +;; packages. They are licensed under GPL-2 and have copyright: +;; 2012, Stefan Handschuh +;; 2015, Kai-Chung Yan +;; Big thanks to them for laying the groundwork. + +;; The version tag is consistent between all repositories. +(define (android-platform-version) "7.1.2_r6") + +(define (android-platform-system-core version) + (origin + (method git-fetch) + (uri (git-reference + (url "https://android.googlesource.com/platform/system/core") + (commit (string-append "android-" version)))) + (file-name (string-append "android-platform-system-core-" + version "-checkout")) + (sha256 + (base32 + "0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg")))) + +(define liblog + (package + (name "liblog") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:make-flags '("CC=3Dgcc") + #: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 =3D liblog\n" + "SOURCES =3D 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 +=3D -fvisibility=3Dhidden -fPIC\n" + "CPPFLAGS +=3D -I../include -DFAKE_LOG_DEVICE=3D1" + ;; Keep these two in sync with "liblog/Android.bp". + " -DLIBLOG_LOG_TAG=3D1005" + " -DSNET_EVENT_LOG_TAG=3D1397638484\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0 -lpthrea= d\n" + + "build: $(SOURCES)\n" + " $(CC) $^ -o $(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFL= AGS)\n")))))) + (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)))))) + (home-page "https://developer.android.com/") + (synopsis "Logging library from the Android platform.") + (description "@code{liblog} represents an interface to the volatile An= droid +Logging system for NDK (Native) applications and libraries and contain +interfaces for either writing or reading logs. The log buffers are divide= d up +in Main, System, Radio and Events sub-logs.") + (license license:asl2.0))) + +(define libbase + (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")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #: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 =3D libbase\n" + "SOURCES =3D file.cpp logging.cpp parsenetaddress.cpp" + " stringprintf.cpp strings.cpp errors_unix.cpp\n" + + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0" + " -L.. -llog\n" + + "build: $(SOURCES)\n" + " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(L= DFLAGS)\n" + )))))) + (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)))))) + (inputs `(("liblog" ,liblog))) + (home-page "https://developer.android.com/") + (synopsis "Android platform base library") + (description "@code{libbase} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define libcutils + (package + (name "libcutils") + (version (android-platform-version)) + (source (android-platform-system-core version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; TODO. + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-source + (lambda _ (chdir "libcutils") #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 =3D libcutils\n" + "SOURCES =3D load_file.o socket_local_client_unix.o" + " socket_loopback_client_unix.o socket_network_client_u= nix.o" + " socket_loopback_server_unix.o socket_local_server_uni= x.o" + " sockets_unix.o socket_inaddr_any_server_unix.o" + " sockets.o\n" + "CC =3D gcc\n" + + "CFLAGS +=3D -fPIC\n" + "CXXFLAGS +=3D -std=3Dgnu++11 -fPIC\n" + "CPPFLAGS +=3D -Iinclude -I../include\n" + "LDFLAGS +=3D -shared -Wl,-soname,$(NAME).so.0\n" + + "build: $(SOURCES)\n" + " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(L= DFLAGS)\n" + )))))) + (delete 'configure) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib"))) + (install-file "libcutils.so.0" lib) + (with-directory-excursion lib + (symlink "libcutils.so.0" "libcutils.so")) + #t)))))) + (home-page "https://developer.android.com/") + (synopsis "Android platform c utils library") + (description "@code{libcutils} is a library in common use by the +various Android core host applications.") + (license license:asl2.0))) + +(define-public adb + (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")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-source + (lambda _ (chdir "adb") #t)) + (add-before 'build 'fix-clang + (lambda _ + (substitute* "adb_client.h" + (("_Nonnull") "") + (("_Nullable") "")))) + (add-before 'build 'fix-main + (lambda _ + (copy-file "client/main.cpp" "adb_main.cpp"))) + (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 +=3D -std=3Dgnu++14 -fpermissive\n" + "CPPFLAGS +=3D -I../include -I../base/include -I. -DADB= _HOST=3D1 " + "-DADB_REVISION=3D'\"" ,version "\"' -fPIC\n" + "LDFLAGS +=3D -lcrypto -lpthread -lbase -lcutils -L. -l= adb\n" + + ;; Libadb specifics. + "LIBADB_SOURCES =3D 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 transpor= t_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 +=3D -shared -Wl,-soname,libadb.so.0 " + "-lcrypto -lpthread -lbase\n" + + ;; Adb specifics. + "ADB_SOURCES =3D adb_main.cpp console.cpp commandline.c= pp " + "adb_client.cpp file_sync_client.cpp\n" + "ADB_LDFLAGS +=3D -Wl,-rpath=3D" (assoc-ref outputs "ou= t") "/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" + )))))) + (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)) + (inputs + `(("libbase" ,libbase) + ("libcutils" ,libcutils) + ("openssl" ,openssl))) + (home-page "https://developer.android.com/studio/command-line/adb.html= ") + (synopsis "Android Debug Bridge") + (description + "@command{adb} is a versatile command line tool that lets you communi= cate +with an emulator instance or connected Android device. It facilitates a v= ariety +of device actions, such as installing and debugging apps, and it provides = access +to a Unix shell that can run commands on the connected device or emulator.= ") + (license license:asl2.0))) diff --git a/gnu/packages/patches/libbase-fix-includes.patch b/gnu/packages= /patches/libbase-fix-includes.patch new file mode 100644 index 000000000..24847ae0c --- /dev/null +++ b/gnu/packages/patches/libbase-fix-includes.patch @@ -0,0 +1,68 @@ +This patch fixes the build of adb on linux. It was taken from archlinux. + +diff --git a/adb/sysdeps.h b/adb/sysdeps.h +index 75dcc86..867f3ec 100644 +--- a/adb/sysdeps.h ++++ b/adb/sysdeps.h +@@ -25,6 +25,7 @@ + #endif +=20 + #include ++#include +=20 + #include + #include +@@ -831,7 +832,16 @@ static __inline__ int adb_is_absolute_host_path(const= char* path) { +=20 + static __inline__ unsigned long adb_thread_id() + { +- return (unsigned long)gettid(); ++ // TODO: this function should be merged with GetThreadId ++#if defined(__BIONIC__) ++ return gettid(); ++#elif defined(__APPLE__) ++ return syscall(SYS_thread_selfid); ++#elif defined(__linux__) ++ return syscall(__NR_gettid); ++#elif defined(_WIN32) ++ return GetCurrentThreadId(); ++#endif + } +=20 + #endif /* !_WIN32 */ +diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp +index 296995e..48269b6 100644 +--- a/base/errors_unix.cpp ++++ b/base/errors_unix.cpp +@@ -17,6 +17,7 @@ + #include "android-base/errors.h" +=20 + #include ++#include +=20 + namespace android { + namespace base { +diff --git a/base/file.cpp b/base/file.cpp +index da1adba..91a3901 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include +=20 + #include +=20 +diff --git a/base/logging.cpp b/base/logging.cpp +index 1741871..e97c7f1 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -21,6 +21,7 @@ + #include "android-base/logging.h" +=20 + #include ++#include +=20 + // For getprogname(3) or program_invocation_short_name. + #if defined(__ANDROID__) || defined(__APPLE__) diff --git a/gnu/packages/patches/libbase-use-own-logging.patch b/gnu/packa= ges/patches/libbase-use-own-logging.patch new file mode 100644 index 000000000..4fcff832f --- /dev/null +++ b/gnu/packages/patches/libbase-use-own-logging.patch @@ -0,0 +1,77 @@ +From e5dd71a290f664d3f3bf0dd8a4bad411dc7ad416 Mon Sep 17 00:00:00 2001 +From: Elliott Hughes +Date: Thu, 28 Jul 2016 15:15:28 -0700 +Subject: [PATCH] libbase should use its own logging! + +Not doing so led to us using a bogus log tag. + +Bug: http://b/30281203 +Change-Id: I3ac91758a1a043146c65f2ae0f36fcfbe372c30f +--- + base/file.cpp | 11 +++++------ + base/logging.cpp | 3 +-- + 2 files changed, 6 insertions(+), 8 deletions(-) + +diff --git a/base/file.cpp b/base/file.cpp +index da1adba19..4e7ac82d1 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -24,9 +24,8 @@ + #include +=20 + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. ++#include "android-base/logging.h" + #include "android-base/utf8.h" +-#define LOG_TAG "base.file" +-#include "cutils/log.h" + #include "utils/Compat.h" +=20 + namespace android { +@@ -86,22 +85,22 @@ bool WriteStringToFile(const std::string& content, con= st std::string& path, + int flags =3D O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW | O= _BINARY; + int fd =3D TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); + if (fd =3D=3D -1) { +- ALOGE("android::WriteStringToFile open failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile open failed"; + return false; + } +=20 + // We do an explicit fchmod here because we assume that the caller real= ly + // meant what they said and doesn't want the umask-influenced mode. + if (fchmod(fd, mode) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchmod failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchmod failed"; + return CleanUpAfterFailedWrite(path); + } + if (fchown(fd, owner, group) =3D=3D -1) { +- ALOGE("android::WriteStringToFile fchown failed: %s", strerror(errno)= ); ++ PLOG(ERROR) << "android::WriteStringToFile fchown failed"; + return CleanUpAfterFailedWrite(path); + } + if (!WriteStringToFd(content, fd)) { +- ALOGE("android::WriteStringToFile write failed: %s", strerror(errno)); ++ PLOG(ERROR) << "android::WriteStringToFile write failed"; + return CleanUpAfterFailedWrite(path); + } + close(fd); +diff --git a/base/logging.cpp b/base/logging.cpp +index 769c266c9..959bb8b05 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -43,12 +43,11 @@ +=20 + #include "android-base/macros.h" + #include "android-base/strings.h" +-#include "cutils/threads.h" +=20 + // Headers for LogMessage::LogLine. + #ifdef __ANDROID__ + #include +-#include "cutils/log.h" ++#include "log/log.h" + #else + #include + #include +--=20 +2.11.0 + --=20 2.12.2 --MP_/8LtqhbUobiNGOBFscY.WPSH-- ------------=_1492677242-6572-1--