1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Stefan Handschuh <handschuh.stefan@googlemail.com>
3 ;;; Copyright © 2015 Kai-Chung Yan <seamlikok@gmail.com>
4 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
5 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
6 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
7 ;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
8 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages android)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system android-ndk)
31 #:use-module (guix build-system python)
32 #:use-module (guix build-system trivial)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages gnupg)
38 #:use-module (gnu packages pcre)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages selinux)
41 #:use-module (gnu packages ssh)
42 #:use-module (gnu packages version-control)
43 #:use-module (gnu packages tls)
44 #:use-module (gnu packages linux))
46 (define-public android-make-stub
48 (name "android-make-stub")
54 (url "https://github.com/daym/android-make-stub.git")
55 (commit (string-append "v" version))))
56 (file-name (string-append "android-make-stub-"
60 "0y1b2x96d37n6f1bp6dcx08bn08zac0cylmbfsx6mf2nahc02fhc"))))
61 (build-system gnu-build-system)
63 `(#:tests? #f ; None exist.
65 (modify-phases %standard-phases
69 (lambda* (#:key outputs #:allow-other-keys)
70 (let* ((out (assoc-ref outputs "out")))
71 (invoke "make" (string-append "prefix=" out) "install")
73 (home-page "https://github.com/daym/android-make-stub")
74 (synopsis "Stubs for the @command{make} system of the Android platform")
75 (description "@code{android-make-stub} provides stubs for the
76 @command{make} system of the Android platform. This allows us to
77 use their packages mostly unmodified in our Android NDK build system.")
78 (license license:asl2.0)))
80 (define-public android-googletest
81 (package (inherit googletest)
82 (name "android-googletest")
84 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
86 (modify-phases %standard-phases
87 (add-after 'install 'install-host-libraries
88 (lambda* (#:key outputs #:allow-other-keys)
89 (let* ((out (assoc-ref outputs "out"))
90 (lib (string-append out "/lib")))
91 (symlink "libgtest.so"
92 (string-append lib "/libgtest_host.so"))
93 (symlink "libgmock.so"
94 (string-append lib "/libgmock_host.so"))
97 ;; The Makefiles that we add are largely based on the Debian
98 ;; packages. They are licensed under GPL-2 and have copyright:
99 ;; 2012, Stefan Handschuh <handschuh.stefan@googlemail.com>
100 ;; 2015, Kai-Chung Yan <seamlikok@gmail.com>
101 ;; Big thanks to them for laying the groundwork.
103 ;; The version tag is consistent between all repositories.
104 (define (android-platform-version) "7.1.2_r6")
106 (define (android-platform-system-core version)
110 (url "https://android.googlesource.com/platform/system/core")
111 (commit (string-append "android-" version))))
112 (file-name (string-append "android-platform-system-core-"
113 version "-checkout"))
116 "0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg"))
118 (search-patches "libbase-use-own-logging.patch"
119 "libbase-fix-includes.patch"
120 "libutils-remove-damaging-includes.patch"
121 "libutils-add-includes.patch"
122 "adb-add-libraries.patch"
123 "libziparchive-add-includes.patch"))))
125 (define (android-platform-system-extras version)
129 (url "https://android.googlesource.com/platform/system/extras")
130 (commit (string-append "android-" version))))
131 (file-name (string-append "android-platform-system-extras-"
132 version "-checkout"))
135 "18130c23ybqcpgjc5v6f8kdbv2xn39hyiaj17dzldjb9rlwzcyy9"))))
137 (define (android-platform-bionic version)
141 (url "https://android.googlesource.com/platform/bionic")
142 (commit (string-append "android-" version))))
143 (file-name (string-append "android-platform-bionic-"
144 version "-checkout"))
147 "0n9wkz3ynqw39if1ss9n32m66iga14nndf29hpm7g1aqn4wvvgzk"))))
149 (define (android-platform-external version subdirectory checksum)
154 (string-append "https://android.googlesource.com/platform/external/"
156 (commit (string-append "android-" version))))
157 (file-name (string-append "android-platform-system-external-" subdirectory "-"
158 version "-checkout"))
163 (define android-liblog
165 (name "android-liblog")
166 (version (android-platform-version))
167 (source (android-platform-system-core version))
168 (build-system android-ndk-build-system)
170 `(#:make-flags '("LDLIBS=-lpthread")
172 (modify-phases %standard-phases
173 (add-after 'unpack 'enter-source
174 (lambda _ (chdir "liblog") #t))
175 (add-after 'install 'ldconfig
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((out (assoc-ref outputs "out")))
178 (symlink "liblog.so.0" (string-append out "/lib/liblog.so"))
180 (home-page "https://developer.android.com/")
181 (synopsis "Logging library from the Android platform.")
182 (description "@code{liblog} represents an interface to the volatile Android
183 Logging system for NDK (Native) applications and libraries and contain
184 interfaces for either writing or reading logs. The log buffers are divided up
185 in Main, System, Radio and Events sub-logs.")
186 (license license:asl2.0)))
188 (define android-libbase
190 (name "android-libbase")
191 (version (android-platform-version))
192 (source (android-platform-system-core version))
193 (build-system android-ndk-build-system)
195 `(#:tests? #f ; Test failure: logging.UNIMPLEMENTED
196 #:make-flags '("CXXFLAGS=-std=gnu++11")
198 (modify-phases %standard-phases
199 (add-after 'unpack 'enter-source
200 (lambda _ (chdir "base") #t)))))
201 (inputs `(("android-liblog" ,android-liblog)))
202 (home-page "https://developer.android.com/")
203 (synopsis "Android platform base library")
204 (description "@code{libbase} is a library in common use by the
205 various Android core host applications.")
206 (license license:asl2.0)))
208 (define android-libcutils
210 (name "android-libcutils")
211 (version (android-platform-version))
212 (source (android-platform-system-core version))
213 (build-system gnu-build-system)
215 `(#:tests? #f ; TODO.
217 (modify-phases %standard-phases
218 (add-after 'unpack 'enter-source
219 (lambda _ (chdir "libcutils") #t))
220 (add-after 'enter-source 'create-Makefile
222 ;; No useful makefile is shipped, so we create one.
223 (with-output-to-file "Makefile"
228 "SOURCES = load_file.o socket_local_client_unix.o"
229 " socket_loopback_client_unix.o socket_network_client_unix.o"
230 " socket_loopback_server_unix.o socket_local_server_unix.o"
231 " sockets_unix.o socket_inaddr_any_server_unix.o"
236 "CXXFLAGS += -std=gnu++11 -fPIC\n"
237 "CPPFLAGS += -Iinclude -I../include\n"
238 "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0\n"
240 "build: $(SOURCES)\n"
241 " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS)"
246 (lambda* (#:key outputs #:allow-other-keys)
247 (let* ((out (assoc-ref outputs "out"))
248 (lib (string-append out "/lib"))
249 (include (string-append out "/include")))
250 (install-file "libcutils.so.0" lib)
251 (with-directory-excursion lib
252 (symlink "libcutils.so.0" "libcutils.so"))
253 (copy-recursively "../include/cutils"
254 (string-append include "/cutils"))
256 (home-page "https://developer.android.com/")
257 (synopsis "Android platform c utils library")
258 (description "@code{libcutils} is a library in common use by the
259 various Android core host applications.")
260 (license license:asl2.0)))
262 (define-public android-libsparse
264 (name "android-libsparse")
265 (version (android-platform-version))
266 (source (android-platform-system-core version))
267 (build-system android-ndk-build-system)
269 `(#:make-flags '("CFLAGS=-Wno-error"
270 "CXXFLAGS=-fpermissive -Wno-error")
272 (modify-phases %standard-phases
273 (add-after 'unpack 'enter-source
274 (lambda _ (chdir "libsparse") #t)))))
277 (home-page "https://developer.android.com/")
278 (synopsis "Android platform sparse library")
279 (description "@code{android-libsparse} is a library in common use by the
280 various Android core host applications.")
281 (license license:asl2.0)))
283 (define-public android-libziparchive
285 (name "android-libziparchive")
286 (version (android-platform-version))
287 (source (android-platform-system-core version))
288 (build-system android-ndk-build-system)
290 `(#:make-flags '("CFLAGS=-Wno-error"
291 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++11")
293 (modify-phases %standard-phases
294 (add-after 'unpack 'enter-source
295 (lambda _ (chdir "libziparchive") #t))
296 (add-before 'check 'setenv
298 (setenv "ziparchive_tests_host_PARAMS" "--test_data_dir=testdata")
300 (add-after 'install 'install-headers
301 (lambda* (#:key inputs outputs #:allow-other-keys)
302 (let ((out (assoc-ref outputs "out")))
303 (copy-recursively "../include/ziparchive"
304 (string-append out "/include/ziparchive"))
309 `(("android-libbase" ,android-libbase)
310 ("android-libutils" ,android-libutils)
311 ("android-liblog" ,android-liblog)))
312 (home-page "https://developer.android.com/")
313 (synopsis "Android platform ZIP library")
314 (description "@code{android-libziparchive} is a library in common use by the
315 various Android core host applications.")
316 (license license:asl2.0)))
321 (version (android-platform-version))
322 (source (android-platform-system-core version))
323 (build-system android-ndk-build-system)
325 `(#:tests? #f ; Test failure: sysdeps_poll.fd_count
327 (list "CFLAGS=-Wno-error"
328 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ."
329 (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib "
330 "-Wl,-rpath=" (assoc-ref %build-inputs "openssl") "/lib -L ."))
332 (modify-phases %standard-phases
333 (add-after 'unpack 'enter-source
334 (lambda _ (chdir "adb") #t))
335 (add-after 'enter-source 'make-libs-available
336 (lambda* (#:key inputs outputs #:allow-other-keys)
337 (substitute* "Android.mk"
338 (("libcrypto_static") "libcrypto"))
340 (add-after 'install 'install-headers
341 (lambda* (#:key inputs outputs #:allow-other-keys)
342 (install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include"))
345 `(("android-libbase" ,android-libbase)
346 ("android-libcutils" ,android-libcutils)
347 ("android-liblog" ,android-liblog)
348 ("openssl" ,openssl)))
349 (home-page "https://developer.android.com/studio/command-line/adb.html")
350 (synopsis "Android Debug Bridge")
352 "@command{adb} is a versatile command line tool that lets you communicate
353 with an emulator instance or connected Android device. It facilitates a variety
354 of device actions, such as installing and debugging apps, and it provides access
355 to a Unix shell that can run commands on the connected device or emulator.")
356 (license license:asl2.0)))
358 (define-public mkbootimg
361 (version (android-platform-version))
363 (inherit (android-platform-system-core version))))
364 (build-system python-build-system)
368 (modify-phases %standard-phases
369 (add-after 'unpack 'enter-source
370 (lambda _ (chdir "mkbootimg") #t))
374 (lambda* (#:key outputs #:allow-other-keys)
375 (let* ((out (assoc-ref outputs "out"))
376 (bin (string-append out "/bin"))
377 (include (string-append out "/include")))
378 (install-file "mkbootimg" bin)
379 (install-file "bootimg.h" include)
381 (home-page "https://developer.android.com/studio/command-line/adb.html")
382 (synopsis "Tool to create Android boot images")
383 (description "This package provides a tool to create Android Boot
385 (license license:asl2.0)))
387 (define-public android-safe-iop
389 (name "android-safe-iop")
390 (version (android-platform-version))
391 (source (android-platform-external version "safe-iop"
392 "1nyyrs463advjhlq8xx1lm37m4g5afv7gy0csxrj7biwwl0v13qw"))
393 (build-system android-ndk-build-system)
395 `(#:make-flags '("CXXFLAGS=-fpermissive -Wno-error")
397 (modify-phases %standard-phases
398 (add-before 'build 'patch-host
400 ;; TODO: Cross-compile.
401 (substitute* "Android.mk"
402 (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY"))
404 (home-page "https://developer.android.com/")
405 (synopsis "Safe integers in C")
406 (description "@code{android-safe-iop} provides a set of functions for
407 performing and checking safe integer operations. Ensure that integer
408 operations do not result in silent overflow.")
409 (license license:bsd-2)))
411 (define-public android-bionic-uapi
413 (name "android-bionic-uapi")
414 (version (android-platform-version))
415 (source (android-platform-bionic version))
416 (build-system android-ndk-build-system)
419 (modify-phases %standard-phases
420 (add-after 'unpack 'enter-source
421 (lambda _ (chdir "libc") #t))
427 (lambda* (#:key outputs #:allow-other-keys)
428 (let* ((out (assoc-ref outputs "out"))
429 (out-sys (string-append out "/include/sys")))
431 (install-file "include/sys/system_properties.h" out-sys)
432 (install-file "include/sys/_system_properties.h" out-sys)
433 (copy-recursively "kernel/uapi" (string-append out "/include"))
435 (home-page "https://developer.android.com/")
436 (synopsis "Android Linux API that is safe for user space")
437 (description "@code{android-bionic-uapi} provides the part of the Linux API
438 that is safe to use for user space. It also includes
439 @code{system_properties.h} and @code{_system_properties.h}.")
440 (license license:asl2.0)))
442 (define-public android-libselinux
444 (name "android-libselinux")
445 (version (android-platform-version))
447 (android-platform-external version "libselinux"
448 "13m2q32gzdcs5d0zj1nwasjy1j8vsxsgbjg7m5sa9lfcjaj7nkm7"))
449 (build-system android-ndk-build-system)
451 ;; See logd/Android.mk for the *_LOG_TAG values.
452 `(#:make-flags (list (string-append "CFLAGS=-Wno-error "
454 "-I core/libpackagelistparser/include "
455 "-DAUDITD_LOG_TAG=1003 "
456 "-DLOGD_LOG_TAG=1004 -D_GNU_SOURCE")
457 "LDFLAGS=-L . -lpcre")
459 (modify-phases %standard-phases
460 (add-after 'unpack-core 'patch-HOST
462 ;; gettid duplicates otherwise.
463 (substitute* "src/procattr.c"
464 (("#ifdef HOST") "#ifdef XXX"))
467 `(("openssl" ,openssl)))
469 `(("android-bionic-uapi" ,android-bionic-uapi)
470 ;; pcre is inlined by our package.
472 (home-page "https://developer.android.com/")
473 (synopsis (package-synopsis libselinux))
474 (description (package-description libselinux))
475 (license (package-license libselinux))))
477 (define-public android-ext4-utils
479 (name "android-ext4-utils")
480 (version (android-platform-version))
481 (source (android-platform-system-extras version))
482 (build-system android-ndk-build-system)
485 (list (string-append "CPPFLAGS="
488 (assoc-ref %build-inputs "android-libselinux")
490 "-I " (assoc-ref %build-inputs "android-libsparse")
492 "-I " (assoc-ref %build-inputs "android-libcutils")
494 "-I " (assoc-ref %build-inputs "android-liblog") "/include "
495 "-I ../core/include")
497 "install-libext4_utils_host.a"
498 (string-append "prefix=" (assoc-ref %outputs "out")))
500 (modify-phases %standard-phases
501 (add-after 'unpack 'unpack-core
502 (lambda* (#:key inputs #:allow-other-keys)
504 (with-directory-excursion "core"
505 (invoke "tar" "axf" (assoc-ref inputs "android-core")
506 "--strip-components=1"))
508 (add-after 'unpack-core 'enter-source
509 (lambda _ (chdir "ext4_utils") #t))
511 (lambda* (#:key inputs outputs #:allow-other-keys)
512 (let ((out (assoc-ref outputs "out")))
513 (copy-recursively "." (string-append out "/include")))
516 `(("android-libcutils" ,android-libcutils)
517 ("android-liblog" ,android-liblog)
518 ("android-libselinux" ,android-libselinux)
519 ("android-libsparse" ,android-libsparse)
522 `(("android-core" ,(android-platform-system-core version))))
523 (home-page "https://developer.android.com/")
524 (synopsis "Android ext4 filesystem utils")
525 (description "@code{android-ext4-utils} is a library in common use by the
527 (license license:asl2.0)))
529 (define-public android-f2fs-utils
531 (name "android-f2fs-utils")
532 (version (android-platform-version))
533 (source (android-platform-system-extras version))
534 (build-system android-ndk-build-system)
537 (modify-phases %standard-phases
538 (add-after 'unpack 'enter-source
539 (lambda _ (chdir "f2fs_utils") #t))
540 (add-after 'install 'install-headers
541 (lambda* (#:key inputs outputs #:allow-other-keys)
542 (copy-recursively "." (string-append (assoc-ref outputs "out")
545 (add-after 'install 'install-shell-scripts
546 (lambda* (#:key outputs #:allow-other-keys)
547 (let* ((out (assoc-ref outputs "out"))
548 (bin (string-append out "/bin")))
549 (patch-shebang "mkf2fsuserimg.sh")
550 (substitute* "mkf2fsuserimg.sh"
551 (("make_f2fs") (string-append bin "/make_f2fs")))
552 (install-file "mkf2fsuserimg.sh" bin)
555 `(("f2fs-tools" ,f2fs-tools-1.7)
556 ("android-libselinux" ,android-libselinux)
557 ("android-libsparse" ,android-libsparse)
558 ("android-libcutils" ,android-libcutils)
560 (home-page "https://developer.android.com/")
561 (synopsis "Android f2fs utils")
562 (description "@code{android-f2fs-utils} is a library in common use by the
563 Android core. It allows the user to create images for the @code{f2fs} Flash
565 (license license:asl2.0)))
567 (define-public android-libutils
569 (name "android-libutils")
570 (version (android-platform-version))
571 (source (android-platform-system-core version))
572 (build-system android-ndk-build-system)
575 #:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
577 (modify-phases %standard-phases
578 (add-after 'unpack 'enter-source
579 (lambda _ (chdir "libutils") #t))
581 (add-after 'install 'install-headers
582 (lambda* (#:key inputs outputs #:allow-other-keys)
583 (copy-recursively "../include/utils" (string-append (assoc-ref outputs "out") "/include/utils")))))))
585 `(("android-safe-iop" ,android-safe-iop)
586 ("android-libcutils" ,android-libcutils)))
588 `(("android-bionic-uapi" ,android-bionic-uapi)
589 ("android-liblog" ,android-liblog)))
590 (home-page "https://developer.android.com/")
591 (synopsis "Android utility library")
592 (description "@code{android-libutils} provides utilities for Android NDK developers.")
593 (license license:asl2.0)))
595 (define-public fastboot
598 (version (android-platform-version))
599 (source (android-platform-system-core version))
600 (build-system android-ndk-build-system)
602 `(#:make-flags (list "CXXFLAGS=-std=gnu++11")
604 (modify-phases %standard-phases
605 (add-after 'unpack 'enter-source
609 (add-after 'enter-source 'patch-source
611 (substitute* "Android.mk"
612 (("libext4_utils_host") "libext4_utils_host libselinux libpcre"))
615 (lambda* (#:key outputs #:allow-other-keys)
616 (let* ((out (assoc-ref outputs "out"))
617 (lib (string-append out "/lib"))
618 (bin (string-append out "/bin")))
619 (install-file "fastboot" bin)
623 ("android-safe-iop" ,android-safe-iop)
624 ("android-ext4-utils" ,android-ext4-utils)
625 ("android-f2fs-utils" ,android-f2fs-utils)
626 ("android-libbase" ,android-libbase)
627 ("android-libcutils" ,android-libcutils)
628 ("android-liblog" ,android-liblog)
629 ("android-libutils" ,android-libutils)
630 ("android-libsparse" ,android-libsparse)
631 ("android-libziparchive" ,android-libziparchive)
632 ("android-libselinux" ,android-libselinux)
634 ("mkbootimg" ,mkbootimg)
638 (home-page "https://developer.android.com/studio/command-line/")
639 (synopsis "Android image flasher")
641 "This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
642 (license license:asl2.0)))
644 (define-public android-udev-rules
646 (name "android-udev-rules")
652 (url "https://github.com/M0Rf30/android-udev-rules")
654 (file-name (string-append name "-" version "-checkout"))
656 (base32 "13gj79nnd04szqlrrzzkdr6wi1fky08pi7x8xfbg0jj3d3v0giah"))))
657 (build-system trivial-build-system)
658 (native-inputs `(("source" ,source)))
660 '(#:modules ((guix build utils))
663 (use-modules (guix build utils))
664 (let ((source (assoc-ref %build-inputs "source")))
665 (install-file (string-append source "/51-android.rules")
666 (string-append %output "/lib/udev/rules.d"))))))
667 (home-page "https://github.com/M0Rf30/android-udev-rules")
668 (synopsis "udev rules for Android devices")
669 (description "Provides a set of udev rules to allow using Android devices
670 with tools such as @command{adb} and @command{fastboot} without root
671 privileges. This package is intended to be added as a rule to the
672 @code{udev-service-type} in your @code{operating-system} configuration.
673 Additionally, an @code{adbusers} group must be defined and your user added to
676 @emph{Simply installing this package will not have any effect.} It is meant
677 to be passed to the @code{udev} service.")
678 (license license:gpl3+)))
680 (define-public git-repo
688 (url "https://gerrit.googlesource.com/git-repo")
689 (commit (string-append "v" version))))
690 (file-name (string-append "git-repo-" version "-checkout"))
692 (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))
693 (build-system python-build-system)
695 `(#:python ,python-2 ; code says: "Python 3 support is … experimental."
697 (modify-phases %standard-phases
698 (add-before 'build 'set-executable-paths
699 (lambda* (#:key inputs outputs #:allow-other-keys)
700 (let* ((out (assoc-ref outputs "out"))
701 (git (assoc-ref inputs "git"))
702 (gpg (assoc-ref inputs "gnupg"))
703 (ssh (assoc-ref inputs "ssh")))
704 (substitute* '("repo" "git_command.py")
706 (string-append "GIT = '" git "/bin/git' ")))
708 ((" cmd = \\['gpg',")
709 (string-append " cmd = ['" gpg "/bin/gpg',")))
710 (substitute* "git_config.py"
711 ((" command_base = \\['ssh',")
712 (string-append " command_base = ['" ssh "/bin/ssh',")))
714 (add-before 'build 'do-not-clone-this-source
715 (lambda* (#:key outputs #:allow-other-keys)
716 (let* ((out (assoc-ref outputs "out"))
717 (repo-dir (string-append out "/share/" ,name)))
719 (("^def _FindRepo\\(\\):.*")
722 '''Look for a repo installation, starting at the current directory.'''
723 # Use the installed version of git-repo.
724 repo_main = '~a/main.py'
727 while curdir != '/' and curdir != olddir:
728 dot_repo = os.path.join(curdir, repodir)
729 if os.path.isdir(dot_repo):
730 return (repo_main, dot_repo)
733 curdir = os.path.dirname(curdir)
736 # The remaining of this function is dead code. It was used to
737 # find a git-checked-out version in the local project.\n" repo-dir))
738 ;; Neither clone, check out, nor verify the git repository
739 (("(^\\s+)_Clone\\(.*\\)") "")
740 (("(^\\s+)_Checkout\\(.*\\)") "")
741 ((" rev = _Verify\\(.*\\)") " rev = None"))
743 (delete 'build) ; nothing to build
746 (zero? (system* "python" "-m" "nose"))))
748 (lambda* (#:key outputs #:allow-other-keys)
749 (let* ((out (assoc-ref outputs "out"))
750 (bin-dir (string-append out "/bin"))
751 (repo-dir (string-append out "/share/" ,name)))
754 (copy-recursively "." repo-dir)
755 (delete-file-recursively (string-append repo-dir "/tests"))
756 (symlink (string-append repo-dir "/repo")
757 (string-append bin-dir "/repo"))
760 ;; TODO: Add git-remote-persistent-https once it is available in guix
765 `(("nose" ,python2-nose)))
766 (home-page "https://code.google.com/p/git-repo/")
767 (synopsis "Helps to manage many Git repositories.")
768 (description "Repo is a tool built on top of Git. Repo helps manage many
769 Git repositories, does the uploads to revision control systems, and automates
770 parts of the development workflow. Repo is not meant to replace Git, only to
771 make it easier to work with Git. The repo command is an executable Python
772 script that you can put anywhere in your path.")
773 (license license:asl2.0)))
775 (define-public abootimg
782 (uri (string-append "http://http.debian.net/debian/pool/main/a/abootimg/"
783 "abootimg_" version ".orig.tar.gz"))
785 (base32 "0sfc2k011l1ymv97821w89391gnqdh8pp0haz4sdcm5hx0axv2ba"))))
786 (build-system gnu-build-system)
790 (modify-phases %standard-phases
796 (lambda* (#:key outputs #:allow-other-keys)
797 (let* ((out (assoc-ref outputs "out"))
798 (bin (string-append out "/bin")))
799 (install-file "abootimg" bin)
802 `(("libblkid" ,util-linux)))
803 (home-page "https://ac100.grandou.net/abootimg")
804 (synopsis "Tool for manipulating Android Boot Images")
805 (description "This package provides a tool for manipulating old Android
806 Boot Images. @code{abootimg} can work directly on block devices, or, the
807 safest way, on a file image.")
808 (license license:gpl2+)))