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>
9 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages android)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system android-ndk)
32 #:use-module (guix build-system python)
33 #:use-module (guix build-system trivial)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages check)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages docker)
39 #:use-module (gnu packages gnupg)
40 #:use-module (gnu packages pcre)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-crypto)
43 #:use-module (gnu packages python-web)
44 #:use-module (gnu packages python-xyz)
45 #:use-module (gnu packages selinux)
46 #:use-module (gnu packages serialization)
47 #:use-module (gnu packages ssh)
48 #:use-module (gnu packages tls)
49 #:use-module (gnu packages version-control)
50 #:use-module (gnu packages virtualization)
51 #:use-module (gnu packages xdisorg)
52 #:use-module (gnu packages linux))
54 (define-public android-make-stub
56 (name "android-make-stub")
62 (url "https://github.com/daym/android-make-stub.git")
63 (commit (string-append "v" version))))
64 (file-name (string-append "android-make-stub-"
68 "0y1b2x96d37n6f1bp6dcx08bn08zac0cylmbfsx6mf2nahc02fhc"))))
69 (build-system gnu-build-system)
71 `(#:tests? #f ; None exist.
73 (modify-phases %standard-phases
77 (lambda* (#:key outputs #:allow-other-keys)
78 (let* ((out (assoc-ref outputs "out")))
79 (invoke "make" (string-append "prefix=" out) "install")
81 (home-page "https://github.com/daym/android-make-stub")
82 (synopsis "Stubs for the @command{make} system of the Android platform")
83 (description "@code{android-make-stub} provides stubs for the
84 @command{make} system of the Android platform. This allows us to
85 use their packages mostly unmodified in our Android NDK build system.")
86 (license license:asl2.0)))
88 (define-public android-googletest
89 (package (inherit googletest)
90 (name "android-googletest")
92 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
94 (modify-phases %standard-phases
95 (add-after 'install 'install-host-libraries
96 (lambda* (#:key outputs #:allow-other-keys)
97 (let* ((out (assoc-ref outputs "out"))
98 (lib (string-append out "/lib")))
99 (symlink "libgtest.so"
100 (string-append lib "/libgtest_host.so"))
101 (symlink "libgmock.so"
102 (string-append lib "/libgmock_host.so"))
105 ;; The Makefiles that we add are largely based on the Debian
106 ;; packages. They are licensed under GPL-2 and have copyright:
107 ;; 2012, Stefan Handschuh <handschuh.stefan@googlemail.com>
108 ;; 2015, Kai-Chung Yan <seamlikok@gmail.com>
109 ;; Big thanks to them for laying the groundwork.
111 ;; The version tag is consistent between all repositories.
112 (define (android-platform-version) "7.1.2_r36")
114 (define (android-platform-system-core version)
118 (url "https://android.googlesource.com/platform/system/core")
119 (commit (string-append "android-" version))))
120 (file-name (string-append "android-platform-system-core-"
121 version "-checkout"))
124 "1krnc2b9zfkzpdgs1dcbji59nszlx2qr723pg89m52622czc06hg"))
126 (search-patches "libbase-use-own-logging.patch"
127 "libbase-fix-includes.patch"
128 "libutils-remove-damaging-includes.patch"
129 "libutils-add-includes.patch"
130 "adb-add-libraries.patch"
131 "libziparchive-add-includes.patch"))))
133 (define (android-platform-system-extras version)
137 (url "https://android.googlesource.com/platform/system/extras")
138 (commit (string-append "android-" version))))
139 (file-name (string-append "android-platform-system-extras-"
140 version "-checkout"))
143 "18130c23ybqcpgjc5v6f8kdbv2xn39hyiaj17dzldjb9rlwzcyy9"))))
145 (define (android-platform-bionic version)
149 (url "https://android.googlesource.com/platform/bionic")
150 (commit (string-append "android-" version))))
151 (file-name (string-append "android-platform-bionic-"
152 version "-checkout"))
155 "15r4s20d7vw022f8vrc3jbghmqwdcqzprl7i2bfvdkz8z76wc1ps"))))
157 (define (android-platform-external version subdirectory checksum)
162 (string-append "https://android.googlesource.com/platform/external/"
164 (commit (string-append "android-" version))))
165 (file-name (string-append "android-platform-system-external-" subdirectory "-"
166 version "-checkout"))
171 (define android-liblog
173 (name "android-liblog")
174 (version (android-platform-version))
175 (source (android-platform-system-core version))
176 (build-system android-ndk-build-system)
178 `(#:make-flags '("LDLIBS=-lpthread")
180 (modify-phases %standard-phases
181 (add-after 'unpack 'enter-source
182 (lambda _ (chdir "liblog") #t))
183 (add-after 'install 'ldconfig
184 (lambda* (#:key outputs #:allow-other-keys)
185 (let ((out (assoc-ref outputs "out")))
186 (symlink "liblog.so.0" (string-append out "/lib/liblog.so"))
188 (home-page "https://developer.android.com/")
189 (synopsis "Logging library from the Android platform.")
190 (description "@code{liblog} represents an interface to the volatile Android
191 Logging system for NDK (Native) applications and libraries and contain
192 interfaces for either writing or reading logs. The log buffers are divided up
193 in Main, System, Radio and Events sub-logs.")
194 (license license:asl2.0)))
196 (define android-libbase
198 (name "android-libbase")
199 (version (android-platform-version))
200 (source (android-platform-system-core version))
201 (build-system android-ndk-build-system)
203 `(#:tests? #f ; Test failure: logging.UNIMPLEMENTED
204 #:make-flags '("CXXFLAGS=-std=gnu++11")
206 (modify-phases %standard-phases
207 (add-after 'unpack 'enter-source
208 (lambda _ (chdir "base") #t)))))
209 (inputs `(("android-liblog" ,android-liblog)))
210 (home-page "https://developer.android.com/")
211 (synopsis "Android platform base library")
212 (description "@code{libbase} is a library in common use by the
213 various Android core host applications.")
214 (license license:asl2.0)))
216 (define android-libcutils
218 (name "android-libcutils")
219 (version (android-platform-version))
220 (source (android-platform-system-core version))
221 (build-system gnu-build-system)
223 `(#:tests? #f ; TODO.
225 (modify-phases %standard-phases
226 (add-after 'unpack 'enter-source
227 (lambda _ (chdir "libcutils") #t))
228 (add-after 'enter-source 'create-Makefile
230 ;; No useful makefile is shipped, so we create one.
231 (with-output-to-file "Makefile"
236 "SOURCES = load_file.o socket_local_client_unix.o"
237 " socket_loopback_client_unix.o socket_network_client_unix.o"
238 " socket_loopback_server_unix.o socket_local_server_unix.o"
239 " sockets_unix.o socket_inaddr_any_server_unix.o"
244 "CXXFLAGS += -std=gnu++11 -fPIC\n"
245 "CPPFLAGS += -Iinclude -I../include\n"
246 "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0\n"
248 "build: $(SOURCES)\n"
249 " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS)"
254 (lambda* (#:key outputs #:allow-other-keys)
255 (let* ((out (assoc-ref outputs "out"))
256 (lib (string-append out "/lib"))
257 (include (string-append out "/include")))
258 (install-file "libcutils.so.0" lib)
259 (with-directory-excursion lib
260 (symlink "libcutils.so.0" "libcutils.so"))
261 (copy-recursively "../include/cutils"
262 (string-append include "/cutils"))
264 (home-page "https://developer.android.com/")
265 (synopsis "Android platform c utils library")
266 (description "@code{libcutils} is a library in common use by the
267 various Android core host applications.")
268 (license license:asl2.0)))
270 (define-public android-libsparse
272 (name "android-libsparse")
273 (version (android-platform-version))
274 (source (android-platform-system-core version))
275 (build-system android-ndk-build-system)
277 `(#:make-flags '("CFLAGS=-Wno-error"
278 "CXXFLAGS=-fpermissive -Wno-error")
280 (modify-phases %standard-phases
281 (add-after 'unpack 'enter-source
282 (lambda _ (chdir "libsparse") #t)))))
285 (home-page "https://developer.android.com/")
286 (synopsis "Android platform sparse library")
287 (description "@code{android-libsparse} is a library in common use by the
288 various Android core host applications.")
289 (license license:asl2.0)))
291 (define-public android-libziparchive
293 (name "android-libziparchive")
294 (version (android-platform-version))
295 (source (android-platform-system-core version))
296 (build-system android-ndk-build-system)
298 `(#:make-flags '("CFLAGS=-Wno-error"
299 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++11")
301 (modify-phases %standard-phases
302 (add-after 'unpack 'enter-source
303 (lambda _ (chdir "libziparchive") #t))
304 (add-before 'check 'setenv
306 (setenv "ziparchive_tests_host_PARAMS" "--test_data_dir=testdata")
308 (add-after 'install 'install-headers
309 (lambda* (#:key inputs outputs #:allow-other-keys)
310 (let ((out (assoc-ref outputs "out")))
311 (copy-recursively "../include/ziparchive"
312 (string-append out "/include/ziparchive"))
317 `(("android-libbase" ,android-libbase)
318 ("android-libutils" ,android-libutils)
319 ("android-liblog" ,android-liblog)))
320 (home-page "https://developer.android.com/")
321 (synopsis "Android platform ZIP library")
322 (description "@code{android-libziparchive} is a library in common use by the
323 various Android core host applications.")
324 (license license:asl2.0)))
329 (version (android-platform-version))
330 (source (android-platform-system-core version))
331 (build-system android-ndk-build-system)
333 `(#:tests? #f ; Test failure: sysdeps_poll.fd_count
335 (list "CFLAGS=-Wno-error"
336 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ."
337 (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib "
338 "-Wl,-rpath=" (assoc-ref %build-inputs "openssl") "/lib -L ."))
340 (modify-phases %standard-phases
341 (add-after 'unpack 'enter-source
342 (lambda _ (chdir "adb") #t))
343 (add-after 'enter-source 'glibc-compat
345 ;; Include sysmacros.h for "major" and "minor" in Glibc 2.28.
346 (substitute* "usb_linux.cpp"
347 (("#include <sys/types.h>" all)
348 (string-append all "\n#include <sys/sysmacros.h>\n")))
350 (add-after 'enter-source 'make-libs-available
351 (lambda* (#:key inputs outputs #:allow-other-keys)
352 (substitute* "Android.mk"
353 (("libcrypto_static") "libcrypto"))
355 (add-after 'install 'install-headers
356 (lambda* (#:key inputs outputs #:allow-other-keys)
357 (install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include"))
360 `(("android-libbase" ,android-libbase)
361 ("android-libcutils" ,android-libcutils)
362 ("android-liblog" ,android-liblog)
363 ("openssl" ,openssl)))
364 (home-page "https://developer.android.com/studio/command-line/adb.html")
365 (synopsis "Android Debug Bridge")
367 "@command{adb} is a versatile command line tool that lets you communicate
368 with an emulator instance or connected Android device. It facilitates a variety
369 of device actions, such as installing and debugging apps, and it provides access
370 to a Unix shell that can run commands on the connected device or emulator.")
371 (license license:asl2.0)))
373 (define-public mkbootimg
376 (version (android-platform-version))
378 (inherit (android-platform-system-core version))))
379 (build-system python-build-system)
383 (modify-phases %standard-phases
384 (add-after 'unpack 'enter-source
385 (lambda _ (chdir "mkbootimg") #t))
389 (lambda* (#:key outputs #:allow-other-keys)
390 (let* ((out (assoc-ref outputs "out"))
391 (bin (string-append out "/bin"))
392 (include (string-append out "/include")))
393 (install-file "mkbootimg" bin)
394 (install-file "bootimg.h" include)
396 (home-page "https://developer.android.com/studio/command-line/adb.html")
397 (synopsis "Tool to create Android boot images")
398 (description "This package provides a tool to create Android Boot
400 (license license:asl2.0)))
402 (define-public android-safe-iop
404 (name "android-safe-iop")
405 (version (android-platform-version))
406 (source (android-platform-external version "safe-iop"
407 "1nyyrs463advjhlq8xx1lm37m4g5afv7gy0csxrj7biwwl0v13qw"))
408 (build-system android-ndk-build-system)
410 `(#:make-flags '("CXXFLAGS=-fpermissive -Wno-error")
412 (modify-phases %standard-phases
413 (add-before 'build 'patch-host
415 ;; TODO: Cross-compile.
416 (substitute* "Android.mk"
417 (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY"))
419 (home-page "https://developer.android.com/")
420 (synopsis "Safe integers in C")
421 (description "@code{android-safe-iop} provides a set of functions for
422 performing and checking safe integer operations. Ensure that integer
423 operations do not result in silent overflow.")
424 (license license:bsd-2)))
426 (define-public android-bionic-uapi
428 (name "android-bionic-uapi")
429 (version (android-platform-version))
430 (source (android-platform-bionic version))
431 (build-system android-ndk-build-system)
434 (modify-phases %standard-phases
435 (add-after 'unpack 'enter-source
436 (lambda _ (chdir "libc") #t))
442 (lambda* (#:key outputs #:allow-other-keys)
443 (let* ((out (assoc-ref outputs "out"))
444 (out-sys (string-append out "/include/sys")))
446 (install-file "include/sys/system_properties.h" out-sys)
447 (install-file "include/sys/_system_properties.h" out-sys)
448 (copy-recursively "kernel/uapi" (string-append out "/include"))
450 (home-page "https://developer.android.com/")
451 (synopsis "Android Linux API that is safe for user space")
452 (description "@code{android-bionic-uapi} provides the part of the Linux API
453 that is safe to use for user space. It also includes
454 @code{system_properties.h} and @code{_system_properties.h}.")
455 (license license:asl2.0)))
457 (define-public android-libselinux
459 (name "android-libselinux")
460 (version (android-platform-version))
462 (android-platform-external version "libselinux"
463 "13m2q32gzdcs5d0zj1nwasjy1j8vsxsgbjg7m5sa9lfcjaj7nkm7"))
464 (build-system android-ndk-build-system)
466 ;; See logd/Android.mk for the *_LOG_TAG values.
467 `(#:make-flags (list (string-append "CFLAGS=-Wno-error "
469 "-I core/libpackagelistparser/include "
470 "-DAUDITD_LOG_TAG=1003 "
471 "-DLOGD_LOG_TAG=1004 -D_GNU_SOURCE")
472 "LDFLAGS=-L . -lpcre")
474 (modify-phases %standard-phases
475 (add-after 'unpack-core 'patch-HOST
477 ;; gettid duplicates otherwise.
478 (substitute* "src/procattr.c"
479 (("#ifdef HOST") "#ifdef XXX"))
482 `(("openssl" ,openssl)))
484 `(("android-bionic-uapi" ,android-bionic-uapi)
485 ;; pcre is inlined by our package.
487 (home-page "https://developer.android.com/")
488 (synopsis (package-synopsis libselinux))
489 (description (package-description libselinux))
490 (license (package-license libselinux))))
492 (define-public android-ext4-utils
494 (name "android-ext4-utils")
495 (version (android-platform-version))
496 (source (android-platform-system-extras version))
497 (build-system android-ndk-build-system)
500 (list (string-append "CPPFLAGS="
503 (assoc-ref %build-inputs "android-libselinux")
505 "-I " (assoc-ref %build-inputs "android-libsparse")
507 "-I " (assoc-ref %build-inputs "android-libcutils")
509 "-I " (assoc-ref %build-inputs "android-liblog") "/include "
510 "-I ../core/include")
512 "install-libext4_utils_host.a"
513 (string-append "prefix=" (assoc-ref %outputs "out")))
515 (modify-phases %standard-phases
516 (add-after 'unpack 'unpack-core
517 (lambda* (#:key inputs #:allow-other-keys)
519 (with-directory-excursion "core"
520 (invoke "tar" "axf" (assoc-ref inputs "android-core")
521 "--strip-components=1"))
523 (add-after 'unpack-core 'enter-source
524 (lambda _ (chdir "ext4_utils") #t))
526 (lambda* (#:key inputs outputs #:allow-other-keys)
527 (let ((out (assoc-ref outputs "out")))
528 (copy-recursively "." (string-append out "/include")))
531 `(("android-libcutils" ,android-libcutils)
532 ("android-liblog" ,android-liblog)
533 ("android-libselinux" ,android-libselinux)
534 ("android-libsparse" ,android-libsparse)
537 `(("android-core" ,(android-platform-system-core version))))
538 (home-page "https://developer.android.com/")
539 (synopsis "Android ext4 filesystem utils")
540 (description "@code{android-ext4-utils} is a library in common use by the
542 (license license:asl2.0)))
544 (define-public android-f2fs-utils
546 (name "android-f2fs-utils")
547 (version (android-platform-version))
548 (source (android-platform-system-extras version))
549 (build-system android-ndk-build-system)
552 (modify-phases %standard-phases
553 (add-after 'unpack 'enter-source
554 (lambda _ (chdir "f2fs_utils") #t))
555 (add-after 'install 'install-headers
556 (lambda* (#:key inputs outputs #:allow-other-keys)
557 (copy-recursively "." (string-append (assoc-ref outputs "out")
560 (add-after 'install 'install-shell-scripts
561 (lambda* (#:key outputs #:allow-other-keys)
562 (let* ((out (assoc-ref outputs "out"))
563 (bin (string-append out "/bin")))
564 (patch-shebang "mkf2fsuserimg.sh")
565 (substitute* "mkf2fsuserimg.sh"
566 (("make_f2fs") (string-append bin "/make_f2fs")))
567 (install-file "mkf2fsuserimg.sh" bin)
570 `(("f2fs-tools" ,f2fs-tools-1.7)
571 ("android-libselinux" ,android-libselinux)
572 ("android-libsparse" ,android-libsparse)
573 ("android-libcutils" ,android-libcutils)
575 (home-page "https://developer.android.com/")
576 (synopsis "Android f2fs utils")
577 (description "@code{android-f2fs-utils} is a library in common use by the
578 Android core. It allows the user to create images for the @code{f2fs} Flash
580 (license license:asl2.0)))
582 (define-public android-libutils
584 (name "android-libutils")
585 (version (android-platform-version))
586 (source (android-platform-system-core version))
587 (build-system android-ndk-build-system)
590 #:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
592 (modify-phases %standard-phases
593 (add-after 'unpack 'enter-source
594 (lambda _ (chdir "libutils") #t))
596 (add-after 'install 'install-headers
597 (lambda* (#:key inputs outputs #:allow-other-keys)
598 (copy-recursively "../include/utils" (string-append (assoc-ref outputs "out") "/include/utils")))))))
600 `(("android-safe-iop" ,android-safe-iop)
601 ("android-libcutils" ,android-libcutils)))
603 `(("android-bionic-uapi" ,android-bionic-uapi)
604 ("android-liblog" ,android-liblog)))
605 (home-page "https://developer.android.com/")
606 (synopsis "Android utility library")
607 (description "@code{android-libutils} provides utilities for Android NDK developers.")
608 (license license:asl2.0)))
610 (define-public fastboot
613 (version (android-platform-version))
614 (source (android-platform-system-core version))
615 (build-system android-ndk-build-system)
617 `(#:make-flags (list "CXXFLAGS=-std=gnu++11")
619 (modify-phases %standard-phases
620 (add-after 'unpack 'enter-source
624 (add-after 'enter-source 'patch-source
626 (substitute* "Android.mk"
627 (("libext4_utils_host") "libext4_utils_host libselinux libpcre"))
630 (lambda* (#:key outputs #:allow-other-keys)
631 (let* ((out (assoc-ref outputs "out"))
632 (lib (string-append out "/lib"))
633 (bin (string-append out "/bin")))
634 (install-file "fastboot" bin)
638 ("android-safe-iop" ,android-safe-iop)
639 ("android-ext4-utils" ,android-ext4-utils)
640 ("android-f2fs-utils" ,android-f2fs-utils)
641 ("android-libbase" ,android-libbase)
642 ("android-libcutils" ,android-libcutils)
643 ("android-liblog" ,android-liblog)
644 ("android-libutils" ,android-libutils)
645 ("android-libsparse" ,android-libsparse)
646 ("android-libziparchive" ,android-libziparchive)
647 ("android-libselinux" ,android-libselinux)
649 ("mkbootimg" ,mkbootimg)
653 (home-page "https://developer.android.com/studio/command-line/")
654 (synopsis "Android image flasher")
656 "This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
657 (license license:asl2.0)))
659 (define-public android-udev-rules
661 (name "android-udev-rules")
667 (url "https://github.com/M0Rf30/android-udev-rules")
669 (file-name (string-append name "-" version "-checkout"))
671 (base32 "13gj79nnd04szqlrrzzkdr6wi1fky08pi7x8xfbg0jj3d3v0giah"))))
672 (build-system trivial-build-system)
673 (native-inputs `(("source" ,source)))
675 '(#:modules ((guix build utils))
678 (use-modules (guix build utils))
679 (let ((source (assoc-ref %build-inputs "source")))
680 (install-file (string-append source "/51-android.rules")
681 (string-append %output "/lib/udev/rules.d"))
683 (home-page "https://github.com/M0Rf30/android-udev-rules")
684 (synopsis "udev rules for Android devices")
685 (description "Provides a set of udev rules to allow using Android devices
686 with tools such as @command{adb} and @command{fastboot} without root
687 privileges. This package is intended to be added as a rule to the
688 @code{udev-service-type} in your @code{operating-system} configuration.
689 Additionally, an @code{adbusers} group must be defined and your user added to
692 @emph{Simply installing this package will not have any effect.} It is meant
693 to be passed to the @code{udev} service.")
694 (license license:gpl3+)))
696 (define-public git-repo
704 (url "https://gerrit.googlesource.com/git-repo")
705 (commit (string-append "v" version))))
706 (file-name (string-append "git-repo-" version "-checkout"))
708 (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))
709 (build-system python-build-system)
711 `(#:python ,python-2 ; code says: "Python 3 support is … experimental."
713 (modify-phases %standard-phases
714 (add-before 'build 'set-executable-paths
715 (lambda* (#:key inputs outputs #:allow-other-keys)
716 (let* ((out (assoc-ref outputs "out"))
717 (git (assoc-ref inputs "git"))
718 (gpg (assoc-ref inputs "gnupg"))
719 (ssh (assoc-ref inputs "ssh")))
720 (substitute* '("repo" "git_command.py")
722 (string-append "GIT = '" git "/bin/git' ")))
724 ((" cmd = \\['gpg',")
725 (string-append " cmd = ['" gpg "/bin/gpg',")))
726 (substitute* "git_config.py"
727 ((" command_base = \\['ssh',")
728 (string-append " command_base = ['" ssh "/bin/ssh',")))
730 (add-before 'build 'do-not-clone-this-source
731 (lambda* (#:key outputs #:allow-other-keys)
732 (let* ((out (assoc-ref outputs "out"))
733 (repo-dir (string-append out "/share/" ,name)))
735 (("^def _FindRepo\\(\\):.*")
738 '''Look for a repo installation, starting at the current directory.'''
739 # Use the installed version of git-repo.
740 repo_main = '~a/main.py'
743 while curdir != '/' and curdir != olddir:
744 dot_repo = os.path.join(curdir, repodir)
745 if os.path.isdir(dot_repo):
746 return (repo_main, dot_repo)
749 curdir = os.path.dirname(curdir)
752 # The remaining of this function is dead code. It was used to
753 # find a git-checked-out version in the local project.\n" repo-dir))
754 ;; Neither clone, check out, nor verify the git repository
755 (("(^\\s+)_Clone\\(.*\\)") "")
756 (("(^\\s+)_Checkout\\(.*\\)") "")
757 ((" rev = _Verify\\(.*\\)") " rev = None"))
759 (delete 'build) ; nothing to build
762 (zero? (system* "python" "-m" "nose"))))
764 (lambda* (#:key outputs #:allow-other-keys)
765 (let* ((out (assoc-ref outputs "out"))
766 (bin-dir (string-append out "/bin"))
767 (repo-dir (string-append out "/share/" ,name)))
770 (copy-recursively "." repo-dir)
771 (delete-file-recursively (string-append repo-dir "/tests"))
772 (symlink (string-append repo-dir "/repo")
773 (string-append bin-dir "/repo"))
776 ;; TODO: Add git-remote-persistent-https once it is available in guix
781 `(("nose" ,python2-nose)))
782 (home-page "https://code.google.com/p/git-repo/")
783 (synopsis "Helps to manage many Git repositories.")
784 (description "Repo is a tool built on top of Git. Repo helps manage many
785 Git repositories, does the uploads to revision control systems, and automates
786 parts of the development workflow. Repo is not meant to replace Git, only to
787 make it easier to work with Git. The repo command is an executable Python
788 script that you can put anywhere in your path.")
789 (license license:asl2.0)))
791 (define-public abootimg
798 (uri (string-append "http://http.debian.net/debian/pool/main/a/abootimg/"
799 "abootimg_" version ".orig.tar.gz"))
801 (base32 "0sfc2k011l1ymv97821w89391gnqdh8pp0haz4sdcm5hx0axv2ba"))))
802 (build-system gnu-build-system)
806 (modify-phases %standard-phases
812 (lambda* (#:key outputs #:allow-other-keys)
813 (let* ((out (assoc-ref outputs "out"))
814 (bin (string-append out "/bin")))
815 (install-file "abootimg" bin)
818 `(("libblkid" ,util-linux)))
819 (home-page "https://ac100.grandou.net/abootimg")
820 (synopsis "Tool for manipulating Android Boot Images")
821 (description "This package provides a tool for manipulating old Android
822 Boot Images. @code{abootimg} can work directly on block devices, or, the
823 safest way, on a file image.")
824 (license license:gpl2+)))
826 (define-public python-androguard
828 (name "python-androguard")
832 ;; The pypi release doesn't have the tests, but the tests use
833 ;; packaged binaries, so we skip them.
835 (uri (pypi-uri "androguard" version))
838 "0ndsw00pkyda4i2s3wi5ap8gbk6a9d23xhhxpdbk02padv8sxkfv"))))
839 (build-system python-build-system)
842 (modify-phases %standard-phases
844 ;; Adapted from .travis.yml
846 (invoke "nosetests" "--with-coverage" "--with-timer"
847 "--timer-top-n" "50"))))))
849 `(("python-codecov" ,python-codecov)
850 ("python-coverage" ,python-coverage)
851 ("python-mock" ,python-mock)
852 ("python-nose" ,python-nose)
853 ("python-nose-timer" ,python-nose-timer)))
855 `(("python-asn1crypto" ,python-asn1crypto)
856 ("python-colorama" ,python-colorama)
857 ("python-future" ,python-future)
858 ("python-ipython" ,python-ipython)
859 ("python-lxml" ,python-lxml)
860 ("python-matplotlib" ,python-matplotlib)
861 ("python-networkx" ,python-networkx)
862 ("python-pygments" ,python-pygments)
863 ("python-pyperclip" ,python-pyperclip)))
864 (home-page "https://github.com/androguard/androguard")
865 (synopsis "Python tool to play with Android files")
867 "Androguard is a full Python tool to manipulate Android files. It is
868 useful for reverse engineering, analysis of Android applications and more.")
869 (license license:asl2.0)))
871 (define-public fdroidserver
873 (name "fdroidserver")
878 (uri (pypi-uri "fdroidserver" version))
881 "0n6kkby65qzqdx1jn72grfffvr1w1j1rby5pwm9z8rymmsh8s0pm"))))
882 (build-system python-build-system)
885 (modify-phases %standard-phases
886 (add-after 'unpack 'fix-versioning
888 (substitute* "setup.py"
889 (("0.2.1") ,(package-version python-pyasn1-modules)))
892 `(("python-androguard" ,python-androguard)
893 ("python-apache-libcloud" ,python-apache-libcloud)
894 ("python-clint" ,python-clint)
895 ("python-docker-py" ,python-docker-py)
896 ("python-gitpython" ,python-gitpython)
897 ("python-mwclient" ,python-mwclient)
898 ("python-paramiko" ,python-paramiko)
899 ("python-pillow" ,python-pillow)
900 ("python-pyasn1" ,python-pyasn1)
901 ("python-pyasn1-modules" ,python-pyasn1-modules)
902 ("python-pyyaml" ,python-pyyaml)
903 ("python-qrcode" ,python-qrcode)
904 ("python-ruamel.yaml" ,python-ruamel.yaml)
905 ("python-requests" ,python-requests)
906 ("python-vagrant" ,python-vagrant)))
908 `(("python-babel" ,python-babel)
909 ("python-bcrypt" ,python-bcrypt)
910 ("python-docker-pycreds" ,python-docker-pycreds)
911 ("python-pynacl" ,python-pynacl)
912 ("python-websocket-client" ,python-websocket-client)))
913 (home-page "https://f-droid.org")
914 (synopsis "F-Droid server tools")
916 "The F-Droid server tools provide various scripts and tools that are used
917 to maintain F-Droid, the repository of free Android applications. You can use
918 these same tools to create your own additional or alternative repository for
919 publishing, or to assist in creating, testing and submitting metadata to the
921 (license license:agpl3+)))